diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/answer_record.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/answer_record.proto new file mode 100644 index 00000000000..1afb47e6399 --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/answer_record.proto @@ -0,0 +1,297 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/v2/participant.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "AnswerRecordsProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// Service for managing [AnswerRecords][google.cloud.dialogflow.v2.AnswerRecord]. +service AnswerRecords { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all answer records in the specified project in reverse + // chronological order. + rpc ListAnswerRecords(ListAnswerRecordsRequest) returns (ListAnswerRecordsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/answerRecords" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/answerRecords" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the specified answer record. + rpc UpdateAnswerRecord(UpdateAnswerRecordRequest) returns (AnswerRecord) { + option (google.api.http) = { + patch: "/v2/{answer_record.name=projects/*/answerRecords/*}" + body: "answer_record" + additional_bindings { + patch: "/v2/{answer_record.name=projects/*/locations/*/answerRecords/*}" + body: "answer_record" + } + }; + option (google.api.method_signature) = "answer_record,update_mask"; + } +} + +// 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][google.cloud.dialogflow.v2.AnswerRecord.name] are returned to the +// customers. +// 2. The customer uses the [AnswerRecord.name][google.cloud.dialogflow.v2.AnswerRecord.name] to call the +// [UpdateAnswerRecord][] method to send feedback about a specific answer +// that they believe is wrong. +message AnswerRecord { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/AnswerRecord" + pattern: "projects/{project}/answerRecords/{answer_record}" + pattern: "projects/{project}/locations/{location}/answerRecords/{answer_record}" + }; + + // The unique identifier of this answer record. + // Format: `projects//locations//answerRecords/`. + string name = 1; + + // Required. The AnswerFeedback for this record. You can set this with + // [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord] in order to give us feedback about + // this answer. + AnswerFeedback answer_feedback = 2 [(google.api.field_behavior) = REQUIRED]; + + // The record for this answer. + oneof record { + // Output only. The record for human agent assistant. + AgentAssistantRecord agent_assistant_record = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// Request message for [AnswerRecords.ListAnswerRecords][google.cloud.dialogflow.v2.AnswerRecords.ListAnswerRecords]. +message ListAnswerRecordsRequest { + // Required. The project to list all answer records for in reverse + // chronological order. Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/AnswerRecord" + } + ]; + + // 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). + string filter = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The + // [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token] + // value returned from a previous list request used to continue listing on + // the next page. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for [AnswerRecords.ListAnswerRecords][google.cloud.dialogflow.v2.AnswerRecords.ListAnswerRecords]. +message ListAnswerRecordsResponse { + // The list of answer records. + repeated AnswerRecord answer_records = 1; + + // A token to retrieve next page of results. Or empty if there are no more + // results. + // Pass this value in the + // [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2.ListAnswerRecordsRequest.page_token] + // field in the subsequent call to `ListAnswerRecords` method to retrieve the + // next page of results. + string next_page_token = 2; +} + +// Request message for [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecord]. +message UpdateAnswerRecordRequest { + // Required. Answer record to update. + AnswerRecord answer_record = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/AnswerRecord" + } + ]; + + // Required. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents feedback the customer has about the quality & correctness of a +// certain answer in a conversation. +message AnswerFeedback { + // The correctness level of an answer. + enum CorrectnessLevel { + // Correctness level unspecified. + CORRECTNESS_LEVEL_UNSPECIFIED = 0; + + // Answer is totally wrong. + NOT_CORRECT = 1; + + // Answer is partially correct. + PARTIALLY_CORRECT = 2; + + // Answer is fully correct. + FULLY_CORRECT = 3; + } + + // The correctness level of the specific answer. + CorrectnessLevel correctness_level = 1; + + // Normally, detail feedback is provided when answer is not fully correct. + oneof detail_feedback { + // Detail feedback of agent assist suggestions. + AgentAssistantFeedback agent_assistant_detail_feedback = 2; + } + + // Indicates whether the answer/item was clicked by the human agent + // or not. Default to false. + bool clicked = 3; + + // Time when the answer/item was clicked. + google.protobuf.Timestamp click_time = 5; + + // Indicates whether the answer/item was displayed to the human + // agent in the agent desktop UI. Default to false. + bool displayed = 4; + + // Time when the answer/item was displayed. + google.protobuf.Timestamp display_time = 6; +} + +// Detail feedback of Agent Assist result. +message AgentAssistantFeedback { + // Relevance of an answer. + enum AnswerRelevance { + // Answer relevance unspecified. + ANSWER_RELEVANCE_UNSPECIFIED = 0; + + // Answer is irrelevant to query. + IRRELEVANT = 1; + + // Answer is relevant to query. + RELEVANT = 2; + } + + // Correctness of document. + enum DocumentCorrectness { + // Document correctness unspecified. + DOCUMENT_CORRECTNESS_UNSPECIFIED = 0; + + // Information in document is incorrect. + INCORRECT = 1; + + // Information in document is correct. + CORRECT = 2; + } + + // Efficiency of document. + enum DocumentEfficiency { + // Document efficiency unspecified. + DOCUMENT_EFFICIENCY_UNSPECIFIED = 0; + + // Document is inefficient. + INEFFICIENT = 1; + + // Document is efficient. + EFFICIENT = 2; + } + + // Optional. 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][google.cloud.dialogflow.v2.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + AnswerRelevance answer_relevance = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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 + DocumentCorrectness document_correctness = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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][google.cloud.dialogflow.v2.AgentAssistantFeedback.document_efficiency] is + // [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. + DocumentEfficiency document_efficiency = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents a record of a human agent assist answer. +message AgentAssistantRecord { + // Output only. The agent assist answer. + oneof answer { + // Output only. The article suggestion answer. + ArticleAnswer article_suggestion_answer = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The FAQ answer. + FaqAnswer faq_answer = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/audio_config.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/audio_config.proto index 8a6777c930c..674535b4b20 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/audio_config.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/audio_config.proto @@ -29,6 +29,36 @@ option java_outer_classname = "AudioConfigProto"; option java_package = "com.google.cloud.dialogflow.v2"; option objc_class_prefix = "DF"; +// Hints for the speech recognizer to help with recognition in a specific +// conversation state. +message SpeechContext { + // Optional. 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. + repeated string phrases = 1; + + // Optional. 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. + float boost = 2; +} + // Audio encoding of the audio content sent in the conversational query request. // Refer to the // [Cloud Speech API @@ -78,36 +108,6 @@ enum AudioEncoding { AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7; } -// Hints for the speech recognizer to help with recognition in a specific -// conversation state. -message SpeechContext { - // Optional. 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. - repeated string phrases = 1; - - // Optional. 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. - float boost = 2; -} - // Information for a word recognized by the speech recognizer. message SpeechWordInfo { // The word this info is for. @@ -247,6 +247,12 @@ message InputAudioConfig { // Note: When specified, InputAudioConfig.single_utterance takes precedence // over StreamingDetectIntentRequest.single_utterance. bool single_utterance = 8; + + // Only used in [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] and + // [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent]. + // If `false` and recognition doesn't return any result, trigger + // `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + bool disable_no_speech_recognized_event = 14; } // Description of which voice to use for speech synthesis. @@ -331,6 +337,12 @@ message OutputAudioConfig { SynthesizeSpeechConfig synthesize_speech_config = 3; } +// A wrapper of repeated TelephonyDtmf digits. +message TelephonyDtmfEvents { + // A sequence of TelephonyDtmf digits. + repeated TelephonyDtmf dtmf_events = 1; +} + // Audio encoding of the output audio format in Text-To-Speech. enum OutputAudioEncoding { // Not specified. @@ -349,3 +361,67 @@ enum OutputAudioEncoding { // than MP3 while using approximately the same bitrate. OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; } + +// Configures speech transcription for [ConversationProfile][google.cloud.dialogflow.v2.ConversationProfile]. +message SpeechToTextConfig { + // Optional. 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][google.cloud.dialogflow.v2.AnalyzeContentRequest] and + // [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest] request. + SpeechModelVariant speech_model_variant = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// [DTMF](https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling) +// digit in Telephony Gateway. +enum TelephonyDtmf { + // Not specified. This value may be used to indicate an absent digit. + TELEPHONY_DTMF_UNSPECIFIED = 0; + + // Number: '1'. + DTMF_ONE = 1; + + // Number: '2'. + DTMF_TWO = 2; + + // Number: '3'. + DTMF_THREE = 3; + + // Number: '4'. + DTMF_FOUR = 4; + + // Number: '5'. + DTMF_FIVE = 5; + + // Number: '6'. + DTMF_SIX = 6; + + // Number: '7'. + DTMF_SEVEN = 7; + + // Number: '8'. + DTMF_EIGHT = 8; + + // Number: '9'. + DTMF_NINE = 9; + + // Number: '0'. + DTMF_ZERO = 10; + + // Letter: 'A'. + DTMF_A = 11; + + // Letter: 'B'. + DTMF_B = 12; + + // Letter: 'C'. + DTMF_C = 13; + + // Letter: 'D'. + DTMF_D = 14; + + // Asterisk/star: '*'. + DTMF_STAR = 15; + + // Pound/diamond/hash/square/gate/octothorpe: '#'. + DTMF_POUND = 16; +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation.proto new file mode 100644 index 00000000000..5124402cdff --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation.proto @@ -0,0 +1,520 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/v2/participant.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "ConversationProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// Service for managing [Conversations][google.cloud.dialogflow.v2.Conversation]. +service Conversations { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // 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][google.cloud.dialogflow.v2.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][google.cloud.dialogflow.v2.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2.Intent.live_agent_handoff] is triggered, conversation + // will transfer to Assist Stage. + rpc CreateConversation(CreateConversationRequest) returns (Conversation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/conversations" + body: "conversation" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/conversations" + body: "conversation" + } + }; + option (google.api.method_signature) = "parent,conversation"; + } + + // Returns the list of all conversations in the specified project. + rpc ListConversations(ListConversationsRequest) returns (ListConversationsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/conversations" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/conversations" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specific conversation. + rpc GetConversation(GetConversationRequest) returns (Conversation) { + option (google.api.http) = { + get: "/v2/{name=projects/*/conversations/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/conversations/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Completes the specified conversation. Finished conversations are purged + // from the database after 30 days. + rpc CompleteConversation(CompleteConversationRequest) returns (Conversation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/conversations/*}:complete" + body: "*" + additional_bindings { + post: "/v2/{name=projects/*/locations/*/conversations/*}:complete" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a call matcher that links incoming SIP calls to the specified + // conversation if they fulfill specified criteria. + rpc CreateCallMatcher(CreateCallMatcherRequest) returns (CallMatcher) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/conversations/*}/callMatchers" + body: "call_matcher" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*/conversations/*}/callMatchers" + body: "*" + } + }; + option (google.api.method_signature) = "parent,call_matcher"; + } + + // Returns the list of all call matchers in the specified conversation. + rpc ListCallMatchers(ListCallMatchersRequest) returns (ListCallMatchersResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/conversations/*}/callMatchers" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*/conversations/*}/callMatchers" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Requests deletion of a call matcher. + rpc DeleteCallMatcher(DeleteCallMatcherRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/conversations/*/callMatchers/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/conversations/*/callMatchers/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // 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. + rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/conversations/*}/messages" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*/conversations/*}/messages" + } + }; + option (google.api.method_signature) = "parent"; + } +} + +// 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. +message Conversation { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Conversation" + pattern: "projects/{project}/conversations/{conversation}" + pattern: "projects/{project}/locations/{location}/conversations/{conversation}" + }; + + // Enumeration of the completion status of the conversation. + enum LifecycleState { + // Unknown. + LIFECYCLE_STATE_UNSPECIFIED = 0; + + // Conversation is currently open for media analysis. + IN_PROGRESS = 1; + + // Conversation has been completed. + COMPLETED = 2; + } + + // Enumeration of the different conversation stages a conversation can be in. + // Reference: + // https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages + enum ConversationStage { + // Unknown. Should never be used after a conversation is successfully + // created. + CONVERSATION_STAGE_UNSPECIFIED = 0; + + // The conversation should return virtual agent responses into the + // conversation. + VIRTUAL_AGENT_STAGE = 1; + + // The conversation should not provide responses, just listen and provide + // suggestions. + HUMAN_ASSIST_STAGE = 2; + } + + // Output only. The unique identifier of this conversation. + // Format: `projects//locations//conversations/`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the Conversation. + LifecycleState lifecycle_state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The Conversation Profile to be used to configure this + // Conversation. This field cannot be updated. + // Format: `projects//locations//conversationProfiles/`. + string conversation_profile = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ConversationProfile" + } + ]; + + // Output only. It will not be empty if the conversation is to be connected over + // telephony. + ConversationPhoneNumber phone_number = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the conversation was started. + google.protobuf.Timestamp start_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the conversation was finished. + google.protobuf.Timestamp end_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; Otherwise, defaults to + // [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.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][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], it skips + // [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] stage and directly goes to + // [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + ConversationStage conversation_stage = 7; +} + +// Represents a call matcher that describes criteria for matching incoming SIP +// calls to a conversation. When Dialogflow get a SIP call from a third-party +// carrier, Dialogflow matches the call to an existing conversation by either: +// +// * Extracting the conversation id from the +// [Call-Info header](https://tools.ietf.org/html/rfc3261#section-20.9), e.g. +// `Call-Info: +// +// ;purpose=Goog-ContactCenter-Conversation`. +// * Or, if that doesn't work, matching incoming [SIP +// headers](https://tools.ietf.org/html/rfc3261#section-7.3) +// against any [CallMatcher][google.cloud.dialogflow.v2.CallMatcher] for the conversation. +// +// If an incoming SIP call without valid `Call-Info` header matches to zero or +// multiple conversations with `CallMatcher`, we reject it. +// +// A call matcher contains equality conditions for SIP headers that all have +// to be fulfilled in order for a SIP call to match. +// +// The matched SIP headers consist of well-known headers (`To`, `From`, +// `Call-ID`) and custom headers. A [CallMatcher][google.cloud.dialogflow.v2.CallMatcher] is only valid if it +// specifies: +// +// * At least 1 custom header, +// * or at least 2 well-known headers. +message CallMatcher { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/CallMatcher" + pattern: "projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}" + pattern: "projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}" + }; + + // Custom SIP headers. See the [description of headers in + // the RFC](https://tools.ietf.org/html/rfc3261#section-7.3). + message CustomHeaders { + // Cisco's proprietary `Cisco-Guid` header. + string cisco_guid = 1; + } + + // Output only. The unique identifier of this call matcher. + // Format: `projects//locations//conversations//callMatchers/`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Value of the [`To` + // header](https://tools.ietf.org/html/rfc3261#section-8.1.1.2) to match. If + // empty or unspecified, we don't match to the + // [`To` header](https://tools.ietf.org/html/rfc3261#section-8.1.1.2). + string to_header = 2; + + // Value of the [`From` + // header](https://tools.ietf.org/html/rfc3261#section-8.1.1.3) to match. If + // empty or unspecified, we don't match to the + // [`From` header](https://tools.ietf.org/html/rfc3261#section-8.1.1.3). + string from_header = 3; + + // Value of the [`Call-ID` + // header](https://tools.ietf.org/html/rfc3261#section-8.1.1.4) to match. If + // empty or unspecified, we don't match to the + // [`Call-ID` header](https://tools.ietf.org/html/rfc3261#section-8.1.1.4). + string call_id_header = 4; + + // Custom SIP headers that must match. + CustomHeaders custom_headers = 5; +} + +// The request message for [Conversations.CreateConversation][google.cloud.dialogflow.v2.Conversations.CreateConversation]. +message CreateConversationRequest { + // Required. Resource identifier of the project creating the conversation. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Conversation" + } + ]; + + // Required. The conversation to create. + Conversation conversation = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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][a-zA-Z0-9_-]*" 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. + string conversation_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for [Conversations.ListConversations][google.cloud.dialogflow.v2.Conversations.ListConversations]. +message ListConversationsRequest { + // Required. The project from which to list all conversation. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Conversation" + } + ]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // 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). + string filter = 4; +} + +// The response message for [Conversations.ListConversations][google.cloud.dialogflow.v2.Conversations.ListConversations]. +message ListConversationsResponse { + // The list of conversations. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated Conversation conversations = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [Conversations.GetConversation][google.cloud.dialogflow.v2.Conversations.GetConversation]. +message GetConversationRequest { + // Required. The name of the conversation. Format: + // `projects//locations//conversations/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Conversation" + } + ]; +} + +// The request message for [Conversations.CompleteConversation][google.cloud.dialogflow.v2.Conversations.CompleteConversation]. +message CompleteConversationRequest { + // Required. Resource identifier of the conversation to close. + // Format: `projects//locations//conversations/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Conversation" + } + ]; +} + +// The request message for [Conversations.CreateCallMatcher][google.cloud.dialogflow.v2.Conversations.CreateCallMatcher]. +message CreateCallMatcherRequest { + // Required. Resource identifier of the conversation adding the call matcher. + // Format: `projects//locations//conversations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/CallMatcher" + } + ]; + + // Required. The call matcher to create. + CallMatcher call_matcher = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Conversations.ListCallMatchers][google.cloud.dialogflow.v2.Conversations.ListCallMatchers]. +message ListCallMatchersRequest { + // Required. The conversation to list all call matchers from. + // Format: `projects//locations//conversations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/CallMatcher" + } + ]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for [Conversations.ListCallMatchers][google.cloud.dialogflow.v2.Conversations.ListCallMatchers]. +message ListCallMatchersResponse { + // The list of call matchers. There is a maximum number of items + // returned based on the page_size field in the request. + repeated CallMatcher call_matchers = 1; + + // Token to retrieve the next page of results or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [Conversations.DeleteCallMatcher][google.cloud.dialogflow.v2.Conversations.DeleteCallMatcher]. +message DeleteCallMatcherRequest { + // Required. The unique identifier of the [CallMatcher][google.cloud.dialogflow.v2.CallMatcher] to delete. + // Format: `projects//locations//conversations//callMatchers/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/CallMatcher" + } + ]; +} + +// The request message for [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages]. +message ListMessagesRequest { + // Required. The name of the conversation to list messages for. + // Format: `projects//locations//conversations/` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Message" + } + ]; + + // 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). + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages]. +message ListMessagesResponse { + // 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. + repeated Message messages = 1; + + // Token to retrieve the next page of results, or empty if there are + // no more results in the list. + string next_page_token = 2; +} + +// Represents a phone number for telephony integration. It allows for connecting +// a particular conversation over telephony. +message ConversationPhoneNumber { + // Output only. The phone number to connect to this conversation. + string phone_number = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_event.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_event.proto new file mode 100644 index 00000000000..61cfd75f68a --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_event.proto @@ -0,0 +1,86 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/cloud/dialogflow/v2/participant.proto"; +import "google/rpc/status.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "ConversationEventProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// Represents a notification sent to Pub/Sub subscribers for conversation +// lifecycle events. +message ConversationEvent { + // Enumeration of the types of events available. + enum Type { + // Type not set. + TYPE_UNSPECIFIED = 0; + + // A new conversation has been opened. This is fired when a telephone call + // is answered, or a conversation is created via the API. + CONVERSATION_STARTED = 1; + + // An existing conversation has closed. This is fired when a telephone call + // is terminated, or a conversation is closed via the API. + CONVERSATION_FINISHED = 2; + + // An existing conversation has received notification from Dialogflow that + // human intervention is required. + HUMAN_INTERVENTION_NEEDED = 3; + + // An existing conversation has received a new message, either from API or + // telephony. It is configured in + // [ConversationProfile.new_message_event_notification_config][google.cloud.dialogflow.v2.ConversationProfile.new_message_event_notification_config] + NEW_MESSAGE = 5; + + // 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. + UNRECOVERABLE_ERROR = 4; + } + + // The unique identifier of the conversation this notification + // refers to. + // Format: `projects//conversations/`. + string conversation = 1; + + // The type of the event that this notification refers to. + Type type = 2; + + // More detailed information about an error. Only set for type + // UNRECOVERABLE_ERROR_IN_PHONE_CALL. + google.rpc.Status error_status = 3; + + // Payload of conversation event. + oneof payload { + // Payload of NEW_MESSAGE event. + Message new_message_payload = 4; + } +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_profile.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_profile.proto new file mode 100644 index 00000000000..ea0fc6f022a --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/conversation_profile.proto @@ -0,0 +1,577 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/v2/audio_config.proto"; +import "google/cloud/dialogflow/v2/participant.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "ConversationProfileProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// Service for managing [ConversationProfiles][google.cloud.dialogflow.v2.ConversationProfile]. +service ConversationProfiles { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all conversation profiles in the specified project. + rpc ListConversationProfiles(ListConversationProfilesRequest) returns (ListConversationProfilesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/conversationProfiles" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/conversationProfiles" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified conversation profile. + rpc GetConversationProfile(GetConversationProfileRequest) returns (ConversationProfile) { + option (google.api.http) = { + get: "/v2/{name=projects/*/conversationProfiles/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/conversationProfiles/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // 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][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] API. + rpc CreateConversationProfile(CreateConversationProfileRequest) returns (ConversationProfile) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/conversationProfiles" + body: "conversation_profile" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/conversationProfiles" + body: "conversation_profile" + } + }; + option (google.api.method_signature) = "parent,conversation_profile"; + } + + // Updates the specified conversation profile. + // + // [ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] + // aren't populated in the response. You can retrieve them via + // [GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile] API. + rpc UpdateConversationProfile(UpdateConversationProfileRequest) returns (ConversationProfile) { + option (google.api.http) = { + patch: "/v2/{conversation_profile.name=projects/*/conversationProfiles/*}" + body: "conversation_profile" + additional_bindings { + patch: "/v2/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}" + body: "conversation_profile" + } + }; + option (google.api.method_signature) = "conversation_profile,update_mask"; + } + + // Deletes the specified conversation profile. + rpc DeleteConversationProfile(DeleteConversationProfileRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/conversationProfiles/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/conversationProfiles/*}" + } + }; + option (google.api.method_signature) = "name"; + } +} + +// Defines the services to connect to incoming Dialogflow conversations. +message ConversationProfile { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/ConversationProfile" + pattern: "projects/{project}/conversationProfiles/{conversation_profile}" + pattern: "projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}" + }; + + // Optional. The unique identifier of this conversation profile. + // Format: `projects//locations//conversationProfiles/`. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Human readable name for this profile. Max length 1024 bytes. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Create time of the conversation profile. + google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time of the conversation profile. + google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration for an automated agent to use with this profile. + AutomatedAgentConfig automated_agent_config = 3; + + // Configuration for agent assistance to use with this profile. + HumanAgentAssistantConfig human_agent_assistant_config = 4; + + // Configuration for connecting to a live agent. + HumanAgentHandoffConfig human_agent_handoff_config = 5; + + // Configuration for publishing conversation lifecycle events. + NotificationConfig notification_config = 6; + + // Configuration for logging conversation lifecycle events. + LoggingConfig logging_config = 7; + + // Configuration for publishing new message events. Event will be sent in + // format of [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] + NotificationConfig new_message_event_notification_config = 8; + + // Settings for speech transcription. + SpeechToTextConfig stt_config = 9; + + // 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. + string language_code = 10; +} + +// The request message for [ConversationProfiles.ListConversationProfiles][google.cloud.dialogflow.v2.ConversationProfiles.ListConversationProfiles]. +message ListConversationProfilesRequest { + // Required. The project to list all conversation profiles from. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/ConversationProfile" + } + ]; + + // The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [ConversationProfiles.ListConversationProfiles][google.cloud.dialogflow.v2.ConversationProfiles.ListConversationProfiles]. +message ListConversationProfilesResponse { + // The list of project conversation profiles. There is a maximum number + // of items returned based on the page_size field in the request. + repeated ConversationProfile conversation_profiles = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [ConversationProfiles.GetConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile]. +message GetConversationProfileRequest { + // Required. The resource name of the conversation profile. + // Format: `projects//locations//conversationProfiles/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ConversationProfile" + } + ]; +} + +// The request message for [ConversationProfiles.CreateConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.CreateConversationProfile]. +message CreateConversationProfileRequest { + // Required. The project to create a conversation profile for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/ConversationProfile" + } + ]; + + // Required. The conversation profile to create. + ConversationProfile conversation_profile = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [ConversationProfiles.UpdateConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.UpdateConversationProfile]. +message UpdateConversationProfileRequest { + // Required. The conversation profile to update. + ConversationProfile conversation_profile = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields to update. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [ConversationProfiles.DeleteConversationProfile][google.cloud.dialogflow.v2.ConversationProfiles.DeleteConversationProfile]. +// +// This operation fails if the conversation profile is still referenced from +// a phone number. +message DeleteConversationProfileRequest { + // Required. The name of the conversation profile to delete. + // Format: `projects//locations//conversationProfiles/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ConversationProfile" + } + ]; +} + +// Defines the Automated Agent to connect to a conversation. +message AutomatedAgentConfig { + // Required. 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. + string agent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; +} + +// Defines the Human Agent Assist to connect to a conversation. +message HumanAgentAssistantConfig { + // Settings of suggestion trigger. + message SuggestionTriggerSettings { + // Do not trigger if last utterance is small talk. + bool no_smalltalk = 1; + + // Only trigger suggestion if participant role of last utterance is + // END_USER. + bool only_end_user = 2; + } + + // Config for suggestion features. + message SuggestionFeatureConfig { + // The suggestion feature. + SuggestionFeature suggestion_feature = 5; + + // Automatically iterates all participants and tries to compile + // suggestions. + // + // Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST. + bool enable_event_based_suggestion = 3; + + // Settings of suggestion trigger. + // + // Currently, only ARTICLE_SUGGESTION and FAQ will use this field. + SuggestionTriggerSettings suggestion_trigger_settings = 10; + + // Configs of query. + SuggestionQueryConfig query_config = 6; + + // Configs of custom conversation model. + ConversationModelConfig conversation_model_config = 7; + } + + // Detail human agent assistant config. + message SuggestionConfig { + // Configuration of different suggestion features. One feature can have only + // one config. + repeated SuggestionFeatureConfig feature_configs = 2; + + // 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. + bool group_suggestion_responses = 3; + } + + // Config for suggestion query. + message SuggestionQueryConfig { + // Knowledge base source settings. + // + // Supported features: ARTICLE_SUGGESTION, FAQ. + message KnowledgeBaseQuerySource { + // Required. Knowledge bases to query. Format: + // `projects//locations//knowledgeBases/`. Currently, at most 5 knowledge + // bases are supported. + repeated string knowledge_bases = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/KnowledgeBase" + } + ]; + } + + // Document source settings. + // + // Supported features: SMART_REPLY, SMART_COMPOSE. + message DocumentQuerySource { + // Required. Knowledge documents to query from. Format: + // `projects//locations//knowledgeBases//documents/`. + // Currently, at most 5 documents are supported. + repeated string documents = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Document" + } + ]; + } + + // Dialogflow source setting. + // + // Supported feature: DIALOGFLOW_ASSIST. + message DialogflowQuerySource { + // Required. 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. + string agent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + } + + // Settings that determine how to filter recent conversation context when + // generating suggestions. + message ContextFilterSettings { + // 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. + bool drop_handoff_messages = 1; + + // If set to true, all messages from virtual agent are dropped. + bool drop_virtual_agent_messages = 2; + + // If set to true, all messages from ivr stage are dropped. + bool drop_ivr_messages = 3; + } + + // Source of query. + oneof query_source { + // Query from knowledgebase. It is used by: + // ARTICLE_SUGGESTION, FAQ. + KnowledgeBaseQuerySource knowledge_base_query_source = 1; + + // Query from knowledge base document. It is used by: + // SMART_REPLY, SMART_COMPOSE. + DocumentQuerySource document_query_source = 2; + + // Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. + DialogflowQuerySource dialogflow_query_source = 3; + } + + // Maximum number of results to return. Currently, if unset, defaults to 10. + // And the max number is 20. + int32 max_results = 4; + + // 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. + float confidence_threshold = 5; + + // Determines how recent conversation context is filtered when generating + // suggestions. If unspecified, no messages will be dropped. + ContextFilterSettings context_filter_settings = 7; + } + + // Custom conversation models used in agent assist feature. + // + // Supported feature: ARTICLE_SUGGESTION, SMART_COMPOSE, SMART_REPLY. + message ConversationModelConfig { + // Required. Conversation model resource name. Format: `projects//conversationModels/`. + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ConversationModel" + } + ]; + } + + // Configuration for analyses to run on each conversation message. + message MessageAnalysisConfig { + // 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. + bool enable_entity_extraction = 2; + + // 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][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] method, result will be in + // [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message]. + // For [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] method, result will be in + // [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2.AnalyzeContentResponse.message] + // For [Conversations.ListMessages][google.cloud.dialogflow.v2.Conversations.ListMessages] method, result will be in + // [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2.ListMessagesResponse.messages] + // If Pub/Sub notification is configured, result will be in + // [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2.ConversationEvent.new_message_payload]. + bool enable_sentiment_analysis = 3; + } + + // Pub/Sub topic on which to publish new agent assistant events. + NotificationConfig notification_config = 2; + + // Configuration for agent assistance of human agent participant. + SuggestionConfig human_agent_suggestion_config = 3; + + // Configuration for agent assistance of end user participant. + SuggestionConfig end_user_suggestion_config = 4; + + // Configuration for message analysis. + MessageAnalysisConfig message_analysis_config = 5; +} + +// Defines the hand off to a live agent, typically on which external agent +// service provider to connect to a conversation. +message HumanAgentHandoffConfig { + // Configuration specific to LivePerson (https://www.liveperson.com). + message LivePersonConfig { + // Required. Account number of the LivePerson account to connect. This is + // the account number you input at the login page. + string account_number = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Configuration specific to Salesforce Live Agent. + message SalesforceLiveAgentConfig { + // Required. The organization ID of the Salesforce account. + string organization_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Live Agent deployment ID. + string deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Live Agent chat button ID. + string button_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. 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. + string endpoint_domain = 4 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Specifies which agent service to connect for human agent handoff. + oneof agent_service { + // Uses LivePerson (https://www.liveperson.com). + LivePersonConfig live_person_config = 1; + + // Uses Salesforce Live Agent. + SalesforceLiveAgentConfig salesforce_live_agent_config = 2; + } +} + +// Defines notification behavior. +message NotificationConfig { + // Format of cloud pub/sub message. + enum MessageFormat { + // If it is unspeified, PROTO will be used. + MESSAGE_FORMAT_UNSPECIFIED = 0; + + // Pubsub message will be serialized proto. + PROTO = 1; + + // Pubsub message will be json. + JSON = 2; + } + + // Name of the Pub/Sub topic to publish conversation + // events like + // [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] as + // serialized [ConversationEvent][google.cloud.dialogflow.v2.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/`. + string topic = 1; + + // Format of message. + MessageFormat message_format = 2; +} + +// Defines logging behavior for conversation lifecycle events. +message LoggingConfig { + // Whether to log conversation events like + // [CONVERSATION_STARTED][google.cloud.dialogflow.v2.ConversationEvent.Type.CONVERSATION_STARTED] to + // Stackdriver in the conversation project as JSON format + // [ConversationEvent][google.cloud.dialogflow.v2.ConversationEvent] protos. + bool enable_stackdriver_logging = 3; +} + +// 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. +message SuggestionFeature { + // Defines the type of Human Agent Assistant feature. + enum Type { + // Unspecified feature type. + TYPE_UNSPECIFIED = 0; + + // Run article suggestion model. + ARTICLE_SUGGESTION = 1; + + // Run FAQ model. + FAQ = 2; + } + + // Type of Human Agent Assistant API feature to request. + Type type = 1; +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/document.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/document.proto new file mode 100644 index 00000000000..5ff57996069 --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/document.proto @@ -0,0 +1,389 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "DocumentProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// Service for managing knowledge [Documents][google.cloud.dialogflow.v2.Document]. +service Documents { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all documents of the knowledge base. + rpc ListDocuments(ListDocumentsRequest) returns (ListDocumentsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/knowledgeBases/*}/documents" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified document. + rpc GetDocument(GetDocumentRequest) returns (Document) { + option (google.api.http) = { + get: "/v2/{name=projects/*/knowledgeBases/*/documents/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new document. + // + // Operation + rpc CreateDocument(CreateDocumentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/knowledgeBases/*}/documents" + body: "document" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents" + body: "document" + } + }; + option (google.api.method_signature) = "parent,document"; + option (google.longrunning.operation_info) = { + response_type: "Document" + metadata_type: "KnowledgeOperationMetadata" + }; + } + + // Deletes the specified document. + // + // Operation + rpc DeleteDocument(DeleteDocumentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/knowledgeBases/*/documents/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}" + } + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "KnowledgeOperationMetadata" + }; + } + + // Updates the specified document. + // + // Operation + rpc UpdateDocument(UpdateDocumentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v2/{document.name=projects/*/knowledgeBases/*/documents/*}" + body: "document" + additional_bindings { + patch: "/v2/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}" + body: "document" + } + }; + option (google.api.method_signature) = "document,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Document" + metadata_type: "KnowledgeOperationMetadata" + }; + } + + // 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 + rpc ReloadDocument(ReloadDocumentRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2/{name=projects/*/knowledgeBases/*/documents/*}:reload" + body: "*" + additional_bindings { + post: "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload" + body: "*" + } + }; + option (google.api.method_signature) = "name,content_uri"; + option (google.longrunning.operation_info) = { + response_type: "Document" + metadata_type: "KnowledgeOperationMetadata" + }; + } +} + +// A knowledge document to be used by a [KnowledgeBase][google.cloud.dialogflow.v2.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`. +message Document { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Document" + pattern: "projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}" + pattern: "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}" + }; + + // The status of a reload attempt. + message ReloadStatus { + // The time of a reload attempt. + // This reload may have been triggered automatically or manually and may + // not have succeeded. + google.protobuf.Timestamp time = 1; + + // The status of a reload attempt or the initial load. + google.rpc.Status status = 2; + } + + // The knowledge type of document content. + enum KnowledgeType { + // The type is unspecified or arbitrary. + KNOWLEDGE_TYPE_UNSPECIFIED = 0; + + // The document content contains question and answer pairs as either HTML or + // CSV. Typical FAQ HTML formats are parsed accurately, but unusual formats + // may fail to be parsed. + // + // CSV must have questions in the first column and answers in the second, + // with no header. Because of this explicit format, they are always parsed + // accurately. + FAQ = 1; + + // Documents for which unstructured text is extracted and used for + // question answering. + EXTRACTIVE_QA = 2; + + // The entire document content as a whole can be used for query results. + // Only for Contact Center Solutions on Dialogflow. + ARTICLE_SUGGESTION = 3; + } + + // Optional. The document resource name. + // The name must be empty when creating a document. + // Format: `projects//locations//knowledgeBases//documents/`. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The display name of the document. The name must be 1024 bytes or + // less; otherwise, the creation request fails. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The MIME type of this document. + string mime_type = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. The knowledge type of document content. + repeated KnowledgeType knowledge_types = 4 [(google.api.field_behavior) = REQUIRED]; + + // Required. The source of this document. + oneof source { + // 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. + string content_uri = 5; + + // The raw content of the document. This field is only permitted for + // EXTRACTIVE_QA and FAQ knowledge types. + bytes raw_content = 9; + } + + // Optional. 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. + bool enable_auto_reload = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time and status of the latest reload. + // This reload may have been triggered automatically or manually + // and may not have succeeded. + ReloadStatus latest_reload_status = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. 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. + map metadata = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [Documents.GetDocument][google.cloud.dialogflow.v2.Documents.GetDocument]. +message GetDocumentRequest { + // Required. The name of the document to retrieve. + // Format `projects//locations//knowledgeBases//documents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Document" + } + ]; +} + +// Request message for [Documents.ListDocuments][google.cloud.dialogflow.v2.Documents.ListDocuments]. +message ListDocumentsRequest { + // Required. The knowledge base to list all documents for. + // Format: `projects//locations//knowledgeBases/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Document" + } + ]; + + // The maximum number of items to return in a single page. By + // default 10 and at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// Response message for [Documents.ListDocuments][google.cloud.dialogflow.v2.Documents.ListDocuments]. +message ListDocumentsResponse { + // The list of documents. + repeated Document documents = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request message for [Documents.CreateDocument][google.cloud.dialogflow.v2.Documents.CreateDocument]. +message CreateDocumentRequest { + // Required. The knowledge base to create a document for. + // Format: `projects//locations//knowledgeBases/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Document" + } + ]; + + // Required. The document to create. + Document document = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [Documents.DeleteDocument][google.cloud.dialogflow.v2.Documents.DeleteDocument]. +message DeleteDocumentRequest { + // Required. The name of the document to delete. + // Format: `projects//locations//knowledgeBases//documents/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Document" + } + ]; +} + +// Request message for [Documents.UpdateDocument][google.cloud.dialogflow.v2.Documents.UpdateDocument]. +message UpdateDocumentRequest { + // Required. The document to update. + Document document = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Not specified means `update all`. + // Currently, only `display_name` can be updated, an InvalidArgument will be + // returned for attempting to update other fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [Documents.ReloadDocument][google.cloud.dialogflow.v2.Documents.ReloadDocument]. +message ReloadDocumentRequest { + // Required. The name of the document to reload. + // Format: `projects//locations//knowledgeBases//documents/` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Document" + } + ]; + + // The source for document reloading. + // If provided, the service will load the contents from the source + // and update document in the knowledge base. + oneof source { + // Optional. 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:///`. + string content_uri = 3 [(google.api.field_behavior) = OPTIONAL]; + } +} + +// Metadata in google::longrunning::Operation for Knowledge operations. +message KnowledgeOperationMetadata { + // States of the operation. + enum State { + // State unspecified. + STATE_UNSPECIFIED = 0; + + // The operation has been created. + PENDING = 1; + + // The operation is currently running. + RUNNING = 2; + + // The operation is done, either cancelled or completed. + DONE = 3; + } + + // Output only. The current state of this operation. + State state = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/gcs.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/gcs.proto new file mode 100644 index 00000000000..1fb2dc99cd2 --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/gcs.proto @@ -0,0 +1,28 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/field_behavior.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "GcsProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto new file mode 100644 index 00000000000..f79ce9d46c1 --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto @@ -0,0 +1,44 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/cloud/dialogflow/v2/participant.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "HumanAgentAssistantEventProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// Represents a notification sent to Cloud Pub/Sub subscribers for +// human agent assistant events in a specific conversation. +message HumanAgentAssistantEvent { + // The conversation this notification refers to. + // Format: `projects//conversations/`. + string conversation = 1; + + // The participant that the suggestion is compiled for. + // Format: `projects//conversations//participants/`. It will not be set in legacy workflow. + string participant = 3; + + // The suggestion results payload that this notification refers to. + repeated SuggestionResult suggestion_results = 5; +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/intent.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/intent.proto index 3c7fa4aa99e..e1507a5c957 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/intent.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/intent.proto @@ -774,6 +774,17 @@ message Intent { // auto-markup in the UI is turned off. bool ml_disabled = 19 [(google.api.field_behavior) = OPTIONAL]; + // Optional. 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. + bool live_agent_handoff = 20 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. 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. + bool end_interaction = 21 [(google.api.field_behavior) = OPTIONAL]; + // Optional. The list of context names required for this intent to be // triggered. // Format: `projects//agent/sessions/-/contexts/`. diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/knowledge_base.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/knowledge_base.proto new file mode 100644 index 00000000000..52dbed10ca5 --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/knowledge_base.proto @@ -0,0 +1,217 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "KnowledgeBaseProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// Service for managing [KnowledgeBases][google.cloud.dialogflow.v2.KnowledgeBase]. +service KnowledgeBases { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all knowledge bases of the specified agent. + rpc ListKnowledgeBases(ListKnowledgeBasesRequest) returns (ListKnowledgeBasesResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*}/knowledgeBases" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*}/knowledgeBases" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified knowledge base. + rpc GetKnowledgeBase(GetKnowledgeBaseRequest) returns (KnowledgeBase) { + option (google.api.http) = { + get: "/v2/{name=projects/*/knowledgeBases/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/knowledgeBases/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a knowledge base. + rpc CreateKnowledgeBase(CreateKnowledgeBaseRequest) returns (KnowledgeBase) { + option (google.api.http) = { + post: "/v2/{parent=projects/*}/knowledgeBases" + body: "knowledge_base" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*}/knowledgeBases" + body: "knowledge_base" + } + }; + option (google.api.method_signature) = "parent,knowledge_base"; + } + + // Deletes the specified knowledge base. + rpc DeleteKnowledgeBase(DeleteKnowledgeBaseRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2/{name=projects/*/knowledgeBases/*}" + additional_bindings { + delete: "/v2/{name=projects/*/locations/*/knowledgeBases/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Updates the specified knowledge base. + rpc UpdateKnowledgeBase(UpdateKnowledgeBaseRequest) returns (KnowledgeBase) { + option (google.api.http) = { + patch: "/v2/{knowledge_base.name=projects/*/knowledgeBases/*}" + body: "knowledge_base" + additional_bindings { + patch: "/v2/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}" + body: "knowledge_base" + } + }; + option (google.api.method_signature) = "knowledge_base,update_mask"; + } +} + +// 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`. +message KnowledgeBase { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/KnowledgeBase" + pattern: "projects/{project}/knowledgeBases/{knowledge_base}" + pattern: "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}" + }; + + // The knowledge base resource name. + // The name must be empty when creating a knowledge base. + // Format: `projects//locations//knowledgeBases/`. + string name = 1; + + // Required. The display name of the knowledge base. The name must be 1024 + // bytes or less; otherwise, the creation request fails. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + string language_code = 4; +} + +// Request message for [KnowledgeBases.ListKnowledgeBases][google.cloud.dialogflow.v2.KnowledgeBases.ListKnowledgeBases]. +message ListKnowledgeBasesRequest { + // Required. The project to list of knowledge bases for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/KnowledgeBase" + } + ]; + + // The maximum number of items to return in a single page. By + // default 10 and at most 100. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// Response message for [KnowledgeBases.ListKnowledgeBases][google.cloud.dialogflow.v2.KnowledgeBases.ListKnowledgeBases]. +message ListKnowledgeBasesResponse { + // The list of knowledge bases. + repeated KnowledgeBase knowledge_bases = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// Request message for [KnowledgeBases.GetKnowledgeBase][google.cloud.dialogflow.v2.KnowledgeBases.GetKnowledgeBase]. +message GetKnowledgeBaseRequest { + // Required. The name of the knowledge base to retrieve. + // Format `projects//locations//knowledgeBases/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/KnowledgeBase" + } + ]; +} + +// Request message for [KnowledgeBases.CreateKnowledgeBase][google.cloud.dialogflow.v2.KnowledgeBases.CreateKnowledgeBase]. +message CreateKnowledgeBaseRequest { + // Required. The project to create a knowledge base for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/KnowledgeBase" + } + ]; + + // Required. The knowledge base to create. + KnowledgeBase knowledge_base = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Request message for [KnowledgeBases.DeleteKnowledgeBase][google.cloud.dialogflow.v2.KnowledgeBases.DeleteKnowledgeBase]. +message DeleteKnowledgeBaseRequest { + // Required. The name of the knowledge base to delete. + // Format: `projects//locations//knowledgeBases/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/KnowledgeBase" + } + ]; + + // Optional. Force deletes the knowledge base. When set to true, any documents + // in the knowledge base are also deleted. + bool force = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for [KnowledgeBases.UpdateKnowledgeBase][google.cloud.dialogflow.v2.KnowledgeBases.UpdateKnowledgeBase]. +message UpdateKnowledgeBaseRequest { + // Required. The knowledge base to update. + KnowledgeBase knowledge_base = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Not specified means `update all`. + // Currently, only `display_name` can be updated, an InvalidArgument will be + // returned for attempting to update other fields. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/participant.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/participant.proto new file mode 100644 index 00000000000..2c6e8573630 --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2/participant.proto @@ -0,0 +1,766 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/v2/audio_config.proto"; +import "google/cloud/dialogflow/v2/session.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "ParticipantProto"; +option java_package = "com.google.cloud.dialogflow.v2"; +option objc_class_prefix = "DF"; + +// Service for managing [Participants][google.cloud.dialogflow.v2.Participant]. +service Participants { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Creates a new participant in a conversation. + rpc CreateParticipant(CreateParticipantRequest) returns (Participant) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/conversations/*}/participants" + body: "participant" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*/conversations/*}/participants" + body: "participant" + } + }; + option (google.api.method_signature) = "parent,participant"; + } + + // Retrieves a conversation participant. + rpc GetParticipant(GetParticipantRequest) returns (Participant) { + option (google.api.http) = { + get: "/v2/{name=projects/*/conversations/*/participants/*}" + additional_bindings { + get: "/v2/{name=projects/*/locations/*/conversations/*/participants/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns the list of all participants in the specified conversation. + rpc ListParticipants(ListParticipantsRequest) returns (ListParticipantsResponse) { + option (google.api.http) = { + get: "/v2/{parent=projects/*/conversations/*}/participants" + additional_bindings { + get: "/v2/{parent=projects/*/locations/*/conversations/*}/participants" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the specified participant. + rpc UpdateParticipant(UpdateParticipantRequest) returns (Participant) { + option (google.api.http) = { + patch: "/v2/{participant.name=projects/*/conversations/*/participants/*}" + body: "participant" + additional_bindings { + patch: "/v2/{participant.name=projects/*/locations/*/conversations/*/participants/*}" + body: "participant" + } + }; + option (google.api.method_signature) = "participant,update_mask"; + } + + // 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). + rpc AnalyzeContent(AnalyzeContentRequest) returns (AnalyzeContentResponse) { + option (google.api.http) = { + post: "/v2/{participant=projects/*/conversations/*/participants/*}:analyzeContent" + body: "*" + additional_bindings { + post: "/v2/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent" + body: "*" + } + }; + option (google.api.method_signature) = "participant,text_input"; + option (google.api.method_signature) = "participant,audio_input"; + option (google.api.method_signature) = "participant,event_input"; + } + + // Adds a text (chat, for example), or audio (phone recording, for example) + // message from a participant into the conversation. + // Note: This method is only available through the gRPC API (not REST). + // + // The top-level message sent to the client by the server is + // `StreamingAnalyzeContentResponse`. Multiple response messages can be + // returned in order. The first one or more messages contain the + // `recognition_result` field. Each result represents a more complete + // transcript of what the user said. The next message contains the + // `reply_text` field and potentially the `reply_audio` field. The message can + // also contain the `automated_agent_reply` field. + // + // 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). + rpc StreamingAnalyzeContent(stream StreamingAnalyzeContentRequest) returns (stream StreamingAnalyzeContentResponse) { + } + + // Gets suggested articles for a participant based on specific historical + // messages. + rpc SuggestArticles(SuggestArticlesRequest) returns (SuggestArticlesResponse) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles" + body: "*" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles" + body: "*" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets suggested faq answers for a participant based on specific historical + // messages. + rpc SuggestFaqAnswers(SuggestFaqAnswersRequest) returns (SuggestFaqAnswersResponse) { + option (google.api.http) = { + post: "/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers" + body: "*" + additional_bindings { + post: "/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers" + body: "*" + } + }; + option (google.api.method_signature) = "parent"; + } +} + +// Represents a conversation participant (human agent, virtual agent, end-user). +message Participant { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Participant" + pattern: "projects/{project}/conversations/{conversation}/participants/{participant}" + pattern: "projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}" + }; + + // Enumeration of the roles a participant can play in a conversation. + enum Role { + // Participant role not set. + ROLE_UNSPECIFIED = 0; + + // Participant is a human agent. + HUMAN_AGENT = 1; + + // Participant is an automated agent, such as a Dialogflow agent. + AUTOMATED_AGENT = 2; + + // Participant is an end user that has called or chatted with + // Dialogflow services. + END_USER = 3; + } + + // Optional. The unique identifier of this participant. + // Format: `projects//locations//conversations//participants/`. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Immutable. The role this participant plays in the conversation. This field must be set + // during participant creation and is then immutable. + Role role = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Optional. 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. + string sip_recording_media_label = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents a message posted into a conversation. +message Message { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Message" + pattern: "projects/{project}/conversations/{conversation}/messages/{message}" + pattern: "projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}" + }; + + // The unique identifier of the message. + // Format: `projects//locations//conversations//messages/`. + string name = 1; + + // Required. The message content. + string content = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The message language. + // This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag. Example: "en-US". + string language_code = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The participant that sends this message. + string participant = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The role of the participant. + Participant.Role participant_role = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the message was created. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The annotation for the message. + MessageAnnotation message_annotation = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for [Participants.CreateParticipant][google.cloud.dialogflow.v2.Participants.CreateParticipant]. +message CreateParticipantRequest { + // Required. Resource identifier of the conversation adding the participant. + // Format: `projects//locations//conversations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Participant" + } + ]; + + // Required. The participant to create. + Participant participant = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Participants.GetParticipant][google.cloud.dialogflow.v2.Participants.GetParticipant]. +message GetParticipantRequest { + // Required. The name of the participant. Format: + // `projects//locations//conversations//participants/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + } + ]; +} + +// The request message for [Participants.ListParticipants][google.cloud.dialogflow.v2.Participants.ListParticipants]. +message ListParticipantsRequest { + // Required. The conversation to list all participants from. + // Format: `projects//locations//conversations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Participant" + } + ]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for [Participants.ListParticipants][google.cloud.dialogflow.v2.Participants.ListParticipants]. +message ListParticipantsResponse { + // The list of participants. There is a maximum number of items + // returned based on the page_size field in the request. + repeated Participant participants = 1; + + // Token to retrieve the next page of results or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [Participants.UpdateParticipant][google.cloud.dialogflow.v2.Participants.UpdateParticipant]. +message UpdateParticipantRequest { + // Required. The participant to update. + Participant participant = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to specify which fields to update. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent]. +message AnalyzeContentRequest { + // Required. The name of the participant this text comes from. + // Format: `projects//locations//conversations//participants/`. + string participant = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + } + ]; + + // Required. The input content. + oneof input { + // The natural language text to be processed. + TextInput text_input = 6; + + // The natural language speech audio to be processed. + AudioInput audio_input = 7; + + // An input event to send to Dialogflow. + EventInput event_input = 8; + } + + // 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. + OutputAudioConfig reply_audio_config = 5; + + // Parameters for a Dialogflow virtual-agent query. + QueryParameters query_params = 9; + + // 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. + string request_id = 11; +} + +// The message in the response that indicates the parameters of DTMF. +message DtmfParameters { + // Indicates whether DTMF input can be handled in the next request. + bool accepts_dtmf_input = 1; +} + +// The response message for [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent]. +message AnalyzeContentResponse { + // The output text content. + // This field is set if the automated agent responded with text to show to + // the user. + string reply_text = 1; + + // 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. + OutputAudio reply_audio = 2; + + // 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][google.cloud.dialogflow.v2.AnalyzeContentResponse.reply_audio] instead. + AutomatedAgentReply automated_agent_reply = 3; + + // Message analyzed by CCAI. + Message message = 5; + + // The suggestions for most recent human agent. The order is the same as + // [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of + // [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + repeated SuggestionResult human_agent_suggestion_results = 6; + + // The suggestions for end user. The order is the same as + // [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of + // [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + repeated SuggestionResult end_user_suggestion_results = 7; + + // Indicates the parameters of DTMF. + DtmfParameters dtmf_parameters = 9; +} + +// The top-level message sent by the client to the +// [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContent] method. +// +// Multiple request messages should be sent in order: +// +// 1. The first message must contain +// [participant][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.participant], +// [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] and optionally +// [query_params][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.query_params]. If you want +// to receive an audio response, it should also contain +// [reply_audio_config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.reply_audio_config]. +// The message must not contain +// [input][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input]. +// +// 2. If [config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in the first message +// was set to [audio_config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.audio_config], +// all subsequent messages must contain +// [input_audio][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input_audio] to continue +// with Speech recognition. +// However, note that: +// +// * Dialogflow will bill you for the audio so far. +// * Dialogflow discards all Speech recognition results in favor of the +// text input. +// +// 3. If [StreamingAnalyzeContentRequest.config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.config] in the first message was set +// to [StreamingAnalyzeContentRequest.text_config][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.text_config], then the second message +// must contain only [input_text][google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.input_text]. +// Moreover, you must not send more than two messages. +// +// After you sent all input, you must half-close or abort the request stream. +message StreamingAnalyzeContentRequest { + // Required. The name of the participant this text comes from. + // Format: `projects//locations//conversations//participants/`. + string participant = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + } + ]; + + // Required. The input config. + oneof config { + // Instructs the speech recognizer how to process the speech audio. + InputAudioConfig audio_config = 2; + + // The natural language text to be processed. + InputTextConfig text_config = 3; + } + + // 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 + // StreamingAnalyzeContent. If this configuration is not supplied, speech + // synthesis is disabled. + OutputAudioConfig reply_audio_config = 4; + + // Required. The input. + oneof input { + // The input audio content to be recognized. Must be sent if `audio_config` + // is set in the first message. The complete audio over all streaming + // messages must not exceed 1 minute. + bytes input_audio = 5; + + // The UTF-8 encoded natural language text to be processed. Must be sent if + // `text_config` is set in the first message. Text length must not exceed + // 256 bytes. The `input_text` field can be only sent once. + string input_text = 6; + + // The DTMF digits used to invoke intent and fill in parameter value. + // + // This input is ignored if the previous response indicated that DTMF input + // is not accepted. + TelephonyDtmfEvents input_dtmf = 9; + } + + // Parameters for a Dialogflow virtual-agent query. + QueryParameters query_params = 7; +} + +// The top-level message returned from the `StreamingAnalyzeContent` method. +// +// Multiple response messages can be returned in order: +// +// 1. If the input was set to streaming audio, the first one or more messages +// contain `recognition_result`. Each `recognition_result` represents a more +// complete transcript of what the user said. The last `recognition_result` +// has `is_final` set to `true`. +// +// 2. The next message contains `reply_text` and optionally `reply_audio` +// returned by an agent. This message may also contain +// `automated_agent_reply`. +message StreamingAnalyzeContentResponse { + // The result of speech recognition. + StreamingRecognitionResult recognition_result = 1; + + // The output text content. + // This field is set if an automated agent responded with a text for the user. + string reply_text = 2; + + // The audio data bytes encoded as specified in the request. + // This field is set if: + // + // - The `reply_audio_config` field is specified in the request. + // - The automated agent, which this output comes from, responded with audio. + // In such case, the `reply_audio.config` field 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. + OutputAudio reply_audio = 3; + + // 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][google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.reply_audio] instead. + AutomatedAgentReply automated_agent_reply = 4; + + // Message analyzed by CCAI. + Message message = 6; + + // The suggestions for most recent human agent. The order is the same as + // [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of + // [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.human_agent_suggestion_config]. + repeated SuggestionResult human_agent_suggestion_results = 7; + + // The suggestions for end user. The order is the same as + // [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of + // [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2.HumanAgentAssistantConfig.end_user_suggestion_config]. + repeated SuggestionResult end_user_suggestion_results = 8; + + // Indicates the parameters of DTMF. + DtmfParameters dtmf_parameters = 10; +} + +// The request message for [Participants.SuggestArticles][google.cloud.dialogflow.v2.Participants.SuggestArticles]. +message SuggestArticlesRequest { + // Required. The name of the participant to fetch suggestion for. + // Format: `projects//locations//conversations//participants/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + } + ]; + + // 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/`. + string latest_message = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Message" + }]; + + // Max number of messages prior to and including + // [latest_message][google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message] to use as context + // when compiling the suggestion. By default 20 and at most 50. + int32 context_size = 3; +} + +// The response message for [Participants.SuggestArticles][google.cloud.dialogflow.v2.Participants.SuggestArticles]. +message SuggestArticlesResponse { + // Articles ordered by score in descending order. + repeated ArticleAnswer article_answers = 1; + + // The name of the latest conversation message used to compile + // suggestion for. + // + // Format: `projects//locations//conversations//messages/`. + string latest_message = 2; + + // Number of messages prior to and including + // [latest_message][google.cloud.dialogflow.v2.SuggestArticlesResponse.latest_message] to compile the + // suggestion. It may be smaller than the + // [SuggestArticlesRequest.context_size][google.cloud.dialogflow.v2.SuggestArticlesRequest.context_size] field in the request if there + // aren't that many messages in the conversation. + int32 context_size = 3; +} + +// The request message for [Participants.SuggestFaqAnswers][google.cloud.dialogflow.v2.Participants.SuggestFaqAnswers]. +message SuggestFaqAnswersRequest { + // Required. The name of the participant to fetch suggestion for. + // Format: `projects//locations//conversations//participants/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + } + ]; + + // 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/`. + string latest_message = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Message" + }]; + + // 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. + int32 context_size = 3; +} + +// The request message for [Participants.SuggestFaqAnswers][google.cloud.dialogflow.v2.Participants.SuggestFaqAnswers]. +message SuggestFaqAnswersResponse { + // Answers extracted from FAQ documents. + repeated FaqAnswer faq_answers = 1; + + // The name of the latest conversation message used to compile + // suggestion for. + // + // Format: `projects//locations//conversations//messages/`. + string latest_message = 2; + + // Number of messages prior to and including + // [latest_message][google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.latest_message] to compile the + // suggestion. It may be smaller than the + // [SuggestFaqAnswersRequest.context_size][google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.context_size] field in the request if there + // aren't that many messages in the conversation. + int32 context_size = 3; +} + +// Represents the natural language speech audio to be processed. +message AudioInput { + // Required. Instructs the speech recognizer how to process the speech audio. + InputAudioConfig config = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. 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. + bytes audio = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the natural language speech audio to be played to the end user. +message OutputAudio { + // Instructs the speech synthesizer how to generate the speech + // audio. + OutputAudioConfig config = 1; + + // The natural language speech audio. + bytes audio = 2; +} + +// Represents a response from an automated agent. +message AutomatedAgentReply { + // Response of the Dialogflow [Sessions.DetectIntent][google.cloud.dialogflow.v2.Sessions.DetectIntent] call. + DetectIntentResponse detect_intent_response = 1; +} + +// Represents article answer. +message ArticleAnswer { + // The article title. + string title = 1; + + // The article URI. + string uri = 2; + + // Article snippets. + repeated string snippets = 3; + + // 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). + float confidence = 4; + + // A map that contains metadata about the answer and the + // document from which it originates. + map metadata = 5; + + // The name of answer record, in the format of + // "projects//locations//answerRecords/" + string answer_record = 6; +} + +// Represents answer from "frequently asked questions". +message FaqAnswer { + // The piece of text from the `source` knowledge base document. + string answer = 1; + + // 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). + float confidence = 2; + + // The corresponding FAQ question. + string question = 3; + + // Indicates which Knowledge Document this answer was extracted + // from. + // Format: `projects//locations//agent/knowledgeBases//documents/`. + string source = 4; + + // A map that contains metadata about the answer and the + // document from which it originates. + map metadata = 5; + + // The name of answer record, in the format of + // "projects//locations//answerRecords/" + string answer_record = 6; +} + +// One response of different type of suggestion response which is used in +// the response of [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent] and +// [Participants.AnalyzeContent][google.cloud.dialogflow.v2.Participants.AnalyzeContent], as well as [HumanAgentAssistantEvent][google.cloud.dialogflow.v2.HumanAgentAssistantEvent]. +message SuggestionResult { + // Different type of suggestion response. + oneof suggestion_response { + // Error status if the request failed. + google.rpc.Status error = 1; + + // SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. + SuggestArticlesResponse suggest_articles_response = 2; + + // SuggestFaqAnswersResponse if request is for FAQ_ANSWER. + SuggestFaqAnswersResponse suggest_faq_answers_response = 3; + } +} + +// Defines the language used in the input text. +message InputTextConfig { + // Required. 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. + string language_code = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// 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. +message AnnotatedMessagePart { + // A part of a message possibly annotated with an entity. + string text = 1; + + // 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. + string entity_type = 2; + + // 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"
+  // }
+  // 
+ google.protobuf.Value formatted_value = 3; +} + +// Represents the result of annotation for the message. +message MessageAnnotation { + // The collection of annotated message parts ordered by their + // position in the message. You can recover the annotated message by + // concatenating [AnnotatedMessagePart.text]. + repeated AnnotatedMessagePart parts = 1; + + // Indicates whether the text message contains entities. + bool contain_entities = 2; +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/answer_record.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/answer_record.proto new file mode 100644 index 00000000000..b344010d1fc --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/answer_record.proto @@ -0,0 +1,322 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/v2beta1/participant.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "AnswerRecordsProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [AnswerRecords][google.cloud.dialogflow.v2beta1.AnswerRecord]. +service AnswerRecords { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Deprecated. + // Retrieves a specific answer record. + rpc GetAnswerRecord(GetAnswerRecordRequest) returns (AnswerRecord) { + option deprecated = true; + option (google.api.http) = { + get: "/v2beta1/{name=projects/*/answerRecords/*}" + additional_bindings { + get: "/v2beta1/{name=projects/*/locations/*/answerRecords/*}" + } + }; + } + + // Returns the list of all answer records in the specified project in reverse + // chronological order. + rpc ListAnswerRecords(ListAnswerRecordsRequest) returns (ListAnswerRecordsResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*}/answerRecords" + additional_bindings { + get: "/v2beta1/{parent=projects/*/locations/*}/answerRecords" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the specified answer record. + rpc UpdateAnswerRecord(UpdateAnswerRecordRequest) returns (AnswerRecord) { + option (google.api.http) = { + patch: "/v2beta1/{answer_record.name=projects/*/answerRecords/*}" + body: "answer_record" + additional_bindings { + patch: "/v2beta1/{answer_record.name=projects/*/locations/*/answerRecords/*}" + body: "answer_record" + } + }; + option (google.api.method_signature) = "answer_record,update_mask"; + } +} + +// 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][google.cloud.dialogflow.v2beta1.AnswerRecord.name] are returned to the +// customers. +// 2. The customer uses the [AnswerRecord.name][google.cloud.dialogflow.v2beta1.AnswerRecord.name] to call the +// [UpdateAnswerRecord][] method to send feedback about a specific answer +// that they believe is wrong. +message AnswerRecord { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/AnswerRecord" + pattern: "projects/{project}/answerRecords/{answer_record}" + pattern: "projects/{project}/locations/{location}/answerRecords/{answer_record}" + }; + + // The unique identifier of this answer record. + // Required for [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2beta1.AnswerRecords.UpdateAnswerRecord] method. + // Format: `projects//locations//answerRecords/`. + string name = 1; + + // Optional. The AnswerFeedback for this record. You can set this with + // [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2beta1.AnswerRecords.UpdateAnswerRecord] in order to give us feedback about + // this answer. + AnswerFeedback answer_feedback = 3; + + // Output only. The record for this answer. + oneof record { + // Output only. The record for human agent assistant. + AgentAssistantRecord agent_assistant_record = 4; + } +} + +// Represents a record of a human agent assistant answer. +message AgentAssistantRecord { + // Output only. The agent assistant answer. + oneof answer { + // Output only. The article suggestion answer. + ArticleAnswer article_suggestion_answer = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The FAQ answer. + FaqAnswer faq_answer = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// Represents feedback the customer has about the quality & correctness of a +// certain answer in a conversation. +message AnswerFeedback { + // The correctness level of an answer. + enum CorrectnessLevel { + // Correctness level unspecified. + CORRECTNESS_LEVEL_UNSPECIFIED = 0; + + // Answer is totally wrong. + NOT_CORRECT = 1; + + // Answer is partially correct. + PARTIALLY_CORRECT = 2; + + // Answer is fully correct. + FULLY_CORRECT = 3; + } + + // The correctness level of the specific answer. + CorrectnessLevel correctness_level = 1; + + // Normally, detail feedback is provided when answer is not fully correct. + oneof detail_feedback { + // Optional. Detail feedback of agent assistant suggestions. + AgentAssistantFeedback agent_assistant_detail_feedback = 2; + } + + // Indicates whether the answer/item was clicked by the human agent + // or not. Default to false. + bool clicked = 3; + + // Time when the answer/item was clicked. + google.protobuf.Timestamp click_time = 5; + + // Indicates whether the answer/item was displayed to the human + // agent in the agent desktop UI. Default to false. + bool displayed = 4; + + // Time when the answer/item was displayed. + google.protobuf.Timestamp display_time = 6; +} + +// Detail feedback of Agent Assistant result. +message AgentAssistantFeedback { + // Feedback for conversation summarization. + message SummarizationFeedback { + // Timestamp when composing of the summary starts. + google.protobuf.Timestamp start_timestamp = 1; + + // Timestamp when the summary was submitted. + google.protobuf.Timestamp submit_timestamp = 2; + + // Text of actual submitted summary. + string summary_text = 3; + } + + // Relevance of an answer. + enum AnswerRelevance { + // Answer relevance unspecified. + ANSWER_RELEVANCE_UNSPECIFIED = 0; + + // Answer is irrelevant to query. + IRRELEVANT = 1; + + // Answer is relevant to query. + RELEVANT = 2; + } + + // Correctness of document. + enum DocumentCorrectness { + // Document correctness unspecified. + DOCUMENT_CORRECTNESS_UNSPECIFIED = 0; + + // Information in document is incorrect. + INCORRECT = 1; + + // Information in document is correct. + CORRECT = 2; + } + + // Efficiency of document. + enum DocumentEfficiency { + // Document efficiency unspecified. + DOCUMENT_EFFICIENCY_UNSPECIFIED = 0; + + // Document is inefficient. + INEFFICIENT = 1; + + // Document is efficient. + EFFICIENT = 2; + } + + // Optional. 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][google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.answer_relevance]: [AnswerRelevance.IRRELEVANT][google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.AnswerRelevance.IRRELEVANT] + AnswerRelevance answer_relevance = 1; + + // Optional. 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 + DocumentCorrectness document_correctness = 2; + + // Optional. 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][google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.document_efficiency] is + // [DocumentEfficiency.INEFFICIENT][google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentEfficiency.INEFFICIENT]. + DocumentEfficiency document_efficiency = 3; + + // Feedback for conversation summarization. + SummarizationFeedback summarization_feedback = 4; +} + +// Request message for [AnswerRecords.GetAnswerRecord][google.cloud.dialogflow.v2beta1.AnswerRecords.GetAnswerRecord]. +message GetAnswerRecordRequest { + // Required. The name of the answer record to retrieve. + // Format: `projects//locations//answerRecords/`. + string name = 1; +} + +// Request message for [AnswerRecords.ListAnswerRecords][google.cloud.dialogflow.v2beta1.AnswerRecords.ListAnswerRecords]. +message ListAnswerRecordsRequest { + // Required. The project to list all answer records for in reverse + // chronological order. Format: `projects//locations/`. + string parent = 1 [(google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/AnswerRecord" + }]; + + // 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. + int32 page_size = 3; + + // Optional. The + // [ListAnswerRecordsResponse.next_page_token][google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.next_page_token] + // value returned from a previous list request used to continue listing on + // the next page. + string page_token = 4; +} + +// Response message for [AnswerRecords.ListAnswerRecords][google.cloud.dialogflow.v2beta1.AnswerRecords.ListAnswerRecords]. +message ListAnswerRecordsResponse { + // The list of answer records. + repeated AnswerRecord answer_records = 1; + + // A token to retrieve next page of results. Or empty if there are no more + // results. + // Pass this value in the + // [ListAnswerRecordsRequest.page_token][google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest.page_token] + // field in the subsequent call to `ListAnswerRecords` method to retrieve the + // next page of results. + string next_page_token = 2; +} + +// Request message for [AnswerRecords.UpdateAnswerRecord][google.cloud.dialogflow.v2beta1.AnswerRecords.UpdateAnswerRecord]. +message UpdateAnswerRecordRequest { + // Required. Answer record to update. + AnswerRecord answer_record = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/AnswerRecord" + } + ]; + + // Required. The mask to control which fields get updated. + google.protobuf.FieldMask update_mask = 2; +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/audio_config.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/audio_config.proto index 1f330db7d5e..009a9473b3c 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/audio_config.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/audio_config.proto @@ -248,6 +248,12 @@ message InputAudioConfig { // Note: When specified, InputAudioConfig.single_utterance takes precedence // over StreamingDetectIntentRequest.single_utterance. bool single_utterance = 8; + + // Only used in [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent] and + // [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.StreamingAnalyzeContent]. + // If `false` and recognition doesn't return any result, trigger + // `NO_SPEECH_RECOGNIZED` event to Dialogflow agent. + bool disable_no_speech_recognized_event = 14; } // Description of which voice to use for speech synthesis. @@ -360,6 +366,15 @@ enum OutputAudioEncoding { OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3; } +// Configures speech transcription for [ConversationProfile][google.cloud.dialogflow.v2beta1.ConversationProfile]. +message SpeechToTextConfig { + // Optional. 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][google.cloud.dialogflow.v2beta1.AnalyzeContentRequest] and + // [StreamingAnalyzeContentRequest][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest] request. + SpeechModelVariant speech_model_variant = 1 [(google.api.field_behavior) = OPTIONAL]; +} + // [DTMF](https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling) // digit in Telephony Gateway. enum TelephonyDtmf { diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation.proto new file mode 100644 index 00000000000..06847382324 --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation.proto @@ -0,0 +1,581 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/v2beta1/gcs.proto"; +import "google/cloud/dialogflow/v2beta1/participant.proto"; +import "google/cloud/dialogflow/v2beta1/session.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "ConversationProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Conversations][google.cloud.dialogflow.v2beta1.Conversation]. +service Conversations { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // 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][google.cloud.dialogflow.v2beta1.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][google.cloud.dialogflow.v2beta1.Intent] with [Intent.live_agent_handoff][google.cloud.dialogflow.v2beta1.Intent.live_agent_handoff] is triggered, conversation + // will transfer to Assist Stage. + rpc CreateConversation(CreateConversationRequest) returns (Conversation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*}/conversations" + body: "conversation" + additional_bindings { + post: "/v2beta1/{parent=projects/*/locations/*}/conversations" + body: "conversation" + } + }; + option (google.api.method_signature) = "parent,conversation"; + } + + // Returns the list of all conversations in the specified project. + rpc ListConversations(ListConversationsRequest) returns (ListConversationsResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*}/conversations" + additional_bindings { + get: "/v2beta1/{parent=projects/*/locations/*}/conversations" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specific conversation. + rpc GetConversation(GetConversationRequest) returns (Conversation) { + option (google.api.http) = { + get: "/v2beta1/{name=projects/*/conversations/*}" + additional_bindings { + get: "/v2beta1/{name=projects/*/locations/*/conversations/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Completes the specified conversation. Finished conversations are purged + // from the database after 30 days. + rpc CompleteConversation(CompleteConversationRequest) returns (Conversation) { + option (google.api.http) = { + post: "/v2beta1/{name=projects/*/conversations/*}:complete" + body: "*" + additional_bindings { + post: "/v2beta1/{name=projects/*/locations/*/conversations/*}:complete" + body: "*" + } + }; + option (google.api.method_signature) = "name"; + } + + // Creates a call matcher that links incoming SIP calls to the specified + // conversation if they fulfill specified criteria. + rpc CreateCallMatcher(CreateCallMatcherRequest) returns (CallMatcher) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/conversations/*}/callMatchers" + body: "call_matcher" + additional_bindings { + post: "/v2beta1/{parent=projects/*/locations/*/conversations/*}/callMatchers" + body: "*" + } + }; + option (google.api.method_signature) = "parent,call_matcher"; + } + + // Returns the list of all call matchers in the specified conversation. + rpc ListCallMatchers(ListCallMatchersRequest) returns (ListCallMatchersResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*/conversations/*}/callMatchers" + additional_bindings { + get: "/v2beta1/{parent=projects/*/locations/*/conversations/*}/callMatchers" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Requests deletion of a call matcher. + rpc DeleteCallMatcher(DeleteCallMatcherRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta1/{name=projects/*/conversations/*/callMatchers/*}" + additional_bindings { + delete: "/v2beta1/{name=projects/*/locations/*/conversations/*/callMatchers/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Batch ingests messages to conversation. Customers can use this RPC to + // ingest historical messages to conversation. + rpc BatchCreateMessages(BatchCreateMessagesRequest) returns (BatchCreateMessagesResponse) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/conversations/*}/messages:batchCreate" + body: "*" + additional_bindings { + post: "/v2beta1/{parent=projects/*/locations/*/conversations/*}/messages:batchCreate" + body: "*" + } + }; + option (google.api.method_signature) = "parent"; + } + + // 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. + rpc ListMessages(ListMessagesRequest) returns (ListMessagesResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*/conversations/*}/messages" + additional_bindings { + get: "/v2beta1/{parent=projects/*/locations/*/conversations/*}/messages" + } + }; + option (google.api.method_signature) = "parent"; + } +} + +// 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. +message Conversation { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Conversation" + pattern: "projects/{project}/conversations/{conversation}" + pattern: "projects/{project}/locations/{location}/conversations/{conversation}" + }; + + // Enumeration of the completion status of the conversation. + enum LifecycleState { + // Unknown. + LIFECYCLE_STATE_UNSPECIFIED = 0; + + // Conversation is currently open for media analysis. + IN_PROGRESS = 1; + + // Conversation has been completed. + COMPLETED = 2; + } + + // Enumeration of the different conversation stages a conversation can be in. + // Reference: + // https://cloud.google.com/dialogflow/priv/docs/contact-center/basics#stages + enum ConversationStage { + // Unknown. Should never be used after a conversation is successfully + // created. + CONVERSATION_STAGE_UNSPECIFIED = 0; + + // The conversation should return virtual agent responses into the + // conversation. + VIRTUAL_AGENT_STAGE = 1; + + // The conversation should not provide responses, just listen and provide + // suggestions. + HUMAN_ASSIST_STAGE = 2; + } + + // Output only. The unique identifier of this conversation. + // Format: `projects//locations//conversations/`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The current state of the Conversation. + LifecycleState lifecycle_state = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The Conversation Profile to be used to configure this + // Conversation. This field cannot be updated. + // Format: `projects//locations//conversationProfiles/`. + string conversation_profile = 3 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ConversationProfile" + } + ]; + + // Output only. Required if the conversation is to be connected over + // telephony. + ConversationPhoneNumber phone_number = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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][google.cloud.dialogflow.v2beta1.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE]; Otherwise, defaults to + // [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2beta1.Conversation.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][google.cloud.dialogflow.v2beta1.Conversation.ConversationStage.HUMAN_ASSIST_STAGE], it skips + // [ConversationStage.VIRTUAL_AGENT_STAGE][google.cloud.dialogflow.v2beta1.Conversation.ConversationStage.VIRTUAL_AGENT_STAGE] stage and directly goes to + // [ConversationStage.HUMAN_ASSIST_STAGE][google.cloud.dialogflow.v2beta1.Conversation.ConversationStage.HUMAN_ASSIST_STAGE]. + ConversationStage conversation_stage = 7; + + // Output only. The time the conversation was started. + google.protobuf.Timestamp start_time = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the conversation was finished. + google.protobuf.Timestamp end_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a phone number for telephony integration. It allows for connecting +// a particular conversation over telephony. +message ConversationPhoneNumber { + // Output only. The phone number to connect to this conversation. + string phone_number = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Represents a call matcher that describes criteria for matching incoming SIP +// calls to a conversation. When Dialogflow get a SIP call from a third-party +// carrier, Dialogflow matches the call to an existing conversation by either: +// +// * Extracting the conversation id from the +// [Call-Info header](https://tools.ietf.org/html/rfc3261#section-20.9), e.g. +// `Call-Info: +// +// ;purpose=Goog-ContactCenter-Conversation`. +// * Or, if that doesn't work, matching incoming [SIP +// headers](https://tools.ietf.org/html/rfc3261#section-7.3) +// against any [CallMatcher][google.cloud.dialogflow.v2beta1.CallMatcher] for the conversation. +// +// If an incoming SIP call without valid `Call-Info` header matches to zero or +// multiple conversations with `CallMatcher`, we reject it. +// +// A call matcher contains equality conditions for SIP headers that all have +// to be fulfilled in order for a SIP call to match. +// +// The matched SIP headers consist of well-known headers (`To`, `From`, +// `Call-ID`) and custom headers. A [CallMatcher][google.cloud.dialogflow.v2beta1.CallMatcher] is only valid if it +// specifies: +// +// * At least 1 custom header, +// * or at least 2 well-known headers. +message CallMatcher { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/CallMatcher" + pattern: "projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}" + pattern: "projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}" + }; + + // Custom SIP headers. See the [description of headers in + // the RFC](https://tools.ietf.org/html/rfc3261#section-7.3). + message CustomHeaders { + // Cisco's proprietary `Cisco-Guid` header. + string cisco_guid = 1; + } + + // Output only. The unique identifier of this call matcher. + // Format: `projects//locations//conversations//callMatchers/`. + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Value of the [`To` + // header](https://tools.ietf.org/html/rfc3261#section-8.1.1.2) to match. If + // empty or unspecified, we don't match to the + // [`To` header](https://tools.ietf.org/html/rfc3261#section-8.1.1.2). + string to_header = 2; + + // Value of the [`From` + // header](https://tools.ietf.org/html/rfc3261#section-8.1.1.3) to match. If + // empty or unspecified, we don't match to the + // [`From` header](https://tools.ietf.org/html/rfc3261#section-8.1.1.3). + string from_header = 3; + + // Value of the [`Call-ID` + // header](https://tools.ietf.org/html/rfc3261#section-8.1.1.4) to match. If + // empty or unspecified, we don't match to the + // [`Call-ID` header](https://tools.ietf.org/html/rfc3261#section-8.1.1.4). + string call_id_header = 4; + + // Custom SIP headers that must match. + CustomHeaders custom_headers = 5; +} + +// The request message for [Conversations.CreateConversation][google.cloud.dialogflow.v2beta1.Conversations.CreateConversation]. +message CreateConversationRequest { + // Required. Resource identifier of the project creating the conversation. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Conversation" + } + ]; + + // Required. The conversation to create. + Conversation conversation = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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][a-zA-Z0-9_-]*" 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. + string conversation_id = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for [Conversations.ListConversations][google.cloud.dialogflow.v2beta1.Conversations.ListConversations]. +message ListConversationsRequest { + // Required. The project from which to list all conversation. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Conversation" + } + ]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3; + + // 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). + string filter = 4; +} + +// The response message for [Conversations.ListConversations][google.cloud.dialogflow.v2beta1.Conversations.ListConversations]. +message ListConversationsResponse { + // The list of conversations. There will be a maximum number of items + // returned based on the page_size field in the request. + repeated Conversation conversations = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [Conversations.GetConversation][google.cloud.dialogflow.v2beta1.Conversations.GetConversation]. +message GetConversationRequest { + // Required. The name of the conversation. Format: + // `projects//locations//conversations/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Conversation" + } + ]; +} + +// The request message for [Conversations.CompleteConversation][google.cloud.dialogflow.v2beta1.Conversations.CompleteConversation]. +message CompleteConversationRequest { + // Required. Resource identifier of the conversation to close. + // Format: `projects//locations//conversations/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Conversation" + } + ]; +} + +// The request message for [Conversations.CreateCallMatcher][google.cloud.dialogflow.v2beta1.Conversations.CreateCallMatcher]. +message CreateCallMatcherRequest { + // Required. Resource identifier of the conversation adding the call matcher. + // Format: `projects//locations//conversations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/CallMatcher" + } + ]; + + // Required. The call matcher to create. + CallMatcher call_matcher = 2; +} + +// The request message for [Conversations.ListCallMatchers][google.cloud.dialogflow.v2beta1.Conversations.ListCallMatchers]. +message ListCallMatchersRequest { + // Required. The conversation to list all call matchers from. + // Format: `projects//locations//conversations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/CallMatcher" + } + ]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Conversations.ListCallMatchers][google.cloud.dialogflow.v2beta1.Conversations.ListCallMatchers]. +message ListCallMatchersResponse { + // The list of call matchers. There is a maximum number of items + // returned based on the page_size field in the request. + repeated CallMatcher call_matchers = 1; + + // Token to retrieve the next page of results or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [Conversations.DeleteCallMatcher][google.cloud.dialogflow.v2beta1.Conversations.DeleteCallMatcher]. +message DeleteCallMatcherRequest { + // Required. The unique identifier of the [CallMatcher][google.cloud.dialogflow.v2beta1.CallMatcher] to delete. + // Format: `projects//locations//conversations//callMatchers/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/CallMatcher" + } + ]; +} + +// The request message to create one Message. Currently it is only used in +// BatchCreateMessagesRequest. +message CreateMessageRequest { + // Required. Resource identifier of the conversation to create message. + // Format: `projects//locations//conversations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Conversation" + } + ]; + + // Required. The message to create. + // [Message.participant][google.cloud.dialogflow.v2beta1.Message.participant] is required. + Message message = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Conversations.BatchCreateMessagesRequest][]. +message BatchCreateMessagesRequest { + // Required. Resource identifier of the conversation to create message. + // Format: `projects//locations//conversations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Conversation" + } + ]; + + // Required. A maximum of 1000 Messages can be created in a batch. + // [CreateMessageRequest.message.send_time][] is required. All created + // messages will have identical [Message.create_time][google.cloud.dialogflow.v2beta1.Message.create_time]. + repeated CreateMessageRequest requests = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Conversations.BatchCreateMessagesResponse][]. +message BatchCreateMessagesResponse { + // Messages created. + repeated Message messages = 1; +} + +// The request message for [Conversations.ListMessages][google.cloud.dialogflow.v2beta1.Conversations.ListMessages]. +message ListMessagesRequest { + // Required. The name of the conversation to list messages for. + // Format: `projects//locations//conversations/` + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Message" + } + ]; + + // 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). + string filter = 4; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [Conversations.ListMessages][google.cloud.dialogflow.v2beta1.Conversations.ListMessages]. +message ListMessagesResponse { + // Required. 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. + repeated Message messages = 1; + + // Optional. Token to retrieve the next page of results, or empty if there are + // no more results in the list. + string next_page_token = 2; +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_event.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_event.proto new file mode 100644 index 00000000000..35c1de1ee05 --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_event.proto @@ -0,0 +1,82 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/cloud/dialogflow/v2beta1/participant.proto"; +import "google/rpc/status.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "ConversationEventProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// Represents a notification sent to Pub/Sub subscribers for conversation +// lifecycle events. +message ConversationEvent { + // Enumeration of the types of events available. + enum Type { + // Type not set. + TYPE_UNSPECIFIED = 0; + + // A new conversation has been opened. This is fired when a telephone call + // is answered, or a conversation is created via the API. + CONVERSATION_STARTED = 1; + + // An existing conversation has closed. This is fired when a telephone call + // is terminated, or a conversation is closed via the API. + CONVERSATION_FINISHED = 2; + + // An existing conversation has received a new message, either from API or + // telephony. It is configured in + // [ConversationProfile.new_message_event_notification_config][google.cloud.dialogflow.v2beta1.ConversationProfile.new_message_event_notification_config] + NEW_MESSAGE = 5; + + // 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. + UNRECOVERABLE_ERROR = 4; + } + + // Required. The unique identifier of the conversation this notification + // refers to. + // Format: `projects//conversations/`. + string conversation = 1; + + // Required. The type of the event that this notification refers to. + Type type = 2; + + // Optional. More detailed information about an error. Only set for type + // UNRECOVERABLE_ERROR_IN_PHONE_CALL. + google.rpc.Status error_status = 3; + + // Payload of conversation event. + oneof payload { + // Payload of NEW_MESSAGE event. + Message new_message_payload = 4; + } +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto new file mode 100644 index 00000000000..4d751373653 --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto @@ -0,0 +1,564 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/v2beta1/audio_config.proto"; +import "google/cloud/dialogflow/v2beta1/document.proto"; +import "google/cloud/dialogflow/v2beta1/participant.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "ConversationProfileProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [ConversationProfiles][google.cloud.dialogflow.v2beta1.ConversationProfile]. +service ConversationProfiles { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Returns the list of all conversation profiles in the specified project. + rpc ListConversationProfiles(ListConversationProfilesRequest) returns (ListConversationProfilesResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*}/conversationProfiles" + additional_bindings { + get: "/v2beta1/{parent=projects/*/locations/*}/conversationProfiles" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Retrieves the specified conversation profile. + rpc GetConversationProfile(GetConversationProfileRequest) returns (ConversationProfile) { + option (google.api.http) = { + get: "/v2beta1/{name=projects/*/conversationProfiles/*}" + additional_bindings { + get: "/v2beta1/{name=projects/*/locations/*/conversationProfiles/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // 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][google.cloud.dialogflow.v2beta1.ConversationProfiles.GetConversationProfile] API. + rpc CreateConversationProfile(CreateConversationProfileRequest) returns (ConversationProfile) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*}/conversationProfiles" + body: "conversation_profile" + additional_bindings { + post: "/v2beta1/{parent=projects/*/locations/*}/conversationProfiles" + body: "conversation_profile" + } + }; + option (google.api.method_signature) = "parent,conversation_profile"; + } + + // Updates the specified conversation profile. + // + // [ConversationProfile.CreateTime][] and [ConversationProfile.UpdateTime][] + // aren't populated in the response. You can retrieve them via + // [GetConversationProfile][google.cloud.dialogflow.v2beta1.ConversationProfiles.GetConversationProfile] API. + rpc UpdateConversationProfile(UpdateConversationProfileRequest) returns (ConversationProfile) { + option (google.api.http) = { + patch: "/v2beta1/{conversation_profile.name=projects/*/conversationProfiles/*}" + body: "conversation_profile" + additional_bindings { + patch: "/v2beta1/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}" + body: "conversation_profile" + } + }; + option (google.api.method_signature) = "conversation_profile,update_mask"; + } + + // Deletes the specified conversation profile. + rpc DeleteConversationProfile(DeleteConversationProfileRequest) returns (google.protobuf.Empty) { + option (google.api.http) = { + delete: "/v2beta1/{name=projects/*/conversationProfiles/*}" + additional_bindings { + delete: "/v2beta1/{name=projects/*/locations/*/conversationProfiles/*}" + } + }; + option (google.api.method_signature) = "name"; + } +} + +// Defines the services to connect to incoming Dialogflow conversations. +message ConversationProfile { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/ConversationProfile" + pattern: "projects/{project}/conversationProfiles/{conversation_profile}" + pattern: "projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}" + }; + + // The unique identifier of this conversation profile. + // Format: `projects//locations//conversationProfiles/`. + string name = 1; + + // Required. Human readable name for this profile. Max length 1024 bytes. + string display_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Create time of the conversation profile. + google.protobuf.Timestamp create_time = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Update time of the conversation profile. + google.protobuf.Timestamp update_time = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration for an automated agent to use with this profile. + AutomatedAgentConfig automated_agent_config = 3; + + // Configuration for agent assistance to use with this profile. + HumanAgentAssistantConfig human_agent_assistant_config = 4; + + // Configuration for connecting to a live agent. + HumanAgentHandoffConfig human_agent_handoff_config = 5; + + // Configuration for publishing conversation lifecycle events. + NotificationConfig notification_config = 6; + + // Configuration for logging conversation lifecycle events. + LoggingConfig logging_config = 7; + + // Configuration for publishing new message events. Event will be sent in + // format of [ConversationEvent][google.cloud.dialogflow.v2beta1.ConversationEvent] + NotificationConfig new_message_event_notification_config = 8; + + // Settings for speech transcription. + SpeechToTextConfig stt_config = 9; + + // Language code for the conversation profile. If not specified, the language + // is en-US. Language at ConversationProfile should be set for all non en-us + // languages. + string language_code = 10; +} + +// Defines the Automated Agent to connect to a conversation. +message AutomatedAgentConfig { + // Required. 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. + // + // - For ES agents, use 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.v2beta1#google.cloud.dialogflow.v2beta1.DetectIntentRequest) + // for more details. + // + // - For CX agents, use format `projects//locations//agents//environments/`. If environment is not specified, the default `draft` environment + // is used. + string agent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; +} + +// Defines the Human Agent Assistant to connect to a conversation. +message HumanAgentAssistantConfig { + // Settings of suggestion trigger. + message SuggestionTriggerSettings { + // Do not trigger if last utterance is small talk. + bool no_small_talk = 1; + + // Only trigger suggestion if participant role of last utterance is + // END_USER. + bool only_end_user = 2; + } + + // Config for suggestion features. + message SuggestionFeatureConfig { + // The suggestion feature. + SuggestionFeature suggestion_feature = 5; + + // Automatically iterates all participants and tries to compile + // suggestions. + // + // Supported features: ARTICLE_SUGGESTION, FAQ, DIALOGFLOW_ASSIST. + bool enable_event_based_suggestion = 3; + + // Settings of suggestion trigger. + // + // Currently, only ARTICLE_SUGGESTION, FAQ, and DIALOGFLOW_ASSIST will use + // this field. + SuggestionTriggerSettings suggestion_trigger_settings = 10; + + // Configs of query. + SuggestionQueryConfig query_config = 6; + + // Configs of custom conversation model. + ConversationModelConfig conversation_model_config = 7; + } + + // Detail human agent assistant config. + message SuggestionConfig { + // Configuration of different suggestion features. One feature can have only + // one config. + repeated SuggestionFeatureConfig feature_configs = 2; + + // 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. + bool group_suggestion_responses = 3; + } + + // Config for suggestion query. + message SuggestionQueryConfig { + // Knowledge base source settings. + // + // Supported features: ARTICLE_SUGGESTION, FAQ. + message KnowledgeBaseQuerySource { + // Required. Knowledge bases to query. Format: + // `projects//locations//knowledgeBases/`. Currently, only one knowledge + // base is supported. + repeated string knowledge_bases = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/KnowledgeBase" + } + ]; + } + + // Document source settings. + // + // Supported features: SMART_REPLY, SMART_COMPOSE. + message DocumentQuerySource { + // Required. Knowledge documents to query from. Format: + // `projects//locations//knowledgeBases//documents/`. + // Currently, only one document is supported. + repeated string documents = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Document" + } + ]; + } + + // Dialogflow source setting. + // + // Supported feature: DIALOGFLOW_ASSIST. + message DialogflowQuerySource { + // Required. 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. + string agent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Agent" + } + ]; + } + + // Settings that determine how to filter recent conversation context when + // generating suggestions. + message ContextFilterSettings { + // 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. + bool drop_handoff_messages = 1; + + // If set to true, all messages from virtual agent are dropped. + bool drop_virtual_agent_messages = 2; + + // If set to true, all messages from ivr stage are dropped. + bool drop_ivr_messages = 3; + } + + // Source of query. + oneof query_source { + // Query from knowledgebase. It is used by: + // ARTICLE_SUGGESTION, FAQ. + KnowledgeBaseQuerySource knowledge_base_query_source = 1; + + // Query from knowledge base document. It is used by: + // SMART_REPLY, SMART_COMPOSE. + DocumentQuerySource document_query_source = 2; + + // Query from Dialogflow agent. It is used by DIALOGFLOW_ASSIST. + DialogflowQuerySource dialogflow_query_source = 3; + } + + // Maximum number of results to return. Currently, if unset, defaults to 10. + // And the max number is 20. + int32 max_results = 4; + + // 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 is default to 0.0, which means that all + // suggestions are returned. + // + // Supported features: ARTICLE_SUGGESTION, FAQ, SMART_REPLY, SMART_COMPOSE. + float confidence_threshold = 5; + + // Determines how recent conversation context is filtered when generating + // suggestions. If unspecified, no messages will be dropped. + ContextFilterSettings context_filter_settings = 7; + } + + // Custom conversation models used in agent assist feature. + // + // Supported feature: ARTICLE_SUGGESTION, SMART_COMPOSE, SMART_REPLY. + message ConversationModelConfig { + // Required. Conversation model resource name. Format: `projects//conversationModels/`. + string model = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ConversationModel" + } + ]; + } + + // Configuration for analyses to run on each conversation message. + message MessageAnalysisConfig { + // 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. + bool enable_entity_extraction = 2; + + // 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][google.cloud.dialogflow.v2beta1.Participants.StreamingAnalyzeContent] method, result will be in + // [StreamingAnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.message]. + // For [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent] method, result will be in + // [AnalyzeContentResponse.message.SentimentAnalysisResult][google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.message] + // For [Conversations.ListMessages][google.cloud.dialogflow.v2beta1.Conversations.ListMessages] method, result will be in + // [ListMessagesResponse.messages.SentimentAnalysisResult][google.cloud.dialogflow.v2beta1.ListMessagesResponse.messages] + // If Pub/Sub notification is configured, result will be in + // [ConversationEvent.new_message_payload.SentimentAnalysisResult][google.cloud.dialogflow.v2beta1.ConversationEvent.new_message_payload]. + bool enable_sentiment_analysis = 3; + } + + // Pub/Sub topic on which to publish new agent assistant events. + NotificationConfig notification_config = 2; + + // Configuration for agent assistance of human agent participant. + SuggestionConfig human_agent_suggestion_config = 3; + + // Configuration for agent assistance of end user participant. + SuggestionConfig end_user_suggestion_config = 4; + + // Configuration for message analysis. + MessageAnalysisConfig message_analysis_config = 5; +} + +// Defines the hand off to a live agent, typically on which external agent +// service provider to connect to a conversation. +message HumanAgentHandoffConfig { + // Configuration specific to LivePerson (https://www.liveperson.com). + message LivePersonConfig { + // Required. Account number of the LivePerson account to connect. This is + // the account number you input at the login page. + string account_number = 1 [(google.api.field_behavior) = REQUIRED]; + } + + // Configuration specific to Salesforce Live Agent. + message SalesforceLiveAgentConfig { + // Required. The organization ID of the Salesforce account. + string organization_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Live Agent deployment ID. + string deployment_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Live Agent chat button ID. + string button_id = 3 [(google.api.field_behavior) = REQUIRED]; + + // Required. 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. + string endpoint_domain = 4 [(google.api.field_behavior) = REQUIRED]; + } + + // Required. Specifies which agent service to connect for human agent handoff. + oneof agent_service { + // Uses LivePerson (https://www.liveperson.com). + LivePersonConfig live_person_config = 1; + + // Uses Salesforce Live Agent. + SalesforceLiveAgentConfig salesforce_live_agent_config = 2; + } +} + +// Defines notification behavior. +message NotificationConfig { + // Format of cloud pub/sub message. + enum MessageFormat { + // If it is unspecified, PROTO will be used. + MESSAGE_FORMAT_UNSPECIFIED = 0; + + // Pubsub message will be serialized proto. + PROTO = 1; + + // Pubsub message will be json. + JSON = 2; + } + + // Name of the Pub/Sub topic to publish conversation + // events like + // [CONVERSATION_STARTED][google.cloud.dialogflow.v2beta1.ConversationEvent.Type.CONVERSATION_STARTED] as + // serialized [ConversationEvent][google.cloud.dialogflow.v2beta1.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/`. + string topic = 1; + + // Format of message. + MessageFormat message_format = 2; +} + +// Defines logging behavior for conversation lifecycle events. +message LoggingConfig { + // Whether to log conversation events like + // [CONVERSATION_STARTED][google.cloud.dialogflow.v2beta1.ConversationEvent.Type.CONVERSATION_STARTED] to + // Stackdriver in the conversation project as JSON format + // [ConversationEvent][google.cloud.dialogflow.v2beta1.ConversationEvent] protos. + bool enable_stackdriver_logging = 3; +} + +// The request message for [ConversationProfiles.ListConversationProfiles][google.cloud.dialogflow.v2beta1.ConversationProfiles.ListConversationProfiles]. +message ListConversationProfilesRequest { + // Required. The project to list all conversation profiles from. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/ConversationProfile" + } + ]; + + // The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2; + + // The next_page_token value returned from a previous list request. + string page_token = 3; +} + +// The response message for [ConversationProfiles.ListConversationProfiles][google.cloud.dialogflow.v2beta1.ConversationProfiles.ListConversationProfiles]. +message ListConversationProfilesResponse { + // The list of project conversation profiles. There is a maximum number + // of items returned based on the page_size field in the request. + repeated ConversationProfile conversation_profiles = 1; + + // Token to retrieve the next page of results, or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [ConversationProfiles.GetConversationProfile][google.cloud.dialogflow.v2beta1.ConversationProfiles.GetConversationProfile]. +message GetConversationProfileRequest { + // Required. The resource name of the conversation profile. + // Format: `projects//locations//conversationProfiles/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ConversationProfile" + } + ]; +} + +// The request message for [ConversationProfiles.CreateConversationProfile][google.cloud.dialogflow.v2beta1.ConversationProfiles.CreateConversationProfile]. +message CreateConversationProfileRequest { + // Required. The project to create a conversation profile for. + // Format: `projects//locations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/ConversationProfile" + } + ]; + + // Required. The conversation profile to create. + ConversationProfile conversation_profile = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [ConversationProfiles.UpdateConversationProfile][google.cloud.dialogflow.v2beta1.ConversationProfiles.UpdateConversationProfile]. +message UpdateConversationProfileRequest { + // Required. The conversation profile to update. + ConversationProfile conversation_profile = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to control which fields to update. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [ConversationProfiles.DeleteConversationProfile][google.cloud.dialogflow.v2beta1.ConversationProfiles.DeleteConversationProfile]. +// +// This operation fails if the conversation profile is still referenced from +// a phone number. +message DeleteConversationProfileRequest { + // Required. The name of the conversation profile to delete. + // Format: `projects//locations//conversationProfiles/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/ConversationProfile" + } + ]; +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/document.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/document.proto index 60be8688fb0..0af6eb9e668 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/document.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/document.proto @@ -100,6 +100,22 @@ service Documents { }; } + // Create documents by importing data from external sources. + rpc ImportDocuments(ImportDocumentsRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents:import" + body: "*" + additional_bindings { + post: "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents:import" + body: "*" + } + }; + option (google.longrunning.operation_info) = { + response_type: "ImportDocumentsResponse" + metadata_type: "KnowledgeOperationMetadata" + }; + } + // Deletes the specified document. // // Note: The `projects.agent.knowledgeBases.documents` resource is deprecated; @@ -219,6 +235,13 @@ message Document { // Documents for which unstructured text is extracted and used for // question answering. EXTRACTIVE_QA = 2; + + // The entire document content as a whole can be used for query results. + // Only for Contact Center Solutions on Dialogflow. + ARTICLE_SUGGESTION = 3; + + // The legacy enum for agent-facing smart reply feature. + SMART_REPLY = 4; } // Optional. The document resource name. @@ -283,6 +306,12 @@ message Document { // This reload may have been triggered automatically or manually // and may not have succeeded. ReloadStatus latest_reload_status = 12 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. 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. + map metadata = 7 [(google.api.field_behavior) = OPTIONAL]; } // Request message for [Documents.GetDocument][google.cloud.dialogflow.v2beta1.Documents.GetDocument]. @@ -371,6 +400,62 @@ message CreateDocumentRequest { bool import_gcs_custom_metadata = 3; } +// Request message for [Documents.ImportDocuments][google.cloud.dialogflow.v2beta1.Documents.ImportDocuments]. +message ImportDocumentsRequest { + // Required. The knowledge base to import documents into. + // Format: `projects//locations//knowledgeBases/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Document" + } + ]; + + // Required. The source to use for importing documents. + // + // If the source captures multiple objects, then multiple documents will be + // created, one corresponding to each object, and all of these documents will + // be created using the same document template. + oneof source { + // The Google Cloud Storage location for the documents. + // The path can include a wildcard. + // + // These URIs may have the forms + // `gs:///`. + // `gs:////*.`. + GcsSources gcs_source = 2; + } + + // Required. Document template used for importing all the documents. + ImportDocumentTemplate document_template = 3 [(google.api.field_behavior) = REQUIRED]; + + // Whether to import custom metadata from Google Cloud Storage. + // Only valid when the document source is Google Cloud Storage URI. + bool import_gcs_custom_metadata = 4; +} + +// The template used for importing documents. +message ImportDocumentTemplate { + // Required. The MIME type of the document. + string mime_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The knowledge type of document content. + repeated Document.KnowledgeType knowledge_types = 2 [(google.api.field_behavior) = REQUIRED]; + + // 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. + map metadata = 3; +} + +// Response message for [Documents.ImportDocuments][google.cloud.dialogflow.v2beta1.Documents.ImportDocuments]. +message ImportDocumentsResponse { + // Includes details about skipped documents or any other warnings. + repeated google.rpc.Status warnings = 1; +} + // Request message for [Documents.DeleteDocument][google.cloud.dialogflow.v2beta1.Documents.DeleteDocument]. message DeleteDocumentRequest { // Required. The name of the document to delete. diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/gcs.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/gcs.proto index 9a9e99d2b6c..f01ad76f36f 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/gcs.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/gcs.proto @@ -27,6 +27,15 @@ option java_outer_classname = "GcsProto"; option java_package = "com.google.cloud.dialogflow.v2beta1"; option objc_class_prefix = "DF"; +// Google Cloud Storage locations for the inputs. +message GcsSources { + // Required. Google Cloud Storage URIs for the inputs. A URI is of the + // form: + // gs://bucket/object-prefix-or-name + // Whether a prefix or name is used depends on the use case. + repeated string uris = 2 [(google.api.field_behavior) = REQUIRED]; +} + // Google Cloud Storage location for single input. message GcsSource { // Required. The Google Cloud Storage URIs for the inputs. A URI is of the diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto new file mode 100644 index 00000000000..d49c83acbb3 --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto @@ -0,0 +1,51 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/cloud/dialogflow/v2beta1/participant.proto"; +import "google/api/annotations.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "HumanAgentAssistantEventProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// Output only. Represents a notification sent to Pub/Sub subscribers for +// agent assistant events in a specific conversation. +message HumanAgentAssistantEvent { + // The conversation this notification refers to. + // Format: `projects//conversations/`. + string conversation = 1; + + // The participant that the suggestion is compiled for. And This field is used + // to call [Participants.ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] API. Format: + // `projects//conversations//participants/`. + // It will not be set in legacy workflow. + // [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name] for more + // information. + string participant = 3; + + // The suggestion results payload that this notification refers to. It will + // only be set when + // [HumanAgentAssistantConfig.SuggestionConfig.group_suggestion_responses][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.group_suggestion_responses] + // sets to true. + repeated SuggestionResult suggestion_results = 5; +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/intent.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/intent.proto index 0dc5f680e77..ba8c1f830c9 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/intent.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/intent.proto @@ -1117,6 +1117,12 @@ message Intent { // auto-markup in the UI is turned off. bool ml_disabled = 19 [(google.api.field_behavior) = OPTIONAL]; + // Optional. 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. + bool live_agent_handoff = 20 [(google.api.field_behavior) = OPTIONAL]; + // Optional. 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. diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/participant.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/participant.proto new file mode 100644 index 00000000000..7257b30f307 --- /dev/null +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/participant.proto @@ -0,0 +1,1255 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.dialogflow.v2beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/dialogflow/v2beta1/audio_config.proto"; +import "google/cloud/dialogflow/v2beta1/session.proto"; +import "google/protobuf/any.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/struct.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option cc_enable_arenas = true; +option csharp_namespace = "Google.Cloud.Dialogflow.V2beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow"; +option java_multiple_files = true; +option java_outer_classname = "ParticipantProto"; +option java_package = "com.google.cloud.dialogflow.v2beta1"; +option objc_class_prefix = "DF"; + +// Service for managing [Participants][google.cloud.dialogflow.v2beta1.Participant]. +service Participants { + option (google.api.default_host) = "dialogflow.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform," + "https://www.googleapis.com/auth/dialogflow"; + + // Creates a new participant in a conversation. + rpc CreateParticipant(CreateParticipantRequest) returns (Participant) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/conversations/*}/participants" + body: "participant" + additional_bindings { + post: "/v2beta1/{parent=projects/*/locations/*/conversations/*}/participants" + body: "participant" + } + }; + option (google.api.method_signature) = "parent,participant"; + } + + // Retrieves a conversation participant. + rpc GetParticipant(GetParticipantRequest) returns (Participant) { + option (google.api.http) = { + get: "/v2beta1/{name=projects/*/conversations/*/participants/*}" + additional_bindings { + get: "/v2beta1/{name=projects/*/locations/*/conversations/*/participants/*}" + } + }; + option (google.api.method_signature) = "name"; + } + + // Returns the list of all participants in the specified conversation. + rpc ListParticipants(ListParticipantsRequest) returns (ListParticipantsResponse) { + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*/conversations/*}/participants" + additional_bindings { + get: "/v2beta1/{parent=projects/*/locations/*/conversations/*}/participants" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Updates the specified participant. + rpc UpdateParticipant(UpdateParticipantRequest) returns (Participant) { + option (google.api.http) = { + patch: "/v2beta1/{participant.name=projects/*/conversations/*/participants/*}" + body: "participant" + additional_bindings { + patch: "/v2beta1/{participant.name=projects/*/locations/*/conversations/*/participants/*}" + body: "participant" + } + }; + option (google.api.method_signature) = "participant,update_mask"; + } + + // 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). + rpc AnalyzeContent(AnalyzeContentRequest) returns (AnalyzeContentResponse) { + option (google.api.http) = { + post: "/v2beta1/{participant=projects/*/conversations/*/participants/*}:analyzeContent" + body: "*" + additional_bindings { + post: "/v2beta1/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent" + body: "*" + } + }; + option (google.api.method_signature) = "participant,text_input"; + option (google.api.method_signature) = "participant,audio_input"; + option (google.api.method_signature) = "participant,event_input"; + } + + // Adds a text (e.g., chat) or audio (e.g., phone recording) message from a + // participant into the conversation. + // Note: This method is only available through the gRPC API (not REST). + // + // The top-level message sent to the client by the server is + // `StreamingAnalyzeContentResponse`. Multiple response messages can be + // returned in order. The first one or more messages contain the + // `recognition_result` field. Each result represents a more complete + // transcript of what the user said. The next message contains the + // `reply_text` field, and potentially the `reply_audio` and/or the + // `automated_agent_reply` fields. + // + // 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). + rpc StreamingAnalyzeContent(stream StreamingAnalyzeContentRequest) returns (stream StreamingAnalyzeContentResponse) { + } + + // Gets suggested articles for a participant based on specific historical + // messages. + // + // Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated + // suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion + // based on the provided conversation context in the real time. + rpc SuggestArticles(SuggestArticlesRequest) returns (SuggestArticlesResponse) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles" + body: "*" + additional_bindings { + post: "/v2beta1/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles" + body: "*" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets suggested faq answers for a participant based on specific historical + // messages. + rpc SuggestFaqAnswers(SuggestFaqAnswersRequest) returns (SuggestFaqAnswersResponse) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers" + body: "*" + additional_bindings { + post: "/v2beta1/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers" + body: "*" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Gets smart replies for a participant based on specific historical + // messages. + rpc SuggestSmartReplies(SuggestSmartRepliesRequest) returns (SuggestSmartRepliesResponse) { + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies" + body: "*" + additional_bindings { + post: "/v2beta1/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies" + body: "*" + } + }; + option (google.api.method_signature) = "parent"; + } + + // Deprecated: Use inline suggestion, event based suggestion or + // Suggestion* API instead. + // See [HumanAgentAssistantConfig.name][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name] for more + // details. + // Removal Date: 2020-09-01. + // + // Retrieves suggestions for live agents. + // + // This method should be used by human agent client software to fetch auto + // generated suggestions in real-time, while the conversation with an end user + // is in progress. The functionality is implemented in terms of the + // [list pagination](https://cloud.google.com/apis/design/design_patterns#list_pagination) + // design pattern. The client app should use the `next_page_token` field + // to fetch the next batch of suggestions. `suggestions` are sorted by + // `create_time` in descending order. + // To fetch latest suggestion, just set `page_size` to 1. + // To fetch new suggestions without duplication, send request with filter + // `create_time_epoch_microseconds > [first item's create_time of previous + // request]` and empty page_token. + rpc ListSuggestions(ListSuggestionsRequest) returns (ListSuggestionsResponse) { + option deprecated = true; + option (google.api.http) = { + get: "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions" + }; + } + + // Deprecated. use [SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles] and [SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers] instead. + // + // Gets suggestions for a participant based on specific historical + // messages. + // + // Note that [ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions] will only list the auto-generated + // suggestions, while [CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion] will try to compile suggestion + // based on the provided conversation context in the real time. + rpc CompileSuggestion(CompileSuggestionRequest) returns (CompileSuggestionResponse) { + option deprecated = true; + option (google.api.http) = { + post: "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:compile" + body: "*" + }; + } +} + +// Represents a conversation participant (human agent, virtual agent, end-user). +message Participant { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Participant" + pattern: "projects/{project}/conversations/{conversation}/participants/{participant}" + pattern: "projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}" + }; + + // Enumeration of the roles a participant can play in a conversation. + enum Role { + // Participant role not set. + ROLE_UNSPECIFIED = 0; + + // Participant is a human agent. + HUMAN_AGENT = 1; + + // Participant is an automated agent, such as a Dialogflow agent. + AUTOMATED_AGENT = 2; + + // Participant is an end user that has called or chatted with + // Dialogflow services. + END_USER = 3; + } + + // Optional. The unique identifier of this participant. + // Format: `projects//locations//conversations//participants/`. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Immutable. The role this participant plays in the conversation. This field must be set + // during participant creation and is then immutable. + Role role = 2 [(google.api.field_behavior) = IMMUTABLE]; + + // Optional. Obfuscated user id that should be associated with the created participant. + // + // You can specify a user id as follows: + // + // 1. If you set this field in + // [CreateParticipantRequest][google.cloud.dialogflow.v2beta1.CreateParticipantRequest.participant] or + // [UpdateParticipantRequest][google.cloud.dialogflow.v2beta1.UpdateParticipantRequest.participant], + // Dialogflow adds the obfuscated user id with the participant. + // + // 2. If you set this field in + // [AnalyzeContent][google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.obfuscated_external_user_id] or + // [StreamingAnalyzeContent][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.obfuscated_external_user_id], + // Dialogflow will update [Participant.obfuscated_external_user_id][google.cloud.dialogflow.v2beta1.Participant.obfuscated_external_user_id]. + // + // Dialogflow uses this user id for following purposes: + // 1) Billing and measurement. If user with the same + // obfuscated_external_user_id is created in a later conversation, dialogflow + // will know it's the same user. 2) Agent assist suggestion personalization. + // For example, Dialogflow can use it to provide personalized smart reply + // suggestions for this user. + // + // Note: + // + // * Please never pass raw user ids to Dialogflow. Always obfuscate your user + // id first. + // * Dialogflow only accepts a UTF-8 encoded string, e.g., a hex digest of a + // hash function like SHA-512. + // * The length of the user id must be <= 256 characters. + string obfuscated_external_user_id = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Represents a message posted into a conversation. +message Message { + option (google.api.resource) = { + type: "dialogflow.googleapis.com/Message" + pattern: "projects/{project}/conversations/{conversation}/messages/{message}" + pattern: "projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}" + }; + + // Optional. The unique identifier of the message. + // Format: `projects//locations//conversations//messages/`. + string name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The message content. + string content = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The message language. + // This should be a [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) + // language tag. Example: "en-US". + string language_code = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The participant that sends this message. + string participant = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The role of the participant. + Participant.Role participant_role = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the message was created in Contact Center AI. + google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The time when the message was sent. + google.protobuf.Timestamp send_time = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The annotation for the message. + MessageAnnotation message_annotation = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The sentiment analysis result for the message. + SentimentAnalysisResult sentiment_analysis = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for [Participants.CreateParticipant][google.cloud.dialogflow.v2beta1.Participants.CreateParticipant]. +message CreateParticipantRequest { + // Required. Resource identifier of the conversation adding the participant. + // Format: `projects//locations//conversations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Participant" + } + ]; + + // Required. The participant to create. + Participant participant = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for [Participants.GetParticipant][google.cloud.dialogflow.v2beta1.Participants.GetParticipant]. +message GetParticipantRequest { + // Required. The name of the participant. Format: + // `projects//locations//conversations//participants/`. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + } + ]; +} + +// The request message for [Participants.ListParticipants][google.cloud.dialogflow.v2beta1.Participants.ListParticipants]. +message ListParticipantsRequest { + // Required. The conversation to list all participants from. + // Format: `projects//locations//conversations/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "dialogflow.googleapis.com/Participant" + } + ]; + + // Optional. The maximum number of items to return in a single page. By + // default 100 and at most 1000. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for [Participants.ListParticipants][google.cloud.dialogflow.v2beta1.Participants.ListParticipants]. +message ListParticipantsResponse { + // The list of participants. There is a maximum number of items + // returned based on the page_size field in the request. + repeated Participant participants = 1; + + // Token to retrieve the next page of results or empty if there are no + // more results in the list. + string next_page_token = 2; +} + +// The request message for [Participants.UpdateParticipant][google.cloud.dialogflow.v2beta1.Participants.UpdateParticipant]. +message UpdateParticipantRequest { + // Required. The participant to update. + Participant participant = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The mask to specify which fields to update. + google.protobuf.FieldMask update_mask = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// Represents the natural language text to be processed. +message InputText { + // Required. The UTF-8 encoded natural language text to be processed. + // Text length must not exceed 256 bytes. + string text = 1; + + // Required. 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. + string language_code = 2; +} + +// Represents the natural language speech audio to be processed. +message InputAudio { + // Required. Instructs the speech recognizer how to process the speech audio. + InputAudioConfig config = 1; + + // Required. 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. + bytes audio = 2; +} + +// Represents the natural language speech audio to be processed. +message AudioInput { + // Required. Instructs the speech recognizer how to process the speech audio. + InputAudioConfig config = 1; + + // Required. 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. + bytes audio = 2; +} + +// Represents the natural language speech audio to be played to the end user. +message OutputAudio { + // Required. Instructs the speech synthesizer how to generate the speech + // audio. + OutputAudioConfig config = 1; + + // Required. The natural language speech audio. + bytes audio = 2; +} + +// Represents a response from an automated agent. +message AutomatedAgentReply { + // Required. + oneof response { + // Response of the Dialogflow [Sessions.DetectIntent][google.cloud.dialogflow.v2beta1.Sessions.DetectIntent] call. + DetectIntentResponse detect_intent_response = 1; + } + + // Response messages from the automated agent. + repeated ResponseMessage response_messages = 3; + + // Info on the query match for the automated agent response. + oneof match { + // Name of the intent if an intent is matched for the query. + // For a V2 query, the value format is `projects//locations/ + // /agent/intents/`. + // For a V3 query, the value format is `projects//locations/ + // /agents//intents/`. + string intent = 4 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Intent" + }]; + + // Event name if an event is triggered for the query. + string event = 5; + } + + // The collection of current Dialogflow CX agent session parameters at the + // time of this response. + google.protobuf.Struct cx_session_parameters = 6; +} + +// 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. +message SuggestionFeature { + // Defines the type of Human Agent Assistant feature. + enum Type { + // Unspecified feature type. + TYPE_UNSPECIFIED = 0; + + // Run article suggestion model. + ARTICLE_SUGGESTION = 1; + + // Run FAQ model. + FAQ = 2; + + // Run smart reply model. + SMART_REPLY = 3; + } + + // Type of Human Agent Assistant API feature to request. + Type type = 1; +} + +// The request message for [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent]. +message AnalyzeContentRequest { + // Required. The name of the participant this text comes from. + // Format: `projects//locations//conversations//participants/`. + string participant = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + } + ]; + + // Required. The input content. + oneof input { + // The natural language text to be processed. + InputText text = 3 [deprecated = true]; + + // The natural language speech audio to be processed. + InputAudio audio = 4 [deprecated = true]; + + // The natural language text to be processed. + TextInput text_input = 6; + + // The natural language speech audio to be processed. + AudioInput audio_input = 7; + + // An input event to send to Dialogflow. + EventInput event_input = 8; + } + + // 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. + OutputAudioConfig reply_audio_config = 5; + + // Parameters for a Dialogflow virtual-agent query. + QueryParameters query_params = 9; + + // Optional. The send time of the message from end user or human agent's + // perspective. It is used for identifying the same message under one + // participant. + // + // Given two messages under the same participant: + // - If send time are different regardless of whether the content of the + // messages are exactly the same, the conversation will regard them as + // two distinct messages sent by the participant. + // - If send time is the same regardless of whether the content of the + // messages are exactly the same, the conversation will regard them as + // same message, and ignore the message received later. + // + // If the value is not provided, a new request will always be regarded as a + // new message without any de-duplication. + google.protobuf.Timestamp message_send_time = 10; + + // 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. + string request_id = 11; +} + +// The message in the response that indicates the parameters of DTMF. +message DtmfParameters { + // Indicates whether DTMF input can be handled in the next request. + bool accepts_dtmf_input = 1; +} + +// The response message for [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent]. +message AnalyzeContentResponse { + // Output only. The output text content. + // This field is set if the automated agent responded with text to show to + // the user. + string reply_text = 1; + + // Optional. 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. + OutputAudio reply_audio = 2; + + // Optional. 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][google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.reply_audio] instead. + AutomatedAgentReply automated_agent_reply = 3; + + // Output only. Message analyzed by CCAI. + Message message = 5; + + // The suggestions for most recent human agent. The order is the same as + // [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of + // [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.human_agent_suggestion_config]. + repeated SuggestionResult human_agent_suggestion_results = 6; + + // The suggestions for end user. The order is the same as + // [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of + // [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.end_user_suggestion_config]. + repeated SuggestionResult end_user_suggestion_results = 7; + + // Indicates the parameters of DTMF. + DtmfParameters dtmf_parameters = 9; +} + +// Defines the language used in the input text. +message InputTextConfig { + // Required. 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. + string language_code = 1; +} + +// The top-level message sent by the client to the +// [Participants.StreamingAnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.StreamingAnalyzeContent] method. +// +// Multiple request messages should be sent in order: +// +// 1. The first message must contain +// [participant][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.participant], +// [config][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.config] and optionally +// [query_params][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.query_params]. If you want +// to receive an audio response, it should also contain +// [reply_audio_config][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.reply_audio_config]. +// The message must not contain +// [input][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.input]. +// +// 2. If [config][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.config] in the first message +// was set to [audio_config][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.audio_config], +// all subsequent messages must contain +// [input_audio][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.input_audio] to continue +// with Speech recognition. +// If you decide to rather analyze text input after you already started +// Speech recognition, please send a message with +// [StreamingAnalyzeContentRequest.input_text][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.input_text]. +// +// However, note that: +// +// * Dialogflow will bill you for the audio so far. +// * Dialogflow discards all Speech recognition results in favor of the +// text input. +// +// 3. If [StreamingAnalyzeContentRequest.config][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.config] in the first message was set +// to [StreamingAnalyzeContentRequest.text_config][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.text_config], then the second message +// must contain only [input_text][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.input_text]. +// Moreover, you must not send more than two messages. +// +// After you sent all input, you must half-close or abort the request stream. +message StreamingAnalyzeContentRequest { + // Required. The name of the participant this text comes from. + // Format: `projects//locations//conversations//participants/`. + string participant = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + } + ]; + + // Required. The input config. + oneof config { + // Instructs the speech recognizer how to process the speech audio. + InputAudioConfig audio_config = 2; + + // The natural language text to be processed. + InputTextConfig text_config = 3; + } + + // 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 + // StreamingAnalyzeContent. If this configuration is not supplied, speech + // synthesis is disabled. + OutputAudioConfig reply_audio_config = 4; + + // Required. The input. + oneof input { + // The input audio content to be recognized. Must be sent if `audio_config` + // is set in the first message. The complete audio over all streaming + // messages must not exceed 1 minute. + bytes input_audio = 5; + + // The UTF-8 encoded natural language text to be processed. Must be sent if + // `text_config` is set in the first message. Text length must not exceed + // 256 bytes. The `input_text` field can be only sent once. + string input_text = 6; + + // The DTMF digits used to invoke intent and fill in parameter value. + // + // This input is ignored if the previous response indicated that DTMF input + // is not accepted. + TelephonyDtmfEvents input_dtmf = 9; + } + + // Parameters for a Dialogflow virtual-agent query. + QueryParameters query_params = 7; + + // Enable full bidirectional streaming. You can keep streaming the audio until + // timeout, and there's no need to half close the stream to get the response. + // + // Restrictions: + // + // - Timeout: 3 mins. + // - Audio Encoding: only supports [AudioEncoding.AUDIO_ENCODING_LINEAR_16][google.cloud.dialogflow.v2beta1.AudioEncoding.AUDIO_ENCODING_LINEAR_16] + // and [AudioEncoding.AUDIO_ENCODING_MULAW][google.cloud.dialogflow.v2beta1.AudioEncoding.AUDIO_ENCODING_MULAW] + // - Lifecycle: conversation should be in `Assist Stage`, go to + // [Conversation.CreateConversation][] for more information. + // + // InvalidArgument Error will be returned if the one of restriction checks + // failed. + // + // You can find more details in + // https://cloud.google.com/dialogflow/priv/docs/agent-assist/analyze-content-streaming + bool enable_extended_streaming = 11; +} + +// The top-level message returned from the `StreamingAnalyzeContent` method. +// +// Multiple response messages can be returned in order: +// +// 1. If the input was set to streaming audio, the first one or more messages +// contain `recognition_result`. Each `recognition_result` represents a more +// complete transcript of what the user said. The last `recognition_result` +// has `is_final` set to `true`. +// +// 2. The next message contains `reply_text` and optionally `reply_audio` +// returned by an agent. This message may also contain +// `automated_agent_reply`. +message StreamingAnalyzeContentResponse { + // The result of speech recognition. + StreamingRecognitionResult recognition_result = 1; + + // Optional. The output text content. + // This field is set if an automated agent responded with a text for the user. + string reply_text = 2; + + // Optional. The audio data bytes encoded as specified in the request. + // This field is set if: + // + // - The `reply_audio_config` field is specified in the request. + // - The automated agent, which this output comes from, responded with audio. + // In such case, the `reply_audio.config` field 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. + OutputAudio reply_audio = 3; + + // Optional. 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][google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.reply_audio] instead. + AutomatedAgentReply automated_agent_reply = 4; + + // Output only. Message analyzed by CCAI. + Message message = 6; + + // The suggestions for most recent human agent. The order is the same as + // [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of + // [HumanAgentAssistantConfig.human_agent_suggestion_config][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.human_agent_suggestion_config]. + repeated SuggestionResult human_agent_suggestion_results = 7; + + // The suggestions for end user. The order is the same as + // [HumanAgentAssistantConfig.SuggestionConfig.feature_configs][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.feature_configs] of + // [HumanAgentAssistantConfig.end_user_suggestion_config][google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.end_user_suggestion_config]. + repeated SuggestionResult end_user_suggestion_results = 8; + + // Indicates the parameters of DTMF. + DtmfParameters dtmf_parameters = 10; +} + +// 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. +message AnnotatedMessagePart { + // Required. A part of a message possibly annotated with an entity. + string text = 1; + + // Optional. 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. + string entity_type = 2; + + // Optional. 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"
+  // }
+  // 
+ google.protobuf.Value formatted_value = 3; +} + +// Represents the result of annotation for the message. +message MessageAnnotation { + // Optional. The collection of annotated message parts ordered by their + // position in the message. You can recover the annotated message by + // concatenating [AnnotatedMessagePart.text]. + repeated AnnotatedMessagePart parts = 1; + + // Required. Indicates whether the text message contains entities. + bool contain_entities = 2; +} + +// Represents article answer. +message ArticleAnswer { + // The article title. + string title = 1; + + // The article URI. + string uri = 2; + + // Output only. Article snippets. + repeated string snippets = 3; + + // A map that contains metadata about the answer and the + // document from which it originates. + map metadata = 5; + + // The name of answer record, in the format of + // "projects//locations//answerRecords/" + string answer_record = 6; +} + +// Represents answer from "frequently asked questions". +message FaqAnswer { + // The piece of text from the `source` knowledge base document. + string answer = 1; + + // 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). + float confidence = 2; + + // The corresponding FAQ question. + string question = 3; + + // Indicates which Knowledge Document this answer was extracted + // from. + // Format: `projects//locations//agent/knowledgeBases//documents/`. + string source = 4; + + // A map that contains metadata about the answer and the + // document from which it originates. + map metadata = 5; + + // The name of answer record, in the format of + // "projects//locations//answerRecords/" + string answer_record = 6; +} + +// Represents a smart reply answer. +message SmartReplyAnswer { + // The content of the reply. + string reply = 1; + + // 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). + float confidence = 2; + + // The name of answer record, in the format of + // "projects//locations//answerRecords/" + string answer_record = 3; +} + +// One response of different type of suggestion response which is used in +// the response of [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent] and +// [Participants.AnalyzeContent][google.cloud.dialogflow.v2beta1.Participants.AnalyzeContent], as well as [HumanAgentAssistantEvent][google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent]. +message SuggestionResult { + // Different type of suggestion response. + oneof suggestion_response { + // Error status if the request failed. + google.rpc.Status error = 1; + + // SuggestArticlesResponse if request is for ARTICLE_SUGGESTION. + SuggestArticlesResponse suggest_articles_response = 2; + + // SuggestFaqAnswersResponse if request is for FAQ_ANSWER. + SuggestFaqAnswersResponse suggest_faq_answers_response = 3; + + // SuggestSmartRepliesResponse if request is for SMART_REPLY. + SuggestSmartRepliesResponse suggest_smart_replies_response = 4; + } +} + +// The request message for [Participants.SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles]. +message SuggestArticlesRequest { + // Required. The name of the participant to fetch suggestion for. + // Format: `projects//locations//conversations//participants/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + } + ]; + + // Optional. 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/`. + string latest_message = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Message" + } + ]; + + // Optional. Max number of messages prior to and including + // [latest_message][google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.latest_message] to use as context + // when compiling the suggestion. By default 20 and at most 50. + int32 context_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for [Participants.SuggestArticles][google.cloud.dialogflow.v2beta1.Participants.SuggestArticles]. +message SuggestArticlesResponse { + // Output only. Articles ordered by score in descending order. + repeated ArticleAnswer article_answers = 1; + + // The name of the latest conversation message used to compile + // suggestion for. + // + // Format: `projects//locations//conversations//messages/`. + string latest_message = 2; + + // Number of messages prior to and including + // [latest_message][google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.latest_message] to compile the + // suggestion. It may be smaller than the + // [SuggestArticlesResponse.context_size][google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.context_size] field in the request if there + // aren't that many messages in the conversation. + int32 context_size = 3; +} + +// The request message for [Participants.SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers]. +message SuggestFaqAnswersRequest { + // Required. The name of the participant to fetch suggestion for. + // Format: `projects//locations//conversations//participants/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + } + ]; + + // Optional. 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/`. + string latest_message = 2 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Message" + } + ]; + + // Optional. 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. + int32 context_size = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The request message for [Participants.SuggestFaqAnswers][google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers]. +message SuggestFaqAnswersResponse { + // Output only. Answers extracted from FAQ documents. + repeated FaqAnswer faq_answers = 1; + + // The name of the latest conversation message used to compile + // suggestion for. + // + // Format: `projects//locations//conversations//messages/`. + string latest_message = 2; + + // Number of messages prior to and including + // [latest_message][google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.latest_message] to compile the + // suggestion. It may be smaller than the + // [SuggestFaqAnswersRequest.context_size][google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest.context_size] field in the request if there + // aren't that many messages in the conversation. + int32 context_size = 3; +} + +// The request message for [Participants.SuggestSmartReplies][google.cloud.dialogflow.v2beta1.Participants.SuggestSmartReplies]. +message SuggestSmartRepliesRequest { + // Required. The name of the participant to fetch suggestion for. + // Format: `projects//locations//conversations//participants/`. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Participant" + } + ]; + + // The current natural language text segment to compile suggestion + // for. This provides a way for user to get follow up smart reply suggestion + // after a smart reply selection, without sending a text message. + TextInput current_text_input = 4; + + // 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/`. + string latest_message = 2 [(google.api.resource_reference) = { + type: "dialogflow.googleapis.com/Message" + }]; + + // Optional. 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. + int32 context_size = 3; +} + +// The response message for [Participants.SuggestSmartReplies][google.cloud.dialogflow.v2beta1.Participants.SuggestSmartReplies]. +message SuggestSmartRepliesResponse { + // Output only. 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. + repeated SmartReplyAnswer smart_reply_answers = 1; + + // The name of the latest conversation message used to compile + // suggestion for. + // + // Format: `projects//locations//conversations//messages/`. + string latest_message = 2; + + // Number of messages prior to and including + // [latest_message][google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.latest_message] to compile the + // suggestion. It may be smaller than the + // [SuggestSmartRepliesRequest.context_size][google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest.context_size] field in the request if there + // aren't that many messages in the conversation. + int32 context_size = 3; +} + +// Represents a suggestion for a human agent. +message Suggestion { + option deprecated = true; + + // Represents suggested article. + message Article { + // Output only. The article title. + string title = 1; + + // Output only. The article URI. + string uri = 2; + + // Output only. Article snippets. + repeated string snippets = 3; + + // Output only. A map that contains metadata about the answer and the + // document from which it originates. + map metadata = 5; + + // Output only. The name of answer record, in the format of + // "projects//locations//answerRecords/" + string answer_record = 6; + } + + // Represents suggested answer from "frequently asked questions". + message FaqAnswer { + // Output only. The piece of text from the `source` knowledge base document. + string answer = 1; + + // 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). + float confidence = 2; + + // Output only. The corresponding FAQ question. + string question = 3; + + // Output only. Indicates which Knowledge Document this answer was extracted + // from. + // Format: `projects//locations//agent/knowledgeBases//documents/`. + string source = 4; + + // Output only. A map that contains metadata about the answer and the + // document from which it originates. + map metadata = 5; + + // Output only. The name of answer record, in the format of + // "projects//locations//answerRecords/" + string answer_record = 6; + } + + // Output only. The name of this suggestion. + // Format: + // `projects//locations//conversations//participants/*/suggestions/`. + string name = 1; + + // Output only. Articles ordered by score in descending order. + repeated Article articles = 2; + + // Output only. Answers extracted from FAQ documents. + repeated FaqAnswer faq_answers = 4; + + // Output only. The time the suggestion was created. + google.protobuf.Timestamp create_time = 5; + + // Output only. Latest message used as context to compile this suggestion. + // + // Format: `projects//locations//conversations//messages/`. + string latest_message = 7; +} + +// The request message for [Participants.ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions]. +message ListSuggestionsRequest { + option deprecated = true; + + // Required. The name of the participant to fetch suggestions for. + // Format: `projects//locations//conversations//participants/`. + string parent = 1; + + // Optional. The maximum number of items to return in a single page. The + // default value is 100; the maximum value is 1000. + int32 page_size = 2; + + // Optional. The next_page_token value returned from a previous list request. + string page_token = 3; + + // Optional. Filter on suggestions 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). + string filter = 4; +} + +// The response message for [Participants.ListSuggestions][google.cloud.dialogflow.v2beta1.Participants.ListSuggestions]. +message ListSuggestionsResponse { + option deprecated = true; + + // Required. The list of suggestions. There will be a maximum number of items + // returned based on the page_size field in the request. `suggestions` is + // sorted by `create_time` in descending order. + repeated Suggestion suggestions = 1; + + // Optional. Token to retrieve the next page of results or empty if there are + // no more results in the list. + string next_page_token = 2; +} + +// The request message for [Participants.CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion]. +message CompileSuggestionRequest { + option deprecated = true; + + // Required. The name of the participant to fetch suggestion for. + // Format: `projects//locations//conversations//participants/`. + string parent = 1; + + // Optional. 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/`. + string latest_message = 2; + + // Optional. Max number of messages prior to and including + // [latest_message] to use as context when compiling the + // suggestion. If zero or less than zero, 20 is used. + int32 context_size = 3; +} + +// The response message for [Participants.CompileSuggestion][google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion]. +message CompileSuggestionResponse { + option deprecated = true; + + // The compiled suggestion. + Suggestion suggestion = 1; + + // The name of the latest conversation message used to compile + // suggestion for. + // + // Format: `projects//locations//conversations//messages/`. + string latest_message = 2; + + // Number of messages prior to and including + // [latest_message][google.cloud.dialogflow.v2beta1.CompileSuggestionResponse.latest_message] + // to compile the suggestion. It may be smaller than the + // [CompileSuggestionRequest.context_size][google.cloud.dialogflow.v2beta1.CompileSuggestionRequest.context_size] field in the request if + // there aren't that many messages in the conversation. + int32 context_size = 3; +} + +// Response messages from an automated agent. +message ResponseMessage { + // The text response message. + message Text { + // A collection of text responses. + repeated string text = 1; + } + + // Indicates that the conversation should be handed off to a human 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 CX 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. + message LiveAgentHandoff { + // Custom metadata for your handoff procedure. Dialogflow doesn't impose + // any structure on this. + google.protobuf.Struct metadata = 1; + } + + // Indicates that interaction with the Dialogflow agent has ended. + message EndInteraction { + + } + + // Required. The rich response message. + oneof message { + // Returns a text response. + Text text = 1; + + // Returns a response containing a custom, platform-specific payload. + google.protobuf.Struct payload = 2; + + // Hands off conversation to a live agent. + LiveAgentHandoff live_agent_handoff = 3; + + // A signal that indicates the interaction with the Dialogflow agent has + // ended. + EndInteraction end_interaction = 4; + } +} diff --git a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/webhook.proto b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/webhook.proto index a8340a968d5..64c7efda725 100644 --- a/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/webhook.proto +++ b/packages/google-cloud-dialogflow/protos/google/cloud/dialogflow/v2beta1/webhook.proto @@ -117,6 +117,12 @@ message WebhookResponse { // `fulfillment_messages`, and `payload` fields. EventInput followup_event_input = 6; + // 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. + bool live_agent_handoff = 7; + // Optional. 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. diff --git a/packages/google-cloud-dialogflow/protos/protos.d.ts b/packages/google-cloud-dialogflow/protos/protos.d.ts index f11d2de5cd1..1b3bfeecb49 100644 --- a/packages/google-cloud-dialogflow/protos/protos.d.ts +++ b/packages/google-cloud-dialogflow/protos/protos.d.ts @@ -1690,701 +1690,841 @@ export namespace google { public toJSON(): { [k: string]: any }; } - /** AudioEncoding enum. */ - enum AudioEncoding { - AUDIO_ENCODING_UNSPECIFIED = 0, - AUDIO_ENCODING_LINEAR_16 = 1, - AUDIO_ENCODING_FLAC = 2, - AUDIO_ENCODING_MULAW = 3, - AUDIO_ENCODING_AMR = 4, - AUDIO_ENCODING_AMR_WB = 5, - AUDIO_ENCODING_OGG_OPUS = 6, - AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7 + /** Represents an AnswerRecords */ + class AnswerRecords extends $protobuf.rpc.Service { + + /** + * Constructs a new AnswerRecords service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AnswerRecords service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AnswerRecords; + + /** + * Calls ListAnswerRecords. + * @param request ListAnswerRecordsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAnswerRecordsResponse + */ + public listAnswerRecords(request: google.cloud.dialogflow.v2.IListAnswerRecordsRequest, callback: google.cloud.dialogflow.v2.AnswerRecords.ListAnswerRecordsCallback): void; + + /** + * Calls ListAnswerRecords. + * @param request ListAnswerRecordsRequest message or plain object + * @returns Promise + */ + public listAnswerRecords(request: google.cloud.dialogflow.v2.IListAnswerRecordsRequest): Promise; + + /** + * Calls UpdateAnswerRecord. + * @param request UpdateAnswerRecordRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnswerRecord + */ + public updateAnswerRecord(request: google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest, callback: google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecordCallback): void; + + /** + * Calls UpdateAnswerRecord. + * @param request UpdateAnswerRecordRequest message or plain object + * @returns Promise + */ + public updateAnswerRecord(request: google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest): Promise; } - /** Properties of a SpeechContext. */ - interface ISpeechContext { + namespace AnswerRecords { - /** SpeechContext phrases */ - phrases?: (string[]|null); + /** + * Callback as used by {@link google.cloud.dialogflow.v2.AnswerRecords#listAnswerRecords}. + * @param error Error, if any + * @param [response] ListAnswerRecordsResponse + */ + type ListAnswerRecordsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListAnswerRecordsResponse) => void; - /** SpeechContext boost */ - boost?: (number|null); + /** + * Callback as used by {@link google.cloud.dialogflow.v2.AnswerRecords#updateAnswerRecord}. + * @param error Error, if any + * @param [response] AnswerRecord + */ + type UpdateAnswerRecordCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.AnswerRecord) => void; } - /** Represents a SpeechContext. */ - class SpeechContext implements ISpeechContext { + /** Properties of an AnswerRecord. */ + interface IAnswerRecord { + + /** AnswerRecord name */ + name?: (string|null); + + /** AnswerRecord answerFeedback */ + answerFeedback?: (google.cloud.dialogflow.v2.IAnswerFeedback|null); + + /** AnswerRecord agentAssistantRecord */ + agentAssistantRecord?: (google.cloud.dialogflow.v2.IAgentAssistantRecord|null); + } + + /** Represents an AnswerRecord. */ + class AnswerRecord implements IAnswerRecord { /** - * Constructs a new SpeechContext. + * Constructs a new AnswerRecord. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.ISpeechContext); + constructor(properties?: google.cloud.dialogflow.v2.IAnswerRecord); - /** SpeechContext phrases. */ - public phrases: string[]; + /** AnswerRecord name. */ + public name: string; - /** SpeechContext boost. */ - public boost: number; + /** AnswerRecord answerFeedback. */ + public answerFeedback?: (google.cloud.dialogflow.v2.IAnswerFeedback|null); + + /** AnswerRecord agentAssistantRecord. */ + public agentAssistantRecord?: (google.cloud.dialogflow.v2.IAgentAssistantRecord|null); + + /** AnswerRecord record. */ + public record?: "agentAssistantRecord"; /** - * Creates a new SpeechContext instance using the specified properties. + * Creates a new AnswerRecord instance using the specified properties. * @param [properties] Properties to set - * @returns SpeechContext instance + * @returns AnswerRecord instance */ - public static create(properties?: google.cloud.dialogflow.v2.ISpeechContext): google.cloud.dialogflow.v2.SpeechContext; + public static create(properties?: google.cloud.dialogflow.v2.IAnswerRecord): google.cloud.dialogflow.v2.AnswerRecord; /** - * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechContext.verify|verify} messages. - * @param message SpeechContext message or plain object to encode + * Encodes the specified AnswerRecord message. Does not implicitly {@link google.cloud.dialogflow.v2.AnswerRecord.verify|verify} messages. + * @param message AnswerRecord message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IAnswerRecord, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechContext.verify|verify} messages. - * @param message SpeechContext message or plain object to encode + * Encodes the specified AnswerRecord message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AnswerRecord.verify|verify} messages. + * @param message AnswerRecord message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IAnswerRecord, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SpeechContext message from the specified reader or buffer. + * Decodes an AnswerRecord message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SpeechContext + * @returns AnswerRecord * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SpeechContext; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.AnswerRecord; /** - * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * Decodes an AnswerRecord message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SpeechContext + * @returns AnswerRecord * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SpeechContext; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.AnswerRecord; /** - * Verifies a SpeechContext message. + * Verifies an AnswerRecord message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * Creates an AnswerRecord message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SpeechContext + * @returns AnswerRecord */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SpeechContext; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.AnswerRecord; /** - * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. - * @param message SpeechContext + * Creates a plain object from an AnswerRecord message. Also converts values to other types if specified. + * @param message AnswerRecord * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.SpeechContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.AnswerRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SpeechContext to JSON. + * Converts this AnswerRecord to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SpeechWordInfo. */ - interface ISpeechWordInfo { + /** Properties of a ListAnswerRecordsRequest. */ + interface IListAnswerRecordsRequest { - /** SpeechWordInfo word */ - word?: (string|null); + /** ListAnswerRecordsRequest parent */ + parent?: (string|null); - /** SpeechWordInfo startOffset */ - startOffset?: (google.protobuf.IDuration|null); + /** ListAnswerRecordsRequest filter */ + filter?: (string|null); - /** SpeechWordInfo endOffset */ - endOffset?: (google.protobuf.IDuration|null); + /** ListAnswerRecordsRequest pageSize */ + pageSize?: (number|null); - /** SpeechWordInfo confidence */ - confidence?: (number|null); + /** ListAnswerRecordsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a SpeechWordInfo. */ - class SpeechWordInfo implements ISpeechWordInfo { + /** Represents a ListAnswerRecordsRequest. */ + class ListAnswerRecordsRequest implements IListAnswerRecordsRequest { /** - * Constructs a new SpeechWordInfo. + * Constructs a new ListAnswerRecordsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.ISpeechWordInfo); + constructor(properties?: google.cloud.dialogflow.v2.IListAnswerRecordsRequest); - /** SpeechWordInfo word. */ - public word: string; + /** ListAnswerRecordsRequest parent. */ + public parent: string; - /** SpeechWordInfo startOffset. */ - public startOffset?: (google.protobuf.IDuration|null); + /** ListAnswerRecordsRequest filter. */ + public filter: string; - /** SpeechWordInfo endOffset. */ - public endOffset?: (google.protobuf.IDuration|null); + /** ListAnswerRecordsRequest pageSize. */ + public pageSize: number; - /** SpeechWordInfo confidence. */ - public confidence: number; + /** ListAnswerRecordsRequest pageToken. */ + public pageToken: string; /** - * Creates a new SpeechWordInfo instance using the specified properties. + * Creates a new ListAnswerRecordsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SpeechWordInfo instance + * @returns ListAnswerRecordsRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.ISpeechWordInfo): google.cloud.dialogflow.v2.SpeechWordInfo; + public static create(properties?: google.cloud.dialogflow.v2.IListAnswerRecordsRequest): google.cloud.dialogflow.v2.ListAnswerRecordsRequest; /** - * Encodes the specified SpeechWordInfo message. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechWordInfo.verify|verify} messages. - * @param message SpeechWordInfo message or plain object to encode + * Encodes the specified ListAnswerRecordsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListAnswerRecordsRequest.verify|verify} messages. + * @param message ListAnswerRecordsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.ISpeechWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IListAnswerRecordsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SpeechWordInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechWordInfo.verify|verify} messages. - * @param message SpeechWordInfo message or plain object to encode + * Encodes the specified ListAnswerRecordsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListAnswerRecordsRequest.verify|verify} messages. + * @param message ListAnswerRecordsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.ISpeechWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListAnswerRecordsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SpeechWordInfo message from the specified reader or buffer. + * Decodes a ListAnswerRecordsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SpeechWordInfo + * @returns ListAnswerRecordsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SpeechWordInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListAnswerRecordsRequest; /** - * Decodes a SpeechWordInfo message from the specified reader or buffer, length delimited. + * Decodes a ListAnswerRecordsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SpeechWordInfo + * @returns ListAnswerRecordsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SpeechWordInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListAnswerRecordsRequest; /** - * Verifies a SpeechWordInfo message. + * Verifies a ListAnswerRecordsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SpeechWordInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ListAnswerRecordsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SpeechWordInfo + * @returns ListAnswerRecordsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SpeechWordInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListAnswerRecordsRequest; /** - * Creates a plain object from a SpeechWordInfo message. Also converts values to other types if specified. - * @param message SpeechWordInfo + * Creates a plain object from a ListAnswerRecordsRequest message. Also converts values to other types if specified. + * @param message ListAnswerRecordsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.SpeechWordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.ListAnswerRecordsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SpeechWordInfo to JSON. + * Converts this ListAnswerRecordsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** SpeechModelVariant enum. */ - enum SpeechModelVariant { - SPEECH_MODEL_VARIANT_UNSPECIFIED = 0, - USE_BEST_AVAILABLE = 1, - USE_STANDARD = 2, - USE_ENHANCED = 3 - } + /** Properties of a ListAnswerRecordsResponse. */ + interface IListAnswerRecordsResponse { - /** Properties of an InputAudioConfig. */ - interface IInputAudioConfig { + /** ListAnswerRecordsResponse answerRecords */ + answerRecords?: (google.cloud.dialogflow.v2.IAnswerRecord[]|null); - /** InputAudioConfig audioEncoding */ - audioEncoding?: (google.cloud.dialogflow.v2.AudioEncoding|keyof typeof google.cloud.dialogflow.v2.AudioEncoding|null); + /** ListAnswerRecordsResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** InputAudioConfig sampleRateHertz */ - sampleRateHertz?: (number|null); + /** Represents a ListAnswerRecordsResponse. */ + class ListAnswerRecordsResponse implements IListAnswerRecordsResponse { - /** InputAudioConfig languageCode */ - languageCode?: (string|null); + /** + * Constructs a new ListAnswerRecordsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListAnswerRecordsResponse); - /** InputAudioConfig enableWordInfo */ - enableWordInfo?: (boolean|null); + /** ListAnswerRecordsResponse answerRecords. */ + public answerRecords: google.cloud.dialogflow.v2.IAnswerRecord[]; - /** InputAudioConfig phraseHints */ - phraseHints?: (string[]|null); + /** ListAnswerRecordsResponse nextPageToken. */ + public nextPageToken: string; - /** InputAudioConfig speechContexts */ - speechContexts?: (google.cloud.dialogflow.v2.ISpeechContext[]|null); + /** + * Creates a new ListAnswerRecordsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnswerRecordsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListAnswerRecordsResponse): google.cloud.dialogflow.v2.ListAnswerRecordsResponse; - /** InputAudioConfig model */ - model?: (string|null); + /** + * Encodes the specified ListAnswerRecordsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListAnswerRecordsResponse.verify|verify} messages. + * @param message ListAnswerRecordsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListAnswerRecordsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** InputAudioConfig modelVariant */ - modelVariant?: (google.cloud.dialogflow.v2.SpeechModelVariant|keyof typeof google.cloud.dialogflow.v2.SpeechModelVariant|null); + /** + * Encodes the specified ListAnswerRecordsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListAnswerRecordsResponse.verify|verify} messages. + * @param message ListAnswerRecordsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListAnswerRecordsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** InputAudioConfig singleUtterance */ - singleUtterance?: (boolean|null); - } + /** + * Decodes a ListAnswerRecordsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnswerRecordsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListAnswerRecordsResponse; - /** Represents an InputAudioConfig. */ - class InputAudioConfig implements IInputAudioConfig { + /** + * Decodes a ListAnswerRecordsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnswerRecordsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListAnswerRecordsResponse; /** - * Constructs a new InputAudioConfig. - * @param [properties] Properties to set + * Verifies a ListAnswerRecordsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - constructor(properties?: google.cloud.dialogflow.v2.IInputAudioConfig); + public static verify(message: { [k: string]: any }): (string|null); - /** InputAudioConfig audioEncoding. */ - public audioEncoding: (google.cloud.dialogflow.v2.AudioEncoding|keyof typeof google.cloud.dialogflow.v2.AudioEncoding); + /** + * Creates a ListAnswerRecordsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnswerRecordsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListAnswerRecordsResponse; - /** InputAudioConfig sampleRateHertz. */ - public sampleRateHertz: number; + /** + * Creates a plain object from a ListAnswerRecordsResponse message. Also converts values to other types if specified. + * @param message ListAnswerRecordsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListAnswerRecordsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** InputAudioConfig languageCode. */ - public languageCode: string; + /** + * Converts this ListAnswerRecordsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** InputAudioConfig enableWordInfo. */ - public enableWordInfo: boolean; + /** Properties of an UpdateAnswerRecordRequest. */ + interface IUpdateAnswerRecordRequest { - /** InputAudioConfig phraseHints. */ - public phraseHints: string[]; + /** UpdateAnswerRecordRequest answerRecord */ + answerRecord?: (google.cloud.dialogflow.v2.IAnswerRecord|null); - /** InputAudioConfig speechContexts. */ - public speechContexts: google.cloud.dialogflow.v2.ISpeechContext[]; + /** UpdateAnswerRecordRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** InputAudioConfig model. */ - public model: string; + /** Represents an UpdateAnswerRecordRequest. */ + class UpdateAnswerRecordRequest implements IUpdateAnswerRecordRequest { - /** InputAudioConfig modelVariant. */ - public modelVariant: (google.cloud.dialogflow.v2.SpeechModelVariant|keyof typeof google.cloud.dialogflow.v2.SpeechModelVariant); + /** + * Constructs a new UpdateAnswerRecordRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest); - /** InputAudioConfig singleUtterance. */ - public singleUtterance: boolean; + /** UpdateAnswerRecordRequest answerRecord. */ + public answerRecord?: (google.cloud.dialogflow.v2.IAnswerRecord|null); + + /** UpdateAnswerRecordRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new InputAudioConfig instance using the specified properties. + * Creates a new UpdateAnswerRecordRequest instance using the specified properties. * @param [properties] Properties to set - * @returns InputAudioConfig instance + * @returns UpdateAnswerRecordRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.IInputAudioConfig): google.cloud.dialogflow.v2.InputAudioConfig; + public static create(properties?: google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest): google.cloud.dialogflow.v2.UpdateAnswerRecordRequest; /** - * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.InputAudioConfig.verify|verify} messages. - * @param message InputAudioConfig message or plain object to encode + * Encodes the specified UpdateAnswerRecordRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateAnswerRecordRequest.verify|verify} messages. + * @param message UpdateAnswerRecordRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.InputAudioConfig.verify|verify} messages. - * @param message InputAudioConfig message or plain object to encode + * Encodes the specified UpdateAnswerRecordRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateAnswerRecordRequest.verify|verify} messages. + * @param message UpdateAnswerRecordRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an InputAudioConfig message from the specified reader or buffer. + * Decodes an UpdateAnswerRecordRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns InputAudioConfig + * @returns UpdateAnswerRecordRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.InputAudioConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateAnswerRecordRequest; /** - * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * Decodes an UpdateAnswerRecordRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns InputAudioConfig + * @returns UpdateAnswerRecordRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.InputAudioConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateAnswerRecordRequest; /** - * Verifies an InputAudioConfig message. + * Verifies an UpdateAnswerRecordRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateAnswerRecordRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns InputAudioConfig + * @returns UpdateAnswerRecordRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.InputAudioConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateAnswerRecordRequest; /** - * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. - * @param message InputAudioConfig + * Creates a plain object from an UpdateAnswerRecordRequest message. Also converts values to other types if specified. + * @param message UpdateAnswerRecordRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.InputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.UpdateAnswerRecordRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this InputAudioConfig to JSON. + * Converts this UpdateAnswerRecordRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a VoiceSelectionParams. */ - interface IVoiceSelectionParams { + /** Properties of an AnswerFeedback. */ + interface IAnswerFeedback { - /** VoiceSelectionParams name */ - name?: (string|null); + /** AnswerFeedback correctnessLevel */ + correctnessLevel?: (google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel|keyof typeof google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel|null); - /** VoiceSelectionParams ssmlGender */ - ssmlGender?: (google.cloud.dialogflow.v2.SsmlVoiceGender|keyof typeof google.cloud.dialogflow.v2.SsmlVoiceGender|null); + /** AnswerFeedback agentAssistantDetailFeedback */ + agentAssistantDetailFeedback?: (google.cloud.dialogflow.v2.IAgentAssistantFeedback|null); + + /** AnswerFeedback clicked */ + clicked?: (boolean|null); + + /** AnswerFeedback clickTime */ + clickTime?: (google.protobuf.ITimestamp|null); + + /** AnswerFeedback displayed */ + displayed?: (boolean|null); + + /** AnswerFeedback displayTime */ + displayTime?: (google.protobuf.ITimestamp|null); } - /** Represents a VoiceSelectionParams. */ - class VoiceSelectionParams implements IVoiceSelectionParams { + /** Represents an AnswerFeedback. */ + class AnswerFeedback implements IAnswerFeedback { /** - * Constructs a new VoiceSelectionParams. + * Constructs a new AnswerFeedback. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IVoiceSelectionParams); + constructor(properties?: google.cloud.dialogflow.v2.IAnswerFeedback); - /** VoiceSelectionParams name. */ - public name: string; + /** AnswerFeedback correctnessLevel. */ + public correctnessLevel: (google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel|keyof typeof google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel); - /** VoiceSelectionParams ssmlGender. */ - public ssmlGender: (google.cloud.dialogflow.v2.SsmlVoiceGender|keyof typeof google.cloud.dialogflow.v2.SsmlVoiceGender); + /** AnswerFeedback agentAssistantDetailFeedback. */ + public agentAssistantDetailFeedback?: (google.cloud.dialogflow.v2.IAgentAssistantFeedback|null); + + /** AnswerFeedback clicked. */ + public clicked: boolean; + + /** AnswerFeedback clickTime. */ + public clickTime?: (google.protobuf.ITimestamp|null); + + /** AnswerFeedback displayed. */ + public displayed: boolean; + + /** AnswerFeedback displayTime. */ + public displayTime?: (google.protobuf.ITimestamp|null); + + /** AnswerFeedback detailFeedback. */ + public detailFeedback?: "agentAssistantDetailFeedback"; /** - * Creates a new VoiceSelectionParams instance using the specified properties. + * Creates a new AnswerFeedback instance using the specified properties. * @param [properties] Properties to set - * @returns VoiceSelectionParams instance + * @returns AnswerFeedback instance */ - public static create(properties?: google.cloud.dialogflow.v2.IVoiceSelectionParams): google.cloud.dialogflow.v2.VoiceSelectionParams; + public static create(properties?: google.cloud.dialogflow.v2.IAnswerFeedback): google.cloud.dialogflow.v2.AnswerFeedback; /** - * Encodes the specified VoiceSelectionParams message. Does not implicitly {@link google.cloud.dialogflow.v2.VoiceSelectionParams.verify|verify} messages. - * @param message VoiceSelectionParams message or plain object to encode + * Encodes the specified AnswerFeedback message. Does not implicitly {@link google.cloud.dialogflow.v2.AnswerFeedback.verify|verify} messages. + * @param message AnswerFeedback message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IVoiceSelectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IAnswerFeedback, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VoiceSelectionParams message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.VoiceSelectionParams.verify|verify} messages. - * @param message VoiceSelectionParams message or plain object to encode + * Encodes the specified AnswerFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AnswerFeedback.verify|verify} messages. + * @param message AnswerFeedback message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IVoiceSelectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IAnswerFeedback, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VoiceSelectionParams message from the specified reader or buffer. + * Decodes an AnswerFeedback message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VoiceSelectionParams + * @returns AnswerFeedback * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.VoiceSelectionParams; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.AnswerFeedback; /** - * Decodes a VoiceSelectionParams message from the specified reader or buffer, length delimited. + * Decodes an AnswerFeedback message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VoiceSelectionParams + * @returns AnswerFeedback * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.VoiceSelectionParams; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.AnswerFeedback; /** - * Verifies a VoiceSelectionParams message. + * Verifies an AnswerFeedback message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VoiceSelectionParams message from a plain object. Also converts values to their respective internal types. + * Creates an AnswerFeedback message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VoiceSelectionParams + * @returns AnswerFeedback */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.VoiceSelectionParams; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.AnswerFeedback; /** - * Creates a plain object from a VoiceSelectionParams message. Also converts values to other types if specified. - * @param message VoiceSelectionParams + * Creates a plain object from an AnswerFeedback message. Also converts values to other types if specified. + * @param message AnswerFeedback * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.VoiceSelectionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.AnswerFeedback, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VoiceSelectionParams to JSON. + * Converts this AnswerFeedback to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SynthesizeSpeechConfig. */ - interface ISynthesizeSpeechConfig { + namespace AnswerFeedback { - /** SynthesizeSpeechConfig speakingRate */ - speakingRate?: (number|null); + /** CorrectnessLevel enum. */ + enum CorrectnessLevel { + CORRECTNESS_LEVEL_UNSPECIFIED = 0, + NOT_CORRECT = 1, + PARTIALLY_CORRECT = 2, + FULLY_CORRECT = 3 + } + } - /** SynthesizeSpeechConfig pitch */ - pitch?: (number|null); + /** Properties of an AgentAssistantFeedback. */ + interface IAgentAssistantFeedback { - /** SynthesizeSpeechConfig volumeGainDb */ - volumeGainDb?: (number|null); + /** AgentAssistantFeedback answerRelevance */ + answerRelevance?: (google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance|keyof typeof google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance|null); - /** SynthesizeSpeechConfig effectsProfileId */ - effectsProfileId?: (string[]|null); + /** AgentAssistantFeedback documentCorrectness */ + documentCorrectness?: (google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness|keyof typeof google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness|null); - /** SynthesizeSpeechConfig voice */ - voice?: (google.cloud.dialogflow.v2.IVoiceSelectionParams|null); + /** AgentAssistantFeedback documentEfficiency */ + documentEfficiency?: (google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency|keyof typeof google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency|null); } - /** Represents a SynthesizeSpeechConfig. */ - class SynthesizeSpeechConfig implements ISynthesizeSpeechConfig { + /** Represents an AgentAssistantFeedback. */ + class AgentAssistantFeedback implements IAgentAssistantFeedback { /** - * Constructs a new SynthesizeSpeechConfig. + * Constructs a new AgentAssistantFeedback. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.ISynthesizeSpeechConfig); - - /** SynthesizeSpeechConfig speakingRate. */ - public speakingRate: number; - - /** SynthesizeSpeechConfig pitch. */ - public pitch: number; + constructor(properties?: google.cloud.dialogflow.v2.IAgentAssistantFeedback); - /** SynthesizeSpeechConfig volumeGainDb. */ - public volumeGainDb: number; + /** AgentAssistantFeedback answerRelevance. */ + public answerRelevance: (google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance|keyof typeof google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance); - /** SynthesizeSpeechConfig effectsProfileId. */ - public effectsProfileId: string[]; + /** AgentAssistantFeedback documentCorrectness. */ + public documentCorrectness: (google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness|keyof typeof google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness); - /** SynthesizeSpeechConfig voice. */ - public voice?: (google.cloud.dialogflow.v2.IVoiceSelectionParams|null); + /** AgentAssistantFeedback documentEfficiency. */ + public documentEfficiency: (google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency|keyof typeof google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency); /** - * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * Creates a new AgentAssistantFeedback instance using the specified properties. * @param [properties] Properties to set - * @returns SynthesizeSpeechConfig instance + * @returns AgentAssistantFeedback instance */ - public static create(properties?: google.cloud.dialogflow.v2.ISynthesizeSpeechConfig): google.cloud.dialogflow.v2.SynthesizeSpeechConfig; + public static create(properties?: google.cloud.dialogflow.v2.IAgentAssistantFeedback): google.cloud.dialogflow.v2.AgentAssistantFeedback; /** - * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.SynthesizeSpeechConfig.verify|verify} messages. - * @param message SynthesizeSpeechConfig message or plain object to encode + * Encodes the specified AgentAssistantFeedback message. Does not implicitly {@link google.cloud.dialogflow.v2.AgentAssistantFeedback.verify|verify} messages. + * @param message AgentAssistantFeedback message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IAgentAssistantFeedback, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SynthesizeSpeechConfig.verify|verify} messages. - * @param message SynthesizeSpeechConfig message or plain object to encode + * Encodes the specified AgentAssistantFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AgentAssistantFeedback.verify|verify} messages. + * @param message AgentAssistantFeedback message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IAgentAssistantFeedback, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * Decodes an AgentAssistantFeedback message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SynthesizeSpeechConfig + * @returns AgentAssistantFeedback * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SynthesizeSpeechConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.AgentAssistantFeedback; /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * Decodes an AgentAssistantFeedback message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SynthesizeSpeechConfig + * @returns AgentAssistantFeedback * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SynthesizeSpeechConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.AgentAssistantFeedback; /** - * Verifies a SynthesizeSpeechConfig message. + * Verifies an AgentAssistantFeedback message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * Creates an AgentAssistantFeedback message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SynthesizeSpeechConfig + * @returns AgentAssistantFeedback */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SynthesizeSpeechConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.AgentAssistantFeedback; /** - * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. - * @param message SynthesizeSpeechConfig + * Creates a plain object from an AgentAssistantFeedback message. Also converts values to other types if specified. + * @param message AgentAssistantFeedback * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.SynthesizeSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.AgentAssistantFeedback, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SynthesizeSpeechConfig to JSON. + * Converts this AgentAssistantFeedback to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** SsmlVoiceGender enum. */ - enum SsmlVoiceGender { - SSML_VOICE_GENDER_UNSPECIFIED = 0, - SSML_VOICE_GENDER_MALE = 1, - SSML_VOICE_GENDER_FEMALE = 2, - SSML_VOICE_GENDER_NEUTRAL = 3 - } + namespace AgentAssistantFeedback { - /** Properties of an OutputAudioConfig. */ - interface IOutputAudioConfig { + /** AnswerRelevance enum. */ + enum AnswerRelevance { + ANSWER_RELEVANCE_UNSPECIFIED = 0, + IRRELEVANT = 1, + RELEVANT = 2 + } - /** OutputAudioConfig audioEncoding */ - audioEncoding?: (google.cloud.dialogflow.v2.OutputAudioEncoding|keyof typeof google.cloud.dialogflow.v2.OutputAudioEncoding|null); + /** DocumentCorrectness enum. */ + enum DocumentCorrectness { + DOCUMENT_CORRECTNESS_UNSPECIFIED = 0, + INCORRECT = 1, + CORRECT = 2 + } - /** OutputAudioConfig sampleRateHertz */ - sampleRateHertz?: (number|null); + /** DocumentEfficiency enum. */ + enum DocumentEfficiency { + DOCUMENT_EFFICIENCY_UNSPECIFIED = 0, + INEFFICIENT = 1, + EFFICIENT = 2 + } + } - /** OutputAudioConfig synthesizeSpeechConfig */ - synthesizeSpeechConfig?: (google.cloud.dialogflow.v2.ISynthesizeSpeechConfig|null); + /** Properties of an AgentAssistantRecord. */ + interface IAgentAssistantRecord { + + /** AgentAssistantRecord articleSuggestionAnswer */ + articleSuggestionAnswer?: (google.cloud.dialogflow.v2.IArticleAnswer|null); + + /** AgentAssistantRecord faqAnswer */ + faqAnswer?: (google.cloud.dialogflow.v2.IFaqAnswer|null); } - /** Represents an OutputAudioConfig. */ - class OutputAudioConfig implements IOutputAudioConfig { + /** Represents an AgentAssistantRecord. */ + class AgentAssistantRecord implements IAgentAssistantRecord { /** - * Constructs a new OutputAudioConfig. + * Constructs a new AgentAssistantRecord. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IOutputAudioConfig); + constructor(properties?: google.cloud.dialogflow.v2.IAgentAssistantRecord); - /** OutputAudioConfig audioEncoding. */ - public audioEncoding: (google.cloud.dialogflow.v2.OutputAudioEncoding|keyof typeof google.cloud.dialogflow.v2.OutputAudioEncoding); + /** AgentAssistantRecord articleSuggestionAnswer. */ + public articleSuggestionAnswer?: (google.cloud.dialogflow.v2.IArticleAnswer|null); - /** OutputAudioConfig sampleRateHertz. */ - public sampleRateHertz: number; + /** AgentAssistantRecord faqAnswer. */ + public faqAnswer?: (google.cloud.dialogflow.v2.IFaqAnswer|null); - /** OutputAudioConfig synthesizeSpeechConfig. */ - public synthesizeSpeechConfig?: (google.cloud.dialogflow.v2.ISynthesizeSpeechConfig|null); + /** AgentAssistantRecord answer. */ + public answer?: ("articleSuggestionAnswer"|"faqAnswer"); /** - * Creates a new OutputAudioConfig instance using the specified properties. + * Creates a new AgentAssistantRecord instance using the specified properties. * @param [properties] Properties to set - * @returns OutputAudioConfig instance + * @returns AgentAssistantRecord instance */ - public static create(properties?: google.cloud.dialogflow.v2.IOutputAudioConfig): google.cloud.dialogflow.v2.OutputAudioConfig; + public static create(properties?: google.cloud.dialogflow.v2.IAgentAssistantRecord): google.cloud.dialogflow.v2.AgentAssistantRecord; /** - * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.OutputAudioConfig.verify|verify} messages. - * @param message OutputAudioConfig message or plain object to encode + * Encodes the specified AgentAssistantRecord message. Does not implicitly {@link google.cloud.dialogflow.v2.AgentAssistantRecord.verify|verify} messages. + * @param message AgentAssistantRecord message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IAgentAssistantRecord, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.OutputAudioConfig.verify|verify} messages. - * @param message OutputAudioConfig message or plain object to encode + * Encodes the specified AgentAssistantRecord message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AgentAssistantRecord.verify|verify} messages. + * @param message AgentAssistantRecord message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IAgentAssistantRecord, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutputAudioConfig message from the specified reader or buffer. + * Decodes an AgentAssistantRecord message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OutputAudioConfig + * @returns AgentAssistantRecord * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.OutputAudioConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.AgentAssistantRecord; /** - * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * Decodes an AgentAssistantRecord message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutputAudioConfig + * @returns AgentAssistantRecord * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.OutputAudioConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.AgentAssistantRecord; /** - * Verifies an OutputAudioConfig message. + * Verifies an AgentAssistantRecord message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * Creates an AgentAssistantRecord message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutputAudioConfig + * @returns AgentAssistantRecord */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.OutputAudioConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.AgentAssistantRecord; /** - * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. - * @param message OutputAudioConfig + * Creates a plain object from an AgentAssistantRecord message. Also converts values to other types if specified. + * @param message AgentAssistantRecord * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.OutputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.AgentAssistantRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutputAudioConfig to JSON. + * Converts this AgentAssistantRecord to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** OutputAudioEncoding enum. */ - enum OutputAudioEncoding { - OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0, - OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1, - OUTPUT_AUDIO_ENCODING_MP3 = 2, - OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3 - } - - /** Represents a Contexts */ - class Contexts extends $protobuf.rpc.Service { + /** Represents a Participants */ + class Participants extends $protobuf.rpc.Service { /** - * Constructs a new Contexts service. + * Constructs a new Participants service. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited @@ -2392,10540 +2532,11013 @@ export namespace google { constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates new Contexts service using the specified rpc implementation. + * Creates new Participants service using the specified rpc implementation. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited * @returns RPC service. Useful where requests and/or responses are streamed. */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Contexts; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Participants; /** - * Calls ListContexts. - * @param request ListContextsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListContextsResponse + * Calls CreateParticipant. + * @param request CreateParticipantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Participant */ - public listContexts(request: google.cloud.dialogflow.v2.IListContextsRequest, callback: google.cloud.dialogflow.v2.Contexts.ListContextsCallback): void; + public createParticipant(request: google.cloud.dialogflow.v2.ICreateParticipantRequest, callback: google.cloud.dialogflow.v2.Participants.CreateParticipantCallback): void; /** - * Calls ListContexts. - * @param request ListContextsRequest message or plain object + * Calls CreateParticipant. + * @param request CreateParticipantRequest message or plain object * @returns Promise */ - public listContexts(request: google.cloud.dialogflow.v2.IListContextsRequest): Promise; + public createParticipant(request: google.cloud.dialogflow.v2.ICreateParticipantRequest): Promise; /** - * Calls GetContext. - * @param request GetContextRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Context + * Calls GetParticipant. + * @param request GetParticipantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Participant */ - public getContext(request: google.cloud.dialogflow.v2.IGetContextRequest, callback: google.cloud.dialogflow.v2.Contexts.GetContextCallback): void; + public getParticipant(request: google.cloud.dialogflow.v2.IGetParticipantRequest, callback: google.cloud.dialogflow.v2.Participants.GetParticipantCallback): void; /** - * Calls GetContext. - * @param request GetContextRequest message or plain object + * Calls GetParticipant. + * @param request GetParticipantRequest message or plain object * @returns Promise */ - public getContext(request: google.cloud.dialogflow.v2.IGetContextRequest): Promise; + public getParticipant(request: google.cloud.dialogflow.v2.IGetParticipantRequest): Promise; /** - * Calls CreateContext. - * @param request CreateContextRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Context + * Calls ListParticipants. + * @param request ListParticipantsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListParticipantsResponse */ - public createContext(request: google.cloud.dialogflow.v2.ICreateContextRequest, callback: google.cloud.dialogflow.v2.Contexts.CreateContextCallback): void; + public listParticipants(request: google.cloud.dialogflow.v2.IListParticipantsRequest, callback: google.cloud.dialogflow.v2.Participants.ListParticipantsCallback): void; /** - * Calls CreateContext. - * @param request CreateContextRequest message or plain object + * Calls ListParticipants. + * @param request ListParticipantsRequest message or plain object * @returns Promise */ - public createContext(request: google.cloud.dialogflow.v2.ICreateContextRequest): Promise; + public listParticipants(request: google.cloud.dialogflow.v2.IListParticipantsRequest): Promise; /** - * Calls UpdateContext. - * @param request UpdateContextRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Context + * Calls UpdateParticipant. + * @param request UpdateParticipantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Participant */ - public updateContext(request: google.cloud.dialogflow.v2.IUpdateContextRequest, callback: google.cloud.dialogflow.v2.Contexts.UpdateContextCallback): void; + public updateParticipant(request: google.cloud.dialogflow.v2.IUpdateParticipantRequest, callback: google.cloud.dialogflow.v2.Participants.UpdateParticipantCallback): void; /** - * Calls UpdateContext. - * @param request UpdateContextRequest message or plain object + * Calls UpdateParticipant. + * @param request UpdateParticipantRequest message or plain object * @returns Promise */ - public updateContext(request: google.cloud.dialogflow.v2.IUpdateContextRequest): Promise; + public updateParticipant(request: google.cloud.dialogflow.v2.IUpdateParticipantRequest): Promise; /** - * Calls DeleteContext. - * @param request DeleteContextRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Calls AnalyzeContent. + * @param request AnalyzeContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeContentResponse */ - public deleteContext(request: google.cloud.dialogflow.v2.IDeleteContextRequest, callback: google.cloud.dialogflow.v2.Contexts.DeleteContextCallback): void; + public analyzeContent(request: google.cloud.dialogflow.v2.IAnalyzeContentRequest, callback: google.cloud.dialogflow.v2.Participants.AnalyzeContentCallback): void; /** - * Calls DeleteContext. - * @param request DeleteContextRequest message or plain object + * Calls AnalyzeContent. + * @param request AnalyzeContentRequest message or plain object * @returns Promise */ - public deleteContext(request: google.cloud.dialogflow.v2.IDeleteContextRequest): Promise; + public analyzeContent(request: google.cloud.dialogflow.v2.IAnalyzeContentRequest): Promise; /** - * Calls DeleteAllContexts. - * @param request DeleteAllContextsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Calls StreamingAnalyzeContent. + * @param request StreamingAnalyzeContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingAnalyzeContentResponse */ - public deleteAllContexts(request: google.cloud.dialogflow.v2.IDeleteAllContextsRequest, callback: google.cloud.dialogflow.v2.Contexts.DeleteAllContextsCallback): void; + public streamingAnalyzeContent(request: google.cloud.dialogflow.v2.IStreamingAnalyzeContentRequest, callback: google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContentCallback): void; /** - * Calls DeleteAllContexts. - * @param request DeleteAllContextsRequest message or plain object + * Calls StreamingAnalyzeContent. + * @param request StreamingAnalyzeContentRequest message or plain object * @returns Promise */ - public deleteAllContexts(request: google.cloud.dialogflow.v2.IDeleteAllContextsRequest): Promise; + public streamingAnalyzeContent(request: google.cloud.dialogflow.v2.IStreamingAnalyzeContentRequest): Promise; + + /** + * Calls SuggestArticles. + * @param request SuggestArticlesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SuggestArticlesResponse + */ + public suggestArticles(request: google.cloud.dialogflow.v2.ISuggestArticlesRequest, callback: google.cloud.dialogflow.v2.Participants.SuggestArticlesCallback): void; + + /** + * Calls SuggestArticles. + * @param request SuggestArticlesRequest message or plain object + * @returns Promise + */ + public suggestArticles(request: google.cloud.dialogflow.v2.ISuggestArticlesRequest): Promise; + + /** + * Calls SuggestFaqAnswers. + * @param request SuggestFaqAnswersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SuggestFaqAnswersResponse + */ + public suggestFaqAnswers(request: google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest, callback: google.cloud.dialogflow.v2.Participants.SuggestFaqAnswersCallback): void; + + /** + * Calls SuggestFaqAnswers. + * @param request SuggestFaqAnswersRequest message or plain object + * @returns Promise + */ + public suggestFaqAnswers(request: google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest): Promise; } - namespace Contexts { + namespace Participants { /** - * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#listContexts}. + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#createParticipant}. * @param error Error, if any - * @param [response] ListContextsResponse + * @param [response] Participant */ - type ListContextsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListContextsResponse) => void; + type CreateParticipantCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Participant) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#getContext}. + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#getParticipant}. * @param error Error, if any - * @param [response] Context + * @param [response] Participant */ - type GetContextCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Context) => void; + type GetParticipantCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Participant) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#createContext}. + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#listParticipants}. * @param error Error, if any - * @param [response] Context + * @param [response] ListParticipantsResponse */ - type CreateContextCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Context) => void; + type ListParticipantsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListParticipantsResponse) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#updateContext}. + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#updateParticipant}. * @param error Error, if any - * @param [response] Context + * @param [response] Participant */ - type UpdateContextCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Context) => void; + type UpdateParticipantCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Participant) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#deleteContext}. + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#analyzeContent}. * @param error Error, if any - * @param [response] Empty + * @param [response] AnalyzeContentResponse */ - type DeleteContextCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + type AnalyzeContentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.AnalyzeContentResponse) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#deleteAllContexts}. + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#streamingAnalyzeContent}. * @param error Error, if any - * @param [response] Empty + * @param [response] StreamingAnalyzeContentResponse */ - type DeleteAllContextsCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } - - /** Properties of a Context. */ - interface IContext { + type StreamingAnalyzeContentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse) => void; - /** Context name */ + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#suggestArticles}. + * @param error Error, if any + * @param [response] SuggestArticlesResponse + */ + type SuggestArticlesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.SuggestArticlesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#suggestFaqAnswers}. + * @param error Error, if any + * @param [response] SuggestFaqAnswersResponse + */ + type SuggestFaqAnswersCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.SuggestFaqAnswersResponse) => void; + } + + /** Properties of a Participant. */ + interface IParticipant { + + /** Participant name */ name?: (string|null); - /** Context lifespanCount */ - lifespanCount?: (number|null); + /** Participant role */ + role?: (google.cloud.dialogflow.v2.Participant.Role|keyof typeof google.cloud.dialogflow.v2.Participant.Role|null); - /** Context parameters */ - parameters?: (google.protobuf.IStruct|null); + /** Participant sipRecordingMediaLabel */ + sipRecordingMediaLabel?: (string|null); } - /** Represents a Context. */ - class Context implements IContext { + /** Represents a Participant. */ + class Participant implements IParticipant { /** - * Constructs a new Context. + * Constructs a new Participant. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IContext); + constructor(properties?: google.cloud.dialogflow.v2.IParticipant); - /** Context name. */ + /** Participant name. */ public name: string; - /** Context lifespanCount. */ - public lifespanCount: number; + /** Participant role. */ + public role: (google.cloud.dialogflow.v2.Participant.Role|keyof typeof google.cloud.dialogflow.v2.Participant.Role); - /** Context parameters. */ - public parameters?: (google.protobuf.IStruct|null); + /** Participant sipRecordingMediaLabel. */ + public sipRecordingMediaLabel: string; /** - * Creates a new Context instance using the specified properties. + * Creates a new Participant instance using the specified properties. * @param [properties] Properties to set - * @returns Context instance + * @returns Participant instance */ - public static create(properties?: google.cloud.dialogflow.v2.IContext): google.cloud.dialogflow.v2.Context; + public static create(properties?: google.cloud.dialogflow.v2.IParticipant): google.cloud.dialogflow.v2.Participant; /** - * Encodes the specified Context message. Does not implicitly {@link google.cloud.dialogflow.v2.Context.verify|verify} messages. - * @param message Context message or plain object to encode + * Encodes the specified Participant message. Does not implicitly {@link google.cloud.dialogflow.v2.Participant.verify|verify} messages. + * @param message Participant message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IParticipant, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Context message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Context.verify|verify} messages. - * @param message Context message or plain object to encode + * Encodes the specified Participant message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Participant.verify|verify} messages. + * @param message Participant message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IParticipant, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Context message from the specified reader or buffer. + * Decodes a Participant message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Context + * @returns Participant * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Context; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Participant; /** - * Decodes a Context message from the specified reader or buffer, length delimited. + * Decodes a Participant message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Context + * @returns Participant * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Context; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Participant; /** - * Verifies a Context message. + * Verifies a Participant message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Context message from a plain object. Also converts values to their respective internal types. + * Creates a Participant message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Context + * @returns Participant */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Context; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Participant; /** - * Creates a plain object from a Context message. Also converts values to other types if specified. - * @param message Context + * Creates a plain object from a Participant message. Also converts values to other types if specified. + * @param message Participant * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.Context, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.Participant, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Context to JSON. + * Converts this Participant to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListContextsRequest. */ - interface IListContextsRequest { + namespace Participant { - /** ListContextsRequest parent */ - parent?: (string|null); + /** Role enum. */ + enum Role { + ROLE_UNSPECIFIED = 0, + HUMAN_AGENT = 1, + AUTOMATED_AGENT = 2, + END_USER = 3 + } + } - /** ListContextsRequest pageSize */ - pageSize?: (number|null); + /** Properties of a Message. */ + interface IMessage { - /** ListContextsRequest pageToken */ - pageToken?: (string|null); + /** Message name */ + name?: (string|null); + + /** Message content */ + content?: (string|null); + + /** Message languageCode */ + languageCode?: (string|null); + + /** Message participant */ + participant?: (string|null); + + /** Message participantRole */ + participantRole?: (google.cloud.dialogflow.v2.Participant.Role|keyof typeof google.cloud.dialogflow.v2.Participant.Role|null); + + /** Message createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Message messageAnnotation */ + messageAnnotation?: (google.cloud.dialogflow.v2.IMessageAnnotation|null); } - /** Represents a ListContextsRequest. */ - class ListContextsRequest implements IListContextsRequest { + /** Represents a Message. */ + class Message implements IMessage { /** - * Constructs a new ListContextsRequest. + * Constructs a new Message. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IListContextsRequest); + constructor(properties?: google.cloud.dialogflow.v2.IMessage); - /** ListContextsRequest parent. */ - public parent: string; + /** Message name. */ + public name: string; - /** ListContextsRequest pageSize. */ - public pageSize: number; + /** Message content. */ + public content: string; - /** ListContextsRequest pageToken. */ - public pageToken: string; + /** Message languageCode. */ + public languageCode: string; + + /** Message participant. */ + public participant: string; + + /** Message participantRole. */ + public participantRole: (google.cloud.dialogflow.v2.Participant.Role|keyof typeof google.cloud.dialogflow.v2.Participant.Role); + + /** Message createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Message messageAnnotation. */ + public messageAnnotation?: (google.cloud.dialogflow.v2.IMessageAnnotation|null); /** - * Creates a new ListContextsRequest instance using the specified properties. + * Creates a new Message instance using the specified properties. * @param [properties] Properties to set - * @returns ListContextsRequest instance + * @returns Message instance */ - public static create(properties?: google.cloud.dialogflow.v2.IListContextsRequest): google.cloud.dialogflow.v2.ListContextsRequest; + public static create(properties?: google.cloud.dialogflow.v2.IMessage): google.cloud.dialogflow.v2.Message; /** - * Encodes the specified ListContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsRequest.verify|verify} messages. - * @param message ListContextsRequest message or plain object to encode + * Encodes the specified Message message. Does not implicitly {@link google.cloud.dialogflow.v2.Message.verify|verify} messages. + * @param message Message message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IListContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsRequest.verify|verify} messages. - * @param message ListContextsRequest message or plain object to encode + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Message.verify|verify} messages. + * @param message Message message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IListContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListContextsRequest message from the specified reader or buffer. + * Decodes a Message message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListContextsRequest + * @returns Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListContextsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Message; /** - * Decodes a ListContextsRequest message from the specified reader or buffer, length delimited. + * Decodes a Message message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListContextsRequest + * @returns Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListContextsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Message; /** - * Verifies a ListContextsRequest message. + * Verifies a Message message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListContextsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Message message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListContextsRequest + * @returns Message */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListContextsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Message; /** - * Creates a plain object from a ListContextsRequest message. Also converts values to other types if specified. - * @param message ListContextsRequest + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.ListContextsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListContextsRequest to JSON. + * Converts this Message to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListContextsResponse. */ - interface IListContextsResponse { + /** Properties of a CreateParticipantRequest. */ + interface ICreateParticipantRequest { - /** ListContextsResponse contexts */ - contexts?: (google.cloud.dialogflow.v2.IContext[]|null); + /** CreateParticipantRequest parent */ + parent?: (string|null); - /** ListContextsResponse nextPageToken */ - nextPageToken?: (string|null); + /** CreateParticipantRequest participant */ + participant?: (google.cloud.dialogflow.v2.IParticipant|null); } - /** Represents a ListContextsResponse. */ - class ListContextsResponse implements IListContextsResponse { + /** Represents a CreateParticipantRequest. */ + class CreateParticipantRequest implements ICreateParticipantRequest { /** - * Constructs a new ListContextsResponse. + * Constructs a new CreateParticipantRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IListContextsResponse); + constructor(properties?: google.cloud.dialogflow.v2.ICreateParticipantRequest); - /** ListContextsResponse contexts. */ - public contexts: google.cloud.dialogflow.v2.IContext[]; + /** CreateParticipantRequest parent. */ + public parent: string; - /** ListContextsResponse nextPageToken. */ - public nextPageToken: string; + /** CreateParticipantRequest participant. */ + public participant?: (google.cloud.dialogflow.v2.IParticipant|null); /** - * Creates a new ListContextsResponse instance using the specified properties. + * Creates a new CreateParticipantRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListContextsResponse instance + * @returns CreateParticipantRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.IListContextsResponse): google.cloud.dialogflow.v2.ListContextsResponse; + public static create(properties?: google.cloud.dialogflow.v2.ICreateParticipantRequest): google.cloud.dialogflow.v2.CreateParticipantRequest; /** - * Encodes the specified ListContextsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsResponse.verify|verify} messages. - * @param message ListContextsResponse message or plain object to encode + * Encodes the specified CreateParticipantRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateParticipantRequest.verify|verify} messages. + * @param message CreateParticipantRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IListContextsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ICreateParticipantRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListContextsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsResponse.verify|verify} messages. - * @param message ListContextsResponse message or plain object to encode + * Encodes the specified CreateParticipantRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateParticipantRequest.verify|verify} messages. + * @param message CreateParticipantRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IListContextsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateParticipantRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListContextsResponse message from the specified reader or buffer. + * Decodes a CreateParticipantRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListContextsResponse + * @returns CreateParticipantRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListContextsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateParticipantRequest; /** - * Decodes a ListContextsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateParticipantRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListContextsResponse + * @returns CreateParticipantRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListContextsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateParticipantRequest; /** - * Verifies a ListContextsResponse message. + * Verifies a CreateParticipantRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListContextsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateParticipantRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListContextsResponse + * @returns CreateParticipantRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListContextsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateParticipantRequest; /** - * Creates a plain object from a ListContextsResponse message. Also converts values to other types if specified. - * @param message ListContextsResponse + * Creates a plain object from a CreateParticipantRequest message. Also converts values to other types if specified. + * @param message CreateParticipantRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.ListContextsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.CreateParticipantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListContextsResponse to JSON. + * Converts this CreateParticipantRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetContextRequest. */ - interface IGetContextRequest { + /** Properties of a GetParticipantRequest. */ + interface IGetParticipantRequest { - /** GetContextRequest name */ + /** GetParticipantRequest name */ name?: (string|null); } - /** Represents a GetContextRequest. */ - class GetContextRequest implements IGetContextRequest { + /** Represents a GetParticipantRequest. */ + class GetParticipantRequest implements IGetParticipantRequest { /** - * Constructs a new GetContextRequest. + * Constructs a new GetParticipantRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IGetContextRequest); + constructor(properties?: google.cloud.dialogflow.v2.IGetParticipantRequest); - /** GetContextRequest name. */ + /** GetParticipantRequest name. */ public name: string; /** - * Creates a new GetContextRequest instance using the specified properties. + * Creates a new GetParticipantRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetContextRequest instance + * @returns GetParticipantRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.IGetContextRequest): google.cloud.dialogflow.v2.GetContextRequest; + public static create(properties?: google.cloud.dialogflow.v2.IGetParticipantRequest): google.cloud.dialogflow.v2.GetParticipantRequest; /** - * Encodes the specified GetContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetContextRequest.verify|verify} messages. - * @param message GetContextRequest message or plain object to encode + * Encodes the specified GetParticipantRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetParticipantRequest.verify|verify} messages. + * @param message GetParticipantRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IGetContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IGetParticipantRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetContextRequest.verify|verify} messages. - * @param message GetContextRequest message or plain object to encode + * Encodes the specified GetParticipantRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetParticipantRequest.verify|verify} messages. + * @param message GetParticipantRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetParticipantRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetContextRequest message from the specified reader or buffer. + * Decodes a GetParticipantRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetContextRequest + * @returns GetParticipantRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetContextRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetParticipantRequest; /** - * Decodes a GetContextRequest message from the specified reader or buffer, length delimited. + * Decodes a GetParticipantRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetContextRequest + * @returns GetParticipantRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetContextRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetParticipantRequest; /** - * Verifies a GetContextRequest message. + * Verifies a GetParticipantRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetParticipantRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetContextRequest + * @returns GetParticipantRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetContextRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetParticipantRequest; /** - * Creates a plain object from a GetContextRequest message. Also converts values to other types if specified. - * @param message GetContextRequest + * Creates a plain object from a GetParticipantRequest message. Also converts values to other types if specified. + * @param message GetParticipantRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.GetContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.GetParticipantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetContextRequest to JSON. + * Converts this GetParticipantRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateContextRequest. */ - interface ICreateContextRequest { + /** Properties of a ListParticipantsRequest. */ + interface IListParticipantsRequest { - /** CreateContextRequest parent */ + /** ListParticipantsRequest parent */ parent?: (string|null); - /** CreateContextRequest context */ - context?: (google.cloud.dialogflow.v2.IContext|null); + /** ListParticipantsRequest pageSize */ + pageSize?: (number|null); + + /** ListParticipantsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a CreateContextRequest. */ - class CreateContextRequest implements ICreateContextRequest { + /** Represents a ListParticipantsRequest. */ + class ListParticipantsRequest implements IListParticipantsRequest { /** - * Constructs a new CreateContextRequest. + * Constructs a new ListParticipantsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.ICreateContextRequest); + constructor(properties?: google.cloud.dialogflow.v2.IListParticipantsRequest); - /** CreateContextRequest parent. */ + /** ListParticipantsRequest parent. */ public parent: string; - /** CreateContextRequest context. */ - public context?: (google.cloud.dialogflow.v2.IContext|null); + /** ListParticipantsRequest pageSize. */ + public pageSize: number; + + /** ListParticipantsRequest pageToken. */ + public pageToken: string; /** - * Creates a new CreateContextRequest instance using the specified properties. + * Creates a new ListParticipantsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateContextRequest instance + * @returns ListParticipantsRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.ICreateContextRequest): google.cloud.dialogflow.v2.CreateContextRequest; + public static create(properties?: google.cloud.dialogflow.v2.IListParticipantsRequest): google.cloud.dialogflow.v2.ListParticipantsRequest; /** - * Encodes the specified CreateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateContextRequest.verify|verify} messages. - * @param message CreateContextRequest message or plain object to encode + * Encodes the specified ListParticipantsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListParticipantsRequest.verify|verify} messages. + * @param message ListParticipantsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.ICreateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IListParticipantsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateContextRequest.verify|verify} messages. - * @param message CreateContextRequest message or plain object to encode + * Encodes the specified ListParticipantsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListParticipantsRequest.verify|verify} messages. + * @param message ListParticipantsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListParticipantsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateContextRequest message from the specified reader or buffer. + * Decodes a ListParticipantsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateContextRequest + * @returns ListParticipantsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateContextRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListParticipantsRequest; /** - * Decodes a CreateContextRequest message from the specified reader or buffer, length delimited. + * Decodes a ListParticipantsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateContextRequest + * @returns ListParticipantsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateContextRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListParticipantsRequest; /** - * Verifies a CreateContextRequest message. + * Verifies a ListParticipantsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListParticipantsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateContextRequest + * @returns ListParticipantsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateContextRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListParticipantsRequest; /** - * Creates a plain object from a CreateContextRequest message. Also converts values to other types if specified. - * @param message CreateContextRequest + * Creates a plain object from a ListParticipantsRequest message. Also converts values to other types if specified. + * @param message ListParticipantsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.CreateContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.ListParticipantsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateContextRequest to JSON. + * Converts this ListParticipantsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateContextRequest. */ - interface IUpdateContextRequest { + /** Properties of a ListParticipantsResponse. */ + interface IListParticipantsResponse { - /** UpdateContextRequest context */ - context?: (google.cloud.dialogflow.v2.IContext|null); + /** ListParticipantsResponse participants */ + participants?: (google.cloud.dialogflow.v2.IParticipant[]|null); - /** UpdateContextRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ListParticipantsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents an UpdateContextRequest. */ - class UpdateContextRequest implements IUpdateContextRequest { + /** Represents a ListParticipantsResponse. */ + class ListParticipantsResponse implements IListParticipantsResponse { /** - * Constructs a new UpdateContextRequest. + * Constructs a new ListParticipantsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IUpdateContextRequest); + constructor(properties?: google.cloud.dialogflow.v2.IListParticipantsResponse); - /** UpdateContextRequest context. */ - public context?: (google.cloud.dialogflow.v2.IContext|null); + /** ListParticipantsResponse participants. */ + public participants: google.cloud.dialogflow.v2.IParticipant[]; - /** UpdateContextRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ListParticipantsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new UpdateContextRequest instance using the specified properties. + * Creates a new ListParticipantsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateContextRequest instance + * @returns ListParticipantsResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2.IUpdateContextRequest): google.cloud.dialogflow.v2.UpdateContextRequest; + public static create(properties?: google.cloud.dialogflow.v2.IListParticipantsResponse): google.cloud.dialogflow.v2.ListParticipantsResponse; /** - * Encodes the specified UpdateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateContextRequest.verify|verify} messages. - * @param message UpdateContextRequest message or plain object to encode + * Encodes the specified ListParticipantsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListParticipantsResponse.verify|verify} messages. + * @param message ListParticipantsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IUpdateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IListParticipantsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateContextRequest.verify|verify} messages. - * @param message UpdateContextRequest message or plain object to encode + * Encodes the specified ListParticipantsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListParticipantsResponse.verify|verify} messages. + * @param message ListParticipantsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListParticipantsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateContextRequest message from the specified reader or buffer. + * Decodes a ListParticipantsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateContextRequest + * @returns ListParticipantsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateContextRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListParticipantsResponse; /** - * Decodes an UpdateContextRequest message from the specified reader or buffer, length delimited. + * Decodes a ListParticipantsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateContextRequest + * @returns ListParticipantsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateContextRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListParticipantsResponse; /** - * Verifies an UpdateContextRequest message. + * Verifies a ListParticipantsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListParticipantsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateContextRequest + * @returns ListParticipantsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateContextRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListParticipantsResponse; /** - * Creates a plain object from an UpdateContextRequest message. Also converts values to other types if specified. - * @param message UpdateContextRequest + * Creates a plain object from a ListParticipantsResponse message. Also converts values to other types if specified. + * @param message ListParticipantsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.UpdateContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.ListParticipantsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateContextRequest to JSON. + * Converts this ListParticipantsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteContextRequest. */ - interface IDeleteContextRequest { + /** Properties of an UpdateParticipantRequest. */ + interface IUpdateParticipantRequest { - /** DeleteContextRequest name */ - name?: (string|null); + /** UpdateParticipantRequest participant */ + participant?: (google.cloud.dialogflow.v2.IParticipant|null); + + /** UpdateParticipantRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a DeleteContextRequest. */ - class DeleteContextRequest implements IDeleteContextRequest { + /** Represents an UpdateParticipantRequest. */ + class UpdateParticipantRequest implements IUpdateParticipantRequest { /** - * Constructs a new DeleteContextRequest. + * Constructs a new UpdateParticipantRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IDeleteContextRequest); + constructor(properties?: google.cloud.dialogflow.v2.IUpdateParticipantRequest); - /** DeleteContextRequest name. */ - public name: string; + /** UpdateParticipantRequest participant. */ + public participant?: (google.cloud.dialogflow.v2.IParticipant|null); + + /** UpdateParticipantRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new DeleteContextRequest instance using the specified properties. + * Creates a new UpdateParticipantRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteContextRequest instance + * @returns UpdateParticipantRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.IDeleteContextRequest): google.cloud.dialogflow.v2.DeleteContextRequest; + public static create(properties?: google.cloud.dialogflow.v2.IUpdateParticipantRequest): google.cloud.dialogflow.v2.UpdateParticipantRequest; /** - * Encodes the specified DeleteContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteContextRequest.verify|verify} messages. - * @param message DeleteContextRequest message or plain object to encode + * Encodes the specified UpdateParticipantRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateParticipantRequest.verify|verify} messages. + * @param message UpdateParticipantRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IDeleteContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IUpdateParticipantRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteContextRequest.verify|verify} messages. - * @param message DeleteContextRequest message or plain object to encode + * Encodes the specified UpdateParticipantRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateParticipantRequest.verify|verify} messages. + * @param message UpdateParticipantRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateParticipantRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteContextRequest message from the specified reader or buffer. + * Decodes an UpdateParticipantRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteContextRequest + * @returns UpdateParticipantRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteContextRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateParticipantRequest; /** - * Decodes a DeleteContextRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateParticipantRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteContextRequest + * @returns UpdateParticipantRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteContextRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateParticipantRequest; /** - * Verifies a DeleteContextRequest message. + * Verifies an UpdateParticipantRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateParticipantRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteContextRequest + * @returns UpdateParticipantRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteContextRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateParticipantRequest; /** - * Creates a plain object from a DeleteContextRequest message. Also converts values to other types if specified. - * @param message DeleteContextRequest + * Creates a plain object from an UpdateParticipantRequest message. Also converts values to other types if specified. + * @param message UpdateParticipantRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.DeleteContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.UpdateParticipantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteContextRequest to JSON. + * Converts this UpdateParticipantRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteAllContextsRequest. */ - interface IDeleteAllContextsRequest { + /** Properties of an AnalyzeContentRequest. */ + interface IAnalyzeContentRequest { - /** DeleteAllContextsRequest parent */ - parent?: (string|null); + /** AnalyzeContentRequest participant */ + participant?: (string|null); + + /** AnalyzeContentRequest textInput */ + textInput?: (google.cloud.dialogflow.v2.ITextInput|null); + + /** AnalyzeContentRequest audioInput */ + audioInput?: (google.cloud.dialogflow.v2.IAudioInput|null); + + /** AnalyzeContentRequest eventInput */ + eventInput?: (google.cloud.dialogflow.v2.IEventInput|null); + + /** AnalyzeContentRequest replyAudioConfig */ + replyAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); + + /** AnalyzeContentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.v2.IQueryParameters|null); + + /** AnalyzeContentRequest requestId */ + requestId?: (string|null); } - /** Represents a DeleteAllContextsRequest. */ - class DeleteAllContextsRequest implements IDeleteAllContextsRequest { + /** Represents an AnalyzeContentRequest. */ + class AnalyzeContentRequest implements IAnalyzeContentRequest { /** - * Constructs a new DeleteAllContextsRequest. + * Constructs a new AnalyzeContentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IDeleteAllContextsRequest); + constructor(properties?: google.cloud.dialogflow.v2.IAnalyzeContentRequest); - /** DeleteAllContextsRequest parent. */ - public parent: string; + /** AnalyzeContentRequest participant. */ + public participant: string; + + /** AnalyzeContentRequest textInput. */ + public textInput?: (google.cloud.dialogflow.v2.ITextInput|null); + + /** AnalyzeContentRequest audioInput. */ + public audioInput?: (google.cloud.dialogflow.v2.IAudioInput|null); + + /** AnalyzeContentRequest eventInput. */ + public eventInput?: (google.cloud.dialogflow.v2.IEventInput|null); + + /** AnalyzeContentRequest replyAudioConfig. */ + public replyAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); + + /** AnalyzeContentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.v2.IQueryParameters|null); + + /** AnalyzeContentRequest requestId. */ + public requestId: string; + + /** AnalyzeContentRequest input. */ + public input?: ("textInput"|"audioInput"|"eventInput"); /** - * Creates a new DeleteAllContextsRequest instance using the specified properties. + * Creates a new AnalyzeContentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteAllContextsRequest instance + * @returns AnalyzeContentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.IDeleteAllContextsRequest): google.cloud.dialogflow.v2.DeleteAllContextsRequest; + public static create(properties?: google.cloud.dialogflow.v2.IAnalyzeContentRequest): google.cloud.dialogflow.v2.AnalyzeContentRequest; /** - * Encodes the specified DeleteAllContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteAllContextsRequest.verify|verify} messages. - * @param message DeleteAllContextsRequest message or plain object to encode + * Encodes the specified AnalyzeContentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.AnalyzeContentRequest.verify|verify} messages. + * @param message AnalyzeContentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IDeleteAllContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IAnalyzeContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteAllContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteAllContextsRequest.verify|verify} messages. - * @param message DeleteAllContextsRequest message or plain object to encode + * Encodes the specified AnalyzeContentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AnalyzeContentRequest.verify|verify} messages. + * @param message AnalyzeContentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteAllContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IAnalyzeContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteAllContextsRequest message from the specified reader or buffer. + * Decodes an AnalyzeContentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteAllContextsRequest + * @returns AnalyzeContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteAllContextsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.AnalyzeContentRequest; /** - * Decodes a DeleteAllContextsRequest message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeContentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteAllContextsRequest + * @returns AnalyzeContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteAllContextsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.AnalyzeContentRequest; /** - * Verifies a DeleteAllContextsRequest message. + * Verifies an AnalyzeContentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteAllContextsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeContentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteAllContextsRequest + * @returns AnalyzeContentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteAllContextsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.AnalyzeContentRequest; /** - * Creates a plain object from a DeleteAllContextsRequest message. Also converts values to other types if specified. - * @param message DeleteAllContextsRequest + * Creates a plain object from an AnalyzeContentRequest message. Also converts values to other types if specified. + * @param message AnalyzeContentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.DeleteAllContextsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.AnalyzeContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteAllContextsRequest to JSON. + * Converts this AnalyzeContentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents an EntityTypes */ - class EntityTypes extends $protobuf.rpc.Service { + /** Properties of a DtmfParameters. */ + interface IDtmfParameters { - /** - * Constructs a new EntityTypes service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** DtmfParameters acceptsDtmfInput */ + acceptsDtmfInput?: (boolean|null); + } - /** - * Creates new EntityTypes service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): EntityTypes; + /** Represents a DtmfParameters. */ + class DtmfParameters implements IDtmfParameters { /** - * Calls ListEntityTypes. - * @param request ListEntityTypesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEntityTypesResponse + * Constructs a new DtmfParameters. + * @param [properties] Properties to set */ - public listEntityTypes(request: google.cloud.dialogflow.v2.IListEntityTypesRequest, callback: google.cloud.dialogflow.v2.EntityTypes.ListEntityTypesCallback): void; + constructor(properties?: google.cloud.dialogflow.v2.IDtmfParameters); + + /** DtmfParameters acceptsDtmfInput. */ + public acceptsDtmfInput: boolean; /** - * Calls ListEntityTypes. - * @param request ListEntityTypesRequest message or plain object - * @returns Promise + * Creates a new DtmfParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns DtmfParameters instance */ - public listEntityTypes(request: google.cloud.dialogflow.v2.IListEntityTypesRequest): Promise; + public static create(properties?: google.cloud.dialogflow.v2.IDtmfParameters): google.cloud.dialogflow.v2.DtmfParameters; /** - * Calls GetEntityType. - * @param request GetEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EntityType + * Encodes the specified DtmfParameters message. Does not implicitly {@link google.cloud.dialogflow.v2.DtmfParameters.verify|verify} messages. + * @param message DtmfParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getEntityType(request: google.cloud.dialogflow.v2.IGetEntityTypeRequest, callback: google.cloud.dialogflow.v2.EntityTypes.GetEntityTypeCallback): void; + public static encode(message: google.cloud.dialogflow.v2.IDtmfParameters, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetEntityType. - * @param request GetEntityTypeRequest message or plain object - * @returns Promise + * Encodes the specified DtmfParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DtmfParameters.verify|verify} messages. + * @param message DtmfParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getEntityType(request: google.cloud.dialogflow.v2.IGetEntityTypeRequest): Promise; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDtmfParameters, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateEntityType. - * @param request CreateEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EntityType + * Decodes a DtmfParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DtmfParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createEntityType(request: google.cloud.dialogflow.v2.ICreateEntityTypeRequest, callback: google.cloud.dialogflow.v2.EntityTypes.CreateEntityTypeCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DtmfParameters; /** - * Calls CreateEntityType. - * @param request CreateEntityTypeRequest message or plain object - * @returns Promise + * Decodes a DtmfParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DtmfParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createEntityType(request: google.cloud.dialogflow.v2.ICreateEntityTypeRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DtmfParameters; /** - * Calls UpdateEntityType. - * @param request UpdateEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EntityType + * Verifies a DtmfParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public updateEntityType(request: google.cloud.dialogflow.v2.IUpdateEntityTypeRequest, callback: google.cloud.dialogflow.v2.EntityTypes.UpdateEntityTypeCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls UpdateEntityType. - * @param request UpdateEntityTypeRequest message or plain object - * @returns Promise + * Creates a DtmfParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DtmfParameters */ - public updateEntityType(request: google.cloud.dialogflow.v2.IUpdateEntityTypeRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DtmfParameters; /** - * Calls DeleteEntityType. - * @param request DeleteEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates a plain object from a DtmfParameters message. Also converts values to other types if specified. + * @param message DtmfParameters + * @param [options] Conversion options + * @returns Plain object */ - public deleteEntityType(request: google.cloud.dialogflow.v2.IDeleteEntityTypeRequest, callback: google.cloud.dialogflow.v2.EntityTypes.DeleteEntityTypeCallback): void; + public static toObject(message: google.cloud.dialogflow.v2.DtmfParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls DeleteEntityType. - * @param request DeleteEntityTypeRequest message or plain object - * @returns Promise + * Converts this DtmfParameters to JSON. + * @returns JSON object */ - public deleteEntityType(request: google.cloud.dialogflow.v2.IDeleteEntityTypeRequest): Promise; + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnalyzeContentResponse. */ + interface IAnalyzeContentResponse { + + /** AnalyzeContentResponse replyText */ + replyText?: (string|null); + + /** AnalyzeContentResponse replyAudio */ + replyAudio?: (google.cloud.dialogflow.v2.IOutputAudio|null); + + /** AnalyzeContentResponse automatedAgentReply */ + automatedAgentReply?: (google.cloud.dialogflow.v2.IAutomatedAgentReply|null); + + /** AnalyzeContentResponse message */ + message?: (google.cloud.dialogflow.v2.IMessage|null); + + /** AnalyzeContentResponse humanAgentSuggestionResults */ + humanAgentSuggestionResults?: (google.cloud.dialogflow.v2.ISuggestionResult[]|null); + + /** AnalyzeContentResponse endUserSuggestionResults */ + endUserSuggestionResults?: (google.cloud.dialogflow.v2.ISuggestionResult[]|null); + + /** AnalyzeContentResponse dtmfParameters */ + dtmfParameters?: (google.cloud.dialogflow.v2.IDtmfParameters|null); + } + + /** Represents an AnalyzeContentResponse. */ + class AnalyzeContentResponse implements IAnalyzeContentResponse { /** - * Calls BatchUpdateEntityTypes. - * @param request BatchUpdateEntityTypesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Constructs a new AnalyzeContentResponse. + * @param [properties] Properties to set */ - public batchUpdateEntityTypes(request: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, callback: google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypesCallback): void; + constructor(properties?: google.cloud.dialogflow.v2.IAnalyzeContentResponse); + + /** AnalyzeContentResponse replyText. */ + public replyText: string; + + /** AnalyzeContentResponse replyAudio. */ + public replyAudio?: (google.cloud.dialogflow.v2.IOutputAudio|null); + + /** AnalyzeContentResponse automatedAgentReply. */ + public automatedAgentReply?: (google.cloud.dialogflow.v2.IAutomatedAgentReply|null); + + /** AnalyzeContentResponse message. */ + public message?: (google.cloud.dialogflow.v2.IMessage|null); + + /** AnalyzeContentResponse humanAgentSuggestionResults. */ + public humanAgentSuggestionResults: google.cloud.dialogflow.v2.ISuggestionResult[]; + + /** AnalyzeContentResponse endUserSuggestionResults. */ + public endUserSuggestionResults: google.cloud.dialogflow.v2.ISuggestionResult[]; + + /** AnalyzeContentResponse dtmfParameters. */ + public dtmfParameters?: (google.cloud.dialogflow.v2.IDtmfParameters|null); /** - * Calls BatchUpdateEntityTypes. - * @param request BatchUpdateEntityTypesRequest message or plain object - * @returns Promise + * Creates a new AnalyzeContentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeContentResponse instance */ - public batchUpdateEntityTypes(request: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest): Promise; + public static create(properties?: google.cloud.dialogflow.v2.IAnalyzeContentResponse): google.cloud.dialogflow.v2.AnalyzeContentResponse; /** - * Calls BatchDeleteEntityTypes. - * @param request BatchDeleteEntityTypesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Encodes the specified AnalyzeContentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.AnalyzeContentResponse.verify|verify} messages. + * @param message AnalyzeContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public batchDeleteEntityTypes(request: google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest, callback: google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntityTypesCallback): void; + public static encode(message: google.cloud.dialogflow.v2.IAnalyzeContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls BatchDeleteEntityTypes. - * @param request BatchDeleteEntityTypesRequest message or plain object - * @returns Promise + * Encodes the specified AnalyzeContentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AnalyzeContentResponse.verify|verify} messages. + * @param message AnalyzeContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public batchDeleteEntityTypes(request: google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest): Promise; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IAnalyzeContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls BatchCreateEntities. - * @param request BatchCreateEntitiesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Decodes an AnalyzeContentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public batchCreateEntities(request: google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, callback: google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntitiesCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.AnalyzeContentResponse; /** - * Calls BatchCreateEntities. - * @param request BatchCreateEntitiesRequest message or plain object - * @returns Promise + * Decodes an AnalyzeContentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public batchCreateEntities(request: google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest): Promise; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.AnalyzeContentResponse; /** - * Calls BatchUpdateEntities. - * @param request BatchUpdateEntitiesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Verifies an AnalyzeContentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public batchUpdateEntities(request: google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, callback: google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntitiesCallback): void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls BatchUpdateEntities. - * @param request BatchUpdateEntitiesRequest message or plain object - * @returns Promise + * Creates an AnalyzeContentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeContentResponse */ - public batchUpdateEntities(request: google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest): Promise; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.AnalyzeContentResponse; /** - * Calls BatchDeleteEntities. - * @param request BatchDeleteEntitiesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a plain object from an AnalyzeContentResponse message. Also converts values to other types if specified. + * @param message AnalyzeContentResponse + * @param [options] Conversion options + * @returns Plain object */ - public batchDeleteEntities(request: google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, callback: google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntitiesCallback): void; + public static toObject(message: google.cloud.dialogflow.v2.AnalyzeContentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls BatchDeleteEntities. - * @param request BatchDeleteEntitiesRequest message or plain object - * @returns Promise + * Converts this AnalyzeContentResponse to JSON. + * @returns JSON object */ - public batchDeleteEntities(request: google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest): Promise; + public toJSON(): { [k: string]: any }; } - namespace EntityTypes { + /** Properties of a StreamingAnalyzeContentRequest. */ + interface IStreamingAnalyzeContentRequest { - /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#listEntityTypes}. - * @param error Error, if any - * @param [response] ListEntityTypesResponse - */ - type ListEntityTypesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListEntityTypesResponse) => void; + /** StreamingAnalyzeContentRequest participant */ + participant?: (string|null); - /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#getEntityType}. - * @param error Error, if any - * @param [response] EntityType - */ - type GetEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.EntityType) => void; + /** StreamingAnalyzeContentRequest audioConfig */ + audioConfig?: (google.cloud.dialogflow.v2.IInputAudioConfig|null); - /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#createEntityType}. - * @param error Error, if any - * @param [response] EntityType - */ - type CreateEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.EntityType) => void; + /** StreamingAnalyzeContentRequest textConfig */ + textConfig?: (google.cloud.dialogflow.v2.IInputTextConfig|null); - /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#updateEntityType}. - * @param error Error, if any - * @param [response] EntityType - */ - type UpdateEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.EntityType) => void; + /** StreamingAnalyzeContentRequest replyAudioConfig */ + replyAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); - /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#deleteEntityType}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteEntityTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** StreamingAnalyzeContentRequest inputAudio */ + inputAudio?: (Uint8Array|string|null); - /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchUpdateEntityTypes}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchUpdateEntityTypesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** StreamingAnalyzeContentRequest inputText */ + inputText?: (string|null); - /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchDeleteEntityTypes}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchDeleteEntityTypesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** StreamingAnalyzeContentRequest inputDtmf */ + inputDtmf?: (google.cloud.dialogflow.v2.ITelephonyDtmfEvents|null); - /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchCreateEntities}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchCreateEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** StreamingAnalyzeContentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.v2.IQueryParameters|null); + } - /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchUpdateEntities}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchUpdateEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** Represents a StreamingAnalyzeContentRequest. */ + class StreamingAnalyzeContentRequest implements IStreamingAnalyzeContentRequest { /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchDeleteEntities}. - * @param error Error, if any - * @param [response] Operation + * Constructs a new StreamingAnalyzeContentRequest. + * @param [properties] Properties to set */ - type BatchDeleteEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an EntityType. */ - interface IEntityType { - - /** EntityType name */ - name?: (string|null); - - /** EntityType displayName */ - displayName?: (string|null); - - /** EntityType kind */ - kind?: (google.cloud.dialogflow.v2.EntityType.Kind|keyof typeof google.cloud.dialogflow.v2.EntityType.Kind|null); - - /** EntityType autoExpansionMode */ - autoExpansionMode?: (google.cloud.dialogflow.v2.EntityType.AutoExpansionMode|keyof typeof google.cloud.dialogflow.v2.EntityType.AutoExpansionMode|null); + constructor(properties?: google.cloud.dialogflow.v2.IStreamingAnalyzeContentRequest); - /** EntityType entities */ - entities?: (google.cloud.dialogflow.v2.EntityType.IEntity[]|null); + /** StreamingAnalyzeContentRequest participant. */ + public participant: string; - /** EntityType enableFuzzyExtraction */ - enableFuzzyExtraction?: (boolean|null); - } + /** StreamingAnalyzeContentRequest audioConfig. */ + public audioConfig?: (google.cloud.dialogflow.v2.IInputAudioConfig|null); - /** Represents an EntityType. */ - class EntityType implements IEntityType { + /** StreamingAnalyzeContentRequest textConfig. */ + public textConfig?: (google.cloud.dialogflow.v2.IInputTextConfig|null); - /** - * Constructs a new EntityType. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IEntityType); + /** StreamingAnalyzeContentRequest replyAudioConfig. */ + public replyAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); - /** EntityType name. */ - public name: string; + /** StreamingAnalyzeContentRequest inputAudio. */ + public inputAudio: (Uint8Array|string); - /** EntityType displayName. */ - public displayName: string; + /** StreamingAnalyzeContentRequest inputText. */ + public inputText: string; - /** EntityType kind. */ - public kind: (google.cloud.dialogflow.v2.EntityType.Kind|keyof typeof google.cloud.dialogflow.v2.EntityType.Kind); + /** StreamingAnalyzeContentRequest inputDtmf. */ + public inputDtmf?: (google.cloud.dialogflow.v2.ITelephonyDtmfEvents|null); - /** EntityType autoExpansionMode. */ - public autoExpansionMode: (google.cloud.dialogflow.v2.EntityType.AutoExpansionMode|keyof typeof google.cloud.dialogflow.v2.EntityType.AutoExpansionMode); + /** StreamingAnalyzeContentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.v2.IQueryParameters|null); - /** EntityType entities. */ - public entities: google.cloud.dialogflow.v2.EntityType.IEntity[]; + /** StreamingAnalyzeContentRequest config. */ + public config?: ("audioConfig"|"textConfig"); - /** EntityType enableFuzzyExtraction. */ - public enableFuzzyExtraction: boolean; + /** StreamingAnalyzeContentRequest input. */ + public input?: ("inputAudio"|"inputText"|"inputDtmf"); /** - * Creates a new EntityType instance using the specified properties. + * Creates a new StreamingAnalyzeContentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns EntityType instance + * @returns StreamingAnalyzeContentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.IEntityType): google.cloud.dialogflow.v2.EntityType; + public static create(properties?: google.cloud.dialogflow.v2.IStreamingAnalyzeContentRequest): google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest; /** - * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.verify|verify} messages. - * @param message EntityType message or plain object to encode + * Encodes the specified StreamingAnalyzeContentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.verify|verify} messages. + * @param message StreamingAnalyzeContentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IStreamingAnalyzeContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.verify|verify} messages. - * @param message EntityType message or plain object to encode + * Encodes the specified StreamingAnalyzeContentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.verify|verify} messages. + * @param message StreamingAnalyzeContentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IStreamingAnalyzeContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EntityType message from the specified reader or buffer. + * Decodes a StreamingAnalyzeContentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EntityType + * @returns StreamingAnalyzeContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.EntityType; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest; /** - * Decodes an EntityType message from the specified reader or buffer, length delimited. + * Decodes a StreamingAnalyzeContentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EntityType + * @returns StreamingAnalyzeContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.EntityType; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest; /** - * Verifies an EntityType message. + * Verifies a StreamingAnalyzeContentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an EntityType message from a plain object. Also converts values to their respective internal types. + * Creates a StreamingAnalyzeContentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EntityType + * @returns StreamingAnalyzeContentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.EntityType; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest; /** - * Creates a plain object from an EntityType message. Also converts values to other types if specified. - * @param message EntityType + * Creates a plain object from a StreamingAnalyzeContentRequest message. Also converts values to other types if specified. + * @param message StreamingAnalyzeContentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.EntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EntityType to JSON. + * Converts this StreamingAnalyzeContentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace EntityType { - - /** Properties of an Entity. */ - interface IEntity { - - /** Entity value */ - value?: (string|null); - - /** Entity synonyms */ - synonyms?: (string[]|null); - } - - /** Represents an Entity. */ - class Entity implements IEntity { - - /** - * Constructs a new Entity. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.EntityType.IEntity); - - /** Entity value. */ - public value: string; - - /** Entity synonyms. */ - public synonyms: string[]; - - /** - * Creates a new Entity instance using the specified properties. - * @param [properties] Properties to set - * @returns Entity instance - */ - public static create(properties?: google.cloud.dialogflow.v2.EntityType.IEntity): google.cloud.dialogflow.v2.EntityType.Entity; - - /** - * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.Entity.verify|verify} messages. - * @param message Entity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.EntityType.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.Entity.verify|verify} messages. - * @param message Entity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.EntityType.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a StreamingAnalyzeContentResponse. */ + interface IStreamingAnalyzeContentResponse { - /** - * Decodes an Entity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Entity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.EntityType.Entity; + /** StreamingAnalyzeContentResponse recognitionResult */ + recognitionResult?: (google.cloud.dialogflow.v2.IStreamingRecognitionResult|null); - /** - * Decodes an Entity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Entity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.EntityType.Entity; + /** StreamingAnalyzeContentResponse replyText */ + replyText?: (string|null); - /** - * Verifies an Entity message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** StreamingAnalyzeContentResponse replyAudio */ + replyAudio?: (google.cloud.dialogflow.v2.IOutputAudio|null); - /** - * Creates an Entity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Entity - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.EntityType.Entity; + /** StreamingAnalyzeContentResponse automatedAgentReply */ + automatedAgentReply?: (google.cloud.dialogflow.v2.IAutomatedAgentReply|null); - /** - * Creates a plain object from an Entity message. Also converts values to other types if specified. - * @param message Entity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.EntityType.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** StreamingAnalyzeContentResponse message */ + message?: (google.cloud.dialogflow.v2.IMessage|null); - /** - * Converts this Entity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** StreamingAnalyzeContentResponse humanAgentSuggestionResults */ + humanAgentSuggestionResults?: (google.cloud.dialogflow.v2.ISuggestionResult[]|null); - /** Kind enum. */ - enum Kind { - KIND_UNSPECIFIED = 0, - KIND_MAP = 1, - KIND_LIST = 2, - KIND_REGEXP = 3 - } + /** StreamingAnalyzeContentResponse endUserSuggestionResults */ + endUserSuggestionResults?: (google.cloud.dialogflow.v2.ISuggestionResult[]|null); - /** AutoExpansionMode enum. */ - enum AutoExpansionMode { - AUTO_EXPANSION_MODE_UNSPECIFIED = 0, - AUTO_EXPANSION_MODE_DEFAULT = 1 - } + /** StreamingAnalyzeContentResponse dtmfParameters */ + dtmfParameters?: (google.cloud.dialogflow.v2.IDtmfParameters|null); } - /** Properties of a ListEntityTypesRequest. */ - interface IListEntityTypesRequest { - - /** ListEntityTypesRequest parent */ - parent?: (string|null); + /** Represents a StreamingAnalyzeContentResponse. */ + class StreamingAnalyzeContentResponse implements IStreamingAnalyzeContentResponse { - /** ListEntityTypesRequest languageCode */ - languageCode?: (string|null); + /** + * Constructs a new StreamingAnalyzeContentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IStreamingAnalyzeContentResponse); - /** ListEntityTypesRequest pageSize */ - pageSize?: (number|null); + /** StreamingAnalyzeContentResponse recognitionResult. */ + public recognitionResult?: (google.cloud.dialogflow.v2.IStreamingRecognitionResult|null); - /** ListEntityTypesRequest pageToken */ - pageToken?: (string|null); - } + /** StreamingAnalyzeContentResponse replyText. */ + public replyText: string; - /** Represents a ListEntityTypesRequest. */ - class ListEntityTypesRequest implements IListEntityTypesRequest { + /** StreamingAnalyzeContentResponse replyAudio. */ + public replyAudio?: (google.cloud.dialogflow.v2.IOutputAudio|null); - /** - * Constructs a new ListEntityTypesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IListEntityTypesRequest); + /** StreamingAnalyzeContentResponse automatedAgentReply. */ + public automatedAgentReply?: (google.cloud.dialogflow.v2.IAutomatedAgentReply|null); - /** ListEntityTypesRequest parent. */ - public parent: string; + /** StreamingAnalyzeContentResponse message. */ + public message?: (google.cloud.dialogflow.v2.IMessage|null); - /** ListEntityTypesRequest languageCode. */ - public languageCode: string; + /** StreamingAnalyzeContentResponse humanAgentSuggestionResults. */ + public humanAgentSuggestionResults: google.cloud.dialogflow.v2.ISuggestionResult[]; - /** ListEntityTypesRequest pageSize. */ - public pageSize: number; + /** StreamingAnalyzeContentResponse endUserSuggestionResults. */ + public endUserSuggestionResults: google.cloud.dialogflow.v2.ISuggestionResult[]; - /** ListEntityTypesRequest pageToken. */ - public pageToken: string; + /** StreamingAnalyzeContentResponse dtmfParameters. */ + public dtmfParameters?: (google.cloud.dialogflow.v2.IDtmfParameters|null); /** - * Creates a new ListEntityTypesRequest instance using the specified properties. + * Creates a new StreamingAnalyzeContentResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListEntityTypesRequest instance + * @returns StreamingAnalyzeContentResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2.IListEntityTypesRequest): google.cloud.dialogflow.v2.ListEntityTypesRequest; + public static create(properties?: google.cloud.dialogflow.v2.IStreamingAnalyzeContentResponse): google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse; /** - * Encodes the specified ListEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesRequest.verify|verify} messages. - * @param message ListEntityTypesRequest message or plain object to encode + * Encodes the specified StreamingAnalyzeContentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.verify|verify} messages. + * @param message StreamingAnalyzeContentResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IListEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IStreamingAnalyzeContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesRequest.verify|verify} messages. - * @param message ListEntityTypesRequest message or plain object to encode + * Encodes the specified StreamingAnalyzeContentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.verify|verify} messages. + * @param message StreamingAnalyzeContentResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IListEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IStreamingAnalyzeContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListEntityTypesRequest message from the specified reader or buffer. + * Decodes a StreamingAnalyzeContentResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListEntityTypesRequest + * @returns StreamingAnalyzeContentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListEntityTypesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse; /** - * Decodes a ListEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes a StreamingAnalyzeContentResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListEntityTypesRequest + * @returns StreamingAnalyzeContentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListEntityTypesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse; /** - * Verifies a ListEntityTypesRequest message. + * Verifies a StreamingAnalyzeContentResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a StreamingAnalyzeContentResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListEntityTypesRequest + * @returns StreamingAnalyzeContentResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListEntityTypesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse; /** - * Creates a plain object from a ListEntityTypesRequest message. Also converts values to other types if specified. - * @param message ListEntityTypesRequest + * Creates a plain object from a StreamingAnalyzeContentResponse message. Also converts values to other types if specified. + * @param message StreamingAnalyzeContentResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.ListEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListEntityTypesRequest to JSON. + * Converts this StreamingAnalyzeContentResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListEntityTypesResponse. */ - interface IListEntityTypesResponse { + /** Properties of a SuggestArticlesRequest. */ + interface ISuggestArticlesRequest { - /** ListEntityTypesResponse entityTypes */ - entityTypes?: (google.cloud.dialogflow.v2.IEntityType[]|null); + /** SuggestArticlesRequest parent */ + parent?: (string|null); - /** ListEntityTypesResponse nextPageToken */ - nextPageToken?: (string|null); + /** SuggestArticlesRequest latestMessage */ + latestMessage?: (string|null); + + /** SuggestArticlesRequest contextSize */ + contextSize?: (number|null); } - /** Represents a ListEntityTypesResponse. */ - class ListEntityTypesResponse implements IListEntityTypesResponse { + /** Represents a SuggestArticlesRequest. */ + class SuggestArticlesRequest implements ISuggestArticlesRequest { /** - * Constructs a new ListEntityTypesResponse. + * Constructs a new SuggestArticlesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IListEntityTypesResponse); + constructor(properties?: google.cloud.dialogflow.v2.ISuggestArticlesRequest); - /** ListEntityTypesResponse entityTypes. */ - public entityTypes: google.cloud.dialogflow.v2.IEntityType[]; + /** SuggestArticlesRequest parent. */ + public parent: string; - /** ListEntityTypesResponse nextPageToken. */ - public nextPageToken: string; + /** SuggestArticlesRequest latestMessage. */ + public latestMessage: string; + + /** SuggestArticlesRequest contextSize. */ + public contextSize: number; /** - * Creates a new ListEntityTypesResponse instance using the specified properties. + * Creates a new SuggestArticlesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListEntityTypesResponse instance + * @returns SuggestArticlesRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.IListEntityTypesResponse): google.cloud.dialogflow.v2.ListEntityTypesResponse; + public static create(properties?: google.cloud.dialogflow.v2.ISuggestArticlesRequest): google.cloud.dialogflow.v2.SuggestArticlesRequest; /** - * Encodes the specified ListEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesResponse.verify|verify} messages. - * @param message ListEntityTypesResponse message or plain object to encode + * Encodes the specified SuggestArticlesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestArticlesRequest.verify|verify} messages. + * @param message SuggestArticlesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IListEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ISuggestArticlesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesResponse.verify|verify} messages. - * @param message ListEntityTypesResponse message or plain object to encode + * Encodes the specified SuggestArticlesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestArticlesRequest.verify|verify} messages. + * @param message SuggestArticlesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IListEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISuggestArticlesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListEntityTypesResponse message from the specified reader or buffer. + * Decodes a SuggestArticlesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListEntityTypesResponse + * @returns SuggestArticlesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListEntityTypesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SuggestArticlesRequest; /** - * Decodes a ListEntityTypesResponse message from the specified reader or buffer, length delimited. + * Decodes a SuggestArticlesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListEntityTypesResponse + * @returns SuggestArticlesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListEntityTypesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SuggestArticlesRequest; /** - * Verifies a ListEntityTypesResponse message. + * Verifies a SuggestArticlesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SuggestArticlesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListEntityTypesResponse + * @returns SuggestArticlesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListEntityTypesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SuggestArticlesRequest; /** - * Creates a plain object from a ListEntityTypesResponse message. Also converts values to other types if specified. - * @param message ListEntityTypesResponse + * Creates a plain object from a SuggestArticlesRequest message. Also converts values to other types if specified. + * @param message SuggestArticlesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.ListEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.SuggestArticlesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListEntityTypesResponse to JSON. + * Converts this SuggestArticlesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetEntityTypeRequest. */ - interface IGetEntityTypeRequest { + /** Properties of a SuggestArticlesResponse. */ + interface ISuggestArticlesResponse { - /** GetEntityTypeRequest name */ - name?: (string|null); + /** SuggestArticlesResponse articleAnswers */ + articleAnswers?: (google.cloud.dialogflow.v2.IArticleAnswer[]|null); - /** GetEntityTypeRequest languageCode */ - languageCode?: (string|null); + /** SuggestArticlesResponse latestMessage */ + latestMessage?: (string|null); + + /** SuggestArticlesResponse contextSize */ + contextSize?: (number|null); } - /** Represents a GetEntityTypeRequest. */ - class GetEntityTypeRequest implements IGetEntityTypeRequest { + /** Represents a SuggestArticlesResponse. */ + class SuggestArticlesResponse implements ISuggestArticlesResponse { /** - * Constructs a new GetEntityTypeRequest. + * Constructs a new SuggestArticlesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IGetEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2.ISuggestArticlesResponse); - /** GetEntityTypeRequest name. */ - public name: string; + /** SuggestArticlesResponse articleAnswers. */ + public articleAnswers: google.cloud.dialogflow.v2.IArticleAnswer[]; - /** GetEntityTypeRequest languageCode. */ - public languageCode: string; + /** SuggestArticlesResponse latestMessage. */ + public latestMessage: string; + + /** SuggestArticlesResponse contextSize. */ + public contextSize: number; /** - * Creates a new GetEntityTypeRequest instance using the specified properties. + * Creates a new SuggestArticlesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetEntityTypeRequest instance + * @returns SuggestArticlesResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2.IGetEntityTypeRequest): google.cloud.dialogflow.v2.GetEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2.ISuggestArticlesResponse): google.cloud.dialogflow.v2.SuggestArticlesResponse; /** - * Encodes the specified GetEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetEntityTypeRequest.verify|verify} messages. - * @param message GetEntityTypeRequest message or plain object to encode + * Encodes the specified SuggestArticlesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestArticlesResponse.verify|verify} messages. + * @param message SuggestArticlesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IGetEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ISuggestArticlesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetEntityTypeRequest.verify|verify} messages. - * @param message GetEntityTypeRequest message or plain object to encode + * Encodes the specified SuggestArticlesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestArticlesResponse.verify|verify} messages. + * @param message SuggestArticlesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISuggestArticlesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetEntityTypeRequest message from the specified reader or buffer. + * Decodes a SuggestArticlesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetEntityTypeRequest + * @returns SuggestArticlesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SuggestArticlesResponse; /** - * Decodes a GetEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a SuggestArticlesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetEntityTypeRequest + * @returns SuggestArticlesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SuggestArticlesResponse; /** - * Verifies a GetEntityTypeRequest message. + * Verifies a SuggestArticlesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SuggestArticlesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetEntityTypeRequest + * @returns SuggestArticlesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SuggestArticlesResponse; /** - * Creates a plain object from a GetEntityTypeRequest message. Also converts values to other types if specified. - * @param message GetEntityTypeRequest + * Creates a plain object from a SuggestArticlesResponse message. Also converts values to other types if specified. + * @param message SuggestArticlesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.GetEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.SuggestArticlesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetEntityTypeRequest to JSON. + * Converts this SuggestArticlesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateEntityTypeRequest. */ - interface ICreateEntityTypeRequest { + /** Properties of a SuggestFaqAnswersRequest. */ + interface ISuggestFaqAnswersRequest { - /** CreateEntityTypeRequest parent */ + /** SuggestFaqAnswersRequest parent */ parent?: (string|null); - /** CreateEntityTypeRequest entityType */ - entityType?: (google.cloud.dialogflow.v2.IEntityType|null); + /** SuggestFaqAnswersRequest latestMessage */ + latestMessage?: (string|null); - /** CreateEntityTypeRequest languageCode */ - languageCode?: (string|null); + /** SuggestFaqAnswersRequest contextSize */ + contextSize?: (number|null); } - /** Represents a CreateEntityTypeRequest. */ - class CreateEntityTypeRequest implements ICreateEntityTypeRequest { + /** Represents a SuggestFaqAnswersRequest. */ + class SuggestFaqAnswersRequest implements ISuggestFaqAnswersRequest { /** - * Constructs a new CreateEntityTypeRequest. + * Constructs a new SuggestFaqAnswersRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.ICreateEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest); - /** CreateEntityTypeRequest parent. */ + /** SuggestFaqAnswersRequest parent. */ public parent: string; - /** CreateEntityTypeRequest entityType. */ - public entityType?: (google.cloud.dialogflow.v2.IEntityType|null); + /** SuggestFaqAnswersRequest latestMessage. */ + public latestMessage: string; - /** CreateEntityTypeRequest languageCode. */ - public languageCode: string; + /** SuggestFaqAnswersRequest contextSize. */ + public contextSize: number; /** - * Creates a new CreateEntityTypeRequest instance using the specified properties. + * Creates a new SuggestFaqAnswersRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateEntityTypeRequest instance + * @returns SuggestFaqAnswersRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.ICreateEntityTypeRequest): google.cloud.dialogflow.v2.CreateEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest): google.cloud.dialogflow.v2.SuggestFaqAnswersRequest; /** - * Encodes the specified CreateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateEntityTypeRequest.verify|verify} messages. - * @param message CreateEntityTypeRequest message or plain object to encode + * Encodes the specified SuggestFaqAnswersRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.verify|verify} messages. + * @param message SuggestFaqAnswersRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.ICreateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateEntityTypeRequest.verify|verify} messages. - * @param message CreateEntityTypeRequest message or plain object to encode + * Encodes the specified SuggestFaqAnswersRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.verify|verify} messages. + * @param message SuggestFaqAnswersRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateEntityTypeRequest message from the specified reader or buffer. + * Decodes a SuggestFaqAnswersRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateEntityTypeRequest + * @returns SuggestFaqAnswersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SuggestFaqAnswersRequest; /** - * Decodes a CreateEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a SuggestFaqAnswersRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateEntityTypeRequest + * @returns SuggestFaqAnswersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SuggestFaqAnswersRequest; /** - * Verifies a CreateEntityTypeRequest message. + * Verifies a SuggestFaqAnswersRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SuggestFaqAnswersRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateEntityTypeRequest + * @returns SuggestFaqAnswersRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SuggestFaqAnswersRequest; /** - * Creates a plain object from a CreateEntityTypeRequest message. Also converts values to other types if specified. - * @param message CreateEntityTypeRequest + * Creates a plain object from a SuggestFaqAnswersRequest message. Also converts values to other types if specified. + * @param message SuggestFaqAnswersRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.CreateEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.SuggestFaqAnswersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateEntityTypeRequest to JSON. + * Converts this SuggestFaqAnswersRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateEntityTypeRequest. */ - interface IUpdateEntityTypeRequest { + /** Properties of a SuggestFaqAnswersResponse. */ + interface ISuggestFaqAnswersResponse { - /** UpdateEntityTypeRequest entityType */ - entityType?: (google.cloud.dialogflow.v2.IEntityType|null); + /** SuggestFaqAnswersResponse faqAnswers */ + faqAnswers?: (google.cloud.dialogflow.v2.IFaqAnswer[]|null); - /** UpdateEntityTypeRequest languageCode */ - languageCode?: (string|null); + /** SuggestFaqAnswersResponse latestMessage */ + latestMessage?: (string|null); - /** UpdateEntityTypeRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** SuggestFaqAnswersResponse contextSize */ + contextSize?: (number|null); } - /** Represents an UpdateEntityTypeRequest. */ - class UpdateEntityTypeRequest implements IUpdateEntityTypeRequest { + /** Represents a SuggestFaqAnswersResponse. */ + class SuggestFaqAnswersResponse implements ISuggestFaqAnswersResponse { /** - * Constructs a new UpdateEntityTypeRequest. + * Constructs a new SuggestFaqAnswersResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IUpdateEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse); - /** UpdateEntityTypeRequest entityType. */ - public entityType?: (google.cloud.dialogflow.v2.IEntityType|null); + /** SuggestFaqAnswersResponse faqAnswers. */ + public faqAnswers: google.cloud.dialogflow.v2.IFaqAnswer[]; - /** UpdateEntityTypeRequest languageCode. */ - public languageCode: string; + /** SuggestFaqAnswersResponse latestMessage. */ + public latestMessage: string; - /** UpdateEntityTypeRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** SuggestFaqAnswersResponse contextSize. */ + public contextSize: number; /** - * Creates a new UpdateEntityTypeRequest instance using the specified properties. + * Creates a new SuggestFaqAnswersResponse instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateEntityTypeRequest instance + * @returns SuggestFaqAnswersResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2.IUpdateEntityTypeRequest): google.cloud.dialogflow.v2.UpdateEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse): google.cloud.dialogflow.v2.SuggestFaqAnswersResponse; /** - * Encodes the specified UpdateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateEntityTypeRequest.verify|verify} messages. - * @param message UpdateEntityTypeRequest message or plain object to encode + * Encodes the specified SuggestFaqAnswersResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.verify|verify} messages. + * @param message SuggestFaqAnswersResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IUpdateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateEntityTypeRequest.verify|verify} messages. - * @param message UpdateEntityTypeRequest message or plain object to encode + * Encodes the specified SuggestFaqAnswersResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.verify|verify} messages. + * @param message SuggestFaqAnswersResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer. + * Decodes a SuggestFaqAnswersResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateEntityTypeRequest + * @returns SuggestFaqAnswersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SuggestFaqAnswersResponse; /** - * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a SuggestFaqAnswersResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateEntityTypeRequest + * @returns SuggestFaqAnswersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SuggestFaqAnswersResponse; /** - * Verifies an UpdateEntityTypeRequest message. + * Verifies a SuggestFaqAnswersResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SuggestFaqAnswersResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateEntityTypeRequest + * @returns SuggestFaqAnswersResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SuggestFaqAnswersResponse; /** - * Creates a plain object from an UpdateEntityTypeRequest message. Also converts values to other types if specified. - * @param message UpdateEntityTypeRequest + * Creates a plain object from a SuggestFaqAnswersResponse message. Also converts values to other types if specified. + * @param message SuggestFaqAnswersResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.UpdateEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.SuggestFaqAnswersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateEntityTypeRequest to JSON. + * Converts this SuggestFaqAnswersResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteEntityTypeRequest. */ - interface IDeleteEntityTypeRequest { + /** Properties of an AudioInput. */ + interface IAudioInput { - /** DeleteEntityTypeRequest name */ - name?: (string|null); + /** AudioInput config */ + config?: (google.cloud.dialogflow.v2.IInputAudioConfig|null); + + /** AudioInput audio */ + audio?: (Uint8Array|string|null); } - /** Represents a DeleteEntityTypeRequest. */ - class DeleteEntityTypeRequest implements IDeleteEntityTypeRequest { + /** Represents an AudioInput. */ + class AudioInput implements IAudioInput { /** - * Constructs a new DeleteEntityTypeRequest. + * Constructs a new AudioInput. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IDeleteEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2.IAudioInput); - /** DeleteEntityTypeRequest name. */ - public name: string; + /** AudioInput config. */ + public config?: (google.cloud.dialogflow.v2.IInputAudioConfig|null); + + /** AudioInput audio. */ + public audio: (Uint8Array|string); /** - * Creates a new DeleteEntityTypeRequest instance using the specified properties. + * Creates a new AudioInput instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteEntityTypeRequest instance + * @returns AudioInput instance */ - public static create(properties?: google.cloud.dialogflow.v2.IDeleteEntityTypeRequest): google.cloud.dialogflow.v2.DeleteEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2.IAudioInput): google.cloud.dialogflow.v2.AudioInput; /** - * Encodes the specified DeleteEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteEntityTypeRequest.verify|verify} messages. - * @param message DeleteEntityTypeRequest message or plain object to encode + * Encodes the specified AudioInput message. Does not implicitly {@link google.cloud.dialogflow.v2.AudioInput.verify|verify} messages. + * @param message AudioInput message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IDeleteEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IAudioInput, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteEntityTypeRequest.verify|verify} messages. - * @param message DeleteEntityTypeRequest message or plain object to encode + * Encodes the specified AudioInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AudioInput.verify|verify} messages. + * @param message AudioInput message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IAudioInput, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer. + * Decodes an AudioInput message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteEntityTypeRequest + * @returns AudioInput * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.AudioInput; /** - * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes an AudioInput message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteEntityTypeRequest + * @returns AudioInput * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.AudioInput; /** - * Verifies a DeleteEntityTypeRequest message. + * Verifies an AudioInput message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AudioInput message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteEntityTypeRequest + * @returns AudioInput */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.AudioInput; /** - * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. - * @param message DeleteEntityTypeRequest + * Creates a plain object from an AudioInput message. Also converts values to other types if specified. + * @param message AudioInput * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.DeleteEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.AudioInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteEntityTypeRequest to JSON. + * Converts this AudioInput to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchUpdateEntityTypesRequest. */ - interface IBatchUpdateEntityTypesRequest { - - /** BatchUpdateEntityTypesRequest parent */ - parent?: (string|null); - - /** BatchUpdateEntityTypesRequest entityTypeBatchUri */ - entityTypeBatchUri?: (string|null); - - /** BatchUpdateEntityTypesRequest entityTypeBatchInline */ - entityTypeBatchInline?: (google.cloud.dialogflow.v2.IEntityTypeBatch|null); + /** Properties of an OutputAudio. */ + interface IOutputAudio { - /** BatchUpdateEntityTypesRequest languageCode */ - languageCode?: (string|null); + /** OutputAudio config */ + config?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); - /** BatchUpdateEntityTypesRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** OutputAudio audio */ + audio?: (Uint8Array|string|null); } - /** Represents a BatchUpdateEntityTypesRequest. */ - class BatchUpdateEntityTypesRequest implements IBatchUpdateEntityTypesRequest { + /** Represents an OutputAudio. */ + class OutputAudio implements IOutputAudio { /** - * Constructs a new BatchUpdateEntityTypesRequest. + * Constructs a new OutputAudio. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest); - - /** BatchUpdateEntityTypesRequest parent. */ - public parent: string; - - /** BatchUpdateEntityTypesRequest entityTypeBatchUri. */ - public entityTypeBatchUri: string; + constructor(properties?: google.cloud.dialogflow.v2.IOutputAudio); - /** BatchUpdateEntityTypesRequest entityTypeBatchInline. */ - public entityTypeBatchInline?: (google.cloud.dialogflow.v2.IEntityTypeBatch|null); - - /** BatchUpdateEntityTypesRequest languageCode. */ - public languageCode: string; - - /** BatchUpdateEntityTypesRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** OutputAudio config. */ + public config?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); - /** BatchUpdateEntityTypesRequest entityTypeBatch. */ - public entityTypeBatch?: ("entityTypeBatchUri"|"entityTypeBatchInline"); + /** OutputAudio audio. */ + public audio: (Uint8Array|string); /** - * Creates a new BatchUpdateEntityTypesRequest instance using the specified properties. + * Creates a new OutputAudio instance using the specified properties. * @param [properties] Properties to set - * @returns BatchUpdateEntityTypesRequest instance + * @returns OutputAudio instance */ - public static create(properties?: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest): google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest; + public static create(properties?: google.cloud.dialogflow.v2.IOutputAudio): google.cloud.dialogflow.v2.OutputAudio; /** - * Encodes the specified BatchUpdateEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.verify|verify} messages. - * @param message BatchUpdateEntityTypesRequest message or plain object to encode + * Encodes the specified OutputAudio message. Does not implicitly {@link google.cloud.dialogflow.v2.OutputAudio.verify|verify} messages. + * @param message OutputAudio message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IOutputAudio, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchUpdateEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.verify|verify} messages. - * @param message BatchUpdateEntityTypesRequest message or plain object to encode + * Encodes the specified OutputAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.OutputAudio.verify|verify} messages. + * @param message OutputAudio message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IOutputAudio, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer. + * Decodes an OutputAudio message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchUpdateEntityTypesRequest + * @returns OutputAudio * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.OutputAudio; /** - * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes an OutputAudio message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchUpdateEntityTypesRequest + * @returns OutputAudio * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.OutputAudio; /** - * Verifies a BatchUpdateEntityTypesRequest message. + * Verifies an OutputAudio message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchUpdateEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an OutputAudio message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchUpdateEntityTypesRequest + * @returns OutputAudio */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.OutputAudio; /** - * Creates a plain object from a BatchUpdateEntityTypesRequest message. Also converts values to other types if specified. - * @param message BatchUpdateEntityTypesRequest + * Creates a plain object from an OutputAudio message. Also converts values to other types if specified. + * @param message OutputAudio * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.OutputAudio, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchUpdateEntityTypesRequest to JSON. + * Converts this OutputAudio to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchUpdateEntityTypesResponse. */ - interface IBatchUpdateEntityTypesResponse { + /** Properties of an AutomatedAgentReply. */ + interface IAutomatedAgentReply { - /** BatchUpdateEntityTypesResponse entityTypes */ - entityTypes?: (google.cloud.dialogflow.v2.IEntityType[]|null); + /** AutomatedAgentReply detectIntentResponse */ + detectIntentResponse?: (google.cloud.dialogflow.v2.IDetectIntentResponse|null); } - /** Represents a BatchUpdateEntityTypesResponse. */ - class BatchUpdateEntityTypesResponse implements IBatchUpdateEntityTypesResponse { + /** Represents an AutomatedAgentReply. */ + class AutomatedAgentReply implements IAutomatedAgentReply { /** - * Constructs a new BatchUpdateEntityTypesResponse. + * Constructs a new AutomatedAgentReply. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse); + constructor(properties?: google.cloud.dialogflow.v2.IAutomatedAgentReply); - /** BatchUpdateEntityTypesResponse entityTypes. */ - public entityTypes: google.cloud.dialogflow.v2.IEntityType[]; + /** AutomatedAgentReply detectIntentResponse. */ + public detectIntentResponse?: (google.cloud.dialogflow.v2.IDetectIntentResponse|null); /** - * Creates a new BatchUpdateEntityTypesResponse instance using the specified properties. + * Creates a new AutomatedAgentReply instance using the specified properties. * @param [properties] Properties to set - * @returns BatchUpdateEntityTypesResponse instance + * @returns AutomatedAgentReply instance */ - public static create(properties?: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse): google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse; + public static create(properties?: google.cloud.dialogflow.v2.IAutomatedAgentReply): google.cloud.dialogflow.v2.AutomatedAgentReply; /** - * Encodes the specified BatchUpdateEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.verify|verify} messages. - * @param message BatchUpdateEntityTypesResponse message or plain object to encode + * Encodes the specified AutomatedAgentReply message. Does not implicitly {@link google.cloud.dialogflow.v2.AutomatedAgentReply.verify|verify} messages. + * @param message AutomatedAgentReply message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IAutomatedAgentReply, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchUpdateEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.verify|verify} messages. - * @param message BatchUpdateEntityTypesResponse message or plain object to encode + * Encodes the specified AutomatedAgentReply message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AutomatedAgentReply.verify|verify} messages. + * @param message AutomatedAgentReply message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IAutomatedAgentReply, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer. + * Decodes an AutomatedAgentReply message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchUpdateEntityTypesResponse + * @returns AutomatedAgentReply * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.AutomatedAgentReply; /** - * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer, length delimited. + * Decodes an AutomatedAgentReply message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchUpdateEntityTypesResponse + * @returns AutomatedAgentReply * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.AutomatedAgentReply; /** - * Verifies a BatchUpdateEntityTypesResponse message. + * Verifies an AutomatedAgentReply message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchUpdateEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AutomatedAgentReply message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchUpdateEntityTypesResponse + * @returns AutomatedAgentReply */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.AutomatedAgentReply; /** - * Creates a plain object from a BatchUpdateEntityTypesResponse message. Also converts values to other types if specified. - * @param message BatchUpdateEntityTypesResponse + * Creates a plain object from an AutomatedAgentReply message. Also converts values to other types if specified. + * @param message AutomatedAgentReply * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.AutomatedAgentReply, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchUpdateEntityTypesResponse to JSON. + * Converts this AutomatedAgentReply to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchDeleteEntityTypesRequest. */ - interface IBatchDeleteEntityTypesRequest { + /** Properties of an ArticleAnswer. */ + interface IArticleAnswer { - /** BatchDeleteEntityTypesRequest parent */ - parent?: (string|null); + /** ArticleAnswer title */ + title?: (string|null); - /** BatchDeleteEntityTypesRequest entityTypeNames */ - entityTypeNames?: (string[]|null); + /** ArticleAnswer uri */ + uri?: (string|null); + + /** ArticleAnswer snippets */ + snippets?: (string[]|null); + + /** ArticleAnswer confidence */ + confidence?: (number|null); + + /** ArticleAnswer metadata */ + metadata?: ({ [k: string]: string }|null); + + /** ArticleAnswer answerRecord */ + answerRecord?: (string|null); } - /** Represents a BatchDeleteEntityTypesRequest. */ - class BatchDeleteEntityTypesRequest implements IBatchDeleteEntityTypesRequest { + /** Represents an ArticleAnswer. */ + class ArticleAnswer implements IArticleAnswer { /** - * Constructs a new BatchDeleteEntityTypesRequest. + * Constructs a new ArticleAnswer. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest); + constructor(properties?: google.cloud.dialogflow.v2.IArticleAnswer); - /** BatchDeleteEntityTypesRequest parent. */ - public parent: string; + /** ArticleAnswer title. */ + public title: string; - /** BatchDeleteEntityTypesRequest entityTypeNames. */ - public entityTypeNames: string[]; + /** ArticleAnswer uri. */ + public uri: string; + + /** ArticleAnswer snippets. */ + public snippets: string[]; + + /** ArticleAnswer confidence. */ + public confidence: number; + + /** ArticleAnswer metadata. */ + public metadata: { [k: string]: string }; + + /** ArticleAnswer answerRecord. */ + public answerRecord: string; /** - * Creates a new BatchDeleteEntityTypesRequest instance using the specified properties. + * Creates a new ArticleAnswer instance using the specified properties. * @param [properties] Properties to set - * @returns BatchDeleteEntityTypesRequest instance + * @returns ArticleAnswer instance */ - public static create(properties?: google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest): google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest; + public static create(properties?: google.cloud.dialogflow.v2.IArticleAnswer): google.cloud.dialogflow.v2.ArticleAnswer; /** - * Encodes the specified BatchDeleteEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest.verify|verify} messages. - * @param message BatchDeleteEntityTypesRequest message or plain object to encode + * Encodes the specified ArticleAnswer message. Does not implicitly {@link google.cloud.dialogflow.v2.ArticleAnswer.verify|verify} messages. + * @param message ArticleAnswer message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IArticleAnswer, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchDeleteEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest.verify|verify} messages. - * @param message BatchDeleteEntityTypesRequest message or plain object to encode + * Encodes the specified ArticleAnswer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ArticleAnswer.verify|verify} messages. + * @param message ArticleAnswer message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IArticleAnswer, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer. + * Decodes an ArticleAnswer message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchDeleteEntityTypesRequest + * @returns ArticleAnswer * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ArticleAnswer; /** - * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes an ArticleAnswer message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchDeleteEntityTypesRequest + * @returns ArticleAnswer * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ArticleAnswer; /** - * Verifies a BatchDeleteEntityTypesRequest message. + * Verifies an ArticleAnswer message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchDeleteEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ArticleAnswer message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchDeleteEntityTypesRequest + * @returns ArticleAnswer */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ArticleAnswer; /** - * Creates a plain object from a BatchDeleteEntityTypesRequest message. Also converts values to other types if specified. - * @param message BatchDeleteEntityTypesRequest + * Creates a plain object from an ArticleAnswer message. Also converts values to other types if specified. + * @param message ArticleAnswer * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.ArticleAnswer, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchDeleteEntityTypesRequest to JSON. + * Converts this ArticleAnswer to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchCreateEntitiesRequest. */ - interface IBatchCreateEntitiesRequest { + /** Properties of a FaqAnswer. */ + interface IFaqAnswer { - /** BatchCreateEntitiesRequest parent */ - parent?: (string|null); + /** FaqAnswer answer */ + answer?: (string|null); - /** BatchCreateEntitiesRequest entities */ - entities?: (google.cloud.dialogflow.v2.EntityType.IEntity[]|null); + /** FaqAnswer confidence */ + confidence?: (number|null); - /** BatchCreateEntitiesRequest languageCode */ - languageCode?: (string|null); + /** FaqAnswer question */ + question?: (string|null); + + /** FaqAnswer source */ + source?: (string|null); + + /** FaqAnswer metadata */ + metadata?: ({ [k: string]: string }|null); + + /** FaqAnswer answerRecord */ + answerRecord?: (string|null); } - /** Represents a BatchCreateEntitiesRequest. */ - class BatchCreateEntitiesRequest implements IBatchCreateEntitiesRequest { + /** Represents a FaqAnswer. */ + class FaqAnswer implements IFaqAnswer { /** - * Constructs a new BatchCreateEntitiesRequest. + * Constructs a new FaqAnswer. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest); + constructor(properties?: google.cloud.dialogflow.v2.IFaqAnswer); - /** BatchCreateEntitiesRequest parent. */ - public parent: string; + /** FaqAnswer answer. */ + public answer: string; - /** BatchCreateEntitiesRequest entities. */ - public entities: google.cloud.dialogflow.v2.EntityType.IEntity[]; + /** FaqAnswer confidence. */ + public confidence: number; - /** BatchCreateEntitiesRequest languageCode. */ - public languageCode: string; + /** FaqAnswer question. */ + public question: string; + + /** FaqAnswer source. */ + public source: string; + + /** FaqAnswer metadata. */ + public metadata: { [k: string]: string }; + + /** FaqAnswer answerRecord. */ + public answerRecord: string; /** - * Creates a new BatchCreateEntitiesRequest instance using the specified properties. + * Creates a new FaqAnswer instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateEntitiesRequest instance + * @returns FaqAnswer instance */ - public static create(properties?: google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest): google.cloud.dialogflow.v2.BatchCreateEntitiesRequest; + public static create(properties?: google.cloud.dialogflow.v2.IFaqAnswer): google.cloud.dialogflow.v2.FaqAnswer; /** - * Encodes the specified BatchCreateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.verify|verify} messages. - * @param message BatchCreateEntitiesRequest message or plain object to encode + * Encodes the specified FaqAnswer message. Does not implicitly {@link google.cloud.dialogflow.v2.FaqAnswer.verify|verify} messages. + * @param message FaqAnswer message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IFaqAnswer, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.verify|verify} messages. - * @param message BatchCreateEntitiesRequest message or plain object to encode + * Encodes the specified FaqAnswer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.FaqAnswer.verify|verify} messages. + * @param message FaqAnswer message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IFaqAnswer, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer. + * Decodes a FaqAnswer message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateEntitiesRequest + * @returns FaqAnswer * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchCreateEntitiesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.FaqAnswer; /** - * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer, length delimited. + * Decodes a FaqAnswer message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateEntitiesRequest + * @returns FaqAnswer * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchCreateEntitiesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.FaqAnswer; /** - * Verifies a BatchCreateEntitiesRequest message. + * Verifies a FaqAnswer message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a FaqAnswer message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateEntitiesRequest + * @returns FaqAnswer */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchCreateEntitiesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.FaqAnswer; /** - * Creates a plain object from a BatchCreateEntitiesRequest message. Also converts values to other types if specified. - * @param message BatchCreateEntitiesRequest + * Creates a plain object from a FaqAnswer message. Also converts values to other types if specified. + * @param message FaqAnswer * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.BatchCreateEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.FaqAnswer, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateEntitiesRequest to JSON. + * Converts this FaqAnswer to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchUpdateEntitiesRequest. */ - interface IBatchUpdateEntitiesRequest { - - /** BatchUpdateEntitiesRequest parent */ - parent?: (string|null); + /** Properties of a SuggestionResult. */ + interface ISuggestionResult { - /** BatchUpdateEntitiesRequest entities */ - entities?: (google.cloud.dialogflow.v2.EntityType.IEntity[]|null); + /** SuggestionResult error */ + error?: (google.rpc.IStatus|null); - /** BatchUpdateEntitiesRequest languageCode */ - languageCode?: (string|null); + /** SuggestionResult suggestArticlesResponse */ + suggestArticlesResponse?: (google.cloud.dialogflow.v2.ISuggestArticlesResponse|null); - /** BatchUpdateEntitiesRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** SuggestionResult suggestFaqAnswersResponse */ + suggestFaqAnswersResponse?: (google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse|null); } - /** Represents a BatchUpdateEntitiesRequest. */ - class BatchUpdateEntitiesRequest implements IBatchUpdateEntitiesRequest { + /** Represents a SuggestionResult. */ + class SuggestionResult implements ISuggestionResult { /** - * Constructs a new BatchUpdateEntitiesRequest. + * Constructs a new SuggestionResult. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest); + constructor(properties?: google.cloud.dialogflow.v2.ISuggestionResult); - /** BatchUpdateEntitiesRequest parent. */ - public parent: string; + /** SuggestionResult error. */ + public error?: (google.rpc.IStatus|null); - /** BatchUpdateEntitiesRequest entities. */ - public entities: google.cloud.dialogflow.v2.EntityType.IEntity[]; + /** SuggestionResult suggestArticlesResponse. */ + public suggestArticlesResponse?: (google.cloud.dialogflow.v2.ISuggestArticlesResponse|null); - /** BatchUpdateEntitiesRequest languageCode. */ - public languageCode: string; + /** SuggestionResult suggestFaqAnswersResponse. */ + public suggestFaqAnswersResponse?: (google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse|null); - /** BatchUpdateEntitiesRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** SuggestionResult suggestionResponse. */ + public suggestionResponse?: ("error"|"suggestArticlesResponse"|"suggestFaqAnswersResponse"); /** - * Creates a new BatchUpdateEntitiesRequest instance using the specified properties. + * Creates a new SuggestionResult instance using the specified properties. * @param [properties] Properties to set - * @returns BatchUpdateEntitiesRequest instance + * @returns SuggestionResult instance */ - public static create(properties?: google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest): google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest; + public static create(properties?: google.cloud.dialogflow.v2.ISuggestionResult): google.cloud.dialogflow.v2.SuggestionResult; /** - * Encodes the specified BatchUpdateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.verify|verify} messages. - * @param message BatchUpdateEntitiesRequest message or plain object to encode + * Encodes the specified SuggestionResult message. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestionResult.verify|verify} messages. + * @param message SuggestionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ISuggestionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchUpdateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.verify|verify} messages. - * @param message BatchUpdateEntitiesRequest message or plain object to encode + * Encodes the specified SuggestionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestionResult.verify|verify} messages. + * @param message SuggestionResult message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISuggestionResult, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer. + * Decodes a SuggestionResult message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchUpdateEntitiesRequest + * @returns SuggestionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SuggestionResult; /** - * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer, length delimited. + * Decodes a SuggestionResult message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchUpdateEntitiesRequest + * @returns SuggestionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SuggestionResult; /** - * Verifies a BatchUpdateEntitiesRequest message. + * Verifies a SuggestionResult message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchUpdateEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SuggestionResult message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchUpdateEntitiesRequest + * @returns SuggestionResult */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SuggestionResult; /** - * Creates a plain object from a BatchUpdateEntitiesRequest message. Also converts values to other types if specified. - * @param message BatchUpdateEntitiesRequest + * Creates a plain object from a SuggestionResult message. Also converts values to other types if specified. + * @param message SuggestionResult * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.SuggestionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchUpdateEntitiesRequest to JSON. + * Converts this SuggestionResult to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchDeleteEntitiesRequest. */ - interface IBatchDeleteEntitiesRequest { - - /** BatchDeleteEntitiesRequest parent */ - parent?: (string|null); - - /** BatchDeleteEntitiesRequest entityValues */ - entityValues?: (string[]|null); + /** Properties of an InputTextConfig. */ + interface IInputTextConfig { - /** BatchDeleteEntitiesRequest languageCode */ + /** InputTextConfig languageCode */ languageCode?: (string|null); } - /** Represents a BatchDeleteEntitiesRequest. */ - class BatchDeleteEntitiesRequest implements IBatchDeleteEntitiesRequest { + /** Represents an InputTextConfig. */ + class InputTextConfig implements IInputTextConfig { /** - * Constructs a new BatchDeleteEntitiesRequest. + * Constructs a new InputTextConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest); - - /** BatchDeleteEntitiesRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.dialogflow.v2.IInputTextConfig); - /** BatchDeleteEntitiesRequest entityValues. */ - public entityValues: string[]; - - /** BatchDeleteEntitiesRequest languageCode. */ + /** InputTextConfig languageCode. */ public languageCode: string; /** - * Creates a new BatchDeleteEntitiesRequest instance using the specified properties. + * Creates a new InputTextConfig instance using the specified properties. * @param [properties] Properties to set - * @returns BatchDeleteEntitiesRequest instance + * @returns InputTextConfig instance */ - public static create(properties?: google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest): google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest; + public static create(properties?: google.cloud.dialogflow.v2.IInputTextConfig): google.cloud.dialogflow.v2.InputTextConfig; /** - * Encodes the specified BatchDeleteEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.verify|verify} messages. - * @param message BatchDeleteEntitiesRequest message or plain object to encode + * Encodes the specified InputTextConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.InputTextConfig.verify|verify} messages. + * @param message InputTextConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IInputTextConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchDeleteEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.verify|verify} messages. - * @param message BatchDeleteEntitiesRequest message or plain object to encode + * Encodes the specified InputTextConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.InputTextConfig.verify|verify} messages. + * @param message InputTextConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IInputTextConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer. + * Decodes an InputTextConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchDeleteEntitiesRequest + * @returns InputTextConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.InputTextConfig; /** - * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer, length delimited. + * Decodes an InputTextConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchDeleteEntitiesRequest + * @returns InputTextConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.InputTextConfig; /** - * Verifies a BatchDeleteEntitiesRequest message. + * Verifies an InputTextConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchDeleteEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an InputTextConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchDeleteEntitiesRequest + * @returns InputTextConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.InputTextConfig; /** - * Creates a plain object from a BatchDeleteEntitiesRequest message. Also converts values to other types if specified. - * @param message BatchDeleteEntitiesRequest + * Creates a plain object from an InputTextConfig message. Also converts values to other types if specified. + * @param message InputTextConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.InputTextConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchDeleteEntitiesRequest to JSON. + * Converts this InputTextConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an EntityTypeBatch. */ - interface IEntityTypeBatch { + /** Properties of an AnnotatedMessagePart. */ + interface IAnnotatedMessagePart { - /** EntityTypeBatch entityTypes */ - entityTypes?: (google.cloud.dialogflow.v2.IEntityType[]|null); + /** AnnotatedMessagePart text */ + text?: (string|null); + + /** AnnotatedMessagePart entityType */ + entityType?: (string|null); + + /** AnnotatedMessagePart formattedValue */ + formattedValue?: (google.protobuf.IValue|null); } - /** Represents an EntityTypeBatch. */ - class EntityTypeBatch implements IEntityTypeBatch { + /** Represents an AnnotatedMessagePart. */ + class AnnotatedMessagePart implements IAnnotatedMessagePart { /** - * Constructs a new EntityTypeBatch. + * Constructs a new AnnotatedMessagePart. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IEntityTypeBatch); + constructor(properties?: google.cloud.dialogflow.v2.IAnnotatedMessagePart); - /** EntityTypeBatch entityTypes. */ - public entityTypes: google.cloud.dialogflow.v2.IEntityType[]; + /** AnnotatedMessagePart text. */ + public text: string; + + /** AnnotatedMessagePart entityType. */ + public entityType: string; + + /** AnnotatedMessagePart formattedValue. */ + public formattedValue?: (google.protobuf.IValue|null); /** - * Creates a new EntityTypeBatch instance using the specified properties. + * Creates a new AnnotatedMessagePart instance using the specified properties. * @param [properties] Properties to set - * @returns EntityTypeBatch instance + * @returns AnnotatedMessagePart instance */ - public static create(properties?: google.cloud.dialogflow.v2.IEntityTypeBatch): google.cloud.dialogflow.v2.EntityTypeBatch; + public static create(properties?: google.cloud.dialogflow.v2.IAnnotatedMessagePart): google.cloud.dialogflow.v2.AnnotatedMessagePart; /** - * Encodes the specified EntityTypeBatch message. Does not implicitly {@link google.cloud.dialogflow.v2.EntityTypeBatch.verify|verify} messages. - * @param message EntityTypeBatch message or plain object to encode + * Encodes the specified AnnotatedMessagePart message. Does not implicitly {@link google.cloud.dialogflow.v2.AnnotatedMessagePart.verify|verify} messages. + * @param message AnnotatedMessagePart message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IEntityTypeBatch, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IAnnotatedMessagePart, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EntityTypeBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EntityTypeBatch.verify|verify} messages. - * @param message EntityTypeBatch message or plain object to encode + * Encodes the specified AnnotatedMessagePart message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AnnotatedMessagePart.verify|verify} messages. + * @param message AnnotatedMessagePart message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IEntityTypeBatch, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IAnnotatedMessagePart, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EntityTypeBatch message from the specified reader or buffer. + * Decodes an AnnotatedMessagePart message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EntityTypeBatch + * @returns AnnotatedMessagePart * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.EntityTypeBatch; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.AnnotatedMessagePart; /** - * Decodes an EntityTypeBatch message from the specified reader or buffer, length delimited. + * Decodes an AnnotatedMessagePart message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EntityTypeBatch + * @returns AnnotatedMessagePart * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.EntityTypeBatch; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.AnnotatedMessagePart; /** - * Verifies an EntityTypeBatch message. + * Verifies an AnnotatedMessagePart message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an EntityTypeBatch message from a plain object. Also converts values to their respective internal types. + * Creates an AnnotatedMessagePart message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EntityTypeBatch + * @returns AnnotatedMessagePart */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.EntityTypeBatch; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.AnnotatedMessagePart; /** - * Creates a plain object from an EntityTypeBatch message. Also converts values to other types if specified. - * @param message EntityTypeBatch + * Creates a plain object from an AnnotatedMessagePart message. Also converts values to other types if specified. + * @param message AnnotatedMessagePart * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.EntityTypeBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.AnnotatedMessagePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EntityTypeBatch to JSON. + * Converts this AnnotatedMessagePart to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents an Environments */ - class Environments extends $protobuf.rpc.Service { - - /** - * Constructs a new Environments service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Environments service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Environments; - - /** - * Calls ListEnvironments. - * @param request ListEnvironmentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEnvironmentsResponse - */ - public listEnvironments(request: google.cloud.dialogflow.v2.IListEnvironmentsRequest, callback: google.cloud.dialogflow.v2.Environments.ListEnvironmentsCallback): void; - - /** - * Calls ListEnvironments. - * @param request ListEnvironmentsRequest message or plain object - * @returns Promise - */ - public listEnvironments(request: google.cloud.dialogflow.v2.IListEnvironmentsRequest): Promise; - } - - namespace Environments { - - /** - * Callback as used by {@link google.cloud.dialogflow.v2.Environments#listEnvironments}. - * @param error Error, if any - * @param [response] ListEnvironmentsResponse - */ - type ListEnvironmentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListEnvironmentsResponse) => void; - } - - /** Properties of an Environment. */ - interface IEnvironment { - - /** Environment name */ - name?: (string|null); - - /** Environment description */ - description?: (string|null); - - /** Environment agentVersion */ - agentVersion?: (string|null); + /** Properties of a MessageAnnotation. */ + interface IMessageAnnotation { - /** Environment state */ - state?: (google.cloud.dialogflow.v2.Environment.State|keyof typeof google.cloud.dialogflow.v2.Environment.State|null); + /** MessageAnnotation parts */ + parts?: (google.cloud.dialogflow.v2.IAnnotatedMessagePart[]|null); - /** Environment updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** MessageAnnotation containEntities */ + containEntities?: (boolean|null); } - /** Represents an Environment. */ - class Environment implements IEnvironment { + /** Represents a MessageAnnotation. */ + class MessageAnnotation implements IMessageAnnotation { /** - * Constructs a new Environment. + * Constructs a new MessageAnnotation. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IEnvironment); - - /** Environment name. */ - public name: string; - - /** Environment description. */ - public description: string; + constructor(properties?: google.cloud.dialogflow.v2.IMessageAnnotation); - /** Environment agentVersion. */ - public agentVersion: string; - - /** Environment state. */ - public state: (google.cloud.dialogflow.v2.Environment.State|keyof typeof google.cloud.dialogflow.v2.Environment.State); + /** MessageAnnotation parts. */ + public parts: google.cloud.dialogflow.v2.IAnnotatedMessagePart[]; - /** Environment updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** MessageAnnotation containEntities. */ + public containEntities: boolean; /** - * Creates a new Environment instance using the specified properties. + * Creates a new MessageAnnotation instance using the specified properties. * @param [properties] Properties to set - * @returns Environment instance + * @returns MessageAnnotation instance */ - public static create(properties?: google.cloud.dialogflow.v2.IEnvironment): google.cloud.dialogflow.v2.Environment; + public static create(properties?: google.cloud.dialogflow.v2.IMessageAnnotation): google.cloud.dialogflow.v2.MessageAnnotation; /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dialogflow.v2.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode + * Encodes the specified MessageAnnotation message. Does not implicitly {@link google.cloud.dialogflow.v2.MessageAnnotation.verify|verify} messages. + * @param message MessageAnnotation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IMessageAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode + * Encodes the specified MessageAnnotation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.MessageAnnotation.verify|verify} messages. + * @param message MessageAnnotation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IMessageAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Environment message from the specified reader or buffer. + * Decodes a MessageAnnotation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Environment + * @returns MessageAnnotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Environment; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.MessageAnnotation; /** - * Decodes an Environment message from the specified reader or buffer, length delimited. + * Decodes a MessageAnnotation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Environment + * @returns MessageAnnotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Environment; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.MessageAnnotation; /** - * Verifies an Environment message. + * Verifies a MessageAnnotation message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * Creates a MessageAnnotation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Environment + * @returns MessageAnnotation */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Environment; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.MessageAnnotation; /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. - * @param message Environment + * Creates a plain object from a MessageAnnotation message. Also converts values to other types if specified. + * @param message MessageAnnotation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.MessageAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Environment to JSON. + * Converts this MessageAnnotation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Environment { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - STOPPED = 1, - LOADING = 2, - RUNNING = 3 - } - } - - /** Properties of a ListEnvironmentsRequest. */ - interface IListEnvironmentsRequest { - - /** ListEnvironmentsRequest parent */ - parent?: (string|null); + /** Properties of a SpeechContext. */ + interface ISpeechContext { - /** ListEnvironmentsRequest pageSize */ - pageSize?: (number|null); + /** SpeechContext phrases */ + phrases?: (string[]|null); - /** ListEnvironmentsRequest pageToken */ - pageToken?: (string|null); + /** SpeechContext boost */ + boost?: (number|null); } - /** Represents a ListEnvironmentsRequest. */ - class ListEnvironmentsRequest implements IListEnvironmentsRequest { + /** Represents a SpeechContext. */ + class SpeechContext implements ISpeechContext { /** - * Constructs a new ListEnvironmentsRequest. + * Constructs a new SpeechContext. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IListEnvironmentsRequest); - - /** ListEnvironmentsRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.dialogflow.v2.ISpeechContext); - /** ListEnvironmentsRequest pageSize. */ - public pageSize: number; + /** SpeechContext phrases. */ + public phrases: string[]; - /** ListEnvironmentsRequest pageToken. */ - public pageToken: string; + /** SpeechContext boost. */ + public boost: number; /** - * Creates a new ListEnvironmentsRequest instance using the specified properties. + * Creates a new SpeechContext instance using the specified properties. * @param [properties] Properties to set - * @returns ListEnvironmentsRequest instance + * @returns SpeechContext instance */ - public static create(properties?: google.cloud.dialogflow.v2.IListEnvironmentsRequest): google.cloud.dialogflow.v2.ListEnvironmentsRequest; + public static create(properties?: google.cloud.dialogflow.v2.ISpeechContext): google.cloud.dialogflow.v2.SpeechContext; /** - * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsRequest.verify|verify} messages. - * @param message ListEnvironmentsRequest message or plain object to encode + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsRequest.verify|verify} messages. - * @param message ListEnvironmentsRequest message or plain object to encode + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * Decodes a SpeechContext message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListEnvironmentsRequest + * @returns SpeechContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListEnvironmentsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SpeechContext; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListEnvironmentsRequest + * @returns SpeechContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListEnvironmentsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SpeechContext; /** - * Verifies a ListEnvironmentsRequest message. + * Verifies a SpeechContext message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListEnvironmentsRequest + * @returns SpeechContext */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListEnvironmentsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SpeechContext; /** - * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. - * @param message ListEnvironmentsRequest + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @param message SpeechContext * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.ListEnvironmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.SpeechContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListEnvironmentsRequest to JSON. + * Converts this SpeechContext to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListEnvironmentsResponse. */ - interface IListEnvironmentsResponse { + /** AudioEncoding enum. */ + enum AudioEncoding { + AUDIO_ENCODING_UNSPECIFIED = 0, + AUDIO_ENCODING_LINEAR_16 = 1, + AUDIO_ENCODING_FLAC = 2, + AUDIO_ENCODING_MULAW = 3, + AUDIO_ENCODING_AMR = 4, + AUDIO_ENCODING_AMR_WB = 5, + AUDIO_ENCODING_OGG_OPUS = 6, + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7 + } - /** ListEnvironmentsResponse environments */ - environments?: (google.cloud.dialogflow.v2.IEnvironment[]|null); + /** Properties of a SpeechWordInfo. */ + interface ISpeechWordInfo { - /** ListEnvironmentsResponse nextPageToken */ - nextPageToken?: (string|null); + /** SpeechWordInfo word */ + word?: (string|null); + + /** SpeechWordInfo startOffset */ + startOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo endOffset */ + endOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo confidence */ + confidence?: (number|null); } - /** Represents a ListEnvironmentsResponse. */ - class ListEnvironmentsResponse implements IListEnvironmentsResponse { + /** Represents a SpeechWordInfo. */ + class SpeechWordInfo implements ISpeechWordInfo { /** - * Constructs a new ListEnvironmentsResponse. + * Constructs a new SpeechWordInfo. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IListEnvironmentsResponse); + constructor(properties?: google.cloud.dialogflow.v2.ISpeechWordInfo); - /** ListEnvironmentsResponse environments. */ - public environments: google.cloud.dialogflow.v2.IEnvironment[]; + /** SpeechWordInfo word. */ + public word: string; - /** ListEnvironmentsResponse nextPageToken. */ - public nextPageToken: string; + /** SpeechWordInfo startOffset. */ + public startOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo endOffset. */ + public endOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo confidence. */ + public confidence: number; /** - * Creates a new ListEnvironmentsResponse instance using the specified properties. + * Creates a new SpeechWordInfo instance using the specified properties. * @param [properties] Properties to set - * @returns ListEnvironmentsResponse instance + * @returns SpeechWordInfo instance */ - public static create(properties?: google.cloud.dialogflow.v2.IListEnvironmentsResponse): google.cloud.dialogflow.v2.ListEnvironmentsResponse; + public static create(properties?: google.cloud.dialogflow.v2.ISpeechWordInfo): google.cloud.dialogflow.v2.SpeechWordInfo; /** - * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsResponse.verify|verify} messages. - * @param message ListEnvironmentsResponse message or plain object to encode + * Encodes the specified SpeechWordInfo message. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechWordInfo.verify|verify} messages. + * @param message SpeechWordInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ISpeechWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsResponse.verify|verify} messages. - * @param message ListEnvironmentsResponse message or plain object to encode + * Encodes the specified SpeechWordInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechWordInfo.verify|verify} messages. + * @param message SpeechWordInfo message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISpeechWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * Decodes a SpeechWordInfo message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListEnvironmentsResponse + * @returns SpeechWordInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListEnvironmentsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SpeechWordInfo; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * Decodes a SpeechWordInfo message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListEnvironmentsResponse + * @returns SpeechWordInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListEnvironmentsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SpeechWordInfo; /** - * Verifies a ListEnvironmentsResponse message. + * Verifies a SpeechWordInfo message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SpeechWordInfo message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListEnvironmentsResponse + * @returns SpeechWordInfo */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListEnvironmentsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SpeechWordInfo; /** - * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. - * @param message ListEnvironmentsResponse + * Creates a plain object from a SpeechWordInfo message. Also converts values to other types if specified. + * @param message SpeechWordInfo * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.ListEnvironmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.SpeechWordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListEnvironmentsResponse to JSON. + * Converts this SpeechWordInfo to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents an Intents */ - class Intents extends $protobuf.rpc.Service { + /** SpeechModelVariant enum. */ + enum SpeechModelVariant { + SPEECH_MODEL_VARIANT_UNSPECIFIED = 0, + USE_BEST_AVAILABLE = 1, + USE_STANDARD = 2, + USE_ENHANCED = 3 + } - /** - * Constructs a new Intents service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** Properties of an InputAudioConfig. */ + interface IInputAudioConfig { - /** - * Creates new Intents service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Intents; + /** InputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.dialogflow.v2.AudioEncoding|keyof typeof google.cloud.dialogflow.v2.AudioEncoding|null); - /** - * Calls ListIntents. - * @param request ListIntentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListIntentsResponse - */ - public listIntents(request: google.cloud.dialogflow.v2.IListIntentsRequest, callback: google.cloud.dialogflow.v2.Intents.ListIntentsCallback): void; + /** InputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** InputAudioConfig languageCode */ + languageCode?: (string|null); + + /** InputAudioConfig enableWordInfo */ + enableWordInfo?: (boolean|null); + + /** InputAudioConfig phraseHints */ + phraseHints?: (string[]|null); + + /** InputAudioConfig speechContexts */ + speechContexts?: (google.cloud.dialogflow.v2.ISpeechContext[]|null); + + /** InputAudioConfig model */ + model?: (string|null); + + /** InputAudioConfig modelVariant */ + modelVariant?: (google.cloud.dialogflow.v2.SpeechModelVariant|keyof typeof google.cloud.dialogflow.v2.SpeechModelVariant|null); + + /** InputAudioConfig singleUtterance */ + singleUtterance?: (boolean|null); + + /** InputAudioConfig disableNoSpeechRecognizedEvent */ + disableNoSpeechRecognizedEvent?: (boolean|null); + } + + /** Represents an InputAudioConfig. */ + class InputAudioConfig implements IInputAudioConfig { /** - * Calls ListIntents. - * @param request ListIntentsRequest message or plain object - * @returns Promise + * Constructs a new InputAudioConfig. + * @param [properties] Properties to set */ - public listIntents(request: google.cloud.dialogflow.v2.IListIntentsRequest): Promise; + constructor(properties?: google.cloud.dialogflow.v2.IInputAudioConfig); + + /** InputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.dialogflow.v2.AudioEncoding|keyof typeof google.cloud.dialogflow.v2.AudioEncoding); + + /** InputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** InputAudioConfig languageCode. */ + public languageCode: string; + + /** InputAudioConfig enableWordInfo. */ + public enableWordInfo: boolean; + + /** InputAudioConfig phraseHints. */ + public phraseHints: string[]; + + /** InputAudioConfig speechContexts. */ + public speechContexts: google.cloud.dialogflow.v2.ISpeechContext[]; + + /** InputAudioConfig model. */ + public model: string; + + /** InputAudioConfig modelVariant. */ + public modelVariant: (google.cloud.dialogflow.v2.SpeechModelVariant|keyof typeof google.cloud.dialogflow.v2.SpeechModelVariant); + + /** InputAudioConfig singleUtterance. */ + public singleUtterance: boolean; + + /** InputAudioConfig disableNoSpeechRecognizedEvent. */ + public disableNoSpeechRecognizedEvent: boolean; /** - * Calls GetIntent. - * @param request GetIntentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Intent + * Creates a new InputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputAudioConfig instance */ - public getIntent(request: google.cloud.dialogflow.v2.IGetIntentRequest, callback: google.cloud.dialogflow.v2.Intents.GetIntentCallback): void; + public static create(properties?: google.cloud.dialogflow.v2.IInputAudioConfig): google.cloud.dialogflow.v2.InputAudioConfig; /** - * Calls GetIntent. - * @param request GetIntentRequest message or plain object - * @returns Promise + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public getIntent(request: google.cloud.dialogflow.v2.IGetIntentRequest): Promise; + public static encode(message: google.cloud.dialogflow.v2.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateIntent. - * @param request CreateIntentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Intent + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public createIntent(request: google.cloud.dialogflow.v2.ICreateIntentRequest, callback: google.cloud.dialogflow.v2.Intents.CreateIntentCallback): void; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls CreateIntent. - * @param request CreateIntentRequest message or plain object - * @returns Promise + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public createIntent(request: google.cloud.dialogflow.v2.ICreateIntentRequest): Promise; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.InputAudioConfig; /** - * Calls UpdateIntent. - * @param request UpdateIntentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Intent + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateIntent(request: google.cloud.dialogflow.v2.IUpdateIntentRequest, callback: google.cloud.dialogflow.v2.Intents.UpdateIntentCallback): void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.InputAudioConfig; /** - * Calls UpdateIntent. - * @param request UpdateIntentRequest message or plain object - * @returns Promise + * Verifies an InputAudioConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - public updateIntent(request: google.cloud.dialogflow.v2.IUpdateIntentRequest): Promise; + public static verify(message: { [k: string]: any }): (string|null); /** - * Calls DeleteIntent. - * @param request DeleteIntentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputAudioConfig */ - public deleteIntent(request: google.cloud.dialogflow.v2.IDeleteIntentRequest, callback: google.cloud.dialogflow.v2.Intents.DeleteIntentCallback): void; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.InputAudioConfig; /** - * Calls DeleteIntent. - * @param request DeleteIntentRequest message or plain object - * @returns Promise + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @param message InputAudioConfig + * @param [options] Conversion options + * @returns Plain object */ - public deleteIntent(request: google.cloud.dialogflow.v2.IDeleteIntentRequest): Promise; + public static toObject(message: google.cloud.dialogflow.v2.InputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Calls BatchUpdateIntents. - * @param request BatchUpdateIntentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Converts this InputAudioConfig to JSON. + * @returns JSON object */ - public batchUpdateIntents(request: google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, callback: google.cloud.dialogflow.v2.Intents.BatchUpdateIntentsCallback): void; + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VoiceSelectionParams. */ + interface IVoiceSelectionParams { + + /** VoiceSelectionParams name */ + name?: (string|null); + + /** VoiceSelectionParams ssmlGender */ + ssmlGender?: (google.cloud.dialogflow.v2.SsmlVoiceGender|keyof typeof google.cloud.dialogflow.v2.SsmlVoiceGender|null); + } + + /** Represents a VoiceSelectionParams. */ + class VoiceSelectionParams implements IVoiceSelectionParams { /** - * Calls BatchUpdateIntents. - * @param request BatchUpdateIntentsRequest message or plain object - * @returns Promise + * Constructs a new VoiceSelectionParams. + * @param [properties] Properties to set */ - public batchUpdateIntents(request: google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest): Promise; + constructor(properties?: google.cloud.dialogflow.v2.IVoiceSelectionParams); + + /** VoiceSelectionParams name. */ + public name: string; + + /** VoiceSelectionParams ssmlGender. */ + public ssmlGender: (google.cloud.dialogflow.v2.SsmlVoiceGender|keyof typeof google.cloud.dialogflow.v2.SsmlVoiceGender); /** - * Calls BatchDeleteIntents. - * @param request BatchDeleteIntentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Creates a new VoiceSelectionParams instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceSelectionParams instance */ - public batchDeleteIntents(request: google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest, callback: google.cloud.dialogflow.v2.Intents.BatchDeleteIntentsCallback): void; + public static create(properties?: google.cloud.dialogflow.v2.IVoiceSelectionParams): google.cloud.dialogflow.v2.VoiceSelectionParams; /** - * Calls BatchDeleteIntents. - * @param request BatchDeleteIntentsRequest message or plain object - * @returns Promise + * Encodes the specified VoiceSelectionParams message. Does not implicitly {@link google.cloud.dialogflow.v2.VoiceSelectionParams.verify|verify} messages. + * @param message VoiceSelectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public batchDeleteIntents(request: google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest): Promise; - } - - namespace Intents { + public static encode(message: google.cloud.dialogflow.v2.IVoiceSelectionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#listIntents}. - * @param error Error, if any - * @param [response] ListIntentsResponse + * Encodes the specified VoiceSelectionParams message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.VoiceSelectionParams.verify|verify} messages. + * @param message VoiceSelectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListIntentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListIntentsResponse) => void; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IVoiceSelectionParams, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#getIntent}. - * @param error Error, if any - * @param [response] Intent + * Decodes a VoiceSelectionParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceSelectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type GetIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Intent) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.VoiceSelectionParams; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#createIntent}. - * @param error Error, if any - * @param [response] Intent + * Decodes a VoiceSelectionParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceSelectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type CreateIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Intent) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.VoiceSelectionParams; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#updateIntent}. - * @param error Error, if any - * @param [response] Intent + * Verifies a VoiceSelectionParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type UpdateIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Intent) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#deleteIntent}. - * @param error Error, if any - * @param [response] Empty + * Creates a VoiceSelectionParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceSelectionParams */ - type DeleteIntentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.VoiceSelectionParams; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#batchUpdateIntents}. - * @param error Error, if any - * @param [response] Operation + * Creates a plain object from a VoiceSelectionParams message. Also converts values to other types if specified. + * @param message VoiceSelectionParams + * @param [options] Conversion options + * @returns Plain object */ - type BatchUpdateIntentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static toObject(message: google.cloud.dialogflow.v2.VoiceSelectionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#batchDeleteIntents}. - * @param error Error, if any - * @param [response] Operation + * Converts this VoiceSelectionParams to JSON. + * @returns JSON object */ - type BatchDeleteIntentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of an Intent. */ - interface IIntent { - - /** Intent name */ - name?: (string|null); - - /** Intent displayName */ - displayName?: (string|null); - - /** Intent webhookState */ - webhookState?: (google.cloud.dialogflow.v2.Intent.WebhookState|keyof typeof google.cloud.dialogflow.v2.Intent.WebhookState|null); - - /** Intent priority */ - priority?: (number|null); - - /** Intent isFallback */ - isFallback?: (boolean|null); - - /** Intent mlDisabled */ - mlDisabled?: (boolean|null); - - /** Intent inputContextNames */ - inputContextNames?: (string[]|null); - - /** Intent events */ - events?: (string[]|null); - - /** Intent trainingPhrases */ - trainingPhrases?: (google.cloud.dialogflow.v2.Intent.ITrainingPhrase[]|null); - - /** Intent action */ - action?: (string|null); - - /** Intent outputContexts */ - outputContexts?: (google.cloud.dialogflow.v2.IContext[]|null); - - /** Intent resetContexts */ - resetContexts?: (boolean|null); - - /** Intent parameters */ - parameters?: (google.cloud.dialogflow.v2.Intent.IParameter[]|null); + /** Properties of a SynthesizeSpeechConfig. */ + interface ISynthesizeSpeechConfig { - /** Intent messages */ - messages?: (google.cloud.dialogflow.v2.Intent.IMessage[]|null); + /** SynthesizeSpeechConfig speakingRate */ + speakingRate?: (number|null); - /** Intent defaultResponsePlatforms */ - defaultResponsePlatforms?: (google.cloud.dialogflow.v2.Intent.Message.Platform[]|null); + /** SynthesizeSpeechConfig pitch */ + pitch?: (number|null); - /** Intent rootFollowupIntentName */ - rootFollowupIntentName?: (string|null); + /** SynthesizeSpeechConfig volumeGainDb */ + volumeGainDb?: (number|null); - /** Intent parentFollowupIntentName */ - parentFollowupIntentName?: (string|null); + /** SynthesizeSpeechConfig effectsProfileId */ + effectsProfileId?: (string[]|null); - /** Intent followupIntentInfo */ - followupIntentInfo?: (google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo[]|null); + /** SynthesizeSpeechConfig voice */ + voice?: (google.cloud.dialogflow.v2.IVoiceSelectionParams|null); } - /** Represents an Intent. */ - class Intent implements IIntent { + /** Represents a SynthesizeSpeechConfig. */ + class SynthesizeSpeechConfig implements ISynthesizeSpeechConfig { /** - * Constructs a new Intent. + * Constructs a new SynthesizeSpeechConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IIntent); - - /** Intent name. */ - public name: string; - - /** Intent displayName. */ - public displayName: string; - - /** Intent webhookState. */ - public webhookState: (google.cloud.dialogflow.v2.Intent.WebhookState|keyof typeof google.cloud.dialogflow.v2.Intent.WebhookState); - - /** Intent priority. */ - public priority: number; - - /** Intent isFallback. */ - public isFallback: boolean; - - /** Intent mlDisabled. */ - public mlDisabled: boolean; - - /** Intent inputContextNames. */ - public inputContextNames: string[]; - - /** Intent events. */ - public events: string[]; - - /** Intent trainingPhrases. */ - public trainingPhrases: google.cloud.dialogflow.v2.Intent.ITrainingPhrase[]; - - /** Intent action. */ - public action: string; - - /** Intent outputContexts. */ - public outputContexts: google.cloud.dialogflow.v2.IContext[]; - - /** Intent resetContexts. */ - public resetContexts: boolean; - - /** Intent parameters. */ - public parameters: google.cloud.dialogflow.v2.Intent.IParameter[]; + constructor(properties?: google.cloud.dialogflow.v2.ISynthesizeSpeechConfig); - /** Intent messages. */ - public messages: google.cloud.dialogflow.v2.Intent.IMessage[]; + /** SynthesizeSpeechConfig speakingRate. */ + public speakingRate: number; - /** Intent defaultResponsePlatforms. */ - public defaultResponsePlatforms: google.cloud.dialogflow.v2.Intent.Message.Platform[]; + /** SynthesizeSpeechConfig pitch. */ + public pitch: number; - /** Intent rootFollowupIntentName. */ - public rootFollowupIntentName: string; + /** SynthesizeSpeechConfig volumeGainDb. */ + public volumeGainDb: number; - /** Intent parentFollowupIntentName. */ - public parentFollowupIntentName: string; + /** SynthesizeSpeechConfig effectsProfileId. */ + public effectsProfileId: string[]; - /** Intent followupIntentInfo. */ - public followupIntentInfo: google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo[]; + /** SynthesizeSpeechConfig voice. */ + public voice?: (google.cloud.dialogflow.v2.IVoiceSelectionParams|null); /** - * Creates a new Intent instance using the specified properties. + * Creates a new SynthesizeSpeechConfig instance using the specified properties. * @param [properties] Properties to set - * @returns Intent instance + * @returns SynthesizeSpeechConfig instance */ - public static create(properties?: google.cloud.dialogflow.v2.IIntent): google.cloud.dialogflow.v2.Intent; + public static create(properties?: google.cloud.dialogflow.v2.ISynthesizeSpeechConfig): google.cloud.dialogflow.v2.SynthesizeSpeechConfig; /** - * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.verify|verify} messages. - * @param message Intent message or plain object to encode + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.verify|verify} messages. - * @param message Intent message or plain object to encode + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Intent message from the specified reader or buffer. + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Intent + * @returns SynthesizeSpeechConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SynthesizeSpeechConfig; /** - * Decodes an Intent message from the specified reader or buffer, length delimited. + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Intent + * @returns SynthesizeSpeechConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SynthesizeSpeechConfig; /** - * Verifies an Intent message. + * Verifies a SynthesizeSpeechConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Intent message from a plain object. Also converts values to their respective internal types. + * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Intent + * @returns SynthesizeSpeechConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SynthesizeSpeechConfig; /** - * Creates a plain object from an Intent message. Also converts values to other types if specified. - * @param message Intent + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @param message SynthesizeSpeechConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.Intent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.SynthesizeSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Intent to JSON. + * Converts this SynthesizeSpeechConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Intent { + /** SsmlVoiceGender enum. */ + enum SsmlVoiceGender { + SSML_VOICE_GENDER_UNSPECIFIED = 0, + SSML_VOICE_GENDER_MALE = 1, + SSML_VOICE_GENDER_FEMALE = 2, + SSML_VOICE_GENDER_NEUTRAL = 3 + } - /** Properties of a TrainingPhrase. */ - interface ITrainingPhrase { + /** Properties of an OutputAudioConfig. */ + interface IOutputAudioConfig { - /** TrainingPhrase name */ - name?: (string|null); + /** OutputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.dialogflow.v2.OutputAudioEncoding|keyof typeof google.cloud.dialogflow.v2.OutputAudioEncoding|null); - /** TrainingPhrase type */ - type?: (google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type|keyof typeof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type|null); + /** OutputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); - /** TrainingPhrase parts */ - parts?: (google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart[]|null); + /** OutputAudioConfig synthesizeSpeechConfig */ + synthesizeSpeechConfig?: (google.cloud.dialogflow.v2.ISynthesizeSpeechConfig|null); + } - /** TrainingPhrase timesAddedCount */ - timesAddedCount?: (number|null); - } + /** Represents an OutputAudioConfig. */ + class OutputAudioConfig implements IOutputAudioConfig { - /** Represents a TrainingPhrase. */ - class TrainingPhrase implements ITrainingPhrase { + /** + * Constructs a new OutputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IOutputAudioConfig); - /** - * Constructs a new TrainingPhrase. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.ITrainingPhrase); + /** OutputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.dialogflow.v2.OutputAudioEncoding|keyof typeof google.cloud.dialogflow.v2.OutputAudioEncoding); - /** TrainingPhrase name. */ - public name: string; + /** OutputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; - /** TrainingPhrase type. */ - public type: (google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type|keyof typeof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type); + /** OutputAudioConfig synthesizeSpeechConfig. */ + public synthesizeSpeechConfig?: (google.cloud.dialogflow.v2.ISynthesizeSpeechConfig|null); - /** TrainingPhrase parts. */ - public parts: google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart[]; + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputAudioConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IOutputAudioConfig): google.cloud.dialogflow.v2.OutputAudioConfig; - /** TrainingPhrase timesAddedCount. */ - public timesAddedCount: number; + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new TrainingPhrase instance using the specified properties. - * @param [properties] Properties to set - * @returns TrainingPhrase instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.ITrainingPhrase): google.cloud.dialogflow.v2.Intent.TrainingPhrase; + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified TrainingPhrase message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.verify|verify} messages. - * @param message TrainingPhrase message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.ITrainingPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.OutputAudioConfig; - /** - * Encodes the specified TrainingPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.verify|verify} messages. - * @param message TrainingPhrase message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.ITrainingPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.OutputAudioConfig; - /** - * Decodes a TrainingPhrase message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrainingPhrase - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.TrainingPhrase; + /** + * Verifies an OutputAudioConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a TrainingPhrase message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrainingPhrase - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.TrainingPhrase; + /** + * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.OutputAudioConfig; - /** - * Verifies a TrainingPhrase message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @param message OutputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.OutputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a TrainingPhrase message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrainingPhrase - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.TrainingPhrase; + /** + * Converts this OutputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a TrainingPhrase message. Also converts values to other types if specified. - * @param message TrainingPhrase - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.TrainingPhrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a TelephonyDtmfEvents. */ + interface ITelephonyDtmfEvents { - /** - * Converts this TrainingPhrase to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** TelephonyDtmfEvents dtmfEvents */ + dtmfEvents?: (google.cloud.dialogflow.v2.TelephonyDtmf[]|null); + } - namespace TrainingPhrase { + /** Represents a TelephonyDtmfEvents. */ + class TelephonyDtmfEvents implements ITelephonyDtmfEvents { - /** Properties of a Part. */ - interface IPart { + /** + * Constructs a new TelephonyDtmfEvents. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.ITelephonyDtmfEvents); - /** Part text */ - text?: (string|null); + /** TelephonyDtmfEvents dtmfEvents. */ + public dtmfEvents: google.cloud.dialogflow.v2.TelephonyDtmf[]; - /** Part entityType */ - entityType?: (string|null); + /** + * Creates a new TelephonyDtmfEvents instance using the specified properties. + * @param [properties] Properties to set + * @returns TelephonyDtmfEvents instance + */ + public static create(properties?: google.cloud.dialogflow.v2.ITelephonyDtmfEvents): google.cloud.dialogflow.v2.TelephonyDtmfEvents; - /** Part alias */ - alias?: (string|null); + /** + * Encodes the specified TelephonyDtmfEvents message. Does not implicitly {@link google.cloud.dialogflow.v2.TelephonyDtmfEvents.verify|verify} messages. + * @param message TelephonyDtmfEvents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.ITelephonyDtmfEvents, writer?: $protobuf.Writer): $protobuf.Writer; - /** Part userDefined */ - userDefined?: (boolean|null); - } + /** + * Encodes the specified TelephonyDtmfEvents message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.TelephonyDtmfEvents.verify|verify} messages. + * @param message TelephonyDtmfEvents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.ITelephonyDtmfEvents, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a Part. */ - class Part implements IPart { + /** + * Decodes a TelephonyDtmfEvents message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TelephonyDtmfEvents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.TelephonyDtmfEvents; - /** - * Constructs a new Part. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart); + /** + * Decodes a TelephonyDtmfEvents message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TelephonyDtmfEvents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.TelephonyDtmfEvents; - /** Part text. */ - public text: string; + /** + * Verifies a TelephonyDtmfEvents message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Part entityType. */ - public entityType: string; + /** + * Creates a TelephonyDtmfEvents message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TelephonyDtmfEvents + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.TelephonyDtmfEvents; - /** Part alias. */ - public alias: string; + /** + * Creates a plain object from a TelephonyDtmfEvents message. Also converts values to other types if specified. + * @param message TelephonyDtmfEvents + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.TelephonyDtmfEvents, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Part userDefined. */ - public userDefined: boolean; + /** + * Converts this TelephonyDtmfEvents to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new Part instance using the specified properties. - * @param [properties] Properties to set - * @returns Part instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart): google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part; + /** OutputAudioEncoding enum. */ + enum OutputAudioEncoding { + OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0, + OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1, + OUTPUT_AUDIO_ENCODING_MP3 = 2, + OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3 + } - /** - * Encodes the specified Part message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.verify|verify} messages. - * @param message Part message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a SpeechToTextConfig. */ + interface ISpeechToTextConfig { - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.verify|verify} messages. - * @param message Part message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + /** SpeechToTextConfig speechModelVariant */ + speechModelVariant?: (google.cloud.dialogflow.v2.SpeechModelVariant|keyof typeof google.cloud.dialogflow.v2.SpeechModelVariant|null); + } - /** - * Decodes a Part message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part; + /** Represents a SpeechToTextConfig. */ + class SpeechToTextConfig implements ISpeechToTextConfig { - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part; + /** + * Constructs a new SpeechToTextConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.ISpeechToTextConfig); - /** - * Verifies a Part message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** SpeechToTextConfig speechModelVariant. */ + public speechModelVariant: (google.cloud.dialogflow.v2.SpeechModelVariant|keyof typeof google.cloud.dialogflow.v2.SpeechModelVariant); - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Part - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part; + /** + * Creates a new SpeechToTextConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechToTextConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.ISpeechToTextConfig): google.cloud.dialogflow.v2.SpeechToTextConfig; - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @param message Part - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified SpeechToTextConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechToTextConfig.verify|verify} messages. + * @param message SpeechToTextConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.ISpeechToTextConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this Part to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified SpeechToTextConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechToTextConfig.verify|verify} messages. + * @param message SpeechToTextConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISpeechToTextConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - EXAMPLE = 1, - TEMPLATE = 2 - } - } + /** + * Decodes a SpeechToTextConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechToTextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SpeechToTextConfig; - /** Properties of a Parameter. */ - interface IParameter { + /** + * Decodes a SpeechToTextConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechToTextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SpeechToTextConfig; - /** Parameter name */ - name?: (string|null); + /** + * Verifies a SpeechToTextConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Parameter displayName */ - displayName?: (string|null); + /** + * Creates a SpeechToTextConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechToTextConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SpeechToTextConfig; - /** Parameter value */ - value?: (string|null); + /** + * Creates a plain object from a SpeechToTextConfig message. Also converts values to other types if specified. + * @param message SpeechToTextConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.SpeechToTextConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Parameter defaultValue */ - defaultValue?: (string|null); + /** + * Converts this SpeechToTextConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Parameter entityTypeDisplayName */ - entityTypeDisplayName?: (string|null); + /** TelephonyDtmf enum. */ + enum TelephonyDtmf { + TELEPHONY_DTMF_UNSPECIFIED = 0, + DTMF_ONE = 1, + DTMF_TWO = 2, + DTMF_THREE = 3, + DTMF_FOUR = 4, + DTMF_FIVE = 5, + DTMF_SIX = 6, + DTMF_SEVEN = 7, + DTMF_EIGHT = 8, + DTMF_NINE = 9, + DTMF_ZERO = 10, + DTMF_A = 11, + DTMF_B = 12, + DTMF_C = 13, + DTMF_D = 14, + DTMF_STAR = 15, + DTMF_POUND = 16 + } - /** Parameter mandatory */ - mandatory?: (boolean|null); + /** Represents a Sessions */ + class Sessions extends $protobuf.rpc.Service { - /** Parameter prompts */ - prompts?: (string[]|null); + /** + * Constructs a new Sessions service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** Parameter isList */ - isList?: (boolean|null); - } + /** + * Creates new Sessions service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Sessions; - /** Represents a Parameter. */ - class Parameter implements IParameter { + /** + * Calls DetectIntent. + * @param request DetectIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DetectIntentResponse + */ + public detectIntent(request: google.cloud.dialogflow.v2.IDetectIntentRequest, callback: google.cloud.dialogflow.v2.Sessions.DetectIntentCallback): void; - /** - * Constructs a new Parameter. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.IParameter); + /** + * Calls DetectIntent. + * @param request DetectIntentRequest message or plain object + * @returns Promise + */ + public detectIntent(request: google.cloud.dialogflow.v2.IDetectIntentRequest): Promise; - /** Parameter name. */ - public name: string; + /** + * Calls StreamingDetectIntent. + * @param request StreamingDetectIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingDetectIntentResponse + */ + public streamingDetectIntent(request: google.cloud.dialogflow.v2.IStreamingDetectIntentRequest, callback: google.cloud.dialogflow.v2.Sessions.StreamingDetectIntentCallback): void; - /** Parameter displayName. */ - public displayName: string; + /** + * Calls StreamingDetectIntent. + * @param request StreamingDetectIntentRequest message or plain object + * @returns Promise + */ + public streamingDetectIntent(request: google.cloud.dialogflow.v2.IStreamingDetectIntentRequest): Promise; + } - /** Parameter value. */ - public value: string; + namespace Sessions { - /** Parameter defaultValue. */ - public defaultValue: string; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Sessions#detectIntent}. + * @param error Error, if any + * @param [response] DetectIntentResponse + */ + type DetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.DetectIntentResponse) => void; - /** Parameter entityTypeDisplayName. */ - public entityTypeDisplayName: string; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Sessions#streamingDetectIntent}. + * @param error Error, if any + * @param [response] StreamingDetectIntentResponse + */ + type StreamingDetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.StreamingDetectIntentResponse) => void; + } - /** Parameter mandatory. */ - public mandatory: boolean; + /** Properties of a DetectIntentRequest. */ + interface IDetectIntentRequest { - /** Parameter prompts. */ - public prompts: string[]; + /** DetectIntentRequest session */ + session?: (string|null); - /** Parameter isList. */ - public isList: boolean; + /** DetectIntentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.v2.IQueryParameters|null); - /** - * Creates a new Parameter instance using the specified properties. - * @param [properties] Properties to set - * @returns Parameter instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.IParameter): google.cloud.dialogflow.v2.Intent.Parameter; + /** DetectIntentRequest queryInput */ + queryInput?: (google.cloud.dialogflow.v2.IQueryInput|null); - /** - * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Parameter.verify|verify} messages. - * @param message Parameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + /** DetectIntentRequest outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); - /** - * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Parameter.verify|verify} messages. - * @param message Parameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + /** DetectIntentRequest outputAudioConfigMask */ + outputAudioConfigMask?: (google.protobuf.IFieldMask|null); - /** - * Decodes a Parameter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Parameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Parameter; + /** DetectIntentRequest inputAudio */ + inputAudio?: (Uint8Array|string|null); + } - /** - * Decodes a Parameter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Parameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Parameter; + /** Represents a DetectIntentRequest. */ + class DetectIntentRequest implements IDetectIntentRequest { - /** - * Verifies a Parameter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new DetectIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IDetectIntentRequest); - /** - * Creates a Parameter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Parameter - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Parameter; + /** DetectIntentRequest session. */ + public session: string; - /** - * Creates a plain object from a Parameter message. Also converts values to other types if specified. - * @param message Parameter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Parameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** DetectIntentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.v2.IQueryParameters|null); - /** - * Converts this Parameter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** DetectIntentRequest queryInput. */ + public queryInput?: (google.cloud.dialogflow.v2.IQueryInput|null); - /** Properties of a Message. */ - interface IMessage { + /** DetectIntentRequest outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); - /** Message text */ - text?: (google.cloud.dialogflow.v2.Intent.Message.IText|null); + /** DetectIntentRequest outputAudioConfigMask. */ + public outputAudioConfigMask?: (google.protobuf.IFieldMask|null); - /** Message image */ - image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** DetectIntentRequest inputAudio. */ + public inputAudio: (Uint8Array|string); - /** Message quickReplies */ - quickReplies?: (google.cloud.dialogflow.v2.Intent.Message.IQuickReplies|null); + /** + * Creates a new DetectIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IDetectIntentRequest): google.cloud.dialogflow.v2.DetectIntentRequest; - /** Message card */ - card?: (google.cloud.dialogflow.v2.Intent.Message.ICard|null); + /** + * Encodes the specified DetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentRequest.verify|verify} messages. + * @param message DetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Message payload */ - payload?: (google.protobuf.IStruct|null); + /** + * Encodes the specified DetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentRequest.verify|verify} messages. + * @param message DetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Message simpleResponses */ - simpleResponses?: (google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses|null); + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DetectIntentRequest; - /** Message basicCard */ - basicCard?: (google.cloud.dialogflow.v2.Intent.Message.IBasicCard|null); + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DetectIntentRequest; - /** Message suggestions */ - suggestions?: (google.cloud.dialogflow.v2.Intent.Message.ISuggestions|null); + /** + * Verifies a DetectIntentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Message linkOutSuggestion */ - linkOutSuggestion?: (google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion|null); + /** + * Creates a DetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DetectIntentRequest; - /** Message listSelect */ - listSelect?: (google.cloud.dialogflow.v2.Intent.Message.IListSelect|null); + /** + * Creates a plain object from a DetectIntentRequest message. Also converts values to other types if specified. + * @param message DetectIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.DetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Message carouselSelect */ - carouselSelect?: (google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect|null); + /** + * Converts this DetectIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Message browseCarouselCard */ - browseCarouselCard?: (google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard|null); + /** Properties of a DetectIntentResponse. */ + interface IDetectIntentResponse { - /** Message tableCard */ - tableCard?: (google.cloud.dialogflow.v2.Intent.Message.ITableCard|null); + /** DetectIntentResponse responseId */ + responseId?: (string|null); - /** Message mediaContent */ - mediaContent?: (google.cloud.dialogflow.v2.Intent.Message.IMediaContent|null); + /** DetectIntentResponse queryResult */ + queryResult?: (google.cloud.dialogflow.v2.IQueryResult|null); - /** Message platform */ - platform?: (google.cloud.dialogflow.v2.Intent.Message.Platform|keyof typeof google.cloud.dialogflow.v2.Intent.Message.Platform|null); - } + /** DetectIntentResponse webhookStatus */ + webhookStatus?: (google.rpc.IStatus|null); - /** Represents a Message. */ - class Message implements IMessage { + /** DetectIntentResponse outputAudio */ + outputAudio?: (Uint8Array|string|null); - /** - * Constructs a new Message. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.IMessage); + /** DetectIntentResponse outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); + } - /** Message text. */ - public text?: (google.cloud.dialogflow.v2.Intent.Message.IText|null); + /** Represents a DetectIntentResponse. */ + class DetectIntentResponse implements IDetectIntentResponse { - /** Message image. */ - public image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** + * Constructs a new DetectIntentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IDetectIntentResponse); - /** Message quickReplies. */ - public quickReplies?: (google.cloud.dialogflow.v2.Intent.Message.IQuickReplies|null); + /** DetectIntentResponse responseId. */ + public responseId: string; - /** Message card. */ - public card?: (google.cloud.dialogflow.v2.Intent.Message.ICard|null); + /** DetectIntentResponse queryResult. */ + public queryResult?: (google.cloud.dialogflow.v2.IQueryResult|null); - /** Message payload. */ - public payload?: (google.protobuf.IStruct|null); + /** DetectIntentResponse webhookStatus. */ + public webhookStatus?: (google.rpc.IStatus|null); - /** Message simpleResponses. */ - public simpleResponses?: (google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses|null); + /** DetectIntentResponse outputAudio. */ + public outputAudio: (Uint8Array|string); - /** Message basicCard. */ - public basicCard?: (google.cloud.dialogflow.v2.Intent.Message.IBasicCard|null); + /** DetectIntentResponse outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); - /** Message suggestions. */ - public suggestions?: (google.cloud.dialogflow.v2.Intent.Message.ISuggestions|null); + /** + * Creates a new DetectIntentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectIntentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IDetectIntentResponse): google.cloud.dialogflow.v2.DetectIntentResponse; - /** Message linkOutSuggestion. */ - public linkOutSuggestion?: (google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion|null); + /** + * Encodes the specified DetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentResponse.verify|verify} messages. + * @param message DetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Message listSelect. */ - public listSelect?: (google.cloud.dialogflow.v2.Intent.Message.IListSelect|null); + /** + * Encodes the specified DetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentResponse.verify|verify} messages. + * @param message DetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Message carouselSelect. */ - public carouselSelect?: (google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect|null); + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DetectIntentResponse; - /** Message browseCarouselCard. */ - public browseCarouselCard?: (google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard|null); + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DetectIntentResponse; - /** Message tableCard. */ - public tableCard?: (google.cloud.dialogflow.v2.Intent.Message.ITableCard|null); + /** + * Verifies a DetectIntentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Message mediaContent. */ - public mediaContent?: (google.cloud.dialogflow.v2.Intent.Message.IMediaContent|null); + /** + * Creates a DetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectIntentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DetectIntentResponse; - /** Message platform. */ - public platform: (google.cloud.dialogflow.v2.Intent.Message.Platform|keyof typeof google.cloud.dialogflow.v2.Intent.Message.Platform); + /** + * Creates a plain object from a DetectIntentResponse message. Also converts values to other types if specified. + * @param message DetectIntentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.DetectIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Message message. */ - public message?: ("text"|"image"|"quickReplies"|"card"|"payload"|"simpleResponses"|"basicCard"|"suggestions"|"linkOutSuggestion"|"listSelect"|"carouselSelect"|"browseCarouselCard"|"tableCard"|"mediaContent"); + /** + * Converts this DetectIntentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new Message instance using the specified properties. - * @param [properties] Properties to set - * @returns Message instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.IMessage): google.cloud.dialogflow.v2.Intent.Message; + /** Properties of a QueryParameters. */ + interface IQueryParameters { - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + /** QueryParameters timeZone */ + timeZone?: (string|null); - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + /** QueryParameters geoLocation */ + geoLocation?: (google.type.ILatLng|null); - /** - * Decodes a Message message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message; + /** QueryParameters contexts */ + contexts?: (google.cloud.dialogflow.v2.IContext[]|null); - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message; + /** QueryParameters resetContexts */ + resetContexts?: (boolean|null); - /** - * Verifies a Message message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** QueryParameters sessionEntityTypes */ + sessionEntityTypes?: (google.cloud.dialogflow.v2.ISessionEntityType[]|null); - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Message - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message; + /** QueryParameters payload */ + payload?: (google.protobuf.IStruct|null); - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @param message Message - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** QueryParameters sentimentAnalysisRequestConfig */ + sentimentAnalysisRequestConfig?: (google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig|null); - /** - * Converts this Message to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** QueryParameters webhookHeaders */ + webhookHeaders?: ({ [k: string]: string }|null); + } - namespace Message { + /** Represents a QueryParameters. */ + class QueryParameters implements IQueryParameters { - /** Properties of a Text. */ - interface IText { + /** + * Constructs a new QueryParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IQueryParameters); - /** Text text */ - text?: (string[]|null); - } + /** QueryParameters timeZone. */ + public timeZone: string; - /** Represents a Text. */ - class Text implements IText { + /** QueryParameters geoLocation. */ + public geoLocation?: (google.type.ILatLng|null); - /** - * Constructs a new Text. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IText); + /** QueryParameters contexts. */ + public contexts: google.cloud.dialogflow.v2.IContext[]; - /** Text text. */ - public text: string[]; + /** QueryParameters resetContexts. */ + public resetContexts: boolean; - /** - * Creates a new Text instance using the specified properties. - * @param [properties] Properties to set - * @returns Text instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IText): google.cloud.dialogflow.v2.Intent.Message.Text; + /** QueryParameters sessionEntityTypes. */ + public sessionEntityTypes: google.cloud.dialogflow.v2.ISessionEntityType[]; - /** - * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Text.verify|verify} messages. - * @param message Text message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IText, writer?: $protobuf.Writer): $protobuf.Writer; + /** QueryParameters payload. */ + public payload?: (google.protobuf.IStruct|null); - /** - * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Text.verify|verify} messages. - * @param message Text message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IText, writer?: $protobuf.Writer): $protobuf.Writer; + /** QueryParameters sentimentAnalysisRequestConfig. */ + public sentimentAnalysisRequestConfig?: (google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig|null); - /** - * Decodes a Text message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Text - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.Text; + /** QueryParameters webhookHeaders. */ + public webhookHeaders: { [k: string]: string }; - /** - * Decodes a Text message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Text - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.Text; + /** + * Creates a new QueryParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryParameters instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IQueryParameters): google.cloud.dialogflow.v2.QueryParameters; - /** - * Verifies a Text message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified QueryParameters message. Does not implicitly {@link google.cloud.dialogflow.v2.QueryParameters.verify|verify} messages. + * @param message QueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a Text message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Text - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.Text; + /** + * Encodes the specified QueryParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.QueryParameters.verify|verify} messages. + * @param message QueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a Text message. Also converts values to other types if specified. - * @param message Text - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.Text, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Text to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a QueryParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.QueryParameters; - /** Properties of an Image. */ - interface IImage { + /** + * Decodes a QueryParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.QueryParameters; - /** Image imageUri */ - imageUri?: (string|null); + /** + * Verifies a QueryParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Image accessibilityText */ - accessibilityText?: (string|null); - } + /** + * Creates a QueryParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.QueryParameters; - /** Represents an Image. */ - class Image implements IImage { + /** + * Creates a plain object from a QueryParameters message. Also converts values to other types if specified. + * @param message QueryParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.QueryParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new Image. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IImage); + /** + * Converts this QueryParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Image imageUri. */ - public imageUri: string; + /** Properties of a QueryInput. */ + interface IQueryInput { - /** Image accessibilityText. */ - public accessibilityText: string; + /** QueryInput audioConfig */ + audioConfig?: (google.cloud.dialogflow.v2.IInputAudioConfig|null); - /** - * Creates a new Image instance using the specified properties. - * @param [properties] Properties to set - * @returns Image instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IImage): google.cloud.dialogflow.v2.Intent.Message.Image; + /** QueryInput text */ + text?: (google.cloud.dialogflow.v2.ITextInput|null); - /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Image.verify|verify} messages. - * @param message Image message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + /** QueryInput event */ + event?: (google.cloud.dialogflow.v2.IEventInput|null); + } - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Image.verify|verify} messages. - * @param message Image message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a QueryInput. */ + class QueryInput implements IQueryInput { - /** - * Decodes an Image message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.Image; + /** + * Constructs a new QueryInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IQueryInput); - /** - * Decodes an Image message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.Image; + /** QueryInput audioConfig. */ + public audioConfig?: (google.cloud.dialogflow.v2.IInputAudioConfig|null); - /** - * Verifies an Image message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** QueryInput text. */ + public text?: (google.cloud.dialogflow.v2.ITextInput|null); - /** - * Creates an Image message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Image - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.Image; + /** QueryInput event. */ + public event?: (google.cloud.dialogflow.v2.IEventInput|null); - /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @param message Image - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** QueryInput input. */ + public input?: ("audioConfig"|"text"|"event"); - /** - * Converts this Image to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new QueryInput instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryInput instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IQueryInput): google.cloud.dialogflow.v2.QueryInput; - /** Properties of a QuickReplies. */ - interface IQuickReplies { + /** + * Encodes the specified QueryInput message. Does not implicitly {@link google.cloud.dialogflow.v2.QueryInput.verify|verify} messages. + * @param message QueryInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IQueryInput, writer?: $protobuf.Writer): $protobuf.Writer; - /** QuickReplies title */ - title?: (string|null); + /** + * Encodes the specified QueryInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.QueryInput.verify|verify} messages. + * @param message QueryInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IQueryInput, writer?: $protobuf.Writer): $protobuf.Writer; - /** QuickReplies quickReplies */ - quickReplies?: (string[]|null); - } + /** + * Decodes a QueryInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.QueryInput; - /** Represents a QuickReplies. */ - class QuickReplies implements IQuickReplies { + /** + * Decodes a QueryInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.QueryInput; - /** - * Constructs a new QuickReplies. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IQuickReplies); + /** + * Verifies a QueryInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** QuickReplies title. */ - public title: string; + /** + * Creates a QueryInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.QueryInput; - /** QuickReplies quickReplies. */ - public quickReplies: string[]; + /** + * Creates a plain object from a QueryInput message. Also converts values to other types if specified. + * @param message QueryInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.QueryInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new QuickReplies instance using the specified properties. - * @param [properties] Properties to set - * @returns QuickReplies instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IQuickReplies): google.cloud.dialogflow.v2.Intent.Message.QuickReplies; + /** + * Converts this QueryInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified QuickReplies message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.QuickReplies.verify|verify} messages. - * @param message QuickReplies message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IQuickReplies, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a QueryResult. */ + interface IQueryResult { - /** - * Encodes the specified QuickReplies message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.QuickReplies.verify|verify} messages. - * @param message QuickReplies message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IQuickReplies, writer?: $protobuf.Writer): $protobuf.Writer; + /** QueryResult queryText */ + queryText?: (string|null); - /** - * Decodes a QuickReplies message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuickReplies - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.QuickReplies; + /** QueryResult languageCode */ + languageCode?: (string|null); - /** - * Decodes a QuickReplies message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuickReplies - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.QuickReplies; + /** QueryResult speechRecognitionConfidence */ + speechRecognitionConfidence?: (number|null); - /** - * Verifies a QuickReplies message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** QueryResult action */ + action?: (string|null); - /** - * Creates a QuickReplies message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuickReplies - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.QuickReplies; + /** QueryResult parameters */ + parameters?: (google.protobuf.IStruct|null); - /** - * Creates a plain object from a QuickReplies message. Also converts values to other types if specified. - * @param message QuickReplies - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.QuickReplies, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** QueryResult allRequiredParamsPresent */ + allRequiredParamsPresent?: (boolean|null); - /** - * Converts this QuickReplies to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** QueryResult fulfillmentText */ + fulfillmentText?: (string|null); - /** Properties of a Card. */ - interface ICard { + /** QueryResult fulfillmentMessages */ + fulfillmentMessages?: (google.cloud.dialogflow.v2.Intent.IMessage[]|null); - /** Card title */ - title?: (string|null); + /** QueryResult webhookSource */ + webhookSource?: (string|null); - /** Card subtitle */ - subtitle?: (string|null); + /** QueryResult webhookPayload */ + webhookPayload?: (google.protobuf.IStruct|null); - /** Card imageUri */ - imageUri?: (string|null); + /** QueryResult outputContexts */ + outputContexts?: (google.cloud.dialogflow.v2.IContext[]|null); - /** Card buttons */ - buttons?: (google.cloud.dialogflow.v2.Intent.Message.Card.IButton[]|null); - } + /** QueryResult intent */ + intent?: (google.cloud.dialogflow.v2.IIntent|null); - /** Represents a Card. */ - class Card implements ICard { + /** QueryResult intentDetectionConfidence */ + intentDetectionConfidence?: (number|null); - /** - * Constructs a new Card. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ICard); + /** QueryResult diagnosticInfo */ + diagnosticInfo?: (google.protobuf.IStruct|null); - /** Card title. */ - public title: string; + /** QueryResult sentimentAnalysisResult */ + sentimentAnalysisResult?: (google.cloud.dialogflow.v2.ISentimentAnalysisResult|null); + } - /** Card subtitle. */ - public subtitle: string; + /** Represents a QueryResult. */ + class QueryResult implements IQueryResult { - /** Card imageUri. */ - public imageUri: string; + /** + * Constructs a new QueryResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IQueryResult); - /** Card buttons. */ - public buttons: google.cloud.dialogflow.v2.Intent.Message.Card.IButton[]; + /** QueryResult queryText. */ + public queryText: string; - /** - * Creates a new Card instance using the specified properties. - * @param [properties] Properties to set - * @returns Card instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ICard): google.cloud.dialogflow.v2.Intent.Message.Card; + /** QueryResult languageCode. */ + public languageCode: string; - /** - * Encodes the specified Card message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.verify|verify} messages. - * @param message Card message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ICard, writer?: $protobuf.Writer): $protobuf.Writer; + /** QueryResult speechRecognitionConfidence. */ + public speechRecognitionConfidence: number; - /** - * Encodes the specified Card message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.verify|verify} messages. - * @param message Card message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ICard, writer?: $protobuf.Writer): $protobuf.Writer; + /** QueryResult action. */ + public action: string; - /** - * Decodes a Card message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Card - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.Card; + /** QueryResult parameters. */ + public parameters?: (google.protobuf.IStruct|null); - /** - * Decodes a Card message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Card - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.Card; + /** QueryResult allRequiredParamsPresent. */ + public allRequiredParamsPresent: boolean; - /** - * Verifies a Card message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** QueryResult fulfillmentText. */ + public fulfillmentText: string; - /** - * Creates a Card message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Card - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.Card; + /** QueryResult fulfillmentMessages. */ + public fulfillmentMessages: google.cloud.dialogflow.v2.Intent.IMessage[]; - /** - * Creates a plain object from a Card message. Also converts values to other types if specified. - * @param message Card - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.Card, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** QueryResult webhookSource. */ + public webhookSource: string; - /** - * Converts this Card to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** QueryResult webhookPayload. */ + public webhookPayload?: (google.protobuf.IStruct|null); - namespace Card { + /** QueryResult outputContexts. */ + public outputContexts: google.cloud.dialogflow.v2.IContext[]; - /** Properties of a Button. */ - interface IButton { + /** QueryResult intent. */ + public intent?: (google.cloud.dialogflow.v2.IIntent|null); - /** Button text */ - text?: (string|null); + /** QueryResult intentDetectionConfidence. */ + public intentDetectionConfidence: number; - /** Button postback */ - postback?: (string|null); - } + /** QueryResult diagnosticInfo. */ + public diagnosticInfo?: (google.protobuf.IStruct|null); - /** Represents a Button. */ - class Button implements IButton { + /** QueryResult sentimentAnalysisResult. */ + public sentimentAnalysisResult?: (google.cloud.dialogflow.v2.ISentimentAnalysisResult|null); - /** - * Constructs a new Button. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.Card.IButton); + /** + * Creates a new QueryResult instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryResult instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IQueryResult): google.cloud.dialogflow.v2.QueryResult; - /** Button text. */ - public text: string; + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.dialogflow.v2.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** Button postback. */ - public postback: string; + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new Button instance using the specified properties. - * @param [properties] Properties to set - * @returns Button instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.Card.IButton): google.cloud.dialogflow.v2.Intent.Message.Card.Button; + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.QueryResult; - /** - * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.Button.verify|verify} messages. - * @param message Button message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.Card.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.QueryResult; - /** - * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.Button.verify|verify} messages. - * @param message Button message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.Card.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a QueryResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a Button message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.Card.Button; + /** + * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.QueryResult; - /** - * Decodes a Button message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.Card.Button; + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @param message QueryResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.QueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a Button message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this QueryResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a Button message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Button - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.Card.Button; + /** Properties of a StreamingDetectIntentRequest. */ + interface IStreamingDetectIntentRequest { - /** - * Creates a plain object from a Button message. Also converts values to other types if specified. - * @param message Button - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.Card.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** StreamingDetectIntentRequest session */ + session?: (string|null); - /** - * Converts this Button to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** StreamingDetectIntentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.v2.IQueryParameters|null); - /** Properties of a SimpleResponse. */ - interface ISimpleResponse { + /** StreamingDetectIntentRequest queryInput */ + queryInput?: (google.cloud.dialogflow.v2.IQueryInput|null); - /** SimpleResponse textToSpeech */ - textToSpeech?: (string|null); + /** StreamingDetectIntentRequest singleUtterance */ + singleUtterance?: (boolean|null); - /** SimpleResponse ssml */ - ssml?: (string|null); + /** StreamingDetectIntentRequest outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); - /** SimpleResponse displayText */ - displayText?: (string|null); - } + /** StreamingDetectIntentRequest outputAudioConfigMask */ + outputAudioConfigMask?: (google.protobuf.IFieldMask|null); - /** Represents a SimpleResponse. */ - class SimpleResponse implements ISimpleResponse { + /** StreamingDetectIntentRequest inputAudio */ + inputAudio?: (Uint8Array|string|null); + } - /** - * Constructs a new SimpleResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse); + /** Represents a StreamingDetectIntentRequest. */ + class StreamingDetectIntentRequest implements IStreamingDetectIntentRequest { - /** SimpleResponse textToSpeech. */ - public textToSpeech: string; + /** + * Constructs a new StreamingDetectIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IStreamingDetectIntentRequest); - /** SimpleResponse ssml. */ - public ssml: string; + /** StreamingDetectIntentRequest session. */ + public session: string; - /** SimpleResponse displayText. */ - public displayText: string; + /** StreamingDetectIntentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.v2.IQueryParameters|null); - /** - * Creates a new SimpleResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SimpleResponse instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse): google.cloud.dialogflow.v2.Intent.Message.SimpleResponse; + /** StreamingDetectIntentRequest queryInput. */ + public queryInput?: (google.cloud.dialogflow.v2.IQueryInput|null); - /** - * Encodes the specified SimpleResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.verify|verify} messages. - * @param message SimpleResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** StreamingDetectIntentRequest singleUtterance. */ + public singleUtterance: boolean; - /** - * Encodes the specified SimpleResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.verify|verify} messages. - * @param message SimpleResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** StreamingDetectIntentRequest outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); - /** - * Decodes a SimpleResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SimpleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.SimpleResponse; + /** StreamingDetectIntentRequest outputAudioConfigMask. */ + public outputAudioConfigMask?: (google.protobuf.IFieldMask|null); - /** - * Decodes a SimpleResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SimpleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.SimpleResponse; + /** StreamingDetectIntentRequest inputAudio. */ + public inputAudio: (Uint8Array|string); - /** - * Verifies a SimpleResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new StreamingDetectIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingDetectIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IStreamingDetectIntentRequest): google.cloud.dialogflow.v2.StreamingDetectIntentRequest; - /** - * Creates a SimpleResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SimpleResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.SimpleResponse; + /** + * Encodes the specified StreamingDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentRequest.verify|verify} messages. + * @param message StreamingDetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IStreamingDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a SimpleResponse message. Also converts values to other types if specified. - * @param message SimpleResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.SimpleResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified StreamingDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentRequest.verify|verify} messages. + * @param message StreamingDetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IStreamingDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this SimpleResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.StreamingDetectIntentRequest; - /** Properties of a SimpleResponses. */ - interface ISimpleResponses { + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.StreamingDetectIntentRequest; - /** SimpleResponses simpleResponses */ - simpleResponses?: (google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse[]|null); - } + /** + * Verifies a StreamingDetectIntentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a SimpleResponses. */ - class SimpleResponses implements ISimpleResponses { + /** + * Creates a StreamingDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingDetectIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.StreamingDetectIntentRequest; - /** - * Constructs a new SimpleResponses. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses); + /** + * Creates a plain object from a StreamingDetectIntentRequest message. Also converts values to other types if specified. + * @param message StreamingDetectIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.StreamingDetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** SimpleResponses simpleResponses. */ - public simpleResponses: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse[]; + /** + * Converts this StreamingDetectIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new SimpleResponses instance using the specified properties. - * @param [properties] Properties to set - * @returns SimpleResponses instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses): google.cloud.dialogflow.v2.Intent.Message.SimpleResponses; + /** Properties of a StreamingDetectIntentResponse. */ + interface IStreamingDetectIntentResponse { - /** - * Encodes the specified SimpleResponses message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.verify|verify} messages. - * @param message SimpleResponses message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses, writer?: $protobuf.Writer): $protobuf.Writer; + /** StreamingDetectIntentResponse responseId */ + responseId?: (string|null); - /** - * Encodes the specified SimpleResponses message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.verify|verify} messages. - * @param message SimpleResponses message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses, writer?: $protobuf.Writer): $protobuf.Writer; + /** StreamingDetectIntentResponse recognitionResult */ + recognitionResult?: (google.cloud.dialogflow.v2.IStreamingRecognitionResult|null); - /** - * Decodes a SimpleResponses message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SimpleResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.SimpleResponses; + /** StreamingDetectIntentResponse queryResult */ + queryResult?: (google.cloud.dialogflow.v2.IQueryResult|null); - /** - * Decodes a SimpleResponses message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SimpleResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.SimpleResponses; + /** StreamingDetectIntentResponse webhookStatus */ + webhookStatus?: (google.rpc.IStatus|null); - /** - * Verifies a SimpleResponses message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** StreamingDetectIntentResponse outputAudio */ + outputAudio?: (Uint8Array|string|null); - /** - * Creates a SimpleResponses message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SimpleResponses - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.SimpleResponses; + /** StreamingDetectIntentResponse outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); + } - /** - * Creates a plain object from a SimpleResponses message. Also converts values to other types if specified. - * @param message SimpleResponses - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.SimpleResponses, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a StreamingDetectIntentResponse. */ + class StreamingDetectIntentResponse implements IStreamingDetectIntentResponse { - /** - * Converts this SimpleResponses to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new StreamingDetectIntentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IStreamingDetectIntentResponse); - /** Properties of a BasicCard. */ - interface IBasicCard { + /** StreamingDetectIntentResponse responseId. */ + public responseId: string; - /** BasicCard title */ - title?: (string|null); + /** StreamingDetectIntentResponse recognitionResult. */ + public recognitionResult?: (google.cloud.dialogflow.v2.IStreamingRecognitionResult|null); - /** BasicCard subtitle */ - subtitle?: (string|null); + /** StreamingDetectIntentResponse queryResult. */ + public queryResult?: (google.cloud.dialogflow.v2.IQueryResult|null); - /** BasicCard formattedText */ - formattedText?: (string|null); + /** StreamingDetectIntentResponse webhookStatus. */ + public webhookStatus?: (google.rpc.IStatus|null); - /** BasicCard image */ - image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** StreamingDetectIntentResponse outputAudio. */ + public outputAudio: (Uint8Array|string); - /** BasicCard buttons */ - buttons?: (google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton[]|null); - } + /** StreamingDetectIntentResponse outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); - /** Represents a BasicCard. */ - class BasicCard implements IBasicCard { + /** + * Creates a new StreamingDetectIntentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingDetectIntentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IStreamingDetectIntentResponse): google.cloud.dialogflow.v2.StreamingDetectIntentResponse; - /** - * Constructs a new BasicCard. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IBasicCard); + /** + * Encodes the specified StreamingDetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentResponse.verify|verify} messages. + * @param message StreamingDetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IStreamingDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** BasicCard title. */ - public title: string; + /** + * Encodes the specified StreamingDetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentResponse.verify|verify} messages. + * @param message StreamingDetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IStreamingDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** BasicCard subtitle. */ - public subtitle: string; + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingDetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.StreamingDetectIntentResponse; - /** BasicCard formattedText. */ - public formattedText: string; + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingDetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.StreamingDetectIntentResponse; - /** BasicCard image. */ - public image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** + * Verifies a StreamingDetectIntentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** BasicCard buttons. */ - public buttons: google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton[]; + /** + * Creates a StreamingDetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingDetectIntentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.StreamingDetectIntentResponse; - /** - * Creates a new BasicCard instance using the specified properties. - * @param [properties] Properties to set - * @returns BasicCard instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IBasicCard): google.cloud.dialogflow.v2.Intent.Message.BasicCard; + /** + * Creates a plain object from a StreamingDetectIntentResponse message. Also converts values to other types if specified. + * @param message StreamingDetectIntentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.StreamingDetectIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified BasicCard message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.verify|verify} messages. - * @param message BasicCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IBasicCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this StreamingDetectIntentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified BasicCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.verify|verify} messages. - * @param message BasicCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IBasicCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a StreamingRecognitionResult. */ + interface IStreamingRecognitionResult { - /** - * Decodes a BasicCard message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BasicCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.BasicCard; + /** StreamingRecognitionResult messageType */ + messageType?: (google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType|keyof typeof google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType|null); - /** - * Decodes a BasicCard message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BasicCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.BasicCard; + /** StreamingRecognitionResult transcript */ + transcript?: (string|null); - /** - * Verifies a BasicCard message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** StreamingRecognitionResult isFinal */ + isFinal?: (boolean|null); - /** - * Creates a BasicCard message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BasicCard - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.BasicCard; + /** StreamingRecognitionResult confidence */ + confidence?: (number|null); - /** - * Creates a plain object from a BasicCard message. Also converts values to other types if specified. - * @param message BasicCard - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** StreamingRecognitionResult speechWordInfo */ + speechWordInfo?: (google.cloud.dialogflow.v2.ISpeechWordInfo[]|null); - /** - * Converts this BasicCard to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** StreamingRecognitionResult speechEndOffset */ + speechEndOffset?: (google.protobuf.IDuration|null); + } - namespace BasicCard { + /** Represents a StreamingRecognitionResult. */ + class StreamingRecognitionResult implements IStreamingRecognitionResult { - /** Properties of a Button. */ - interface IButton { + /** + * Constructs a new StreamingRecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IStreamingRecognitionResult); - /** Button title */ - title?: (string|null); + /** StreamingRecognitionResult messageType. */ + public messageType: (google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType|keyof typeof google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType); - /** Button openUriAction */ - openUriAction?: (google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction|null); - } + /** StreamingRecognitionResult transcript. */ + public transcript: string; - /** Represents a Button. */ - class Button implements IButton { + /** StreamingRecognitionResult isFinal. */ + public isFinal: boolean; - /** - * Constructs a new Button. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton); + /** StreamingRecognitionResult confidence. */ + public confidence: number; - /** Button title. */ - public title: string; + /** StreamingRecognitionResult speechWordInfo. */ + public speechWordInfo: google.cloud.dialogflow.v2.ISpeechWordInfo[]; - /** Button openUriAction. */ - public openUriAction?: (google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction|null); + /** StreamingRecognitionResult speechEndOffset. */ + public speechEndOffset?: (google.protobuf.IDuration|null); - /** - * Creates a new Button instance using the specified properties. - * @param [properties] Properties to set - * @returns Button instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button; + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionResult instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IStreamingRecognitionResult): google.cloud.dialogflow.v2.StreamingRecognitionResult; - /** - * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.verify|verify} messages. - * @param message Button message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.verify|verify} messages. - * @param message Button message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Button message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button; + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.StreamingRecognitionResult; - /** - * Decodes a Button message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button; + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.StreamingRecognitionResult; - /** - * Verifies a Button message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a StreamingRecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a Button message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Button - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button; + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.StreamingRecognitionResult; - /** - * Creates a plain object from a Button message. Also converts values to other types if specified. - * @param message Button - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @param message StreamingRecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.StreamingRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this Button to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this StreamingRecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - namespace Button { + namespace StreamingRecognitionResult { - /** Properties of an OpenUriAction. */ - interface IOpenUriAction { + /** MessageType enum. */ + enum MessageType { + MESSAGE_TYPE_UNSPECIFIED = 0, + TRANSCRIPT = 1, + END_OF_SINGLE_UTTERANCE = 2 + } + } - /** OpenUriAction uri */ - uri?: (string|null); - } + /** Properties of a TextInput. */ + interface ITextInput { - /** Represents an OpenUriAction. */ - class OpenUriAction implements IOpenUriAction { + /** TextInput text */ + text?: (string|null); - /** - * Constructs a new OpenUriAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction); + /** TextInput languageCode */ + languageCode?: (string|null); + } - /** OpenUriAction uri. */ - public uri: string; + /** Represents a TextInput. */ + class TextInput implements ITextInput { - /** - * Creates a new OpenUriAction instance using the specified properties. - * @param [properties] Properties to set - * @returns OpenUriAction instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction; + /** + * Constructs a new TextInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.ITextInput); - /** - * Encodes the specified OpenUriAction message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. - * @param message OpenUriAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** TextInput text. */ + public text: string; - /** - * Encodes the specified OpenUriAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. - * @param message OpenUriAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** TextInput languageCode. */ + public languageCode: string; - /** - * Decodes an OpenUriAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OpenUriAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction; + /** + * Creates a new TextInput instance using the specified properties. + * @param [properties] Properties to set + * @returns TextInput instance + */ + public static create(properties?: google.cloud.dialogflow.v2.ITextInput): google.cloud.dialogflow.v2.TextInput; - /** - * Decodes an OpenUriAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OpenUriAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction; + /** + * Encodes the specified TextInput message. Does not implicitly {@link google.cloud.dialogflow.v2.TextInput.verify|verify} messages. + * @param message TextInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an OpenUriAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.TextInput.verify|verify} messages. + * @param message TextInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an OpenUriAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OpenUriAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction; + /** + * Decodes a TextInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.TextInput; - /** - * Creates a plain object from an OpenUriAction message. Also converts values to other types if specified. - * @param message OpenUriAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a TextInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.TextInput; - /** - * Converts this OpenUriAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } + /** + * Verifies a TextInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a Suggestion. */ - interface ISuggestion { + /** + * Creates a TextInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.TextInput; - /** Suggestion title */ - title?: (string|null); - } + /** + * Creates a plain object from a TextInput message. Also converts values to other types if specified. + * @param message TextInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.TextInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a Suggestion. */ - class Suggestion implements ISuggestion { + /** + * Converts this TextInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new Suggestion. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ISuggestion); + /** Properties of an EventInput. */ + interface IEventInput { - /** Suggestion title. */ - public title: string; + /** EventInput name */ + name?: (string|null); - /** - * Creates a new Suggestion instance using the specified properties. - * @param [properties] Properties to set - * @returns Suggestion instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ISuggestion): google.cloud.dialogflow.v2.Intent.Message.Suggestion; + /** EventInput parameters */ + parameters?: (google.protobuf.IStruct|null); - /** - * Encodes the specified Suggestion message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestion.verify|verify} messages. - * @param message Suggestion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ISuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + /** EventInput languageCode */ + languageCode?: (string|null); + } - /** - * Encodes the specified Suggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestion.verify|verify} messages. - * @param message Suggestion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ISuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents an EventInput. */ + class EventInput implements IEventInput { - /** - * Decodes a Suggestion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Suggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.Suggestion; + /** + * Constructs a new EventInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IEventInput); - /** - * Decodes a Suggestion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Suggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.Suggestion; + /** EventInput name. */ + public name: string; - /** - * Verifies a Suggestion message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** EventInput parameters. */ + public parameters?: (google.protobuf.IStruct|null); - /** - * Creates a Suggestion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Suggestion - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.Suggestion; + /** EventInput languageCode. */ + public languageCode: string; - /** - * Creates a plain object from a Suggestion message. Also converts values to other types if specified. - * @param message Suggestion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.Suggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new EventInput instance using the specified properties. + * @param [properties] Properties to set + * @returns EventInput instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IEventInput): google.cloud.dialogflow.v2.EventInput; - /** - * Converts this Suggestion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified EventInput message. Does not implicitly {@link google.cloud.dialogflow.v2.EventInput.verify|verify} messages. + * @param message EventInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IEventInput, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a Suggestions. */ - interface ISuggestions { + /** + * Encodes the specified EventInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EventInput.verify|verify} messages. + * @param message EventInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IEventInput, writer?: $protobuf.Writer): $protobuf.Writer; - /** Suggestions suggestions */ - suggestions?: (google.cloud.dialogflow.v2.Intent.Message.ISuggestion[]|null); - } + /** + * Decodes an EventInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.EventInput; - /** Represents a Suggestions. */ - class Suggestions implements ISuggestions { + /** + * Decodes an EventInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.EventInput; - /** - * Constructs a new Suggestions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ISuggestions); - - /** Suggestions suggestions. */ - public suggestions: google.cloud.dialogflow.v2.Intent.Message.ISuggestion[]; + /** + * Verifies an EventInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new Suggestions instance using the specified properties. - * @param [properties] Properties to set - * @returns Suggestions instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ISuggestions): google.cloud.dialogflow.v2.Intent.Message.Suggestions; + /** + * Creates an EventInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.EventInput; - /** - * Encodes the specified Suggestions message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestions.verify|verify} messages. - * @param message Suggestions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ISuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from an EventInput message. Also converts values to other types if specified. + * @param message EventInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.EventInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified Suggestions message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestions.verify|verify} messages. - * @param message Suggestions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ISuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this EventInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a Suggestions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Suggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.Suggestions; + /** Properties of a SentimentAnalysisRequestConfig. */ + interface ISentimentAnalysisRequestConfig { - /** - * Decodes a Suggestions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Suggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.Suggestions; + /** SentimentAnalysisRequestConfig analyzeQueryTextSentiment */ + analyzeQueryTextSentiment?: (boolean|null); + } - /** - * Verifies a Suggestions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a SentimentAnalysisRequestConfig. */ + class SentimentAnalysisRequestConfig implements ISentimentAnalysisRequestConfig { - /** - * Creates a Suggestions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Suggestions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.Suggestions; + /** + * Constructs a new SentimentAnalysisRequestConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig); - /** - * Creates a plain object from a Suggestions message. Also converts values to other types if specified. - * @param message Suggestions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.Suggestions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** SentimentAnalysisRequestConfig analyzeQueryTextSentiment. */ + public analyzeQueryTextSentiment: boolean; - /** - * Converts this Suggestions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new SentimentAnalysisRequestConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SentimentAnalysisRequestConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig): google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig; - /** Properties of a LinkOutSuggestion. */ - interface ILinkOutSuggestion { + /** + * Encodes the specified SentimentAnalysisRequestConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.verify|verify} messages. + * @param message SentimentAnalysisRequestConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** LinkOutSuggestion destinationName */ - destinationName?: (string|null); + /** + * Encodes the specified SentimentAnalysisRequestConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.verify|verify} messages. + * @param message SentimentAnalysisRequestConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** LinkOutSuggestion uri */ - uri?: (string|null); - } + /** + * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SentimentAnalysisRequestConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig; - /** Represents a LinkOutSuggestion. */ - class LinkOutSuggestion implements ILinkOutSuggestion { + /** + * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SentimentAnalysisRequestConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig; - /** - * Constructs a new LinkOutSuggestion. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion); + /** + * Verifies a SentimentAnalysisRequestConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** LinkOutSuggestion destinationName. */ - public destinationName: string; + /** + * Creates a SentimentAnalysisRequestConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SentimentAnalysisRequestConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig; - /** LinkOutSuggestion uri. */ - public uri: string; + /** + * Creates a plain object from a SentimentAnalysisRequestConfig message. Also converts values to other types if specified. + * @param message SentimentAnalysisRequestConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new LinkOutSuggestion instance using the specified properties. - * @param [properties] Properties to set - * @returns LinkOutSuggestion instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion): google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion; + /** + * Converts this SentimentAnalysisRequestConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified LinkOutSuggestion message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.verify|verify} messages. - * @param message LinkOutSuggestion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a SentimentAnalysisResult. */ + interface ISentimentAnalysisResult { - /** - * Encodes the specified LinkOutSuggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.verify|verify} messages. - * @param message LinkOutSuggestion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + /** SentimentAnalysisResult queryTextSentiment */ + queryTextSentiment?: (google.cloud.dialogflow.v2.ISentiment|null); + } - /** - * Decodes a LinkOutSuggestion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LinkOutSuggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion; + /** Represents a SentimentAnalysisResult. */ + class SentimentAnalysisResult implements ISentimentAnalysisResult { - /** - * Decodes a LinkOutSuggestion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LinkOutSuggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion; + /** + * Constructs a new SentimentAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.ISentimentAnalysisResult); - /** - * Verifies a LinkOutSuggestion message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** SentimentAnalysisResult queryTextSentiment. */ + public queryTextSentiment?: (google.cloud.dialogflow.v2.ISentiment|null); - /** - * Creates a LinkOutSuggestion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LinkOutSuggestion - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion; + /** + * Creates a new SentimentAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SentimentAnalysisResult instance + */ + public static create(properties?: google.cloud.dialogflow.v2.ISentimentAnalysisResult): google.cloud.dialogflow.v2.SentimentAnalysisResult; - /** - * Creates a plain object from a LinkOutSuggestion message. Also converts values to other types if specified. - * @param message LinkOutSuggestion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisResult.verify|verify} messages. + * @param message SentimentAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this LinkOutSuggestion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisResult.verify|verify} messages. + * @param message SentimentAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a ListSelect. */ - interface IListSelect { + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SentimentAnalysisResult; - /** ListSelect title */ - title?: (string|null); + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SentimentAnalysisResult; - /** ListSelect items */ - items?: (google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem[]|null); + /** + * Verifies a SentimentAnalysisResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ListSelect subtitle */ - subtitle?: (string|null); - } + /** + * Creates a SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SentimentAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SentimentAnalysisResult; - /** Represents a ListSelect. */ - class ListSelect implements IListSelect { + /** + * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * @param message SentimentAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.SentimentAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new ListSelect. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IListSelect); + /** + * Converts this SentimentAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ListSelect title. */ - public title: string; + /** Properties of a Sentiment. */ + interface ISentiment { - /** ListSelect items. */ - public items: google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem[]; + /** Sentiment score */ + score?: (number|null); - /** ListSelect subtitle. */ - public subtitle: string; + /** Sentiment magnitude */ + magnitude?: (number|null); + } - /** - * Creates a new ListSelect instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSelect instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IListSelect): google.cloud.dialogflow.v2.Intent.Message.ListSelect; + /** Represents a Sentiment. */ + class Sentiment implements ISentiment { - /** - * Encodes the specified ListSelect message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.verify|verify} messages. - * @param message ListSelect message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IListSelect, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new Sentiment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.ISentiment); - /** - * Encodes the specified ListSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.verify|verify} messages. - * @param message ListSelect message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IListSelect, writer?: $protobuf.Writer): $protobuf.Writer; + /** Sentiment score. */ + public score: number; - /** - * Decodes a ListSelect message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.ListSelect; + /** Sentiment magnitude. */ + public magnitude: number; - /** - * Decodes a ListSelect message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.ListSelect; + /** + * Creates a new Sentiment instance using the specified properties. + * @param [properties] Properties to set + * @returns Sentiment instance + */ + public static create(properties?: google.cloud.dialogflow.v2.ISentiment): google.cloud.dialogflow.v2.Sentiment; - /** - * Verifies a ListSelect message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.dialogflow.v2.Sentiment.verify|verify} messages. + * @param message Sentiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.ISentiment, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a ListSelect message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSelect - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.ListSelect; + /** + * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Sentiment.verify|verify} messages. + * @param message Sentiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISentiment, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a ListSelect message. Also converts values to other types if specified. - * @param message ListSelect - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.ListSelect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a Sentiment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Sentiment; - /** - * Converts this ListSelect to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a Sentiment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Sentiment; - namespace ListSelect { + /** + * Verifies a Sentiment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of an Item. */ - interface IItem { + /** + * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sentiment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Sentiment; - /** Item info */ - info?: (google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null); + /** + * Creates a plain object from a Sentiment message. Also converts values to other types if specified. + * @param message Sentiment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Sentiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Item title */ - title?: (string|null); + /** + * Converts this Sentiment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Item description */ - description?: (string|null); + /** Represents a Contexts */ + class Contexts extends $protobuf.rpc.Service { - /** Item image */ - image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - } + /** + * Constructs a new Contexts service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** Represents an Item. */ - class Item implements IItem { + /** + * Creates new Contexts service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Contexts; - /** - * Constructs a new Item. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem); + /** + * Calls ListContexts. + * @param request ListContextsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListContextsResponse + */ + public listContexts(request: google.cloud.dialogflow.v2.IListContextsRequest, callback: google.cloud.dialogflow.v2.Contexts.ListContextsCallback): void; - /** Item info. */ - public info?: (google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null); + /** + * Calls ListContexts. + * @param request ListContextsRequest message or plain object + * @returns Promise + */ + public listContexts(request: google.cloud.dialogflow.v2.IListContextsRequest): Promise; - /** Item title. */ - public title: string; + /** + * Calls GetContext. + * @param request GetContextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Context + */ + public getContext(request: google.cloud.dialogflow.v2.IGetContextRequest, callback: google.cloud.dialogflow.v2.Contexts.GetContextCallback): void; - /** Item description. */ - public description: string; + /** + * Calls GetContext. + * @param request GetContextRequest message or plain object + * @returns Promise + */ + public getContext(request: google.cloud.dialogflow.v2.IGetContextRequest): Promise; - /** Item image. */ - public image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** + * Calls CreateContext. + * @param request CreateContextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Context + */ + public createContext(request: google.cloud.dialogflow.v2.ICreateContextRequest, callback: google.cloud.dialogflow.v2.Contexts.CreateContextCallback): void; - /** - * Creates a new Item instance using the specified properties. - * @param [properties] Properties to set - * @returns Item instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem): google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item; + /** + * Calls CreateContext. + * @param request CreateContextRequest message or plain object + * @returns Promise + */ + public createContext(request: google.cloud.dialogflow.v2.ICreateContextRequest): Promise; - /** - * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.verify|verify} messages. - * @param message Item message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls UpdateContext. + * @param request UpdateContextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Context + */ + public updateContext(request: google.cloud.dialogflow.v2.IUpdateContextRequest, callback: google.cloud.dialogflow.v2.Contexts.UpdateContextCallback): void; - /** - * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.verify|verify} messages. - * @param message Item message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls UpdateContext. + * @param request UpdateContextRequest message or plain object + * @returns Promise + */ + public updateContext(request: google.cloud.dialogflow.v2.IUpdateContextRequest): Promise; - /** - * Decodes an Item message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item; + /** + * Calls DeleteContext. + * @param request DeleteContextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteContext(request: google.cloud.dialogflow.v2.IDeleteContextRequest, callback: google.cloud.dialogflow.v2.Contexts.DeleteContextCallback): void; - /** - * Decodes an Item message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item; + /** + * Calls DeleteContext. + * @param request DeleteContextRequest message or plain object + * @returns Promise + */ + public deleteContext(request: google.cloud.dialogflow.v2.IDeleteContextRequest): Promise; - /** - * Verifies an Item message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Calls DeleteAllContexts. + * @param request DeleteAllContextsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAllContexts(request: google.cloud.dialogflow.v2.IDeleteAllContextsRequest, callback: google.cloud.dialogflow.v2.Contexts.DeleteAllContextsCallback): void; - /** - * Creates an Item message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Item - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item; + /** + * Calls DeleteAllContexts. + * @param request DeleteAllContextsRequest message or plain object + * @returns Promise + */ + public deleteAllContexts(request: google.cloud.dialogflow.v2.IDeleteAllContextsRequest): Promise; + } - /** - * Creates a plain object from an Item message. Also converts values to other types if specified. - * @param message Item - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + namespace Contexts { - /** - * Converts this Item to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#listContexts}. + * @param error Error, if any + * @param [response] ListContextsResponse + */ + type ListContextsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListContextsResponse) => void; - /** Properties of a CarouselSelect. */ - interface ICarouselSelect { + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#getContext}. + * @param error Error, if any + * @param [response] Context + */ + type GetContextCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Context) => void; - /** CarouselSelect items */ - items?: (google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem[]|null); - } + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#createContext}. + * @param error Error, if any + * @param [response] Context + */ + type CreateContextCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Context) => void; - /** Represents a CarouselSelect. */ - class CarouselSelect implements ICarouselSelect { + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#updateContext}. + * @param error Error, if any + * @param [response] Context + */ + type UpdateContextCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Context) => void; - /** - * Constructs a new CarouselSelect. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect); + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#deleteContext}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteContextCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** CarouselSelect items. */ - public items: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem[]; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#deleteAllContexts}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAllContextsCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } - /** - * Creates a new CarouselSelect instance using the specified properties. - * @param [properties] Properties to set - * @returns CarouselSelect instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect; + /** Properties of a Context. */ + interface IContext { - /** - * Encodes the specified CarouselSelect message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.verify|verify} messages. - * @param message CarouselSelect message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect, writer?: $protobuf.Writer): $protobuf.Writer; + /** Context name */ + name?: (string|null); - /** - * Encodes the specified CarouselSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.verify|verify} messages. - * @param message CarouselSelect message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect, writer?: $protobuf.Writer): $protobuf.Writer; + /** Context lifespanCount */ + lifespanCount?: (number|null); - /** - * Decodes a CarouselSelect message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CarouselSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect; + /** Context parameters */ + parameters?: (google.protobuf.IStruct|null); + } - /** - * Decodes a CarouselSelect message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CarouselSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect; + /** Represents a Context. */ + class Context implements IContext { - /** - * Verifies a CarouselSelect message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new Context. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IContext); - /** - * Creates a CarouselSelect message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CarouselSelect - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect; + /** Context name. */ + public name: string; - /** - * Creates a plain object from a CarouselSelect message. Also converts values to other types if specified. - * @param message CarouselSelect - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Context lifespanCount. */ + public lifespanCount: number; - /** - * Converts this CarouselSelect to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Context parameters. */ + public parameters?: (google.protobuf.IStruct|null); - namespace CarouselSelect { + /** + * Creates a new Context instance using the specified properties. + * @param [properties] Properties to set + * @returns Context instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IContext): google.cloud.dialogflow.v2.Context; - /** Properties of an Item. */ - interface IItem { + /** + * Encodes the specified Context message. Does not implicitly {@link google.cloud.dialogflow.v2.Context.verify|verify} messages. + * @param message Context message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IContext, writer?: $protobuf.Writer): $protobuf.Writer; - /** Item info */ - info?: (google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null); + /** + * Encodes the specified Context message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Context.verify|verify} messages. + * @param message Context message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IContext, writer?: $protobuf.Writer): $protobuf.Writer; - /** Item title */ - title?: (string|null); + /** + * Decodes a Context message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Context; - /** Item description */ - description?: (string|null); + /** + * Decodes a Context message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Context; - /** Item image */ - image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - } + /** + * Verifies a Context message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents an Item. */ - class Item implements IItem { + /** + * Creates a Context message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Context + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Context; - /** - * Constructs a new Item. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem); + /** + * Creates a plain object from a Context message. Also converts values to other types if specified. + * @param message Context + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Context, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Item info. */ - public info?: (google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null); + /** + * Converts this Context to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Item title. */ - public title: string; + /** Properties of a ListContextsRequest. */ + interface IListContextsRequest { - /** Item description. */ - public description: string; + /** ListContextsRequest parent */ + parent?: (string|null); - /** Item image. */ - public image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** ListContextsRequest pageSize */ + pageSize?: (number|null); - /** - * Creates a new Item instance using the specified properties. - * @param [properties] Properties to set - * @returns Item instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item; + /** ListContextsRequest pageToken */ + pageToken?: (string|null); + } - /** - * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.verify|verify} messages. - * @param message Item message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a ListContextsRequest. */ + class ListContextsRequest implements IListContextsRequest { - /** - * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.verify|verify} messages. - * @param message Item message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new ListContextsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListContextsRequest); - /** - * Decodes an Item message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item; + /** ListContextsRequest parent. */ + public parent: string; - /** - * Decodes an Item message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item; + /** ListContextsRequest pageSize. */ + public pageSize: number; - /** - * Verifies an Item message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ListContextsRequest pageToken. */ + public pageToken: string; - /** - * Creates an Item message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Item - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item; + /** + * Creates a new ListContextsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContextsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListContextsRequest): google.cloud.dialogflow.v2.ListContextsRequest; - /** - * Creates a plain object from an Item message. Also converts values to other types if specified. - * @param message Item - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified ListContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsRequest.verify|verify} messages. + * @param message ListContextsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this Item to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Encodes the specified ListContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsRequest.verify|verify} messages. + * @param message ListContextsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a SelectItemInfo. */ - interface ISelectItemInfo { + /** + * Decodes a ListContextsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListContextsRequest; - /** SelectItemInfo key */ - key?: (string|null); + /** + * Decodes a ListContextsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListContextsRequest; - /** SelectItemInfo synonyms */ - synonyms?: (string[]|null); - } + /** + * Verifies a ListContextsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a SelectItemInfo. */ - class SelectItemInfo implements ISelectItemInfo { + /** + * Creates a ListContextsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContextsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListContextsRequest; - /** - * Constructs a new SelectItemInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo); + /** + * Creates a plain object from a ListContextsRequest message. Also converts values to other types if specified. + * @param message ListContextsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListContextsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** SelectItemInfo key. */ - public key: string; + /** + * Converts this ListContextsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** SelectItemInfo synonyms. */ - public synonyms: string[]; + /** Properties of a ListContextsResponse. */ + interface IListContextsResponse { - /** - * Creates a new SelectItemInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SelectItemInfo instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo): google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo; + /** ListContextsResponse contexts */ + contexts?: (google.cloud.dialogflow.v2.IContext[]|null); - /** - * Encodes the specified SelectItemInfo message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.verify|verify} messages. - * @param message SelectItemInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListContextsResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * Encodes the specified SelectItemInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.verify|verify} messages. - * @param message SelectItemInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a ListContextsResponse. */ + class ListContextsResponse implements IListContextsResponse { - /** - * Decodes a SelectItemInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SelectItemInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo; + /** + * Constructs a new ListContextsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListContextsResponse); - /** - * Decodes a SelectItemInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SelectItemInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo; + /** ListContextsResponse contexts. */ + public contexts: google.cloud.dialogflow.v2.IContext[]; - /** - * Verifies a SelectItemInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ListContextsResponse nextPageToken. */ + public nextPageToken: string; - /** - * Creates a SelectItemInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SelectItemInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo; + /** + * Creates a new ListContextsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContextsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListContextsResponse): google.cloud.dialogflow.v2.ListContextsResponse; - /** - * Creates a plain object from a SelectItemInfo message. Also converts values to other types if specified. - * @param message SelectItemInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified ListContextsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsResponse.verify|verify} messages. + * @param message ListContextsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListContextsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this SelectItemInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified ListContextsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsResponse.verify|verify} messages. + * @param message ListContextsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListContextsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a MediaContent. */ - interface IMediaContent { + /** + * Decodes a ListContextsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContextsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListContextsResponse; - /** MediaContent mediaType */ - mediaType?: (google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType|keyof typeof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType|null); + /** + * Decodes a ListContextsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContextsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListContextsResponse; - /** MediaContent mediaObjects */ - mediaObjects?: (google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject[]|null); - } + /** + * Verifies a ListContextsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a MediaContent. */ - class MediaContent implements IMediaContent { + /** + * Creates a ListContextsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContextsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListContextsResponse; - /** - * Constructs a new MediaContent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IMediaContent); + /** + * Creates a plain object from a ListContextsResponse message. Also converts values to other types if specified. + * @param message ListContextsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListContextsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** MediaContent mediaType. */ - public mediaType: (google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType|keyof typeof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType); + /** + * Converts this ListContextsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MediaContent mediaObjects. */ - public mediaObjects: google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject[]; + /** Properties of a GetContextRequest. */ + interface IGetContextRequest { - /** - * Creates a new MediaContent instance using the specified properties. - * @param [properties] Properties to set - * @returns MediaContent instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IMediaContent): google.cloud.dialogflow.v2.Intent.Message.MediaContent; + /** GetContextRequest name */ + name?: (string|null); + } - /** - * Encodes the specified MediaContent message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.verify|verify} messages. - * @param message MediaContent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IMediaContent, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a GetContextRequest. */ + class GetContextRequest implements IGetContextRequest { - /** - * Encodes the specified MediaContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.verify|verify} messages. - * @param message MediaContent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IMediaContent, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new GetContextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IGetContextRequest); - /** - * Decodes a MediaContent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MediaContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.MediaContent; + /** GetContextRequest name. */ + public name: string; - /** - * Decodes a MediaContent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MediaContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.MediaContent; + /** + * Creates a new GetContextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetContextRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IGetContextRequest): google.cloud.dialogflow.v2.GetContextRequest; - /** - * Verifies a MediaContent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified GetContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetContextRequest.verify|verify} messages. + * @param message GetContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IGetContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a MediaContent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MediaContent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.MediaContent; + /** + * Encodes the specified GetContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetContextRequest.verify|verify} messages. + * @param message GetContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a MediaContent message. Also converts values to other types if specified. - * @param message MediaContent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.MediaContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a GetContextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetContextRequest; - /** - * Converts this MediaContent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a GetContextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetContextRequest; - namespace MediaContent { + /** + * Verifies a GetContextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a ResponseMediaObject. */ - interface IResponseMediaObject { + /** + * Creates a GetContextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetContextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetContextRequest; - /** ResponseMediaObject name */ - name?: (string|null); + /** + * Creates a plain object from a GetContextRequest message. Also converts values to other types if specified. + * @param message GetContextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.GetContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ResponseMediaObject description */ - description?: (string|null); + /** + * Converts this GetContextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ResponseMediaObject largeImage */ - largeImage?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** Properties of a CreateContextRequest. */ + interface ICreateContextRequest { - /** ResponseMediaObject icon */ - icon?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** CreateContextRequest parent */ + parent?: (string|null); - /** ResponseMediaObject contentUrl */ - contentUrl?: (string|null); - } + /** CreateContextRequest context */ + context?: (google.cloud.dialogflow.v2.IContext|null); + } - /** Represents a ResponseMediaObject. */ - class ResponseMediaObject implements IResponseMediaObject { + /** Represents a CreateContextRequest. */ + class CreateContextRequest implements ICreateContextRequest { - /** - * Constructs a new ResponseMediaObject. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject); + /** + * Constructs a new CreateContextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.ICreateContextRequest); - /** ResponseMediaObject name. */ - public name: string; + /** CreateContextRequest parent. */ + public parent: string; - /** ResponseMediaObject description. */ - public description: string; + /** CreateContextRequest context. */ + public context?: (google.cloud.dialogflow.v2.IContext|null); - /** ResponseMediaObject largeImage. */ - public largeImage?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** + * Creates a new CreateContextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateContextRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.ICreateContextRequest): google.cloud.dialogflow.v2.CreateContextRequest; - /** ResponseMediaObject icon. */ - public icon?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** + * Encodes the specified CreateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateContextRequest.verify|verify} messages. + * @param message CreateContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.ICreateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** ResponseMediaObject contentUrl. */ - public contentUrl: string; + /** + * Encodes the specified CreateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateContextRequest.verify|verify} messages. + * @param message CreateContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** ResponseMediaObject image. */ - public image?: ("largeImage"|"icon"); + /** + * Decodes a CreateContextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateContextRequest; - /** - * Creates a new ResponseMediaObject instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseMediaObject instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject): google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject; + /** + * Decodes a CreateContextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateContextRequest; - /** - * Encodes the specified ResponseMediaObject message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. - * @param message ResponseMediaObject message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a CreateContextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified ResponseMediaObject message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. - * @param message ResponseMediaObject message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a CreateContextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateContextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateContextRequest; - /** - * Decodes a ResponseMediaObject message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseMediaObject - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject; + /** + * Creates a plain object from a CreateContextRequest message. Also converts values to other types if specified. + * @param message CreateContextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.CreateContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a ResponseMediaObject message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseMediaObject - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject; + /** + * Converts this CreateContextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a ResponseMediaObject message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of an UpdateContextRequest. */ + interface IUpdateContextRequest { - /** - * Creates a ResponseMediaObject message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseMediaObject - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject; + /** UpdateContextRequest context */ + context?: (google.cloud.dialogflow.v2.IContext|null); - /** - * Creates a plain object from a ResponseMediaObject message. Also converts values to other types if specified. - * @param message ResponseMediaObject - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UpdateContextRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** - * Converts this ResponseMediaObject to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** ResponseMediaType enum. */ - enum ResponseMediaType { - RESPONSE_MEDIA_TYPE_UNSPECIFIED = 0, - AUDIO = 1 - } - } + /** Represents an UpdateContextRequest. */ + class UpdateContextRequest implements IUpdateContextRequest { - /** Properties of a BrowseCarouselCard. */ - interface IBrowseCarouselCard { + /** + * Constructs a new UpdateContextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IUpdateContextRequest); - /** BrowseCarouselCard items */ - items?: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem[]|null); + /** UpdateContextRequest context. */ + public context?: (google.cloud.dialogflow.v2.IContext|null); - /** BrowseCarouselCard imageDisplayOptions */ - imageDisplayOptions?: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|keyof typeof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|null); - } + /** UpdateContextRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** Represents a BrowseCarouselCard. */ - class BrowseCarouselCard implements IBrowseCarouselCard { + /** + * Creates a new UpdateContextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateContextRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IUpdateContextRequest): google.cloud.dialogflow.v2.UpdateContextRequest; - /** - * Constructs a new BrowseCarouselCard. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard); + /** + * Encodes the specified UpdateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateContextRequest.verify|verify} messages. + * @param message UpdateContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IUpdateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** BrowseCarouselCard items. */ - public items: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem[]; + /** + * Encodes the specified UpdateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateContextRequest.verify|verify} messages. + * @param message UpdateContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** BrowseCarouselCard imageDisplayOptions. */ - public imageDisplayOptions: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|keyof typeof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions); + /** + * Decodes an UpdateContextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateContextRequest; - /** - * Creates a new BrowseCarouselCard instance using the specified properties. - * @param [properties] Properties to set - * @returns BrowseCarouselCard instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard; + /** + * Decodes an UpdateContextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateContextRequest; - /** - * Encodes the specified BrowseCarouselCard message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.verify|verify} messages. - * @param message BrowseCarouselCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies an UpdateContextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified BrowseCarouselCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.verify|verify} messages. - * @param message BrowseCarouselCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates an UpdateContextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateContextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateContextRequest; - /** - * Decodes a BrowseCarouselCard message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BrowseCarouselCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard; + /** + * Creates a plain object from an UpdateContextRequest message. Also converts values to other types if specified. + * @param message UpdateContextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.UpdateContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a BrowseCarouselCard message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BrowseCarouselCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard; + /** + * Converts this UpdateContextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a BrowseCarouselCard message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of a DeleteContextRequest. */ + interface IDeleteContextRequest { - /** - * Creates a BrowseCarouselCard message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BrowseCarouselCard - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard; + /** DeleteContextRequest name */ + name?: (string|null); + } - /** - * Creates a plain object from a BrowseCarouselCard message. Also converts values to other types if specified. - * @param message BrowseCarouselCard - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a DeleteContextRequest. */ + class DeleteContextRequest implements IDeleteContextRequest { - /** - * Converts this BrowseCarouselCard to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new DeleteContextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IDeleteContextRequest); - namespace BrowseCarouselCard { + /** DeleteContextRequest name. */ + public name: string; - /** Properties of a BrowseCarouselCardItem. */ - interface IBrowseCarouselCardItem { + /** + * Creates a new DeleteContextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteContextRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IDeleteContextRequest): google.cloud.dialogflow.v2.DeleteContextRequest; - /** BrowseCarouselCardItem openUriAction */ - openUriAction?: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null); + /** + * Encodes the specified DeleteContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteContextRequest.verify|verify} messages. + * @param message DeleteContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IDeleteContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** BrowseCarouselCardItem title */ - title?: (string|null); + /** + * Encodes the specified DeleteContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteContextRequest.verify|verify} messages. + * @param message DeleteContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** BrowseCarouselCardItem description */ - description?: (string|null); + /** + * Decodes a DeleteContextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteContextRequest; - /** BrowseCarouselCardItem image */ - image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** + * Decodes a DeleteContextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteContextRequest; - /** BrowseCarouselCardItem footer */ - footer?: (string|null); - } + /** + * Verifies a DeleteContextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a BrowseCarouselCardItem. */ - class BrowseCarouselCardItem implements IBrowseCarouselCardItem { + /** + * Creates a DeleteContextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteContextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteContextRequest; - /** - * Constructs a new BrowseCarouselCardItem. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem); + /** + * Creates a plain object from a DeleteContextRequest message. Also converts values to other types if specified. + * @param message DeleteContextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.DeleteContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** BrowseCarouselCardItem openUriAction. */ - public openUriAction?: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null); + /** + * Converts this DeleteContextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** BrowseCarouselCardItem title. */ - public title: string; + /** Properties of a DeleteAllContextsRequest. */ + interface IDeleteAllContextsRequest { - /** BrowseCarouselCardItem description. */ - public description: string; + /** DeleteAllContextsRequest parent */ + parent?: (string|null); + } - /** BrowseCarouselCardItem image. */ - public image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** Represents a DeleteAllContextsRequest. */ + class DeleteAllContextsRequest implements IDeleteAllContextsRequest { - /** BrowseCarouselCardItem footer. */ - public footer: string; + /** + * Constructs a new DeleteAllContextsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IDeleteAllContextsRequest); - /** - * Creates a new BrowseCarouselCardItem instance using the specified properties. - * @param [properties] Properties to set - * @returns BrowseCarouselCardItem instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; + /** DeleteAllContextsRequest parent. */ + public parent: string; - /** - * Encodes the specified BrowseCarouselCardItem message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. - * @param message BrowseCarouselCardItem message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new DeleteAllContextsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAllContextsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IDeleteAllContextsRequest): google.cloud.dialogflow.v2.DeleteAllContextsRequest; - /** - * Encodes the specified BrowseCarouselCardItem message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. - * @param message BrowseCarouselCardItem message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified DeleteAllContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteAllContextsRequest.verify|verify} messages. + * @param message DeleteAllContextsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IDeleteAllContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a BrowseCarouselCardItem message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BrowseCarouselCardItem - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; + /** + * Encodes the specified DeleteAllContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteAllContextsRequest.verify|verify} messages. + * @param message DeleteAllContextsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteAllContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a BrowseCarouselCardItem message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BrowseCarouselCardItem - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; + /** + * Decodes a DeleteAllContextsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAllContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteAllContextsRequest; - /** - * Verifies a BrowseCarouselCardItem message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a DeleteAllContextsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAllContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteAllContextsRequest; - /** - * Creates a BrowseCarouselCardItem message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BrowseCarouselCardItem - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; + /** + * Verifies a DeleteAllContextsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a BrowseCarouselCardItem message. Also converts values to other types if specified. - * @param message BrowseCarouselCardItem - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a DeleteAllContextsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAllContextsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteAllContextsRequest; - /** - * Converts this BrowseCarouselCardItem to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a DeleteAllContextsRequest message. Also converts values to other types if specified. + * @param message DeleteAllContextsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.DeleteAllContextsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - namespace BrowseCarouselCardItem { + /** + * Converts this DeleteAllContextsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of an OpenUrlAction. */ - interface IOpenUrlAction { + /** Represents an Intents */ + class Intents extends $protobuf.rpc.Service { - /** OpenUrlAction url */ - url?: (string|null); + /** + * Constructs a new Intents service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** OpenUrlAction urlTypeHint */ - urlTypeHint?: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|keyof typeof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|null); - } + /** + * Creates new Intents service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Intents; - /** Represents an OpenUrlAction. */ - class OpenUrlAction implements IOpenUrlAction { + /** + * Calls ListIntents. + * @param request ListIntentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListIntentsResponse + */ + public listIntents(request: google.cloud.dialogflow.v2.IListIntentsRequest, callback: google.cloud.dialogflow.v2.Intents.ListIntentsCallback): void; - /** - * Constructs a new OpenUrlAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction); + /** + * Calls ListIntents. + * @param request ListIntentsRequest message or plain object + * @returns Promise + */ + public listIntents(request: google.cloud.dialogflow.v2.IListIntentsRequest): Promise; - /** OpenUrlAction url. */ - public url: string; + /** + * Calls GetIntent. + * @param request GetIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Intent + */ + public getIntent(request: google.cloud.dialogflow.v2.IGetIntentRequest, callback: google.cloud.dialogflow.v2.Intents.GetIntentCallback): void; - /** OpenUrlAction urlTypeHint. */ - public urlTypeHint: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|keyof typeof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint); + /** + * Calls GetIntent. + * @param request GetIntentRequest message or plain object + * @returns Promise + */ + public getIntent(request: google.cloud.dialogflow.v2.IGetIntentRequest): Promise; - /** - * Creates a new OpenUrlAction instance using the specified properties. - * @param [properties] Properties to set - * @returns OpenUrlAction instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; + /** + * Calls CreateIntent. + * @param request CreateIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Intent + */ + public createIntent(request: google.cloud.dialogflow.v2.ICreateIntentRequest, callback: google.cloud.dialogflow.v2.Intents.CreateIntentCallback): void; - /** - * Encodes the specified OpenUrlAction message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. - * @param message OpenUrlAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls CreateIntent. + * @param request CreateIntentRequest message or plain object + * @returns Promise + */ + public createIntent(request: google.cloud.dialogflow.v2.ICreateIntentRequest): Promise; - /** - * Encodes the specified OpenUrlAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. - * @param message OpenUrlAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls UpdateIntent. + * @param request UpdateIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Intent + */ + public updateIntent(request: google.cloud.dialogflow.v2.IUpdateIntentRequest, callback: google.cloud.dialogflow.v2.Intents.UpdateIntentCallback): void; - /** - * Decodes an OpenUrlAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OpenUrlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; + /** + * Calls UpdateIntent. + * @param request UpdateIntentRequest message or plain object + * @returns Promise + */ + public updateIntent(request: google.cloud.dialogflow.v2.IUpdateIntentRequest): Promise; - /** - * Decodes an OpenUrlAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OpenUrlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; + /** + * Calls DeleteIntent. + * @param request DeleteIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteIntent(request: google.cloud.dialogflow.v2.IDeleteIntentRequest, callback: google.cloud.dialogflow.v2.Intents.DeleteIntentCallback): void; - /** - * Verifies an OpenUrlAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Calls DeleteIntent. + * @param request DeleteIntentRequest message or plain object + * @returns Promise + */ + public deleteIntent(request: google.cloud.dialogflow.v2.IDeleteIntentRequest): Promise; - /** - * Creates an OpenUrlAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OpenUrlAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; + /** + * Calls BatchUpdateIntents. + * @param request BatchUpdateIntentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchUpdateIntents(request: google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, callback: google.cloud.dialogflow.v2.Intents.BatchUpdateIntentsCallback): void; - /** - * Creates a plain object from an OpenUrlAction message. Also converts values to other types if specified. - * @param message OpenUrlAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Calls BatchUpdateIntents. + * @param request BatchUpdateIntentsRequest message or plain object + * @returns Promise + */ + public batchUpdateIntents(request: google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest): Promise; - /** - * Converts this OpenUrlAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Calls BatchDeleteIntents. + * @param request BatchDeleteIntentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchDeleteIntents(request: google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest, callback: google.cloud.dialogflow.v2.Intents.BatchDeleteIntentsCallback): void; - namespace OpenUrlAction { + /** + * Calls BatchDeleteIntents. + * @param request BatchDeleteIntentsRequest message or plain object + * @returns Promise + */ + public batchDeleteIntents(request: google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest): Promise; + } - /** UrlTypeHint enum. */ - enum UrlTypeHint { - URL_TYPE_HINT_UNSPECIFIED = 0, - AMP_ACTION = 1, - AMP_CONTENT = 2 - } - } - } + namespace Intents { - /** ImageDisplayOptions enum. */ - enum ImageDisplayOptions { - IMAGE_DISPLAY_OPTIONS_UNSPECIFIED = 0, - GRAY = 1, - WHITE = 2, - CROPPED = 3, - BLURRED_BACKGROUND = 4 - } - } + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#listIntents}. + * @param error Error, if any + * @param [response] ListIntentsResponse + */ + type ListIntentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListIntentsResponse) => void; - /** Properties of a TableCard. */ - interface ITableCard { + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#getIntent}. + * @param error Error, if any + * @param [response] Intent + */ + type GetIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Intent) => void; - /** TableCard title */ - title?: (string|null); + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#createIntent}. + * @param error Error, if any + * @param [response] Intent + */ + type CreateIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Intent) => void; - /** TableCard subtitle */ - subtitle?: (string|null); + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#updateIntent}. + * @param error Error, if any + * @param [response] Intent + */ + type UpdateIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Intent) => void; - /** TableCard image */ - image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#deleteIntent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteIntentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** TableCard columnProperties */ - columnProperties?: (google.cloud.dialogflow.v2.Intent.Message.IColumnProperties[]|null); + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#batchUpdateIntents}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchUpdateIntentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** TableCard rows */ - rows?: (google.cloud.dialogflow.v2.Intent.Message.ITableCardRow[]|null); + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#batchDeleteIntents}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchDeleteIntentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } - /** TableCard buttons */ - buttons?: (google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton[]|null); - } + /** Properties of an Intent. */ + interface IIntent { - /** Represents a TableCard. */ - class TableCard implements ITableCard { + /** Intent name */ + name?: (string|null); - /** - * Constructs a new TableCard. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ITableCard); + /** Intent displayName */ + displayName?: (string|null); - /** TableCard title. */ - public title: string; + /** Intent webhookState */ + webhookState?: (google.cloud.dialogflow.v2.Intent.WebhookState|keyof typeof google.cloud.dialogflow.v2.Intent.WebhookState|null); - /** TableCard subtitle. */ - public subtitle: string; + /** Intent priority */ + priority?: (number|null); - /** TableCard image. */ - public image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + /** Intent isFallback */ + isFallback?: (boolean|null); - /** TableCard columnProperties. */ - public columnProperties: google.cloud.dialogflow.v2.Intent.Message.IColumnProperties[]; + /** Intent mlDisabled */ + mlDisabled?: (boolean|null); - /** TableCard rows. */ - public rows: google.cloud.dialogflow.v2.Intent.Message.ITableCardRow[]; + /** Intent liveAgentHandoff */ + liveAgentHandoff?: (boolean|null); - /** TableCard buttons. */ - public buttons: google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton[]; + /** Intent endInteraction */ + endInteraction?: (boolean|null); - /** - * Creates a new TableCard instance using the specified properties. - * @param [properties] Properties to set - * @returns TableCard instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ITableCard): google.cloud.dialogflow.v2.Intent.Message.TableCard; + /** Intent inputContextNames */ + inputContextNames?: (string[]|null); - /** - * Encodes the specified TableCard message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCard.verify|verify} messages. - * @param message TableCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ITableCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** Intent events */ + events?: (string[]|null); - /** - * Encodes the specified TableCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCard.verify|verify} messages. - * @param message TableCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ITableCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** Intent trainingPhrases */ + trainingPhrases?: (google.cloud.dialogflow.v2.Intent.ITrainingPhrase[]|null); - /** - * Decodes a TableCard message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TableCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.TableCard; + /** Intent action */ + action?: (string|null); - /** - * Decodes a TableCard message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TableCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.TableCard; + /** Intent outputContexts */ + outputContexts?: (google.cloud.dialogflow.v2.IContext[]|null); - /** - * Verifies a TableCard message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Intent resetContexts */ + resetContexts?: (boolean|null); - /** - * Creates a TableCard message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TableCard - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.TableCard; + /** Intent parameters */ + parameters?: (google.cloud.dialogflow.v2.Intent.IParameter[]|null); - /** - * Creates a plain object from a TableCard message. Also converts values to other types if specified. - * @param message TableCard - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.TableCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Intent messages */ + messages?: (google.cloud.dialogflow.v2.Intent.IMessage[]|null); - /** - * Converts this TableCard to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Intent defaultResponsePlatforms */ + defaultResponsePlatforms?: (google.cloud.dialogflow.v2.Intent.Message.Platform[]|null); - /** Properties of a ColumnProperties. */ - interface IColumnProperties { + /** Intent rootFollowupIntentName */ + rootFollowupIntentName?: (string|null); - /** ColumnProperties header */ - header?: (string|null); + /** Intent parentFollowupIntentName */ + parentFollowupIntentName?: (string|null); - /** ColumnProperties horizontalAlignment */ - horizontalAlignment?: (google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment|keyof typeof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment|null); - } + /** Intent followupIntentInfo */ + followupIntentInfo?: (google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo[]|null); + } - /** Represents a ColumnProperties. */ - class ColumnProperties implements IColumnProperties { + /** Represents an Intent. */ + class Intent implements IIntent { - /** - * Constructs a new ColumnProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IColumnProperties); + /** + * Constructs a new Intent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IIntent); - /** ColumnProperties header. */ - public header: string; + /** Intent name. */ + public name: string; - /** ColumnProperties horizontalAlignment. */ - public horizontalAlignment: (google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment|keyof typeof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment); + /** Intent displayName. */ + public displayName: string; - /** - * Creates a new ColumnProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns ColumnProperties instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IColumnProperties): google.cloud.dialogflow.v2.Intent.Message.ColumnProperties; + /** Intent webhookState. */ + public webhookState: (google.cloud.dialogflow.v2.Intent.WebhookState|keyof typeof google.cloud.dialogflow.v2.Intent.WebhookState); - /** - * Encodes the specified ColumnProperties message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.verify|verify} messages. - * @param message ColumnProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IColumnProperties, writer?: $protobuf.Writer): $protobuf.Writer; + /** Intent priority. */ + public priority: number; - /** - * Encodes the specified ColumnProperties message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.verify|verify} messages. - * @param message ColumnProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IColumnProperties, writer?: $protobuf.Writer): $protobuf.Writer; + /** Intent isFallback. */ + public isFallback: boolean; - /** - * Decodes a ColumnProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ColumnProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.ColumnProperties; + /** Intent mlDisabled. */ + public mlDisabled: boolean; - /** - * Decodes a ColumnProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ColumnProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.ColumnProperties; + /** Intent liveAgentHandoff. */ + public liveAgentHandoff: boolean; - /** - * Verifies a ColumnProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Intent endInteraction. */ + public endInteraction: boolean; - /** - * Creates a ColumnProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ColumnProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.ColumnProperties; + /** Intent inputContextNames. */ + public inputContextNames: string[]; - /** - * Creates a plain object from a ColumnProperties message. Also converts values to other types if specified. - * @param message ColumnProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.ColumnProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Intent events. */ + public events: string[]; - /** - * Converts this ColumnProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Intent trainingPhrases. */ + public trainingPhrases: google.cloud.dialogflow.v2.Intent.ITrainingPhrase[]; - namespace ColumnProperties { + /** Intent action. */ + public action: string; - /** HorizontalAlignment enum. */ - enum HorizontalAlignment { - HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0, - LEADING = 1, - CENTER = 2, - TRAILING = 3 - } - } + /** Intent outputContexts. */ + public outputContexts: google.cloud.dialogflow.v2.IContext[]; - /** Properties of a TableCardRow. */ - interface ITableCardRow { + /** Intent resetContexts. */ + public resetContexts: boolean; - /** TableCardRow cells */ - cells?: (google.cloud.dialogflow.v2.Intent.Message.ITableCardCell[]|null); + /** Intent parameters. */ + public parameters: google.cloud.dialogflow.v2.Intent.IParameter[]; - /** TableCardRow dividerAfter */ - dividerAfter?: (boolean|null); - } + /** Intent messages. */ + public messages: google.cloud.dialogflow.v2.Intent.IMessage[]; - /** Represents a TableCardRow. */ - class TableCardRow implements ITableCardRow { + /** Intent defaultResponsePlatforms. */ + public defaultResponsePlatforms: google.cloud.dialogflow.v2.Intent.Message.Platform[]; - /** - * Constructs a new TableCardRow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ITableCardRow); + /** Intent rootFollowupIntentName. */ + public rootFollowupIntentName: string; - /** TableCardRow cells. */ - public cells: google.cloud.dialogflow.v2.Intent.Message.ITableCardCell[]; + /** Intent parentFollowupIntentName. */ + public parentFollowupIntentName: string; - /** TableCardRow dividerAfter. */ - public dividerAfter: boolean; + /** Intent followupIntentInfo. */ + public followupIntentInfo: google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo[]; - /** - * Creates a new TableCardRow instance using the specified properties. - * @param [properties] Properties to set - * @returns TableCardRow instance - */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ITableCardRow): google.cloud.dialogflow.v2.Intent.Message.TableCardRow; + /** + * Creates a new Intent instance using the specified properties. + * @param [properties] Properties to set + * @returns Intent instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IIntent): google.cloud.dialogflow.v2.Intent; - /** - * Encodes the specified TableCardRow message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardRow.verify|verify} messages. - * @param message TableCardRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ITableCardRow, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.verify|verify} messages. + * @param message Intent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified TableCardRow message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardRow.verify|verify} messages. - * @param message TableCardRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ITableCardRow, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.verify|verify} messages. + * @param message Intent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a TableCardRow message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TableCardRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.TableCardRow; + /** + * Decodes an Intent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent; - /** - * Decodes a TableCardRow message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TableCardRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.TableCardRow; + /** + * Decodes an Intent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent; - /** - * Verifies a TableCardRow message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies an Intent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a TableCardRow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TableCardRow - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.TableCardRow; + /** + * Creates an Intent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Intent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent; - /** - * Creates a plain object from a TableCardRow message. Also converts values to other types if specified. - * @param message TableCardRow - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.TableCardRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from an Intent message. Also converts values to other types if specified. + * @param message Intent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this TableCardRow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this Intent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a TableCardCell. */ - interface ITableCardCell { + namespace Intent { - /** TableCardCell text */ + /** Properties of a TrainingPhrase. */ + interface ITrainingPhrase { + + /** TrainingPhrase name */ + name?: (string|null); + + /** TrainingPhrase type */ + type?: (google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type|keyof typeof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type|null); + + /** TrainingPhrase parts */ + parts?: (google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart[]|null); + + /** TrainingPhrase timesAddedCount */ + timesAddedCount?: (number|null); + } + + /** Represents a TrainingPhrase. */ + class TrainingPhrase implements ITrainingPhrase { + + /** + * Constructs a new TrainingPhrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.ITrainingPhrase); + + /** TrainingPhrase name. */ + public name: string; + + /** TrainingPhrase type. */ + public type: (google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type|keyof typeof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type); + + /** TrainingPhrase parts. */ + public parts: google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart[]; + + /** TrainingPhrase timesAddedCount. */ + public timesAddedCount: number; + + /** + * Creates a new TrainingPhrase instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainingPhrase instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.ITrainingPhrase): google.cloud.dialogflow.v2.Intent.TrainingPhrase; + + /** + * Encodes the specified TrainingPhrase message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.verify|verify} messages. + * @param message TrainingPhrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.ITrainingPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainingPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.verify|verify} messages. + * @param message TrainingPhrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.ITrainingPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainingPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.TrainingPhrase; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainingPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.TrainingPhrase; + + /** + * Verifies a TrainingPhrase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrainingPhrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainingPhrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.TrainingPhrase; + + /** + * Creates a plain object from a TrainingPhrase message. Also converts values to other types if specified. + * @param message TrainingPhrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.TrainingPhrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainingPhrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TrainingPhrase { + + /** Properties of a Part. */ + interface IPart { + + /** Part text */ text?: (string|null); + + /** Part entityType */ + entityType?: (string|null); + + /** Part alias */ + alias?: (string|null); + + /** Part userDefined */ + userDefined?: (boolean|null); } - /** Represents a TableCardCell. */ - class TableCardCell implements ITableCardCell { + /** Represents a Part. */ + class Part implements IPart { /** - * Constructs a new TableCardCell. + * Constructs a new Part. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ITableCardCell); + constructor(properties?: google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart); - /** TableCardCell text. */ + /** Part text. */ public text: string; + /** Part entityType. */ + public entityType: string; + + /** Part alias. */ + public alias: string; + + /** Part userDefined. */ + public userDefined: boolean; + /** - * Creates a new TableCardCell instance using the specified properties. + * Creates a new Part instance using the specified properties. * @param [properties] Properties to set - * @returns TableCardCell instance + * @returns Part instance */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ITableCardCell): google.cloud.dialogflow.v2.Intent.Message.TableCardCell; + public static create(properties?: google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart): google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part; /** - * Encodes the specified TableCardCell message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardCell.verify|verify} messages. - * @param message TableCardCell message or plain object to encode + * Encodes the specified Part message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.verify|verify} messages. + * @param message Part message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ITableCardCell, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TableCardCell message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardCell.verify|verify} messages. - * @param message TableCardCell message or plain object to encode + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.verify|verify} messages. + * @param message Part message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ITableCardCell, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TableCardCell message from the specified reader or buffer. + * Decodes a Part message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TableCardCell + * @returns Part * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.TableCardCell; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part; /** - * Decodes a TableCardCell message from the specified reader or buffer, length delimited. + * Decodes a Part message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TableCardCell + * @returns Part * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.TableCardCell; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part; /** - * Verifies a TableCardCell message. + * Verifies a Part message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TableCardCell message from a plain object. Also converts values to their respective internal types. + * Creates a Part message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TableCardCell + * @returns Part */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.TableCardCell; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part; /** - * Creates a plain object from a TableCardCell message. Also converts values to other types if specified. - * @param message TableCardCell + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @param message Part * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.TableCardCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TableCardCell to JSON. + * Converts this Part to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Platform enum. */ - enum Platform { - PLATFORM_UNSPECIFIED = 0, - FACEBOOK = 1, - SLACK = 2, - TELEGRAM = 3, - KIK = 4, - SKYPE = 5, - LINE = 6, - VIBER = 7, - ACTIONS_ON_GOOGLE = 8, - GOOGLE_HANGOUTS = 11 + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + EXAMPLE = 1, + TEMPLATE = 2 } } - /** Properties of a FollowupIntentInfo. */ - interface IFollowupIntentInfo { + /** Properties of a Parameter. */ + interface IParameter { - /** FollowupIntentInfo followupIntentName */ - followupIntentName?: (string|null); + /** Parameter name */ + name?: (string|null); - /** FollowupIntentInfo parentFollowupIntentName */ - parentFollowupIntentName?: (string|null); + /** Parameter displayName */ + displayName?: (string|null); + + /** Parameter value */ + value?: (string|null); + + /** Parameter defaultValue */ + defaultValue?: (string|null); + + /** Parameter entityTypeDisplayName */ + entityTypeDisplayName?: (string|null); + + /** Parameter mandatory */ + mandatory?: (boolean|null); + + /** Parameter prompts */ + prompts?: (string[]|null); + + /** Parameter isList */ + isList?: (boolean|null); } - /** Represents a FollowupIntentInfo. */ - class FollowupIntentInfo implements IFollowupIntentInfo { + /** Represents a Parameter. */ + class Parameter implements IParameter { /** - * Constructs a new FollowupIntentInfo. + * Constructs a new Parameter. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo); + constructor(properties?: google.cloud.dialogflow.v2.Intent.IParameter); - /** FollowupIntentInfo followupIntentName. */ - public followupIntentName: string; + /** Parameter name. */ + public name: string; - /** FollowupIntentInfo parentFollowupIntentName. */ - public parentFollowupIntentName: string; + /** Parameter displayName. */ + public displayName: string; + + /** Parameter value. */ + public value: string; + + /** Parameter defaultValue. */ + public defaultValue: string; + + /** Parameter entityTypeDisplayName. */ + public entityTypeDisplayName: string; + + /** Parameter mandatory. */ + public mandatory: boolean; + + /** Parameter prompts. */ + public prompts: string[]; + + /** Parameter isList. */ + public isList: boolean; /** - * Creates a new FollowupIntentInfo instance using the specified properties. + * Creates a new Parameter instance using the specified properties. * @param [properties] Properties to set - * @returns FollowupIntentInfo instance + * @returns Parameter instance */ - public static create(properties?: google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo): google.cloud.dialogflow.v2.Intent.FollowupIntentInfo; + public static create(properties?: google.cloud.dialogflow.v2.Intent.IParameter): google.cloud.dialogflow.v2.Intent.Parameter; /** - * Encodes the specified FollowupIntentInfo message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.verify|verify} messages. - * @param message FollowupIntentInfo message or plain object to encode + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.Intent.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified FollowupIntentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.verify|verify} messages. - * @param message FollowupIntentInfo message or plain object to encode + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a FollowupIntentInfo message from the specified reader or buffer. + * Decodes a Parameter message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns FollowupIntentInfo + * @returns Parameter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.FollowupIntentInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Parameter; /** - * Decodes a FollowupIntentInfo message from the specified reader or buffer, length delimited. + * Decodes a Parameter message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns FollowupIntentInfo + * @returns Parameter * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.FollowupIntentInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Parameter; /** - * Verifies a FollowupIntentInfo message. + * Verifies a Parameter message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a FollowupIntentInfo message from a plain object. Also converts values to their respective internal types. + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns FollowupIntentInfo + * @returns Parameter */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.FollowupIntentInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Parameter; /** - * Creates a plain object from a FollowupIntentInfo message. Also converts values to other types if specified. - * @param message FollowupIntentInfo + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @param message Parameter * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.Intent.FollowupIntentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.Intent.Parameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this FollowupIntentInfo to JSON. + * Converts this Parameter to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** WebhookState enum. */ - enum WebhookState { - WEBHOOK_STATE_UNSPECIFIED = 0, - WEBHOOK_STATE_ENABLED = 1, - WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2 - } - } + /** Properties of a Message. */ + interface IMessage { - /** Properties of a ListIntentsRequest. */ - interface IListIntentsRequest { + /** Message text */ + text?: (google.cloud.dialogflow.v2.Intent.Message.IText|null); - /** ListIntentsRequest parent */ - parent?: (string|null); + /** Message image */ + image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** ListIntentsRequest languageCode */ - languageCode?: (string|null); + /** Message quickReplies */ + quickReplies?: (google.cloud.dialogflow.v2.Intent.Message.IQuickReplies|null); - /** ListIntentsRequest intentView */ - intentView?: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView|null); + /** Message card */ + card?: (google.cloud.dialogflow.v2.Intent.Message.ICard|null); - /** ListIntentsRequest pageSize */ - pageSize?: (number|null); + /** Message payload */ + payload?: (google.protobuf.IStruct|null); - /** ListIntentsRequest pageToken */ - pageToken?: (string|null); - } + /** Message simpleResponses */ + simpleResponses?: (google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses|null); - /** Represents a ListIntentsRequest. */ - class ListIntentsRequest implements IListIntentsRequest { + /** Message basicCard */ + basicCard?: (google.cloud.dialogflow.v2.Intent.Message.IBasicCard|null); - /** - * Constructs a new ListIntentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IListIntentsRequest); + /** Message suggestions */ + suggestions?: (google.cloud.dialogflow.v2.Intent.Message.ISuggestions|null); - /** ListIntentsRequest parent. */ - public parent: string; + /** Message linkOutSuggestion */ + linkOutSuggestion?: (google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion|null); - /** ListIntentsRequest languageCode. */ - public languageCode: string; + /** Message listSelect */ + listSelect?: (google.cloud.dialogflow.v2.Intent.Message.IListSelect|null); - /** ListIntentsRequest intentView. */ - public intentView: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView); + /** Message carouselSelect */ + carouselSelect?: (google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect|null); - /** ListIntentsRequest pageSize. */ - public pageSize: number; + /** Message browseCarouselCard */ + browseCarouselCard?: (google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard|null); - /** ListIntentsRequest pageToken. */ - public pageToken: string; + /** Message tableCard */ + tableCard?: (google.cloud.dialogflow.v2.Intent.Message.ITableCard|null); - /** - * Creates a new ListIntentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListIntentsRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IListIntentsRequest): google.cloud.dialogflow.v2.ListIntentsRequest; + /** Message mediaContent */ + mediaContent?: (google.cloud.dialogflow.v2.Intent.Message.IMediaContent|null); - /** - * Encodes the specified ListIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsRequest.verify|verify} messages. - * @param message ListIntentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IListIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Message platform */ + platform?: (google.cloud.dialogflow.v2.Intent.Message.Platform|keyof typeof google.cloud.dialogflow.v2.Intent.Message.Platform|null); + } - /** - * Encodes the specified ListIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsRequest.verify|verify} messages. - * @param message ListIntentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IListIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a Message. */ + class Message implements IMessage { - /** - * Decodes a ListIntentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListIntentsRequest; + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.IMessage); - /** - * Decodes a ListIntentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListIntentsRequest; + /** Message text. */ + public text?: (google.cloud.dialogflow.v2.Intent.Message.IText|null); - /** - * Verifies a ListIntentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Message image. */ + public image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** - * Creates a ListIntentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListIntentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListIntentsRequest; + /** Message quickReplies. */ + public quickReplies?: (google.cloud.dialogflow.v2.Intent.Message.IQuickReplies|null); - /** - * Creates a plain object from a ListIntentsRequest message. Also converts values to other types if specified. - * @param message ListIntentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.ListIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Message card. */ + public card?: (google.cloud.dialogflow.v2.Intent.Message.ICard|null); - /** - * Converts this ListIntentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Message payload. */ + public payload?: (google.protobuf.IStruct|null); - /** Properties of a ListIntentsResponse. */ - interface IListIntentsResponse { + /** Message simpleResponses. */ + public simpleResponses?: (google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses|null); - /** ListIntentsResponse intents */ - intents?: (google.cloud.dialogflow.v2.IIntent[]|null); + /** Message basicCard. */ + public basicCard?: (google.cloud.dialogflow.v2.Intent.Message.IBasicCard|null); - /** ListIntentsResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** Message suggestions. */ + public suggestions?: (google.cloud.dialogflow.v2.Intent.Message.ISuggestions|null); - /** Represents a ListIntentsResponse. */ - class ListIntentsResponse implements IListIntentsResponse { + /** Message linkOutSuggestion. */ + public linkOutSuggestion?: (google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion|null); - /** - * Constructs a new ListIntentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IListIntentsResponse); + /** Message listSelect. */ + public listSelect?: (google.cloud.dialogflow.v2.Intent.Message.IListSelect|null); - /** ListIntentsResponse intents. */ - public intents: google.cloud.dialogflow.v2.IIntent[]; + /** Message carouselSelect. */ + public carouselSelect?: (google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect|null); - /** ListIntentsResponse nextPageToken. */ - public nextPageToken: string; + /** Message browseCarouselCard. */ + public browseCarouselCard?: (google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard|null); - /** - * Creates a new ListIntentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListIntentsResponse instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IListIntentsResponse): google.cloud.dialogflow.v2.ListIntentsResponse; + /** Message tableCard. */ + public tableCard?: (google.cloud.dialogflow.v2.Intent.Message.ITableCard|null); - /** - * Encodes the specified ListIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsResponse.verify|verify} messages. - * @param message ListIntentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IListIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Message mediaContent. */ + public mediaContent?: (google.cloud.dialogflow.v2.Intent.Message.IMediaContent|null); - /** - * Encodes the specified ListIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsResponse.verify|verify} messages. - * @param message ListIntentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IListIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Message platform. */ + public platform: (google.cloud.dialogflow.v2.Intent.Message.Platform|keyof typeof google.cloud.dialogflow.v2.Intent.Message.Platform); - /** - * Decodes a ListIntentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListIntentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListIntentsResponse; + /** Message message. */ + public message?: ("text"|"image"|"quickReplies"|"card"|"payload"|"simpleResponses"|"basicCard"|"suggestions"|"linkOutSuggestion"|"listSelect"|"carouselSelect"|"browseCarouselCard"|"tableCard"|"mediaContent"); - /** - * Decodes a ListIntentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListIntentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListIntentsResponse; + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.IMessage): google.cloud.dialogflow.v2.Intent.Message; - /** - * Verifies a ListIntentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a ListIntentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListIntentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListIntentsResponse; + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a ListIntentsResponse message. Also converts values to other types if specified. - * @param message ListIntentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.ListIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message; - /** - * Converts this ListIntentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message; - /** Properties of a GetIntentRequest. */ - interface IGetIntentRequest { + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** GetIntentRequest name */ - name?: (string|null); + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message; - /** GetIntentRequest languageCode */ - languageCode?: (string|null); + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** GetIntentRequest intentView */ - intentView?: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView|null); - } + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a GetIntentRequest. */ - class GetIntentRequest implements IGetIntentRequest { + namespace Message { - /** - * Constructs a new GetIntentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IGetIntentRequest); + /** Properties of a Text. */ + interface IText { - /** GetIntentRequest name. */ - public name: string; + /** Text text */ + text?: (string[]|null); + } - /** GetIntentRequest languageCode. */ - public languageCode: string; + /** Represents a Text. */ + class Text implements IText { - /** GetIntentRequest intentView. */ - public intentView: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView); + /** + * Constructs a new Text. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IText); - /** - * Creates a new GetIntentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetIntentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IGetIntentRequest): google.cloud.dialogflow.v2.GetIntentRequest; + /** Text text. */ + public text: string[]; - /** - * Encodes the specified GetIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetIntentRequest.verify|verify} messages. - * @param message GetIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IGetIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new Text instance using the specified properties. + * @param [properties] Properties to set + * @returns Text instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IText): google.cloud.dialogflow.v2.Intent.Message.Text; - /** - * Encodes the specified GetIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetIntentRequest.verify|verify} messages. - * @param message GetIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Text.verify|verify} messages. + * @param message Text message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IText, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a GetIntentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetIntentRequest; + /** + * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Text.verify|verify} messages. + * @param message Text message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IText, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a GetIntentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetIntentRequest; + /** + * Decodes a Text message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.Text; - /** - * Verifies a GetIntentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a Text message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.Text; - /** - * Creates a GetIntentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIntentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetIntentRequest; + /** + * Verifies a Text message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a GetIntentRequest message. Also converts values to other types if specified. - * @param message GetIntentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.GetIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a Text message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Text + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.Text; - /** - * Converts this GetIntentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a Text message. Also converts values to other types if specified. + * @param message Text + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.Text, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a CreateIntentRequest. */ - interface ICreateIntentRequest { + /** + * Converts this Text to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** CreateIntentRequest parent */ - parent?: (string|null); + /** Properties of an Image. */ + interface IImage { - /** CreateIntentRequest intent */ - intent?: (google.cloud.dialogflow.v2.IIntent|null); + /** Image imageUri */ + imageUri?: (string|null); - /** CreateIntentRequest languageCode */ - languageCode?: (string|null); + /** Image accessibilityText */ + accessibilityText?: (string|null); + } - /** CreateIntentRequest intentView */ - intentView?: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView|null); - } + /** Represents an Image. */ + class Image implements IImage { - /** Represents a CreateIntentRequest. */ - class CreateIntentRequest implements ICreateIntentRequest { + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IImage); - /** - * Constructs a new CreateIntentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.ICreateIntentRequest); + /** Image imageUri. */ + public imageUri: string; - /** CreateIntentRequest parent. */ - public parent: string; + /** Image accessibilityText. */ + public accessibilityText: string; - /** CreateIntentRequest intent. */ - public intent?: (google.cloud.dialogflow.v2.IIntent|null); + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IImage): google.cloud.dialogflow.v2.Intent.Message.Image; - /** CreateIntentRequest languageCode. */ - public languageCode: string; + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IImage, writer?: $protobuf.Writer): $protobuf.Writer; - /** CreateIntentRequest intentView. */ - public intentView: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView); + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IImage, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new CreateIntentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateIntentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2.ICreateIntentRequest): google.cloud.dialogflow.v2.CreateIntentRequest; + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.Image; - /** - * Encodes the specified CreateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateIntentRequest.verify|verify} messages. - * @param message CreateIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.ICreateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.Image; - /** - * Encodes the specified CreateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateIntentRequest.verify|verify} messages. - * @param message CreateIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies an Image message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a CreateIntentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateIntentRequest; + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.Image; - /** - * Decodes a CreateIntentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateIntentRequest; + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a CreateIntentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a CreateIntentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateIntentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateIntentRequest; + /** Properties of a QuickReplies. */ + interface IQuickReplies { - /** - * Creates a plain object from a CreateIntentRequest message. Also converts values to other types if specified. - * @param message CreateIntentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.CreateIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** QuickReplies title */ + title?: (string|null); - /** - * Converts this CreateIntentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** QuickReplies quickReplies */ + quickReplies?: (string[]|null); + } - /** Properties of an UpdateIntentRequest. */ - interface IUpdateIntentRequest { + /** Represents a QuickReplies. */ + class QuickReplies implements IQuickReplies { - /** UpdateIntentRequest intent */ - intent?: (google.cloud.dialogflow.v2.IIntent|null); + /** + * Constructs a new QuickReplies. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IQuickReplies); - /** UpdateIntentRequest languageCode */ - languageCode?: (string|null); + /** QuickReplies title. */ + public title: string; - /** UpdateIntentRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** QuickReplies quickReplies. */ + public quickReplies: string[]; - /** UpdateIntentRequest intentView */ - intentView?: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView|null); - } + /** + * Creates a new QuickReplies instance using the specified properties. + * @param [properties] Properties to set + * @returns QuickReplies instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IQuickReplies): google.cloud.dialogflow.v2.Intent.Message.QuickReplies; - /** Represents an UpdateIntentRequest. */ - class UpdateIntentRequest implements IUpdateIntentRequest { + /** + * Encodes the specified QuickReplies message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.QuickReplies.verify|verify} messages. + * @param message QuickReplies message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IQuickReplies, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new UpdateIntentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IUpdateIntentRequest); + /** + * Encodes the specified QuickReplies message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.QuickReplies.verify|verify} messages. + * @param message QuickReplies message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IQuickReplies, writer?: $protobuf.Writer): $protobuf.Writer; - /** UpdateIntentRequest intent. */ - public intent?: (google.cloud.dialogflow.v2.IIntent|null); + /** + * Decodes a QuickReplies message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuickReplies + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.QuickReplies; - /** UpdateIntentRequest languageCode. */ - public languageCode: string; + /** + * Decodes a QuickReplies message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuickReplies + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.QuickReplies; - /** UpdateIntentRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Verifies a QuickReplies message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** UpdateIntentRequest intentView. */ - public intentView: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView); + /** + * Creates a QuickReplies message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuickReplies + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.QuickReplies; - /** - * Creates a new UpdateIntentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateIntentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IUpdateIntentRequest): google.cloud.dialogflow.v2.UpdateIntentRequest; + /** + * Creates a plain object from a QuickReplies message. Also converts values to other types if specified. + * @param message QuickReplies + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.QuickReplies, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified UpdateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateIntentRequest.verify|verify} messages. - * @param message UpdateIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IUpdateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this QuickReplies to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified UpdateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateIntentRequest.verify|verify} messages. - * @param message UpdateIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a Card. */ + interface ICard { - /** - * Decodes an UpdateIntentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateIntentRequest; + /** Card title */ + title?: (string|null); - /** - * Decodes an UpdateIntentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateIntentRequest; + /** Card subtitle */ + subtitle?: (string|null); - /** - * Verifies an UpdateIntentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Card imageUri */ + imageUri?: (string|null); - /** - * Creates an UpdateIntentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateIntentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateIntentRequest; + /** Card buttons */ + buttons?: (google.cloud.dialogflow.v2.Intent.Message.Card.IButton[]|null); + } - /** - * Creates a plain object from an UpdateIntentRequest message. Also converts values to other types if specified. - * @param message UpdateIntentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.UpdateIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a Card. */ + class Card implements ICard { - /** - * Converts this UpdateIntentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new Card. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ICard); - /** Properties of a DeleteIntentRequest. */ - interface IDeleteIntentRequest { + /** Card title. */ + public title: string; - /** DeleteIntentRequest name */ - name?: (string|null); - } + /** Card subtitle. */ + public subtitle: string; - /** Represents a DeleteIntentRequest. */ - class DeleteIntentRequest implements IDeleteIntentRequest { + /** Card imageUri. */ + public imageUri: string; - /** - * Constructs a new DeleteIntentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IDeleteIntentRequest); + /** Card buttons. */ + public buttons: google.cloud.dialogflow.v2.Intent.Message.Card.IButton[]; - /** DeleteIntentRequest name. */ - public name: string; + /** + * Creates a new Card instance using the specified properties. + * @param [properties] Properties to set + * @returns Card instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ICard): google.cloud.dialogflow.v2.Intent.Message.Card; - /** - * Creates a new DeleteIntentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteIntentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IDeleteIntentRequest): google.cloud.dialogflow.v2.DeleteIntentRequest; + /** + * Encodes the specified Card message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.verify|verify} messages. + * @param message Card message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ICard, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DeleteIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteIntentRequest.verify|verify} messages. - * @param message DeleteIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IDeleteIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Card message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.verify|verify} messages. + * @param message Card message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ICard, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DeleteIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteIntentRequest.verify|verify} messages. - * @param message DeleteIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a Card message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.Card; - /** - * Decodes a DeleteIntentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteIntentRequest; + /** + * Decodes a Card message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.Card; - /** - * Decodes a DeleteIntentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteIntentRequest; + /** + * Verifies a Card message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a DeleteIntentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a Card message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Card + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.Card; - /** - * Creates a DeleteIntentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteIntentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteIntentRequest; + /** + * Creates a plain object from a Card message. Also converts values to other types if specified. + * @param message Card + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.Card, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a DeleteIntentRequest message. Also converts values to other types if specified. - * @param message DeleteIntentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.DeleteIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this Card to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this DeleteIntentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + namespace Card { - /** Properties of a BatchUpdateIntentsRequest. */ - interface IBatchUpdateIntentsRequest { + /** Properties of a Button. */ + interface IButton { - /** BatchUpdateIntentsRequest parent */ - parent?: (string|null); + /** Button text */ + text?: (string|null); - /** BatchUpdateIntentsRequest intentBatchUri */ - intentBatchUri?: (string|null); + /** Button postback */ + postback?: (string|null); + } - /** BatchUpdateIntentsRequest intentBatchInline */ - intentBatchInline?: (google.cloud.dialogflow.v2.IIntentBatch|null); + /** Represents a Button. */ + class Button implements IButton { - /** BatchUpdateIntentsRequest languageCode */ - languageCode?: (string|null); + /** + * Constructs a new Button. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.Card.IButton); - /** BatchUpdateIntentsRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** Button text. */ + public text: string; - /** BatchUpdateIntentsRequest intentView */ - intentView?: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView|null); - } + /** Button postback. */ + public postback: string; - /** Represents a BatchUpdateIntentsRequest. */ - class BatchUpdateIntentsRequest implements IBatchUpdateIntentsRequest { + /** + * Creates a new Button instance using the specified properties. + * @param [properties] Properties to set + * @returns Button instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.Card.IButton): google.cloud.dialogflow.v2.Intent.Message.Card.Button; - /** - * Constructs a new BatchUpdateIntentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest); + /** + * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.Button.verify|verify} messages. + * @param message Button message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.Card.IButton, writer?: $protobuf.Writer): $protobuf.Writer; - /** BatchUpdateIntentsRequest parent. */ - public parent: string; + /** + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.Button.verify|verify} messages. + * @param message Button message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.Card.IButton, writer?: $protobuf.Writer): $protobuf.Writer; - /** BatchUpdateIntentsRequest intentBatchUri. */ - public intentBatchUri: string; + /** + * Decodes a Button message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.Card.Button; - /** BatchUpdateIntentsRequest intentBatchInline. */ - public intentBatchInline?: (google.cloud.dialogflow.v2.IIntentBatch|null); + /** + * Decodes a Button message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.Card.Button; - /** BatchUpdateIntentsRequest languageCode. */ - public languageCode: string; + /** + * Verifies a Button message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** BatchUpdateIntentsRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Creates a Button message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Button + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.Card.Button; - /** BatchUpdateIntentsRequest intentView. */ - public intentView: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView); + /** + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @param message Button + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.Card.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** BatchUpdateIntentsRequest intentBatch. */ - public intentBatch?: ("intentBatchUri"|"intentBatchInline"); + /** + * Converts this Button to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Creates a new BatchUpdateIntentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchUpdateIntentsRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest): google.cloud.dialogflow.v2.BatchUpdateIntentsRequest; + /** Properties of a SimpleResponse. */ + interface ISimpleResponse { - /** - * Encodes the specified BatchUpdateIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.verify|verify} messages. - * @param message BatchUpdateIntentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** SimpleResponse textToSpeech */ + textToSpeech?: (string|null); - /** - * Encodes the specified BatchUpdateIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.verify|verify} messages. - * @param message BatchUpdateIntentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** SimpleResponse ssml */ + ssml?: (string|null); - /** - * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchUpdateIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchUpdateIntentsRequest; + /** SimpleResponse displayText */ + displayText?: (string|null); + } - /** - * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchUpdateIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchUpdateIntentsRequest; + /** Represents a SimpleResponse. */ + class SimpleResponse implements ISimpleResponse { - /** - * Verifies a BatchUpdateIntentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new SimpleResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse); - /** - * Creates a BatchUpdateIntentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchUpdateIntentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchUpdateIntentsRequest; + /** SimpleResponse textToSpeech. */ + public textToSpeech: string; - /** - * Creates a plain object from a BatchUpdateIntentsRequest message. Also converts values to other types if specified. - * @param message BatchUpdateIntentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.BatchUpdateIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** SimpleResponse ssml. */ + public ssml: string; - /** - * Converts this BatchUpdateIntentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** SimpleResponse displayText. */ + public displayText: string; - /** Properties of a BatchUpdateIntentsResponse. */ - interface IBatchUpdateIntentsResponse { + /** + * Creates a new SimpleResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SimpleResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse): google.cloud.dialogflow.v2.Intent.Message.SimpleResponse; - /** BatchUpdateIntentsResponse intents */ - intents?: (google.cloud.dialogflow.v2.IIntent[]|null); - } + /** + * Encodes the specified SimpleResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.verify|verify} messages. + * @param message SimpleResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a BatchUpdateIntentsResponse. */ - class BatchUpdateIntentsResponse implements IBatchUpdateIntentsResponse { + /** + * Encodes the specified SimpleResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.verify|verify} messages. + * @param message SimpleResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new BatchUpdateIntentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse); + /** + * Decodes a SimpleResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SimpleResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.SimpleResponse; - /** BatchUpdateIntentsResponse intents. */ - public intents: google.cloud.dialogflow.v2.IIntent[]; + /** + * Decodes a SimpleResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SimpleResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.SimpleResponse; - /** - * Creates a new BatchUpdateIntentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchUpdateIntentsResponse instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse): google.cloud.dialogflow.v2.BatchUpdateIntentsResponse; + /** + * Verifies a SimpleResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified BatchUpdateIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.verify|verify} messages. - * @param message BatchUpdateIntentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a SimpleResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SimpleResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.SimpleResponse; - /** - * Encodes the specified BatchUpdateIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.verify|verify} messages. - * @param message BatchUpdateIntentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a SimpleResponse message. Also converts values to other types if specified. + * @param message SimpleResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.SimpleResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchUpdateIntentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchUpdateIntentsResponse; + /** + * Converts this SimpleResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchUpdateIntentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchUpdateIntentsResponse; + /** Properties of a SimpleResponses. */ + interface ISimpleResponses { - /** - * Verifies a BatchUpdateIntentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** SimpleResponses simpleResponses */ + simpleResponses?: (google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse[]|null); + } - /** - * Creates a BatchUpdateIntentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchUpdateIntentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchUpdateIntentsResponse; + /** Represents a SimpleResponses. */ + class SimpleResponses implements ISimpleResponses { - /** - * Creates a plain object from a BatchUpdateIntentsResponse message. Also converts values to other types if specified. - * @param message BatchUpdateIntentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.BatchUpdateIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new SimpleResponses. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses); - /** - * Converts this BatchUpdateIntentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** SimpleResponses simpleResponses. */ + public simpleResponses: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse[]; - /** Properties of a BatchDeleteIntentsRequest. */ - interface IBatchDeleteIntentsRequest { + /** + * Creates a new SimpleResponses instance using the specified properties. + * @param [properties] Properties to set + * @returns SimpleResponses instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses): google.cloud.dialogflow.v2.Intent.Message.SimpleResponses; - /** BatchDeleteIntentsRequest parent */ - parent?: (string|null); + /** + * Encodes the specified SimpleResponses message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.verify|verify} messages. + * @param message SimpleResponses message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses, writer?: $protobuf.Writer): $protobuf.Writer; - /** BatchDeleteIntentsRequest intents */ - intents?: (google.cloud.dialogflow.v2.IIntent[]|null); - } + /** + * Encodes the specified SimpleResponses message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.verify|verify} messages. + * @param message SimpleResponses message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a BatchDeleteIntentsRequest. */ - class BatchDeleteIntentsRequest implements IBatchDeleteIntentsRequest { + /** + * Decodes a SimpleResponses message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SimpleResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.SimpleResponses; - /** - * Constructs a new BatchDeleteIntentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest); + /** + * Decodes a SimpleResponses message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SimpleResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.SimpleResponses; - /** BatchDeleteIntentsRequest parent. */ - public parent: string; + /** + * Verifies a SimpleResponses message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** BatchDeleteIntentsRequest intents. */ - public intents: google.cloud.dialogflow.v2.IIntent[]; + /** + * Creates a SimpleResponses message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SimpleResponses + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.SimpleResponses; - /** - * Creates a new BatchDeleteIntentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDeleteIntentsRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest): google.cloud.dialogflow.v2.BatchDeleteIntentsRequest; + /** + * Creates a plain object from a SimpleResponses message. Also converts values to other types if specified. + * @param message SimpleResponses + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.SimpleResponses, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified BatchDeleteIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.verify|verify} messages. - * @param message BatchDeleteIntentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this SimpleResponses to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified BatchDeleteIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.verify|verify} messages. - * @param message BatchDeleteIntentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a BasicCard. */ + interface IBasicCard { - /** - * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDeleteIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchDeleteIntentsRequest; + /** BasicCard title */ + title?: (string|null); - /** - * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDeleteIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchDeleteIntentsRequest; + /** BasicCard subtitle */ + subtitle?: (string|null); - /** - * Verifies a BatchDeleteIntentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** BasicCard formattedText */ + formattedText?: (string|null); - /** - * Creates a BatchDeleteIntentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDeleteIntentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchDeleteIntentsRequest; + /** BasicCard image */ + image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** - * Creates a plain object from a BatchDeleteIntentsRequest message. Also converts values to other types if specified. - * @param message BatchDeleteIntentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.BatchDeleteIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** BasicCard buttons */ + buttons?: (google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton[]|null); + } - /** - * Converts this BatchDeleteIntentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a BasicCard. */ + class BasicCard implements IBasicCard { - /** Properties of an IntentBatch. */ - interface IIntentBatch { + /** + * Constructs a new BasicCard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IBasicCard); - /** IntentBatch intents */ - intents?: (google.cloud.dialogflow.v2.IIntent[]|null); - } + /** BasicCard title. */ + public title: string; - /** Represents an IntentBatch. */ - class IntentBatch implements IIntentBatch { + /** BasicCard subtitle. */ + public subtitle: string; - /** - * Constructs a new IntentBatch. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IIntentBatch); + /** BasicCard formattedText. */ + public formattedText: string; - /** IntentBatch intents. */ - public intents: google.cloud.dialogflow.v2.IIntent[]; + /** BasicCard image. */ + public image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** - * Creates a new IntentBatch instance using the specified properties. - * @param [properties] Properties to set - * @returns IntentBatch instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IIntentBatch): google.cloud.dialogflow.v2.IntentBatch; + /** BasicCard buttons. */ + public buttons: google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton[]; - /** - * Encodes the specified IntentBatch message. Does not implicitly {@link google.cloud.dialogflow.v2.IntentBatch.verify|verify} messages. - * @param message IntentBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IIntentBatch, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new BasicCard instance using the specified properties. + * @param [properties] Properties to set + * @returns BasicCard instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IBasicCard): google.cloud.dialogflow.v2.Intent.Message.BasicCard; - /** - * Encodes the specified IntentBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.IntentBatch.verify|verify} messages. - * @param message IntentBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IIntentBatch, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified BasicCard message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.verify|verify} messages. + * @param message BasicCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IBasicCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an IntentBatch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntentBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.IntentBatch; + /** + * Encodes the specified BasicCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.verify|verify} messages. + * @param message BasicCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IBasicCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an IntentBatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntentBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.IntentBatch; + /** + * Decodes a BasicCard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BasicCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.BasicCard; - /** - * Verifies an IntentBatch message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a BasicCard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BasicCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.BasicCard; - /** - * Creates an IntentBatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntentBatch - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.IntentBatch; + /** + * Verifies a BasicCard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from an IntentBatch message. Also converts values to other types if specified. - * @param message IntentBatch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.IntentBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a BasicCard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BasicCard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.BasicCard; - /** - * Converts this IntentBatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a BasicCard message. Also converts values to other types if specified. + * @param message BasicCard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** IntentView enum. */ - enum IntentView { - INTENT_VIEW_UNSPECIFIED = 0, - INTENT_VIEW_FULL = 1 - } + /** + * Converts this BasicCard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a Sessions */ - class Sessions extends $protobuf.rpc.Service { + namespace BasicCard { - /** - * Constructs a new Sessions service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** Properties of a Button. */ + interface IButton { - /** - * Creates new Sessions service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Sessions; + /** Button title */ + title?: (string|null); - /** - * Calls DetectIntent. - * @param request DetectIntentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DetectIntentResponse - */ - public detectIntent(request: google.cloud.dialogflow.v2.IDetectIntentRequest, callback: google.cloud.dialogflow.v2.Sessions.DetectIntentCallback): void; + /** Button openUriAction */ + openUriAction?: (google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction|null); + } - /** - * Calls DetectIntent. - * @param request DetectIntentRequest message or plain object - * @returns Promise - */ - public detectIntent(request: google.cloud.dialogflow.v2.IDetectIntentRequest): Promise; + /** Represents a Button. */ + class Button implements IButton { - /** - * Calls StreamingDetectIntent. - * @param request StreamingDetectIntentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and StreamingDetectIntentResponse - */ - public streamingDetectIntent(request: google.cloud.dialogflow.v2.IStreamingDetectIntentRequest, callback: google.cloud.dialogflow.v2.Sessions.StreamingDetectIntentCallback): void; - - /** - * Calls StreamingDetectIntent. - * @param request StreamingDetectIntentRequest message or plain object - * @returns Promise - */ - public streamingDetectIntent(request: google.cloud.dialogflow.v2.IStreamingDetectIntentRequest): Promise; - } - - namespace Sessions { + /** + * Constructs a new Button. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton); - /** - * Callback as used by {@link google.cloud.dialogflow.v2.Sessions#detectIntent}. - * @param error Error, if any - * @param [response] DetectIntentResponse - */ - type DetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.DetectIntentResponse) => void; + /** Button title. */ + public title: string; - /** - * Callback as used by {@link google.cloud.dialogflow.v2.Sessions#streamingDetectIntent}. - * @param error Error, if any - * @param [response] StreamingDetectIntentResponse - */ - type StreamingDetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.StreamingDetectIntentResponse) => void; - } + /** Button openUriAction. */ + public openUriAction?: (google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction|null); - /** Properties of a DetectIntentRequest. */ - interface IDetectIntentRequest { + /** + * Creates a new Button instance using the specified properties. + * @param [properties] Properties to set + * @returns Button instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button; - /** DetectIntentRequest session */ - session?: (string|null); + /** + * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.verify|verify} messages. + * @param message Button message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton, writer?: $protobuf.Writer): $protobuf.Writer; - /** DetectIntentRequest queryParams */ - queryParams?: (google.cloud.dialogflow.v2.IQueryParameters|null); + /** + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.verify|verify} messages. + * @param message Button message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton, writer?: $protobuf.Writer): $protobuf.Writer; - /** DetectIntentRequest queryInput */ - queryInput?: (google.cloud.dialogflow.v2.IQueryInput|null); + /** + * Decodes a Button message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button; - /** DetectIntentRequest outputAudioConfig */ - outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); + /** + * Decodes a Button message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button; - /** DetectIntentRequest outputAudioConfigMask */ - outputAudioConfigMask?: (google.protobuf.IFieldMask|null); + /** + * Verifies a Button message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** DetectIntentRequest inputAudio */ - inputAudio?: (Uint8Array|string|null); - } + /** + * Creates a Button message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Button + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button; - /** Represents a DetectIntentRequest. */ - class DetectIntentRequest implements IDetectIntentRequest { + /** + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @param message Button + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new DetectIntentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IDetectIntentRequest); + /** + * Converts this Button to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** DetectIntentRequest session. */ - public session: string; + namespace Button { - /** DetectIntentRequest queryParams. */ - public queryParams?: (google.cloud.dialogflow.v2.IQueryParameters|null); + /** Properties of an OpenUriAction. */ + interface IOpenUriAction { - /** DetectIntentRequest queryInput. */ - public queryInput?: (google.cloud.dialogflow.v2.IQueryInput|null); + /** OpenUriAction uri */ + uri?: (string|null); + } - /** DetectIntentRequest outputAudioConfig. */ - public outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); + /** Represents an OpenUriAction. */ + class OpenUriAction implements IOpenUriAction { - /** DetectIntentRequest outputAudioConfigMask. */ - public outputAudioConfigMask?: (google.protobuf.IFieldMask|null); + /** + * Constructs a new OpenUriAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction); - /** DetectIntentRequest inputAudio. */ - public inputAudio: (Uint8Array|string); + /** OpenUriAction uri. */ + public uri: string; - /** - * Creates a new DetectIntentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DetectIntentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IDetectIntentRequest): google.cloud.dialogflow.v2.DetectIntentRequest; + /** + * Creates a new OpenUriAction instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenUriAction instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction; - /** - * Encodes the specified DetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentRequest.verify|verify} messages. - * @param message DetectIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified OpenUriAction message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. + * @param message OpenUriAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentRequest.verify|verify} messages. - * @param message DetectIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified OpenUriAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. + * @param message OpenUriAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a DetectIntentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DetectIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DetectIntentRequest; + /** + * Decodes an OpenUriAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenUriAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction; - /** - * Decodes a DetectIntentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DetectIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DetectIntentRequest; + /** + * Decodes an OpenUriAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenUriAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction; - /** - * Verifies a DetectIntentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies an OpenUriAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a DetectIntentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DetectIntentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DetectIntentRequest; + /** + * Creates an OpenUriAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenUriAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction; - /** - * Creates a plain object from a DetectIntentRequest message. Also converts values to other types if specified. - * @param message DetectIntentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.DetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from an OpenUriAction message. Also converts values to other types if specified. + * @param message OpenUriAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this DetectIntentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this OpenUriAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } - /** Properties of a DetectIntentResponse. */ - interface IDetectIntentResponse { + /** Properties of a Suggestion. */ + interface ISuggestion { - /** DetectIntentResponse responseId */ - responseId?: (string|null); + /** Suggestion title */ + title?: (string|null); + } - /** DetectIntentResponse queryResult */ - queryResult?: (google.cloud.dialogflow.v2.IQueryResult|null); + /** Represents a Suggestion. */ + class Suggestion implements ISuggestion { - /** DetectIntentResponse webhookStatus */ - webhookStatus?: (google.rpc.IStatus|null); + /** + * Constructs a new Suggestion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ISuggestion); - /** DetectIntentResponse outputAudio */ - outputAudio?: (Uint8Array|string|null); + /** Suggestion title. */ + public title: string; - /** DetectIntentResponse outputAudioConfig */ - outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); - } + /** + * Creates a new Suggestion instance using the specified properties. + * @param [properties] Properties to set + * @returns Suggestion instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ISuggestion): google.cloud.dialogflow.v2.Intent.Message.Suggestion; - /** Represents a DetectIntentResponse. */ - class DetectIntentResponse implements IDetectIntentResponse { + /** + * Encodes the specified Suggestion message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestion.verify|verify} messages. + * @param message Suggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ISuggestion, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new DetectIntentResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IDetectIntentResponse); + /** + * Encodes the specified Suggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestion.verify|verify} messages. + * @param message Suggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ISuggestion, writer?: $protobuf.Writer): $protobuf.Writer; - /** DetectIntentResponse responseId. */ - public responseId: string; + /** + * Decodes a Suggestion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.Suggestion; - /** DetectIntentResponse queryResult. */ - public queryResult?: (google.cloud.dialogflow.v2.IQueryResult|null); + /** + * Decodes a Suggestion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.Suggestion; - /** DetectIntentResponse webhookStatus. */ - public webhookStatus?: (google.rpc.IStatus|null); + /** + * Verifies a Suggestion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** DetectIntentResponse outputAudio. */ - public outputAudio: (Uint8Array|string); + /** + * Creates a Suggestion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Suggestion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.Suggestion; - /** DetectIntentResponse outputAudioConfig. */ - public outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); + /** + * Creates a plain object from a Suggestion message. Also converts values to other types if specified. + * @param message Suggestion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.Suggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new DetectIntentResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns DetectIntentResponse instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IDetectIntentResponse): google.cloud.dialogflow.v2.DetectIntentResponse; + /** + * Converts this Suggestion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified DetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentResponse.verify|verify} messages. - * @param message DetectIntentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a Suggestions. */ + interface ISuggestions { - /** - * Encodes the specified DetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentResponse.verify|verify} messages. - * @param message DetectIntentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Suggestions suggestions */ + suggestions?: (google.cloud.dialogflow.v2.Intent.Message.ISuggestion[]|null); + } - /** - * Decodes a DetectIntentResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DetectIntentResponse; + /** Represents a Suggestions. */ + class Suggestions implements ISuggestions { - /** - * Decodes a DetectIntentResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DetectIntentResponse; + /** + * Constructs a new Suggestions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ISuggestions); - /** - * Verifies a DetectIntentResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Suggestions suggestions. */ + public suggestions: google.cloud.dialogflow.v2.Intent.Message.ISuggestion[]; - /** - * Creates a DetectIntentResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DetectIntentResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DetectIntentResponse; + /** + * Creates a new Suggestions instance using the specified properties. + * @param [properties] Properties to set + * @returns Suggestions instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ISuggestions): google.cloud.dialogflow.v2.Intent.Message.Suggestions; - /** - * Creates a plain object from a DetectIntentResponse message. Also converts values to other types if specified. - * @param message DetectIntentResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.DetectIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified Suggestions message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestions.verify|verify} messages. + * @param message Suggestions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ISuggestions, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this DetectIntentResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified Suggestions message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestions.verify|verify} messages. + * @param message Suggestions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ISuggestions, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a QueryParameters. */ - interface IQueryParameters { + /** + * Decodes a Suggestions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Suggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.Suggestions; - /** QueryParameters timeZone */ - timeZone?: (string|null); + /** + * Decodes a Suggestions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Suggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.Suggestions; - /** QueryParameters geoLocation */ - geoLocation?: (google.type.ILatLng|null); + /** + * Verifies a Suggestions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** QueryParameters contexts */ - contexts?: (google.cloud.dialogflow.v2.IContext[]|null); + /** + * Creates a Suggestions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Suggestions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.Suggestions; - /** QueryParameters resetContexts */ - resetContexts?: (boolean|null); + /** + * Creates a plain object from a Suggestions message. Also converts values to other types if specified. + * @param message Suggestions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.Suggestions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** QueryParameters sessionEntityTypes */ - sessionEntityTypes?: (google.cloud.dialogflow.v2.ISessionEntityType[]|null); + /** + * Converts this Suggestions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** QueryParameters payload */ - payload?: (google.protobuf.IStruct|null); + /** Properties of a LinkOutSuggestion. */ + interface ILinkOutSuggestion { - /** QueryParameters sentimentAnalysisRequestConfig */ - sentimentAnalysisRequestConfig?: (google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig|null); + /** LinkOutSuggestion destinationName */ + destinationName?: (string|null); - /** QueryParameters webhookHeaders */ - webhookHeaders?: ({ [k: string]: string }|null); - } + /** LinkOutSuggestion uri */ + uri?: (string|null); + } - /** Represents a QueryParameters. */ - class QueryParameters implements IQueryParameters { + /** Represents a LinkOutSuggestion. */ + class LinkOutSuggestion implements ILinkOutSuggestion { - /** - * Constructs a new QueryParameters. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IQueryParameters); + /** + * Constructs a new LinkOutSuggestion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion); - /** QueryParameters timeZone. */ - public timeZone: string; + /** LinkOutSuggestion destinationName. */ + public destinationName: string; - /** QueryParameters geoLocation. */ - public geoLocation?: (google.type.ILatLng|null); + /** LinkOutSuggestion uri. */ + public uri: string; - /** QueryParameters contexts. */ - public contexts: google.cloud.dialogflow.v2.IContext[]; + /** + * Creates a new LinkOutSuggestion instance using the specified properties. + * @param [properties] Properties to set + * @returns LinkOutSuggestion instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion): google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion; - /** QueryParameters resetContexts. */ - public resetContexts: boolean; + /** + * Encodes the specified LinkOutSuggestion message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.verify|verify} messages. + * @param message LinkOutSuggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion, writer?: $protobuf.Writer): $protobuf.Writer; - /** QueryParameters sessionEntityTypes. */ - public sessionEntityTypes: google.cloud.dialogflow.v2.ISessionEntityType[]; + /** + * Encodes the specified LinkOutSuggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.verify|verify} messages. + * @param message LinkOutSuggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion, writer?: $protobuf.Writer): $protobuf.Writer; - /** QueryParameters payload. */ - public payload?: (google.protobuf.IStruct|null); + /** + * Decodes a LinkOutSuggestion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LinkOutSuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion; - /** QueryParameters sentimentAnalysisRequestConfig. */ - public sentimentAnalysisRequestConfig?: (google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig|null); + /** + * Decodes a LinkOutSuggestion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LinkOutSuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion; - /** QueryParameters webhookHeaders. */ - public webhookHeaders: { [k: string]: string }; + /** + * Verifies a LinkOutSuggestion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new QueryParameters instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryParameters instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IQueryParameters): google.cloud.dialogflow.v2.QueryParameters; + /** + * Creates a LinkOutSuggestion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LinkOutSuggestion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion; - /** - * Encodes the specified QueryParameters message. Does not implicitly {@link google.cloud.dialogflow.v2.QueryParameters.verify|verify} messages. - * @param message QueryParameters message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a LinkOutSuggestion message. Also converts values to other types if specified. + * @param message LinkOutSuggestion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified QueryParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.QueryParameters.verify|verify} messages. - * @param message QueryParameters message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this LinkOutSuggestion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a QueryParameters message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryParameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.QueryParameters; + /** Properties of a ListSelect. */ + interface IListSelect { - /** - * Decodes a QueryParameters message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryParameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.QueryParameters; + /** ListSelect title */ + title?: (string|null); - /** - * Verifies a QueryParameters message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ListSelect items */ + items?: (google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem[]|null); - /** - * Creates a QueryParameters message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryParameters - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.QueryParameters; + /** ListSelect subtitle */ + subtitle?: (string|null); + } - /** - * Creates a plain object from a QueryParameters message. Also converts values to other types if specified. - * @param message QueryParameters - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.QueryParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a ListSelect. */ + class ListSelect implements IListSelect { - /** - * Converts this QueryParameters to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new ListSelect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IListSelect); - /** Properties of a QueryInput. */ - interface IQueryInput { + /** ListSelect title. */ + public title: string; - /** QueryInput audioConfig */ - audioConfig?: (google.cloud.dialogflow.v2.IInputAudioConfig|null); + /** ListSelect items. */ + public items: google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem[]; - /** QueryInput text */ - text?: (google.cloud.dialogflow.v2.ITextInput|null); + /** ListSelect subtitle. */ + public subtitle: string; - /** QueryInput event */ - event?: (google.cloud.dialogflow.v2.IEventInput|null); - } + /** + * Creates a new ListSelect instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSelect instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IListSelect): google.cloud.dialogflow.v2.Intent.Message.ListSelect; - /** Represents a QueryInput. */ - class QueryInput implements IQueryInput { + /** + * Encodes the specified ListSelect message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.verify|verify} messages. + * @param message ListSelect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IListSelect, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new QueryInput. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IQueryInput); + /** + * Encodes the specified ListSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.verify|verify} messages. + * @param message ListSelect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IListSelect, writer?: $protobuf.Writer): $protobuf.Writer; - /** QueryInput audioConfig. */ - public audioConfig?: (google.cloud.dialogflow.v2.IInputAudioConfig|null); + /** + * Decodes a ListSelect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.ListSelect; - /** QueryInput text. */ - public text?: (google.cloud.dialogflow.v2.ITextInput|null); + /** + * Decodes a ListSelect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.ListSelect; - /** QueryInput event. */ - public event?: (google.cloud.dialogflow.v2.IEventInput|null); + /** + * Verifies a ListSelect message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** QueryInput input. */ - public input?: ("audioConfig"|"text"|"event"); + /** + * Creates a ListSelect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSelect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.ListSelect; - /** - * Creates a new QueryInput instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryInput instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IQueryInput): google.cloud.dialogflow.v2.QueryInput; + /** + * Creates a plain object from a ListSelect message. Also converts values to other types if specified. + * @param message ListSelect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.ListSelect, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified QueryInput message. Does not implicitly {@link google.cloud.dialogflow.v2.QueryInput.verify|verify} messages. - * @param message QueryInput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IQueryInput, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this ListSelect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified QueryInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.QueryInput.verify|verify} messages. - * @param message QueryInput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IQueryInput, writer?: $protobuf.Writer): $protobuf.Writer; + namespace ListSelect { - /** - * Decodes a QueryInput message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.QueryInput; + /** Properties of an Item. */ + interface IItem { - /** - * Decodes a QueryInput message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.QueryInput; + /** Item info */ + info?: (google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null); - /** - * Verifies a QueryInput message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Item title */ + title?: (string|null); - /** - * Creates a QueryInput message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryInput - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.QueryInput; + /** Item description */ + description?: (string|null); - /** - * Creates a plain object from a QueryInput message. Also converts values to other types if specified. - * @param message QueryInput - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.QueryInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Item image */ + image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + } - /** - * Converts this QueryInput to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents an Item. */ + class Item implements IItem { - /** Properties of a QueryResult. */ - interface IQueryResult { + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem); - /** QueryResult queryText */ - queryText?: (string|null); + /** Item info. */ + public info?: (google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null); - /** QueryResult languageCode */ - languageCode?: (string|null); + /** Item title. */ + public title: string; - /** QueryResult speechRecognitionConfidence */ - speechRecognitionConfidence?: (number|null); + /** Item description. */ + public description: string; - /** QueryResult action */ - action?: (string|null); + /** Item image. */ + public image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** QueryResult parameters */ - parameters?: (google.protobuf.IStruct|null); + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem): google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item; - /** QueryResult allRequiredParamsPresent */ - allRequiredParamsPresent?: (boolean|null); + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; - /** QueryResult fulfillmentText */ - fulfillmentText?: (string|null); + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; - /** QueryResult fulfillmentMessages */ - fulfillmentMessages?: (google.cloud.dialogflow.v2.Intent.IMessage[]|null); + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item; - /** QueryResult webhookSource */ - webhookSource?: (string|null); + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item; - /** QueryResult webhookPayload */ - webhookPayload?: (google.protobuf.IStruct|null); + /** + * Verifies an Item message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** QueryResult outputContexts */ - outputContexts?: (google.cloud.dialogflow.v2.IContext[]|null); + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item; - /** QueryResult intent */ - intent?: (google.cloud.dialogflow.v2.IIntent|null); + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** QueryResult intentDetectionConfidence */ - intentDetectionConfidence?: (number|null); + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** QueryResult diagnosticInfo */ - diagnosticInfo?: (google.protobuf.IStruct|null); + /** Properties of a CarouselSelect. */ + interface ICarouselSelect { - /** QueryResult sentimentAnalysisResult */ - sentimentAnalysisResult?: (google.cloud.dialogflow.v2.ISentimentAnalysisResult|null); - } + /** CarouselSelect items */ + items?: (google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem[]|null); + } - /** Represents a QueryResult. */ - class QueryResult implements IQueryResult { + /** Represents a CarouselSelect. */ + class CarouselSelect implements ICarouselSelect { - /** - * Constructs a new QueryResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IQueryResult); + /** + * Constructs a new CarouselSelect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect); - /** QueryResult queryText. */ - public queryText: string; + /** CarouselSelect items. */ + public items: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem[]; - /** QueryResult languageCode. */ - public languageCode: string; + /** + * Creates a new CarouselSelect instance using the specified properties. + * @param [properties] Properties to set + * @returns CarouselSelect instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect; - /** QueryResult speechRecognitionConfidence. */ - public speechRecognitionConfidence: number; - - /** QueryResult action. */ - public action: string; + /** + * Encodes the specified CarouselSelect message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.verify|verify} messages. + * @param message CarouselSelect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect, writer?: $protobuf.Writer): $protobuf.Writer; - /** QueryResult parameters. */ - public parameters?: (google.protobuf.IStruct|null); + /** + * Encodes the specified CarouselSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.verify|verify} messages. + * @param message CarouselSelect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect, writer?: $protobuf.Writer): $protobuf.Writer; - /** QueryResult allRequiredParamsPresent. */ - public allRequiredParamsPresent: boolean; + /** + * Decodes a CarouselSelect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CarouselSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect; - /** QueryResult fulfillmentText. */ - public fulfillmentText: string; + /** + * Decodes a CarouselSelect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CarouselSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect; - /** QueryResult fulfillmentMessages. */ - public fulfillmentMessages: google.cloud.dialogflow.v2.Intent.IMessage[]; + /** + * Verifies a CarouselSelect message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** QueryResult webhookSource. */ - public webhookSource: string; + /** + * Creates a CarouselSelect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CarouselSelect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect; - /** QueryResult webhookPayload. */ - public webhookPayload?: (google.protobuf.IStruct|null); + /** + * Creates a plain object from a CarouselSelect message. Also converts values to other types if specified. + * @param message CarouselSelect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** QueryResult outputContexts. */ - public outputContexts: google.cloud.dialogflow.v2.IContext[]; + /** + * Converts this CarouselSelect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** QueryResult intent. */ - public intent?: (google.cloud.dialogflow.v2.IIntent|null); + namespace CarouselSelect { - /** QueryResult intentDetectionConfidence. */ - public intentDetectionConfidence: number; + /** Properties of an Item. */ + interface IItem { - /** QueryResult diagnosticInfo. */ - public diagnosticInfo?: (google.protobuf.IStruct|null); + /** Item info */ + info?: (google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null); - /** QueryResult sentimentAnalysisResult. */ - public sentimentAnalysisResult?: (google.cloud.dialogflow.v2.ISentimentAnalysisResult|null); + /** Item title */ + title?: (string|null); - /** - * Creates a new QueryResult instance using the specified properties. - * @param [properties] Properties to set - * @returns QueryResult instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IQueryResult): google.cloud.dialogflow.v2.QueryResult; + /** Item description */ + description?: (string|null); - /** - * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.dialogflow.v2.QueryResult.verify|verify} messages. - * @param message QueryResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** Item image */ + image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); + } - /** - * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.QueryResult.verify|verify} messages. - * @param message QueryResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents an Item. */ + class Item implements IItem { - /** - * Decodes a QueryResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.QueryResult; + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem); - /** - * Decodes a QueryResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.QueryResult; + /** Item info. */ + public info?: (google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null); - /** - * Verifies a QueryResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Item title. */ + public title: string; - /** - * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QueryResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.QueryResult; + /** Item description. */ + public description: string; - /** - * Creates a plain object from a QueryResult message. Also converts values to other types if specified. - * @param message QueryResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.QueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Item image. */ + public image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** - * Converts this QueryResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item; - /** Properties of a StreamingDetectIntentRequest. */ - interface IStreamingDetectIntentRequest { + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; - /** StreamingDetectIntentRequest session */ - session?: (string|null); + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; - /** StreamingDetectIntentRequest queryParams */ - queryParams?: (google.cloud.dialogflow.v2.IQueryParameters|null); + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item; - /** StreamingDetectIntentRequest queryInput */ - queryInput?: (google.cloud.dialogflow.v2.IQueryInput|null); + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item; - /** StreamingDetectIntentRequest singleUtterance */ - singleUtterance?: (boolean|null); + /** + * Verifies an Item message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** StreamingDetectIntentRequest outputAudioConfig */ - outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item; - /** StreamingDetectIntentRequest outputAudioConfigMask */ - outputAudioConfigMask?: (google.protobuf.IFieldMask|null); + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** StreamingDetectIntentRequest inputAudio */ - inputAudio?: (Uint8Array|string|null); - } + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** Represents a StreamingDetectIntentRequest. */ - class StreamingDetectIntentRequest implements IStreamingDetectIntentRequest { + /** Properties of a SelectItemInfo. */ + interface ISelectItemInfo { - /** - * Constructs a new StreamingDetectIntentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IStreamingDetectIntentRequest); + /** SelectItemInfo key */ + key?: (string|null); - /** StreamingDetectIntentRequest session. */ - public session: string; + /** SelectItemInfo synonyms */ + synonyms?: (string[]|null); + } - /** StreamingDetectIntentRequest queryParams. */ - public queryParams?: (google.cloud.dialogflow.v2.IQueryParameters|null); + /** Represents a SelectItemInfo. */ + class SelectItemInfo implements ISelectItemInfo { - /** StreamingDetectIntentRequest queryInput. */ - public queryInput?: (google.cloud.dialogflow.v2.IQueryInput|null); + /** + * Constructs a new SelectItemInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo); - /** StreamingDetectIntentRequest singleUtterance. */ - public singleUtterance: boolean; + /** SelectItemInfo key. */ + public key: string; - /** StreamingDetectIntentRequest outputAudioConfig. */ - public outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); + /** SelectItemInfo synonyms. */ + public synonyms: string[]; - /** StreamingDetectIntentRequest outputAudioConfigMask. */ - public outputAudioConfigMask?: (google.protobuf.IFieldMask|null); + /** + * Creates a new SelectItemInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectItemInfo instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo): google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo; - /** StreamingDetectIntentRequest inputAudio. */ - public inputAudio: (Uint8Array|string); + /** + * Encodes the specified SelectItemInfo message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.verify|verify} messages. + * @param message SelectItemInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new StreamingDetectIntentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns StreamingDetectIntentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IStreamingDetectIntentRequest): google.cloud.dialogflow.v2.StreamingDetectIntentRequest; + /** + * Encodes the specified SelectItemInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.verify|verify} messages. + * @param message SelectItemInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified StreamingDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentRequest.verify|verify} messages. - * @param message StreamingDetectIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IStreamingDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a SelectItemInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectItemInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo; - /** - * Encodes the specified StreamingDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentRequest.verify|verify} messages. - * @param message StreamingDetectIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IStreamingDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a SelectItemInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectItemInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo; - /** - * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StreamingDetectIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.StreamingDetectIntentRequest; + /** + * Verifies a SelectItemInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StreamingDetectIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.StreamingDetectIntentRequest; + /** + * Creates a SelectItemInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectItemInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo; - /** - * Verifies a StreamingDetectIntentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from a SelectItemInfo message. Also converts values to other types if specified. + * @param message SelectItemInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a StreamingDetectIntentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StreamingDetectIntentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.StreamingDetectIntentRequest; + /** + * Converts this SelectItemInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a StreamingDetectIntentRequest message. Also converts values to other types if specified. - * @param message StreamingDetectIntentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.StreamingDetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a MediaContent. */ + interface IMediaContent { - /** - * Converts this StreamingDetectIntentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** MediaContent mediaType */ + mediaType?: (google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType|keyof typeof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType|null); - /** Properties of a StreamingDetectIntentResponse. */ - interface IStreamingDetectIntentResponse { + /** MediaContent mediaObjects */ + mediaObjects?: (google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject[]|null); + } - /** StreamingDetectIntentResponse responseId */ - responseId?: (string|null); + /** Represents a MediaContent. */ + class MediaContent implements IMediaContent { - /** StreamingDetectIntentResponse recognitionResult */ - recognitionResult?: (google.cloud.dialogflow.v2.IStreamingRecognitionResult|null); + /** + * Constructs a new MediaContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IMediaContent); - /** StreamingDetectIntentResponse queryResult */ - queryResult?: (google.cloud.dialogflow.v2.IQueryResult|null); + /** MediaContent mediaType. */ + public mediaType: (google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType|keyof typeof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType); - /** StreamingDetectIntentResponse webhookStatus */ - webhookStatus?: (google.rpc.IStatus|null); + /** MediaContent mediaObjects. */ + public mediaObjects: google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject[]; - /** StreamingDetectIntentResponse outputAudio */ - outputAudio?: (Uint8Array|string|null); + /** + * Creates a new MediaContent instance using the specified properties. + * @param [properties] Properties to set + * @returns MediaContent instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IMediaContent): google.cloud.dialogflow.v2.Intent.Message.MediaContent; - /** StreamingDetectIntentResponse outputAudioConfig */ - outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); - } + /** + * Encodes the specified MediaContent message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.verify|verify} messages. + * @param message MediaContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IMediaContent, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a StreamingDetectIntentResponse. */ - class StreamingDetectIntentResponse implements IStreamingDetectIntentResponse { + /** + * Encodes the specified MediaContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.verify|verify} messages. + * @param message MediaContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IMediaContent, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new StreamingDetectIntentResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IStreamingDetectIntentResponse); + /** + * Decodes a MediaContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MediaContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.MediaContent; - /** StreamingDetectIntentResponse responseId. */ - public responseId: string; + /** + * Decodes a MediaContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MediaContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.MediaContent; - /** StreamingDetectIntentResponse recognitionResult. */ - public recognitionResult?: (google.cloud.dialogflow.v2.IStreamingRecognitionResult|null); + /** + * Verifies a MediaContent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** StreamingDetectIntentResponse queryResult. */ - public queryResult?: (google.cloud.dialogflow.v2.IQueryResult|null); + /** + * Creates a MediaContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MediaContent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.MediaContent; - /** StreamingDetectIntentResponse webhookStatus. */ - public webhookStatus?: (google.rpc.IStatus|null); + /** + * Creates a plain object from a MediaContent message. Also converts values to other types if specified. + * @param message MediaContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.MediaContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** StreamingDetectIntentResponse outputAudio. */ - public outputAudio: (Uint8Array|string); + /** + * Converts this MediaContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** StreamingDetectIntentResponse outputAudioConfig. */ - public outputAudioConfig?: (google.cloud.dialogflow.v2.IOutputAudioConfig|null); + namespace MediaContent { - /** - * Creates a new StreamingDetectIntentResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns StreamingDetectIntentResponse instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IStreamingDetectIntentResponse): google.cloud.dialogflow.v2.StreamingDetectIntentResponse; + /** Properties of a ResponseMediaObject. */ + interface IResponseMediaObject { - /** - * Encodes the specified StreamingDetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentResponse.verify|verify} messages. - * @param message StreamingDetectIntentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IStreamingDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** ResponseMediaObject name */ + name?: (string|null); - /** - * Encodes the specified StreamingDetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentResponse.verify|verify} messages. - * @param message StreamingDetectIntentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IStreamingDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** ResponseMediaObject description */ + description?: (string|null); - /** - * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StreamingDetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.StreamingDetectIntentResponse; + /** ResponseMediaObject largeImage */ + largeImage?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** - * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StreamingDetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.StreamingDetectIntentResponse; + /** ResponseMediaObject icon */ + icon?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** - * Verifies a StreamingDetectIntentResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ResponseMediaObject contentUrl */ + contentUrl?: (string|null); + } - /** - * Creates a StreamingDetectIntentResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StreamingDetectIntentResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.StreamingDetectIntentResponse; + /** Represents a ResponseMediaObject. */ + class ResponseMediaObject implements IResponseMediaObject { - /** - * Creates a plain object from a StreamingDetectIntentResponse message. Also converts values to other types if specified. - * @param message StreamingDetectIntentResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.StreamingDetectIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new ResponseMediaObject. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject); - /** - * Converts this StreamingDetectIntentResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ResponseMediaObject name. */ + public name: string; - /** Properties of a StreamingRecognitionResult. */ - interface IStreamingRecognitionResult { + /** ResponseMediaObject description. */ + public description: string; - /** StreamingRecognitionResult messageType */ - messageType?: (google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType|keyof typeof google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType|null); + /** ResponseMediaObject largeImage. */ + public largeImage?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** StreamingRecognitionResult transcript */ - transcript?: (string|null); + /** ResponseMediaObject icon. */ + public icon?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** StreamingRecognitionResult isFinal */ - isFinal?: (boolean|null); + /** ResponseMediaObject contentUrl. */ + public contentUrl: string; - /** StreamingRecognitionResult confidence */ - confidence?: (number|null); + /** ResponseMediaObject image. */ + public image?: ("largeImage"|"icon"); - /** StreamingRecognitionResult speechWordInfo */ - speechWordInfo?: (google.cloud.dialogflow.v2.ISpeechWordInfo[]|null); + /** + * Creates a new ResponseMediaObject instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponseMediaObject instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject): google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject; - /** StreamingRecognitionResult speechEndOffset */ - speechEndOffset?: (google.protobuf.IDuration|null); - } + /** + * Encodes the specified ResponseMediaObject message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. + * @param message ResponseMediaObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a StreamingRecognitionResult. */ - class StreamingRecognitionResult implements IStreamingRecognitionResult { + /** + * Encodes the specified ResponseMediaObject message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. + * @param message ResponseMediaObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new StreamingRecognitionResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IStreamingRecognitionResult); + /** + * Decodes a ResponseMediaObject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponseMediaObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject; - /** StreamingRecognitionResult messageType. */ - public messageType: (google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType|keyof typeof google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType); + /** + * Decodes a ResponseMediaObject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponseMediaObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject; - /** StreamingRecognitionResult transcript. */ - public transcript: string; + /** + * Verifies a ResponseMediaObject message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** StreamingRecognitionResult isFinal. */ - public isFinal: boolean; + /** + * Creates a ResponseMediaObject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResponseMediaObject + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject; - /** StreamingRecognitionResult confidence. */ - public confidence: number; + /** + * Creates a plain object from a ResponseMediaObject message. Also converts values to other types if specified. + * @param message ResponseMediaObject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** StreamingRecognitionResult speechWordInfo. */ - public speechWordInfo: google.cloud.dialogflow.v2.ISpeechWordInfo[]; + /** + * Converts this ResponseMediaObject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** StreamingRecognitionResult speechEndOffset. */ - public speechEndOffset?: (google.protobuf.IDuration|null); + /** ResponseMediaType enum. */ + enum ResponseMediaType { + RESPONSE_MEDIA_TYPE_UNSPECIFIED = 0, + AUDIO = 1 + } + } - /** - * Creates a new StreamingRecognitionResult instance using the specified properties. - * @param [properties] Properties to set - * @returns StreamingRecognitionResult instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IStreamingRecognitionResult): google.cloud.dialogflow.v2.StreamingRecognitionResult; + /** Properties of a BrowseCarouselCard. */ + interface IBrowseCarouselCard { - /** - * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingRecognitionResult.verify|verify} messages. - * @param message StreamingRecognitionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** BrowseCarouselCard items */ + items?: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem[]|null); - /** - * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingRecognitionResult.verify|verify} messages. - * @param message StreamingRecognitionResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** BrowseCarouselCard imageDisplayOptions */ + imageDisplayOptions?: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|keyof typeof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|null); + } - /** - * Decodes a StreamingRecognitionResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StreamingRecognitionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.StreamingRecognitionResult; + /** Represents a BrowseCarouselCard. */ + class BrowseCarouselCard implements IBrowseCarouselCard { - /** - * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StreamingRecognitionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.StreamingRecognitionResult; + /** + * Constructs a new BrowseCarouselCard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard); - /** - * Verifies a StreamingRecognitionResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** BrowseCarouselCard items. */ + public items: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem[]; - /** - * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StreamingRecognitionResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.StreamingRecognitionResult; + /** BrowseCarouselCard imageDisplayOptions. */ + public imageDisplayOptions: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|keyof typeof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions); - /** - * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. - * @param message StreamingRecognitionResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.StreamingRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new BrowseCarouselCard instance using the specified properties. + * @param [properties] Properties to set + * @returns BrowseCarouselCard instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard; - /** - * Converts this StreamingRecognitionResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified BrowseCarouselCard message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.verify|verify} messages. + * @param message BrowseCarouselCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard, writer?: $protobuf.Writer): $protobuf.Writer; - namespace StreamingRecognitionResult { + /** + * Encodes the specified BrowseCarouselCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.verify|verify} messages. + * @param message BrowseCarouselCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** MessageType enum. */ - enum MessageType { - MESSAGE_TYPE_UNSPECIFIED = 0, - TRANSCRIPT = 1, - END_OF_SINGLE_UTTERANCE = 2 - } - } + /** + * Decodes a BrowseCarouselCard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BrowseCarouselCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard; - /** Properties of a TextInput. */ - interface ITextInput { + /** + * Decodes a BrowseCarouselCard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BrowseCarouselCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard; - /** TextInput text */ - text?: (string|null); + /** + * Verifies a BrowseCarouselCard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** TextInput languageCode */ - languageCode?: (string|null); - } + /** + * Creates a BrowseCarouselCard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BrowseCarouselCard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard; - /** Represents a TextInput. */ - class TextInput implements ITextInput { + /** + * Creates a plain object from a BrowseCarouselCard message. Also converts values to other types if specified. + * @param message BrowseCarouselCard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new TextInput. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.ITextInput); + /** + * Converts this BrowseCarouselCard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** TextInput text. */ - public text: string; + namespace BrowseCarouselCard { - /** TextInput languageCode. */ - public languageCode: string; + /** Properties of a BrowseCarouselCardItem. */ + interface IBrowseCarouselCardItem { - /** - * Creates a new TextInput instance using the specified properties. - * @param [properties] Properties to set - * @returns TextInput instance - */ - public static create(properties?: google.cloud.dialogflow.v2.ITextInput): google.cloud.dialogflow.v2.TextInput; + /** BrowseCarouselCardItem openUriAction */ + openUriAction?: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null); - /** - * Encodes the specified TextInput message. Does not implicitly {@link google.cloud.dialogflow.v2.TextInput.verify|verify} messages. - * @param message TextInput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; + /** BrowseCarouselCardItem title */ + title?: (string|null); - /** - * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.TextInput.verify|verify} messages. - * @param message TextInput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; + /** BrowseCarouselCardItem description */ + description?: (string|null); - /** - * Decodes a TextInput message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TextInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.TextInput; + /** BrowseCarouselCardItem image */ + image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** - * Decodes a TextInput message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TextInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.TextInput; + /** BrowseCarouselCardItem footer */ + footer?: (string|null); + } - /** - * Verifies a TextInput message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a BrowseCarouselCardItem. */ + class BrowseCarouselCardItem implements IBrowseCarouselCardItem { - /** - * Creates a TextInput message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TextInput - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.TextInput; + /** + * Constructs a new BrowseCarouselCardItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem); - /** - * Creates a plain object from a TextInput message. Also converts values to other types if specified. - * @param message TextInput - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.TextInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** BrowseCarouselCardItem openUriAction. */ + public openUriAction?: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null); - /** - * Converts this TextInput to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** BrowseCarouselCardItem title. */ + public title: string; - /** Properties of an EventInput. */ - interface IEventInput { + /** BrowseCarouselCardItem description. */ + public description: string; - /** EventInput name */ - name?: (string|null); + /** BrowseCarouselCardItem image. */ + public image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** EventInput parameters */ - parameters?: (google.protobuf.IStruct|null); + /** BrowseCarouselCardItem footer. */ + public footer: string; - /** EventInput languageCode */ - languageCode?: (string|null); - } + /** + * Creates a new BrowseCarouselCardItem instance using the specified properties. + * @param [properties] Properties to set + * @returns BrowseCarouselCardItem instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; - /** Represents an EventInput. */ - class EventInput implements IEventInput { + /** + * Encodes the specified BrowseCarouselCardItem message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. + * @param message BrowseCarouselCardItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new EventInput. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IEventInput); + /** + * Encodes the specified BrowseCarouselCardItem message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. + * @param message BrowseCarouselCardItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem, writer?: $protobuf.Writer): $protobuf.Writer; - /** EventInput name. */ - public name: string; + /** + * Decodes a BrowseCarouselCardItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BrowseCarouselCardItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; - /** EventInput parameters. */ - public parameters?: (google.protobuf.IStruct|null); + /** + * Decodes a BrowseCarouselCardItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BrowseCarouselCardItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; - /** EventInput languageCode. */ - public languageCode: string; + /** + * Verifies a BrowseCarouselCardItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new EventInput instance using the specified properties. - * @param [properties] Properties to set - * @returns EventInput instance - */ - public static create(properties?: google.cloud.dialogflow.v2.IEventInput): google.cloud.dialogflow.v2.EventInput; + /** + * Creates a BrowseCarouselCardItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BrowseCarouselCardItem + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; - /** - * Encodes the specified EventInput message. Does not implicitly {@link google.cloud.dialogflow.v2.EventInput.verify|verify} messages. - * @param message EventInput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.IEventInput, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a BrowseCarouselCardItem message. Also converts values to other types if specified. + * @param message BrowseCarouselCardItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified EventInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EventInput.verify|verify} messages. - * @param message EventInput message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IEventInput, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this BrowseCarouselCardItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes an EventInput message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EventInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.EventInput; + namespace BrowseCarouselCardItem { - /** - * Decodes an EventInput message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EventInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.EventInput; + /** Properties of an OpenUrlAction. */ + interface IOpenUrlAction { - /** - * Verifies an EventInput message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** OpenUrlAction url */ + url?: (string|null); - /** - * Creates an EventInput message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EventInput - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.EventInput; + /** OpenUrlAction urlTypeHint */ + urlTypeHint?: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|keyof typeof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|null); + } - /** - * Creates a plain object from an EventInput message. Also converts values to other types if specified. - * @param message EventInput - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.EventInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents an OpenUrlAction. */ + class OpenUrlAction implements IOpenUrlAction { - /** - * Converts this EventInput to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new OpenUrlAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction); - /** Properties of a SentimentAnalysisRequestConfig. */ - interface ISentimentAnalysisRequestConfig { + /** OpenUrlAction url. */ + public url: string; - /** SentimentAnalysisRequestConfig analyzeQueryTextSentiment */ - analyzeQueryTextSentiment?: (boolean|null); - } + /** OpenUrlAction urlTypeHint. */ + public urlTypeHint: (google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|keyof typeof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint); - /** Represents a SentimentAnalysisRequestConfig. */ - class SentimentAnalysisRequestConfig implements ISentimentAnalysisRequestConfig { + /** + * Creates a new OpenUrlAction instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenUrlAction instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; - /** - * Constructs a new SentimentAnalysisRequestConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig); + /** + * Encodes the specified OpenUrlAction message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. + * @param message OpenUrlAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** SentimentAnalysisRequestConfig analyzeQueryTextSentiment. */ - public analyzeQueryTextSentiment: boolean; + /** + * Encodes the specified OpenUrlAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. + * @param message OpenUrlAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new SentimentAnalysisRequestConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns SentimentAnalysisRequestConfig instance - */ - public static create(properties?: google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig): google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig; + /** + * Decodes an OpenUrlAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenUrlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; - /** - * Encodes the specified SentimentAnalysisRequestConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.verify|verify} messages. - * @param message SentimentAnalysisRequestConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an OpenUrlAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenUrlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; - /** - * Encodes the specified SentimentAnalysisRequestConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.verify|verify} messages. - * @param message SentimentAnalysisRequestConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies an OpenUrlAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SentimentAnalysisRequestConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig; + /** + * Creates an OpenUrlAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenUrlAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; - /** - * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SentimentAnalysisRequestConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig; + /** + * Creates a plain object from an OpenUrlAction message. Also converts values to other types if specified. + * @param message OpenUrlAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a SentimentAnalysisRequestConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this OpenUrlAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a SentimentAnalysisRequestConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SentimentAnalysisRequestConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig; + namespace OpenUrlAction { - /** - * Creates a plain object from a SentimentAnalysisRequestConfig message. Also converts values to other types if specified. - * @param message SentimentAnalysisRequestConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** UrlTypeHint enum. */ + enum UrlTypeHint { + URL_TYPE_HINT_UNSPECIFIED = 0, + AMP_ACTION = 1, + AMP_CONTENT = 2 + } + } + } - /** - * Converts this SentimentAnalysisRequestConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ImageDisplayOptions enum. */ + enum ImageDisplayOptions { + IMAGE_DISPLAY_OPTIONS_UNSPECIFIED = 0, + GRAY = 1, + WHITE = 2, + CROPPED = 3, + BLURRED_BACKGROUND = 4 + } + } - /** Properties of a SentimentAnalysisResult. */ - interface ISentimentAnalysisResult { + /** Properties of a TableCard. */ + interface ITableCard { - /** SentimentAnalysisResult queryTextSentiment */ - queryTextSentiment?: (google.cloud.dialogflow.v2.ISentiment|null); - } + /** TableCard title */ + title?: (string|null); - /** Represents a SentimentAnalysisResult. */ - class SentimentAnalysisResult implements ISentimentAnalysisResult { + /** TableCard subtitle */ + subtitle?: (string|null); - /** - * Constructs a new SentimentAnalysisResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.ISentimentAnalysisResult); + /** TableCard image */ + image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** SentimentAnalysisResult queryTextSentiment. */ - public queryTextSentiment?: (google.cloud.dialogflow.v2.ISentiment|null); + /** TableCard columnProperties */ + columnProperties?: (google.cloud.dialogflow.v2.Intent.Message.IColumnProperties[]|null); - /** - * Creates a new SentimentAnalysisResult instance using the specified properties. - * @param [properties] Properties to set - * @returns SentimentAnalysisResult instance - */ - public static create(properties?: google.cloud.dialogflow.v2.ISentimentAnalysisResult): google.cloud.dialogflow.v2.SentimentAnalysisResult; + /** TableCard rows */ + rows?: (google.cloud.dialogflow.v2.Intent.Message.ITableCardRow[]|null); - /** - * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisResult.verify|verify} messages. - * @param message SentimentAnalysisResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** TableCard buttons */ + buttons?: (google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton[]|null); + } - /** - * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisResult.verify|verify} messages. - * @param message SentimentAnalysisResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a TableCard. */ + class TableCard implements ITableCard { - /** - * Decodes a SentimentAnalysisResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SentimentAnalysisResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SentimentAnalysisResult; + /** + * Constructs a new TableCard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ITableCard); - /** - * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SentimentAnalysisResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SentimentAnalysisResult; + /** TableCard title. */ + public title: string; - /** - * Verifies a SentimentAnalysisResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** TableCard subtitle. */ + public subtitle: string; - /** - * Creates a SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SentimentAnalysisResult - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SentimentAnalysisResult; + /** TableCard image. */ + public image?: (google.cloud.dialogflow.v2.Intent.Message.IImage|null); - /** - * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. - * @param message SentimentAnalysisResult - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.SentimentAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** TableCard columnProperties. */ + public columnProperties: google.cloud.dialogflow.v2.Intent.Message.IColumnProperties[]; - /** - * Converts this SentimentAnalysisResult to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** TableCard rows. */ + public rows: google.cloud.dialogflow.v2.Intent.Message.ITableCardRow[]; - /** Properties of a Sentiment. */ - interface ISentiment { + /** TableCard buttons. */ + public buttons: google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton[]; - /** Sentiment score */ - score?: (number|null); + /** + * Creates a new TableCard instance using the specified properties. + * @param [properties] Properties to set + * @returns TableCard instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ITableCard): google.cloud.dialogflow.v2.Intent.Message.TableCard; - /** Sentiment magnitude */ - magnitude?: (number|null); - } + /** + * Encodes the specified TableCard message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCard.verify|verify} messages. + * @param message TableCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ITableCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a Sentiment. */ - class Sentiment implements ISentiment { + /** + * Encodes the specified TableCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCard.verify|verify} messages. + * @param message TableCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ITableCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new Sentiment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.ISentiment); + /** + * Decodes a TableCard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.TableCard; - /** Sentiment score. */ - public score: number; + /** + * Decodes a TableCard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.TableCard; - /** Sentiment magnitude. */ - public magnitude: number; + /** + * Verifies a TableCard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new Sentiment instance using the specified properties. - * @param [properties] Properties to set - * @returns Sentiment instance - */ - public static create(properties?: google.cloud.dialogflow.v2.ISentiment): google.cloud.dialogflow.v2.Sentiment; + /** + * Creates a TableCard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableCard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.TableCard; - /** - * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.dialogflow.v2.Sentiment.verify|verify} messages. - * @param message Sentiment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.ISentiment, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a TableCard message. Also converts values to other types if specified. + * @param message TableCard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.TableCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Sentiment.verify|verify} messages. - * @param message Sentiment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.ISentiment, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this TableCard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a Sentiment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Sentiment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Sentiment; + /** Properties of a ColumnProperties. */ + interface IColumnProperties { - /** - * Decodes a Sentiment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Sentiment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Sentiment; + /** ColumnProperties header */ + header?: (string|null); - /** - * Verifies a Sentiment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ColumnProperties horizontalAlignment */ + horizontalAlignment?: (google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment|keyof typeof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment|null); + } - /** - * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Sentiment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Sentiment; + /** Represents a ColumnProperties. */ + class ColumnProperties implements IColumnProperties { - /** - * Creates a plain object from a Sentiment message. Also converts values to other types if specified. - * @param message Sentiment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.Sentiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new ColumnProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.IColumnProperties); - /** - * Converts this Sentiment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ColumnProperties header. */ + public header: string; - /** Represents a SessionEntityTypes */ - class SessionEntityTypes extends $protobuf.rpc.Service { + /** ColumnProperties horizontalAlignment. */ + public horizontalAlignment: (google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment|keyof typeof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment); - /** - * Constructs a new SessionEntityTypes service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** + * Creates a new ColumnProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnProperties instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.IColumnProperties): google.cloud.dialogflow.v2.Intent.Message.ColumnProperties; - /** - * Creates new SessionEntityTypes service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SessionEntityTypes; + /** + * Encodes the specified ColumnProperties message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.verify|verify} messages. + * @param message ColumnProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.IColumnProperties, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls ListSessionEntityTypes. - * @param request ListSessionEntityTypesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSessionEntityTypesResponse - */ - public listSessionEntityTypes(request: google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, callback: google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypesCallback): void; + /** + * Encodes the specified ColumnProperties message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.verify|verify} messages. + * @param message ColumnProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.IColumnProperties, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls ListSessionEntityTypes. - * @param request ListSessionEntityTypesRequest message or plain object - * @returns Promise - */ - public listSessionEntityTypes(request: google.cloud.dialogflow.v2.IListSessionEntityTypesRequest): Promise; + /** + * Decodes a ColumnProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.ColumnProperties; - /** - * Calls GetSessionEntityType. - * @param request GetSessionEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SessionEntityType - */ - public getSessionEntityType(request: google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2.SessionEntityTypes.GetSessionEntityTypeCallback): void; + /** + * Decodes a ColumnProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.ColumnProperties; - /** - * Calls GetSessionEntityType. - * @param request GetSessionEntityTypeRequest message or plain object - * @returns Promise - */ - public getSessionEntityType(request: google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest): Promise; + /** + * Verifies a ColumnProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Calls CreateSessionEntityType. - * @param request CreateSessionEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SessionEntityType - */ - public createSessionEntityType(request: google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2.SessionEntityTypes.CreateSessionEntityTypeCallback): void; + /** + * Creates a ColumnProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.ColumnProperties; - /** - * Calls CreateSessionEntityType. - * @param request CreateSessionEntityTypeRequest message or plain object - * @returns Promise - */ - public createSessionEntityType(request: google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest): Promise; + /** + * Creates a plain object from a ColumnProperties message. Also converts values to other types if specified. + * @param message ColumnProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.ColumnProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Calls UpdateSessionEntityType. - * @param request UpdateSessionEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SessionEntityType - */ - public updateSessionEntityType(request: google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2.SessionEntityTypes.UpdateSessionEntityTypeCallback): void; + /** + * Converts this ColumnProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Calls UpdateSessionEntityType. - * @param request UpdateSessionEntityTypeRequest message or plain object - * @returns Promise - */ - public updateSessionEntityType(request: google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest): Promise; + namespace ColumnProperties { - /** - * Calls DeleteSessionEntityType. - * @param request DeleteSessionEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteSessionEntityType(request: google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2.SessionEntityTypes.DeleteSessionEntityTypeCallback): void; + /** HorizontalAlignment enum. */ + enum HorizontalAlignment { + HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0, + LEADING = 1, + CENTER = 2, + TRAILING = 3 + } + } - /** - * Calls DeleteSessionEntityType. - * @param request DeleteSessionEntityTypeRequest message or plain object - * @returns Promise - */ - public deleteSessionEntityType(request: google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest): Promise; - } + /** Properties of a TableCardRow. */ + interface ITableCardRow { - namespace SessionEntityTypes { + /** TableCardRow cells */ + cells?: (google.cloud.dialogflow.v2.Intent.Message.ITableCardCell[]|null); - /** - * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#listSessionEntityTypes}. - * @param error Error, if any - * @param [response] ListSessionEntityTypesResponse - */ - type ListSessionEntityTypesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListSessionEntityTypesResponse) => void; + /** TableCardRow dividerAfter */ + dividerAfter?: (boolean|null); + } - /** - * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#getSessionEntityType}. - * @param error Error, if any - * @param [response] SessionEntityType - */ - type GetSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.SessionEntityType) => void; + /** Represents a TableCardRow. */ + class TableCardRow implements ITableCardRow { - /** - * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#createSessionEntityType}. - * @param error Error, if any - * @param [response] SessionEntityType - */ - type CreateSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.SessionEntityType) => void; + /** + * Constructs a new TableCardRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ITableCardRow); - /** - * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#updateSessionEntityType}. - * @param error Error, if any - * @param [response] SessionEntityType - */ - type UpdateSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.SessionEntityType) => void; + /** TableCardRow cells. */ + public cells: google.cloud.dialogflow.v2.Intent.Message.ITableCardCell[]; - /** - * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#deleteSessionEntityType}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteSessionEntityTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - } + /** TableCardRow dividerAfter. */ + public dividerAfter: boolean; - /** Properties of a SessionEntityType. */ - interface ISessionEntityType { + /** + * Creates a new TableCardRow instance using the specified properties. + * @param [properties] Properties to set + * @returns TableCardRow instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ITableCardRow): google.cloud.dialogflow.v2.Intent.Message.TableCardRow; - /** SessionEntityType name */ - name?: (string|null); + /** + * Encodes the specified TableCardRow message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardRow.verify|verify} messages. + * @param message TableCardRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ITableCardRow, writer?: $protobuf.Writer): $protobuf.Writer; - /** SessionEntityType entityOverrideMode */ - entityOverrideMode?: (google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode|keyof typeof google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode|null); + /** + * Encodes the specified TableCardRow message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardRow.verify|verify} messages. + * @param message TableCardRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ITableCardRow, writer?: $protobuf.Writer): $protobuf.Writer; - /** SessionEntityType entities */ - entities?: (google.cloud.dialogflow.v2.EntityType.IEntity[]|null); - } + /** + * Decodes a TableCardRow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableCardRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.TableCardRow; - /** Represents a SessionEntityType. */ - class SessionEntityType implements ISessionEntityType { + /** + * Decodes a TableCardRow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableCardRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.TableCardRow; - /** - * Constructs a new SessionEntityType. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.ISessionEntityType); + /** + * Verifies a TableCardRow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** SessionEntityType name. */ - public name: string; + /** + * Creates a TableCardRow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableCardRow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.TableCardRow; - /** SessionEntityType entityOverrideMode. */ - public entityOverrideMode: (google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode|keyof typeof google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode); + /** + * Creates a plain object from a TableCardRow message. Also converts values to other types if specified. + * @param message TableCardRow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.TableCardRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** SessionEntityType entities. */ - public entities: google.cloud.dialogflow.v2.EntityType.IEntity[]; + /** + * Converts this TableCardRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new SessionEntityType instance using the specified properties. - * @param [properties] Properties to set - * @returns SessionEntityType instance - */ - public static create(properties?: google.cloud.dialogflow.v2.ISessionEntityType): google.cloud.dialogflow.v2.SessionEntityType; + /** Properties of a TableCardCell. */ + interface ITableCardCell { - /** - * Encodes the specified SessionEntityType message. Does not implicitly {@link google.cloud.dialogflow.v2.SessionEntityType.verify|verify} messages. - * @param message SessionEntityType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2.ISessionEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + /** TableCardCell text */ + text?: (string|null); + } - /** - * Encodes the specified SessionEntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SessionEntityType.verify|verify} messages. - * @param message SessionEntityType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.ISessionEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a TableCardCell. */ + class TableCardCell implements ITableCardCell { - /** - * Decodes a SessionEntityType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SessionEntityType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SessionEntityType; + /** + * Constructs a new TableCardCell. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.Message.ITableCardCell); - /** - * Decodes a SessionEntityType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SessionEntityType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SessionEntityType; + /** TableCardCell text. */ + public text: string; - /** - * Verifies a SessionEntityType message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new TableCardCell instance using the specified properties. + * @param [properties] Properties to set + * @returns TableCardCell instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.Message.ITableCardCell): google.cloud.dialogflow.v2.Intent.Message.TableCardCell; - /** - * Creates a SessionEntityType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SessionEntityType - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SessionEntityType; + /** + * Encodes the specified TableCardCell message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardCell.verify|verify} messages. + * @param message TableCardCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.Message.ITableCardCell, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a SessionEntityType message. Also converts values to other types if specified. - * @param message SessionEntityType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2.SessionEntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified TableCardCell message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardCell.verify|verify} messages. + * @param message TableCardCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.Message.ITableCardCell, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this SessionEntityType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a TableCardCell message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableCardCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.Message.TableCardCell; - namespace SessionEntityType { + /** + * Decodes a TableCardCell message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableCardCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.Message.TableCardCell; - /** EntityOverrideMode enum. */ - enum EntityOverrideMode { - ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0, - ENTITY_OVERRIDE_MODE_OVERRIDE = 1, - ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2 - } - } + /** + * Verifies a TableCardCell message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a ListSessionEntityTypesRequest. */ - interface IListSessionEntityTypesRequest { + /** + * Creates a TableCardCell message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableCardCell + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.Message.TableCardCell; - /** ListSessionEntityTypesRequest parent */ - parent?: (string|null); + /** + * Creates a plain object from a TableCardCell message. Also converts values to other types if specified. + * @param message TableCardCell + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.Message.TableCardCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ListSessionEntityTypesRequest pageSize */ - pageSize?: (number|null); + /** + * Converts this TableCardCell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ListSessionEntityTypesRequest pageToken */ - pageToken?: (string|null); - } + /** Platform enum. */ + enum Platform { + PLATFORM_UNSPECIFIED = 0, + FACEBOOK = 1, + SLACK = 2, + TELEGRAM = 3, + KIK = 4, + SKYPE = 5, + LINE = 6, + VIBER = 7, + ACTIONS_ON_GOOGLE = 8, + GOOGLE_HANGOUTS = 11 + } + } - /** Represents a ListSessionEntityTypesRequest. */ - class ListSessionEntityTypesRequest implements IListSessionEntityTypesRequest { + /** Properties of a FollowupIntentInfo. */ + interface IFollowupIntentInfo { - /** - * Constructs a new ListSessionEntityTypesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2.IListSessionEntityTypesRequest); + /** FollowupIntentInfo followupIntentName */ + followupIntentName?: (string|null); - /** ListSessionEntityTypesRequest parent. */ - public parent: string; + /** FollowupIntentInfo parentFollowupIntentName */ + parentFollowupIntentName?: (string|null); + } - /** ListSessionEntityTypesRequest pageSize. */ - public pageSize: number; + /** Represents a FollowupIntentInfo. */ + class FollowupIntentInfo implements IFollowupIntentInfo { - /** ListSessionEntityTypesRequest pageToken. */ + /** + * Constructs a new FollowupIntentInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo); + + /** FollowupIntentInfo followupIntentName. */ + public followupIntentName: string; + + /** FollowupIntentInfo parentFollowupIntentName. */ + public parentFollowupIntentName: string; + + /** + * Creates a new FollowupIntentInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FollowupIntentInfo instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo): google.cloud.dialogflow.v2.Intent.FollowupIntentInfo; + + /** + * Encodes the specified FollowupIntentInfo message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.verify|verify} messages. + * @param message FollowupIntentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FollowupIntentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.verify|verify} messages. + * @param message FollowupIntentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FollowupIntentInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FollowupIntentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Intent.FollowupIntentInfo; + + /** + * Decodes a FollowupIntentInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FollowupIntentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Intent.FollowupIntentInfo; + + /** + * Verifies a FollowupIntentInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FollowupIntentInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FollowupIntentInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Intent.FollowupIntentInfo; + + /** + * Creates a plain object from a FollowupIntentInfo message. Also converts values to other types if specified. + * @param message FollowupIntentInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Intent.FollowupIntentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FollowupIntentInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** WebhookState enum. */ + enum WebhookState { + WEBHOOK_STATE_UNSPECIFIED = 0, + WEBHOOK_STATE_ENABLED = 1, + WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2 + } + } + + /** Properties of a ListIntentsRequest. */ + interface IListIntentsRequest { + + /** ListIntentsRequest parent */ + parent?: (string|null); + + /** ListIntentsRequest languageCode */ + languageCode?: (string|null); + + /** ListIntentsRequest intentView */ + intentView?: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView|null); + + /** ListIntentsRequest pageSize */ + pageSize?: (number|null); + + /** ListIntentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListIntentsRequest. */ + class ListIntentsRequest implements IListIntentsRequest { + + /** + * Constructs a new ListIntentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListIntentsRequest); + + /** ListIntentsRequest parent. */ + public parent: string; + + /** ListIntentsRequest languageCode. */ + public languageCode: string; + + /** ListIntentsRequest intentView. */ + public intentView: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView); + + /** ListIntentsRequest pageSize. */ + public pageSize: number; + + /** ListIntentsRequest pageToken. */ public pageToken: string; /** - * Creates a new ListSessionEntityTypesRequest instance using the specified properties. + * Creates a new ListIntentsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListSessionEntityTypesRequest instance + * @returns ListIntentsRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.IListSessionEntityTypesRequest): google.cloud.dialogflow.v2.ListSessionEntityTypesRequest; + public static create(properties?: google.cloud.dialogflow.v2.IListIntentsRequest): google.cloud.dialogflow.v2.ListIntentsRequest; /** - * Encodes the specified ListSessionEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesRequest.verify|verify} messages. - * @param message ListSessionEntityTypesRequest message or plain object to encode + * Encodes the specified ListIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsRequest.verify|verify} messages. + * @param message ListIntentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IListIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSessionEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesRequest.verify|verify} messages. - * @param message ListSessionEntityTypesRequest message or plain object to encode + * Encodes the specified ListIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsRequest.verify|verify} messages. + * @param message ListIntentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer. + * Decodes a ListIntentsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSessionEntityTypesRequest + * @returns ListIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListSessionEntityTypesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListIntentsRequest; /** - * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListIntentsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSessionEntityTypesRequest + * @returns ListIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListSessionEntityTypesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListIntentsRequest; /** - * Verifies a ListSessionEntityTypesRequest message. + * Verifies a ListIntentsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListSessionEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListIntentsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSessionEntityTypesRequest + * @returns ListIntentsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListSessionEntityTypesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListIntentsRequest; /** - * Creates a plain object from a ListSessionEntityTypesRequest message. Also converts values to other types if specified. - * @param message ListSessionEntityTypesRequest + * Creates a plain object from a ListIntentsRequest message. Also converts values to other types if specified. + * @param message ListIntentsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.ListSessionEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.ListIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSessionEntityTypesRequest to JSON. + * Converts this ListIntentsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListSessionEntityTypesResponse. */ - interface IListSessionEntityTypesResponse { + /** Properties of a ListIntentsResponse. */ + interface IListIntentsResponse { - /** ListSessionEntityTypesResponse sessionEntityTypes */ - sessionEntityTypes?: (google.cloud.dialogflow.v2.ISessionEntityType[]|null); + /** ListIntentsResponse intents */ + intents?: (google.cloud.dialogflow.v2.IIntent[]|null); - /** ListSessionEntityTypesResponse nextPageToken */ + /** ListIntentsResponse nextPageToken */ nextPageToken?: (string|null); } - /** Represents a ListSessionEntityTypesResponse. */ - class ListSessionEntityTypesResponse implements IListSessionEntityTypesResponse { + /** Represents a ListIntentsResponse. */ + class ListIntentsResponse implements IListIntentsResponse { /** - * Constructs a new ListSessionEntityTypesResponse. + * Constructs a new ListIntentsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IListSessionEntityTypesResponse); + constructor(properties?: google.cloud.dialogflow.v2.IListIntentsResponse); - /** ListSessionEntityTypesResponse sessionEntityTypes. */ - public sessionEntityTypes: google.cloud.dialogflow.v2.ISessionEntityType[]; + /** ListIntentsResponse intents. */ + public intents: google.cloud.dialogflow.v2.IIntent[]; - /** ListSessionEntityTypesResponse nextPageToken. */ + /** ListIntentsResponse nextPageToken. */ public nextPageToken: string; /** - * Creates a new ListSessionEntityTypesResponse instance using the specified properties. + * Creates a new ListIntentsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListSessionEntityTypesResponse instance + * @returns ListIntentsResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2.IListSessionEntityTypesResponse): google.cloud.dialogflow.v2.ListSessionEntityTypesResponse; + public static create(properties?: google.cloud.dialogflow.v2.IListIntentsResponse): google.cloud.dialogflow.v2.ListIntentsResponse; /** - * Encodes the specified ListSessionEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.verify|verify} messages. - * @param message ListSessionEntityTypesResponse message or plain object to encode + * Encodes the specified ListIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsResponse.verify|verify} messages. + * @param message ListIntentsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IListSessionEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IListIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSessionEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.verify|verify} messages. - * @param message ListSessionEntityTypesResponse message or plain object to encode + * Encodes the specified ListIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsResponse.verify|verify} messages. + * @param message ListIntentsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IListSessionEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer. + * Decodes a ListIntentsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSessionEntityTypesResponse + * @returns ListIntentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListSessionEntityTypesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListIntentsResponse; /** - * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListIntentsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSessionEntityTypesResponse + * @returns ListIntentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListSessionEntityTypesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListIntentsResponse; /** - * Verifies a ListSessionEntityTypesResponse message. + * Verifies a ListIntentsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListSessionEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListIntentsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSessionEntityTypesResponse + * @returns ListIntentsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListSessionEntityTypesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListIntentsResponse; /** - * Creates a plain object from a ListSessionEntityTypesResponse message. Also converts values to other types if specified. - * @param message ListSessionEntityTypesResponse + * Creates a plain object from a ListIntentsResponse message. Also converts values to other types if specified. + * @param message ListIntentsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.ListSessionEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.ListIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSessionEntityTypesResponse to JSON. + * Converts this ListIntentsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetSessionEntityTypeRequest. */ - interface IGetSessionEntityTypeRequest { + /** Properties of a GetIntentRequest. */ + interface IGetIntentRequest { - /** GetSessionEntityTypeRequest name */ + /** GetIntentRequest name */ name?: (string|null); + + /** GetIntentRequest languageCode */ + languageCode?: (string|null); + + /** GetIntentRequest intentView */ + intentView?: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView|null); } - /** Represents a GetSessionEntityTypeRequest. */ - class GetSessionEntityTypeRequest implements IGetSessionEntityTypeRequest { + /** Represents a GetIntentRequest. */ + class GetIntentRequest implements IGetIntentRequest { /** - * Constructs a new GetSessionEntityTypeRequest. + * Constructs a new GetIntentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2.IGetIntentRequest); - /** GetSessionEntityTypeRequest name. */ + /** GetIntentRequest name. */ public name: string; + /** GetIntentRequest languageCode. */ + public languageCode: string; + + /** GetIntentRequest intentView. */ + public intentView: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView); + /** - * Creates a new GetSessionEntityTypeRequest instance using the specified properties. + * Creates a new GetIntentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetSessionEntityTypeRequest instance + * @returns GetIntentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest): google.cloud.dialogflow.v2.GetSessionEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2.IGetIntentRequest): google.cloud.dialogflow.v2.GetIntentRequest; /** - * Encodes the specified GetSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetSessionEntityTypeRequest.verify|verify} messages. - * @param message GetSessionEntityTypeRequest message or plain object to encode + * Encodes the specified GetIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetIntentRequest.verify|verify} messages. + * @param message GetIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IGetIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetSessionEntityTypeRequest.verify|verify} messages. - * @param message GetSessionEntityTypeRequest message or plain object to encode + * Encodes the specified GetIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetIntentRequest.verify|verify} messages. + * @param message GetIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer. + * Decodes a GetIntentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetSessionEntityTypeRequest + * @returns GetIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetSessionEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetIntentRequest; /** - * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a GetIntentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetSessionEntityTypeRequest + * @returns GetIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetSessionEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetIntentRequest; /** - * Verifies a GetSessionEntityTypeRequest message. + * Verifies a GetIntentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetIntentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetSessionEntityTypeRequest + * @returns GetIntentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetSessionEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetIntentRequest; /** - * Creates a plain object from a GetSessionEntityTypeRequest message. Also converts values to other types if specified. - * @param message GetSessionEntityTypeRequest + * Creates a plain object from a GetIntentRequest message. Also converts values to other types if specified. + * @param message GetIntentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.GetSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.GetIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetSessionEntityTypeRequest to JSON. + * Converts this GetIntentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateSessionEntityTypeRequest. */ - interface ICreateSessionEntityTypeRequest { + /** Properties of a CreateIntentRequest. */ + interface ICreateIntentRequest { - /** CreateSessionEntityTypeRequest parent */ + /** CreateIntentRequest parent */ parent?: (string|null); - /** CreateSessionEntityTypeRequest sessionEntityType */ - sessionEntityType?: (google.cloud.dialogflow.v2.ISessionEntityType|null); + /** CreateIntentRequest intent */ + intent?: (google.cloud.dialogflow.v2.IIntent|null); + + /** CreateIntentRequest languageCode */ + languageCode?: (string|null); + + /** CreateIntentRequest intentView */ + intentView?: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView|null); } - /** Represents a CreateSessionEntityTypeRequest. */ - class CreateSessionEntityTypeRequest implements ICreateSessionEntityTypeRequest { + /** Represents a CreateIntentRequest. */ + class CreateIntentRequest implements ICreateIntentRequest { /** - * Constructs a new CreateSessionEntityTypeRequest. + * Constructs a new CreateIntentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2.ICreateIntentRequest); - /** CreateSessionEntityTypeRequest parent. */ + /** CreateIntentRequest parent. */ public parent: string; - /** CreateSessionEntityTypeRequest sessionEntityType. */ - public sessionEntityType?: (google.cloud.dialogflow.v2.ISessionEntityType|null); + /** CreateIntentRequest intent. */ + public intent?: (google.cloud.dialogflow.v2.IIntent|null); + + /** CreateIntentRequest languageCode. */ + public languageCode: string; + + /** CreateIntentRequest intentView. */ + public intentView: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView); /** - * Creates a new CreateSessionEntityTypeRequest instance using the specified properties. + * Creates a new CreateIntentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateSessionEntityTypeRequest instance + * @returns CreateIntentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest): google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2.ICreateIntentRequest): google.cloud.dialogflow.v2.CreateIntentRequest; /** - * Encodes the specified CreateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest.verify|verify} messages. - * @param message CreateSessionEntityTypeRequest message or plain object to encode + * Encodes the specified CreateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateIntentRequest.verify|verify} messages. + * @param message CreateIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ICreateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest.verify|verify} messages. - * @param message CreateSessionEntityTypeRequest message or plain object to encode + * Encodes the specified CreateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateIntentRequest.verify|verify} messages. + * @param message CreateIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer. + * Decodes a CreateIntentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateSessionEntityTypeRequest + * @returns CreateIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateIntentRequest; /** - * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateIntentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateSessionEntityTypeRequest + * @returns CreateIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateIntentRequest; /** - * Verifies a CreateSessionEntityTypeRequest message. + * Verifies a CreateIntentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateIntentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateSessionEntityTypeRequest + * @returns CreateIntentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateIntentRequest; /** - * Creates a plain object from a CreateSessionEntityTypeRequest message. Also converts values to other types if specified. - * @param message CreateSessionEntityTypeRequest + * Creates a plain object from a CreateIntentRequest message. Also converts values to other types if specified. + * @param message CreateIntentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.CreateIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateSessionEntityTypeRequest to JSON. + * Converts this CreateIntentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateSessionEntityTypeRequest. */ - interface IUpdateSessionEntityTypeRequest { + /** Properties of an UpdateIntentRequest. */ + interface IUpdateIntentRequest { - /** UpdateSessionEntityTypeRequest sessionEntityType */ - sessionEntityType?: (google.cloud.dialogflow.v2.ISessionEntityType|null); + /** UpdateIntentRequest intent */ + intent?: (google.cloud.dialogflow.v2.IIntent|null); - /** UpdateSessionEntityTypeRequest updateMask */ + /** UpdateIntentRequest languageCode */ + languageCode?: (string|null); + + /** UpdateIntentRequest updateMask */ updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateIntentRequest intentView */ + intentView?: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView|null); } - /** Represents an UpdateSessionEntityTypeRequest. */ - class UpdateSessionEntityTypeRequest implements IUpdateSessionEntityTypeRequest { + /** Represents an UpdateIntentRequest. */ + class UpdateIntentRequest implements IUpdateIntentRequest { /** - * Constructs a new UpdateSessionEntityTypeRequest. + * Constructs a new UpdateIntentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2.IUpdateIntentRequest); - /** UpdateSessionEntityTypeRequest sessionEntityType. */ - public sessionEntityType?: (google.cloud.dialogflow.v2.ISessionEntityType|null); + /** UpdateIntentRequest intent. */ + public intent?: (google.cloud.dialogflow.v2.IIntent|null); - /** UpdateSessionEntityTypeRequest updateMask. */ + /** UpdateIntentRequest languageCode. */ + public languageCode: string; + + /** UpdateIntentRequest updateMask. */ public updateMask?: (google.protobuf.IFieldMask|null); + /** UpdateIntentRequest intentView. */ + public intentView: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView); + /** - * Creates a new UpdateSessionEntityTypeRequest instance using the specified properties. + * Creates a new UpdateIntentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateSessionEntityTypeRequest instance + * @returns UpdateIntentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest): google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2.IUpdateIntentRequest): google.cloud.dialogflow.v2.UpdateIntentRequest; /** - * Encodes the specified UpdateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.verify|verify} messages. - * @param message UpdateSessionEntityTypeRequest message or plain object to encode + * Encodes the specified UpdateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateIntentRequest.verify|verify} messages. + * @param message UpdateIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IUpdateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.verify|verify} messages. - * @param message UpdateSessionEntityTypeRequest message or plain object to encode + * Encodes the specified UpdateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateIntentRequest.verify|verify} messages. + * @param message UpdateIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer. + * Decodes an UpdateIntentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateSessionEntityTypeRequest + * @returns UpdateIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateIntentRequest; /** - * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateIntentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateSessionEntityTypeRequest + * @returns UpdateIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateIntentRequest; /** - * Verifies an UpdateSessionEntityTypeRequest message. + * Verifies an UpdateIntentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateIntentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateSessionEntityTypeRequest + * @returns UpdateIntentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateIntentRequest; /** - * Creates a plain object from an UpdateSessionEntityTypeRequest message. Also converts values to other types if specified. - * @param message UpdateSessionEntityTypeRequest + * Creates a plain object from an UpdateIntentRequest message. Also converts values to other types if specified. + * @param message UpdateIntentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.UpdateIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateSessionEntityTypeRequest to JSON. + * Converts this UpdateIntentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteSessionEntityTypeRequest. */ - interface IDeleteSessionEntityTypeRequest { + /** Properties of a DeleteIntentRequest. */ + interface IDeleteIntentRequest { - /** DeleteSessionEntityTypeRequest name */ + /** DeleteIntentRequest name */ name?: (string|null); } - /** Represents a DeleteSessionEntityTypeRequest. */ - class DeleteSessionEntityTypeRequest implements IDeleteSessionEntityTypeRequest { + /** Represents a DeleteIntentRequest. */ + class DeleteIntentRequest implements IDeleteIntentRequest { /** - * Constructs a new DeleteSessionEntityTypeRequest. + * Constructs a new DeleteIntentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2.IDeleteIntentRequest); - /** DeleteSessionEntityTypeRequest name. */ + /** DeleteIntentRequest name. */ public name: string; /** - * Creates a new DeleteSessionEntityTypeRequest instance using the specified properties. + * Creates a new DeleteIntentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteSessionEntityTypeRequest instance + * @returns DeleteIntentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest): google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2.IDeleteIntentRequest): google.cloud.dialogflow.v2.DeleteIntentRequest; /** - * Encodes the specified DeleteSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest.verify|verify} messages. - * @param message DeleteSessionEntityTypeRequest message or plain object to encode + * Encodes the specified DeleteIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteIntentRequest.verify|verify} messages. + * @param message DeleteIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IDeleteIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest.verify|verify} messages. - * @param message DeleteSessionEntityTypeRequest message or plain object to encode + * Encodes the specified DeleteIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteIntentRequest.verify|verify} messages. + * @param message DeleteIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer. + * Decodes a DeleteIntentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteSessionEntityTypeRequest + * @returns DeleteIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteIntentRequest; /** - * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteIntentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteSessionEntityTypeRequest + * @returns DeleteIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteIntentRequest; /** - * Verifies a DeleteSessionEntityTypeRequest message. + * Verifies a DeleteIntentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteIntentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteSessionEntityTypeRequest + * @returns DeleteIntentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteIntentRequest; /** - * Creates a plain object from a DeleteSessionEntityTypeRequest message. Also converts values to other types if specified. - * @param message DeleteSessionEntityTypeRequest + * Creates a plain object from a DeleteIntentRequest message. Also converts values to other types if specified. + * @param message DeleteIntentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.DeleteIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteSessionEntityTypeRequest to JSON. + * Converts this DeleteIntentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a WebhookRequest. */ - interface IWebhookRequest { + /** Properties of a BatchUpdateIntentsRequest. */ + interface IBatchUpdateIntentsRequest { - /** WebhookRequest session */ - session?: (string|null); + /** BatchUpdateIntentsRequest parent */ + parent?: (string|null); - /** WebhookRequest responseId */ - responseId?: (string|null); + /** BatchUpdateIntentsRequest intentBatchUri */ + intentBatchUri?: (string|null); - /** WebhookRequest queryResult */ - queryResult?: (google.cloud.dialogflow.v2.IQueryResult|null); + /** BatchUpdateIntentsRequest intentBatchInline */ + intentBatchInline?: (google.cloud.dialogflow.v2.IIntentBatch|null); - /** WebhookRequest originalDetectIntentRequest */ - originalDetectIntentRequest?: (google.cloud.dialogflow.v2.IOriginalDetectIntentRequest|null); + /** BatchUpdateIntentsRequest languageCode */ + languageCode?: (string|null); + + /** BatchUpdateIntentsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** BatchUpdateIntentsRequest intentView */ + intentView?: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView|null); } - /** Represents a WebhookRequest. */ - class WebhookRequest implements IWebhookRequest { + /** Represents a BatchUpdateIntentsRequest. */ + class BatchUpdateIntentsRequest implements IBatchUpdateIntentsRequest { /** - * Constructs a new WebhookRequest. + * Constructs a new BatchUpdateIntentsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IWebhookRequest); + constructor(properties?: google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest); - /** WebhookRequest session. */ - public session: string; + /** BatchUpdateIntentsRequest parent. */ + public parent: string; - /** WebhookRequest responseId. */ - public responseId: string; + /** BatchUpdateIntentsRequest intentBatchUri. */ + public intentBatchUri: string; - /** WebhookRequest queryResult. */ - public queryResult?: (google.cloud.dialogflow.v2.IQueryResult|null); + /** BatchUpdateIntentsRequest intentBatchInline. */ + public intentBatchInline?: (google.cloud.dialogflow.v2.IIntentBatch|null); - /** WebhookRequest originalDetectIntentRequest. */ - public originalDetectIntentRequest?: (google.cloud.dialogflow.v2.IOriginalDetectIntentRequest|null); + /** BatchUpdateIntentsRequest languageCode. */ + public languageCode: string; + + /** BatchUpdateIntentsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** BatchUpdateIntentsRequest intentView. */ + public intentView: (google.cloud.dialogflow.v2.IntentView|keyof typeof google.cloud.dialogflow.v2.IntentView); + + /** BatchUpdateIntentsRequest intentBatch. */ + public intentBatch?: ("intentBatchUri"|"intentBatchInline"); /** - * Creates a new WebhookRequest instance using the specified properties. + * Creates a new BatchUpdateIntentsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns WebhookRequest instance + * @returns BatchUpdateIntentsRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2.IWebhookRequest): google.cloud.dialogflow.v2.WebhookRequest; + public static create(properties?: google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest): google.cloud.dialogflow.v2.BatchUpdateIntentsRequest; /** - * Encodes the specified WebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookRequest.verify|verify} messages. - * @param message WebhookRequest message or plain object to encode + * Encodes the specified BatchUpdateIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.verify|verify} messages. + * @param message BatchUpdateIntentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookRequest.verify|verify} messages. - * @param message WebhookRequest message or plain object to encode + * Encodes the specified BatchUpdateIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.verify|verify} messages. + * @param message BatchUpdateIntentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WebhookRequest message from the specified reader or buffer. + * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WebhookRequest + * @returns BatchUpdateIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.WebhookRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchUpdateIntentsRequest; /** - * Decodes a WebhookRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WebhookRequest + * @returns BatchUpdateIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.WebhookRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchUpdateIntentsRequest; /** - * Verifies a WebhookRequest message. + * Verifies a BatchUpdateIntentsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WebhookRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchUpdateIntentsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WebhookRequest + * @returns BatchUpdateIntentsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.WebhookRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchUpdateIntentsRequest; /** - * Creates a plain object from a WebhookRequest message. Also converts values to other types if specified. - * @param message WebhookRequest + * Creates a plain object from a BatchUpdateIntentsRequest message. Also converts values to other types if specified. + * @param message BatchUpdateIntentsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.WebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.BatchUpdateIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WebhookRequest to JSON. + * Converts this BatchUpdateIntentsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a WebhookResponse. */ - interface IWebhookResponse { + /** Properties of a BatchUpdateIntentsResponse. */ + interface IBatchUpdateIntentsResponse { - /** WebhookResponse fulfillmentText */ - fulfillmentText?: (string|null); + /** BatchUpdateIntentsResponse intents */ + intents?: (google.cloud.dialogflow.v2.IIntent[]|null); + } - /** WebhookResponse fulfillmentMessages */ - fulfillmentMessages?: (google.cloud.dialogflow.v2.Intent.IMessage[]|null); + /** Represents a BatchUpdateIntentsResponse. */ + class BatchUpdateIntentsResponse implements IBatchUpdateIntentsResponse { - /** WebhookResponse source */ - source?: (string|null); + /** + * Constructs a new BatchUpdateIntentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse); - /** WebhookResponse payload */ - payload?: (google.protobuf.IStruct|null); + /** BatchUpdateIntentsResponse intents. */ + public intents: google.cloud.dialogflow.v2.IIntent[]; - /** WebhookResponse outputContexts */ - outputContexts?: (google.cloud.dialogflow.v2.IContext[]|null); + /** + * Creates a new BatchUpdateIntentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchUpdateIntentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse): google.cloud.dialogflow.v2.BatchUpdateIntentsResponse; - /** WebhookResponse followupEventInput */ - followupEventInput?: (google.cloud.dialogflow.v2.IEventInput|null); + /** + * Encodes the specified BatchUpdateIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.verify|verify} messages. + * @param message BatchUpdateIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** WebhookResponse sessionEntityTypes */ - sessionEntityTypes?: (google.cloud.dialogflow.v2.ISessionEntityType[]|null); - } + /** + * Encodes the specified BatchUpdateIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.verify|verify} messages. + * @param message BatchUpdateIntentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a WebhookResponse. */ - class WebhookResponse implements IWebhookResponse { + /** + * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchUpdateIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchUpdateIntentsResponse; /** - * Constructs a new WebhookResponse. - * @param [properties] Properties to set + * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchUpdateIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - constructor(properties?: google.cloud.dialogflow.v2.IWebhookResponse); + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchUpdateIntentsResponse; - /** WebhookResponse fulfillmentText. */ - public fulfillmentText: string; + /** + * Verifies a BatchUpdateIntentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** WebhookResponse fulfillmentMessages. */ - public fulfillmentMessages: google.cloud.dialogflow.v2.Intent.IMessage[]; + /** + * Creates a BatchUpdateIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchUpdateIntentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchUpdateIntentsResponse; - /** WebhookResponse source. */ - public source: string; + /** + * Creates a plain object from a BatchUpdateIntentsResponse message. Also converts values to other types if specified. + * @param message BatchUpdateIntentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.BatchUpdateIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** WebhookResponse payload. */ - public payload?: (google.protobuf.IStruct|null); + /** + * Converts this BatchUpdateIntentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** WebhookResponse outputContexts. */ - public outputContexts: google.cloud.dialogflow.v2.IContext[]; + /** Properties of a BatchDeleteIntentsRequest. */ + interface IBatchDeleteIntentsRequest { - /** WebhookResponse followupEventInput. */ - public followupEventInput?: (google.cloud.dialogflow.v2.IEventInput|null); + /** BatchDeleteIntentsRequest parent */ + parent?: (string|null); - /** WebhookResponse sessionEntityTypes. */ - public sessionEntityTypes: google.cloud.dialogflow.v2.ISessionEntityType[]; + /** BatchDeleteIntentsRequest intents */ + intents?: (google.cloud.dialogflow.v2.IIntent[]|null); + } + + /** Represents a BatchDeleteIntentsRequest. */ + class BatchDeleteIntentsRequest implements IBatchDeleteIntentsRequest { /** - * Creates a new WebhookResponse instance using the specified properties. + * Constructs a new BatchDeleteIntentsRequest. * @param [properties] Properties to set - * @returns WebhookResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2.IWebhookResponse): google.cloud.dialogflow.v2.WebhookResponse; + constructor(properties?: google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest); + + /** BatchDeleteIntentsRequest parent. */ + public parent: string; + + /** BatchDeleteIntentsRequest intents. */ + public intents: google.cloud.dialogflow.v2.IIntent[]; /** - * Encodes the specified WebhookResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookResponse.verify|verify} messages. - * @param message WebhookResponse message or plain object to encode + * Creates a new BatchDeleteIntentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteIntentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest): google.cloud.dialogflow.v2.BatchDeleteIntentsRequest; + + /** + * Encodes the specified BatchDeleteIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.verify|verify} messages. + * @param message BatchDeleteIntentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IWebhookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified WebhookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookResponse.verify|verify} messages. - * @param message WebhookResponse message or plain object to encode + * Encodes the specified BatchDeleteIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.verify|verify} messages. + * @param message BatchDeleteIntentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IWebhookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a WebhookResponse message from the specified reader or buffer. + * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns WebhookResponse + * @returns BatchDeleteIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.WebhookResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchDeleteIntentsRequest; /** - * Decodes a WebhookResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns WebhookResponse + * @returns BatchDeleteIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.WebhookResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchDeleteIntentsRequest; /** - * Verifies a WebhookResponse message. + * Verifies a BatchDeleteIntentsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a WebhookResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDeleteIntentsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns WebhookResponse + * @returns BatchDeleteIntentsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.WebhookResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchDeleteIntentsRequest; /** - * Creates a plain object from a WebhookResponse message. Also converts values to other types if specified. - * @param message WebhookResponse + * Creates a plain object from a BatchDeleteIntentsRequest message. Also converts values to other types if specified. + * @param message BatchDeleteIntentsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.WebhookResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.BatchDeleteIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this WebhookResponse to JSON. + * Converts this BatchDeleteIntentsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an OriginalDetectIntentRequest. */ - interface IOriginalDetectIntentRequest { - - /** OriginalDetectIntentRequest source */ - source?: (string|null); - - /** OriginalDetectIntentRequest version */ - version?: (string|null); + /** Properties of an IntentBatch. */ + interface IIntentBatch { - /** OriginalDetectIntentRequest payload */ - payload?: (google.protobuf.IStruct|null); + /** IntentBatch intents */ + intents?: (google.cloud.dialogflow.v2.IIntent[]|null); } - /** Represents an OriginalDetectIntentRequest. */ - class OriginalDetectIntentRequest implements IOriginalDetectIntentRequest { + /** Represents an IntentBatch. */ + class IntentBatch implements IIntentBatch { /** - * Constructs a new OriginalDetectIntentRequest. + * Constructs a new IntentBatch. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2.IOriginalDetectIntentRequest); - - /** OriginalDetectIntentRequest source. */ - public source: string; - - /** OriginalDetectIntentRequest version. */ - public version: string; + constructor(properties?: google.cloud.dialogflow.v2.IIntentBatch); - /** OriginalDetectIntentRequest payload. */ - public payload?: (google.protobuf.IStruct|null); + /** IntentBatch intents. */ + public intents: google.cloud.dialogflow.v2.IIntent[]; /** - * Creates a new OriginalDetectIntentRequest instance using the specified properties. + * Creates a new IntentBatch instance using the specified properties. * @param [properties] Properties to set - * @returns OriginalDetectIntentRequest instance + * @returns IntentBatch instance */ - public static create(properties?: google.cloud.dialogflow.v2.IOriginalDetectIntentRequest): google.cloud.dialogflow.v2.OriginalDetectIntentRequest; + public static create(properties?: google.cloud.dialogflow.v2.IIntentBatch): google.cloud.dialogflow.v2.IntentBatch; /** - * Encodes the specified OriginalDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.OriginalDetectIntentRequest.verify|verify} messages. - * @param message OriginalDetectIntentRequest message or plain object to encode + * Encodes the specified IntentBatch message. Does not implicitly {@link google.cloud.dialogflow.v2.IntentBatch.verify|verify} messages. + * @param message IntentBatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2.IOriginalDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IIntentBatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OriginalDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.OriginalDetectIntentRequest.verify|verify} messages. - * @param message OriginalDetectIntentRequest message or plain object to encode + * Encodes the specified IntentBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.IntentBatch.verify|verify} messages. + * @param message IntentBatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2.IOriginalDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IIntentBatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OriginalDetectIntentRequest message from the specified reader or buffer. + * Decodes an IntentBatch message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OriginalDetectIntentRequest + * @returns IntentBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.OriginalDetectIntentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.IntentBatch; /** - * Decodes an OriginalDetectIntentRequest message from the specified reader or buffer, length delimited. + * Decodes an IntentBatch message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OriginalDetectIntentRequest + * @returns IntentBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.OriginalDetectIntentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.IntentBatch; /** - * Verifies an OriginalDetectIntentRequest message. + * Verifies an IntentBatch message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OriginalDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an IntentBatch message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OriginalDetectIntentRequest + * @returns IntentBatch */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.OriginalDetectIntentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.IntentBatch; /** - * Creates a plain object from an OriginalDetectIntentRequest message. Also converts values to other types if specified. - * @param message OriginalDetectIntentRequest + * Creates a plain object from an IntentBatch message. Also converts values to other types if specified. + * @param message IntentBatch * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2.OriginalDetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.IntentBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OriginalDetectIntentRequest to JSON. + * Converts this IntentBatch to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - } - /** Namespace v2beta1. */ - namespace v2beta1 { + /** IntentView enum. */ + enum IntentView { + INTENT_VIEW_UNSPECIFIED = 0, + INTENT_VIEW_FULL = 1 + } - /** Represents an Agents */ - class Agents extends $protobuf.rpc.Service { + /** Represents a SessionEntityTypes */ + class SessionEntityTypes extends $protobuf.rpc.Service { /** - * Constructs a new Agents service. + * Constructs a new SessionEntityTypes service. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited @@ -12933,13929 +13546,35026 @@ export namespace google { constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates new Agents service using the specified rpc implementation. + * Creates new SessionEntityTypes service using the specified rpc implementation. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited * @returns RPC service. Useful where requests and/or responses are streamed. */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Agents; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SessionEntityTypes; /** - * Calls GetAgent. - * @param request GetAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Agent + * Calls ListSessionEntityTypes. + * @param request ListSessionEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSessionEntityTypesResponse */ - public getAgent(request: google.cloud.dialogflow.v2beta1.IGetAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.GetAgentCallback): void; + public listSessionEntityTypes(request: google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, callback: google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypesCallback): void; /** - * Calls GetAgent. - * @param request GetAgentRequest message or plain object + * Calls ListSessionEntityTypes. + * @param request ListSessionEntityTypesRequest message or plain object * @returns Promise */ - public getAgent(request: google.cloud.dialogflow.v2beta1.IGetAgentRequest): Promise; + public listSessionEntityTypes(request: google.cloud.dialogflow.v2.IListSessionEntityTypesRequest): Promise; /** - * Calls SetAgent. - * @param request SetAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Agent + * Calls GetSessionEntityType. + * @param request GetSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionEntityType */ - public setAgent(request: google.cloud.dialogflow.v2beta1.ISetAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.SetAgentCallback): void; + public getSessionEntityType(request: google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2.SessionEntityTypes.GetSessionEntityTypeCallback): void; /** - * Calls SetAgent. - * @param request SetAgentRequest message or plain object + * Calls GetSessionEntityType. + * @param request GetSessionEntityTypeRequest message or plain object * @returns Promise */ - public setAgent(request: google.cloud.dialogflow.v2beta1.ISetAgentRequest): Promise; + public getSessionEntityType(request: google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest): Promise; /** - * Calls DeleteAgent. - * @param request DeleteAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Calls CreateSessionEntityType. + * @param request CreateSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionEntityType */ - public deleteAgent(request: google.cloud.dialogflow.v2beta1.IDeleteAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.DeleteAgentCallback): void; + public createSessionEntityType(request: google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2.SessionEntityTypes.CreateSessionEntityTypeCallback): void; /** - * Calls DeleteAgent. - * @param request DeleteAgentRequest message or plain object + * Calls CreateSessionEntityType. + * @param request CreateSessionEntityTypeRequest message or plain object * @returns Promise */ - public deleteAgent(request: google.cloud.dialogflow.v2beta1.IDeleteAgentRequest): Promise; + public createSessionEntityType(request: google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest): Promise; /** - * Calls SearchAgents. - * @param request SearchAgentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SearchAgentsResponse + * Calls UpdateSessionEntityType. + * @param request UpdateSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionEntityType */ - public searchAgents(request: google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, callback: google.cloud.dialogflow.v2beta1.Agents.SearchAgentsCallback): void; + public updateSessionEntityType(request: google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2.SessionEntityTypes.UpdateSessionEntityTypeCallback): void; /** - * Calls SearchAgents. - * @param request SearchAgentsRequest message or plain object + * Calls UpdateSessionEntityType. + * @param request UpdateSessionEntityTypeRequest message or plain object * @returns Promise */ - public searchAgents(request: google.cloud.dialogflow.v2beta1.ISearchAgentsRequest): Promise; + public updateSessionEntityType(request: google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest): Promise; /** - * Calls TrainAgent. - * @param request TrainAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Calls DeleteSessionEntityType. + * @param request DeleteSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public trainAgent(request: google.cloud.dialogflow.v2beta1.ITrainAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.TrainAgentCallback): void; + public deleteSessionEntityType(request: google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2.SessionEntityTypes.DeleteSessionEntityTypeCallback): void; /** - * Calls TrainAgent. - * @param request TrainAgentRequest message or plain object + * Calls DeleteSessionEntityType. + * @param request DeleteSessionEntityTypeRequest message or plain object * @returns Promise */ - public trainAgent(request: google.cloud.dialogflow.v2beta1.ITrainAgentRequest): Promise; + public deleteSessionEntityType(request: google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest): Promise; + } - /** - * Calls ExportAgent. - * @param request ExportAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public exportAgent(request: google.cloud.dialogflow.v2beta1.IExportAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.ExportAgentCallback): void; + namespace SessionEntityTypes { /** - * Calls ExportAgent. - * @param request ExportAgentRequest message or plain object - * @returns Promise + * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#listSessionEntityTypes}. + * @param error Error, if any + * @param [response] ListSessionEntityTypesResponse */ - public exportAgent(request: google.cloud.dialogflow.v2beta1.IExportAgentRequest): Promise; + type ListSessionEntityTypesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListSessionEntityTypesResponse) => void; /** - * Calls ImportAgent. - * @param request ImportAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#getSessionEntityType}. + * @param error Error, if any + * @param [response] SessionEntityType */ - public importAgent(request: google.cloud.dialogflow.v2beta1.IImportAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.ImportAgentCallback): void; + type GetSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.SessionEntityType) => void; /** - * Calls ImportAgent. - * @param request ImportAgentRequest message or plain object - * @returns Promise - */ - public importAgent(request: google.cloud.dialogflow.v2beta1.IImportAgentRequest): Promise; - - /** - * Calls RestoreAgent. - * @param request RestoreAgentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreAgent(request: google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.RestoreAgentCallback): void; - - /** - * Calls RestoreAgent. - * @param request RestoreAgentRequest message or plain object - * @returns Promise - */ - public restoreAgent(request: google.cloud.dialogflow.v2beta1.IRestoreAgentRequest): Promise; - - /** - * Calls GetValidationResult. - * @param request GetValidationResultRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ValidationResult - */ - public getValidationResult(request: google.cloud.dialogflow.v2beta1.IGetValidationResultRequest, callback: google.cloud.dialogflow.v2beta1.Agents.GetValidationResultCallback): void; - - /** - * Calls GetValidationResult. - * @param request GetValidationResultRequest message or plain object - * @returns Promise - */ - public getValidationResult(request: google.cloud.dialogflow.v2beta1.IGetValidationResultRequest): Promise; - } - - namespace Agents { - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#getAgent}. + * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#createSessionEntityType}. * @param error Error, if any - * @param [response] Agent + * @param [response] SessionEntityType */ - type GetAgentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Agent) => void; + type CreateSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.SessionEntityType) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#setAgent}. + * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#updateSessionEntityType}. * @param error Error, if any - * @param [response] Agent + * @param [response] SessionEntityType */ - type SetAgentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Agent) => void; + type UpdateSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.SessionEntityType) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#deleteAgent}. + * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#deleteSessionEntityType}. * @param error Error, if any * @param [response] Empty */ - type DeleteAgentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#searchAgents}. - * @param error Error, if any - * @param [response] SearchAgentsResponse - */ - type SearchAgentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.SearchAgentsResponse) => void; - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#trainAgent}. - * @param error Error, if any - * @param [response] Operation - */ - type TrainAgentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#exportAgent}. - * @param error Error, if any - * @param [response] Operation - */ - type ExportAgentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#importAgent}. - * @param error Error, if any - * @param [response] Operation - */ - type ImportAgentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#restoreAgent}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreAgentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#getValidationResult}. - * @param error Error, if any - * @param [response] ValidationResult - */ - type GetValidationResultCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ValidationResult) => void; + type DeleteSessionEntityTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; } - /** Properties of an Agent. */ - interface IAgent { - - /** Agent parent */ - parent?: (string|null); - - /** Agent displayName */ - displayName?: (string|null); - - /** Agent defaultLanguageCode */ - defaultLanguageCode?: (string|null); - - /** Agent supportedLanguageCodes */ - supportedLanguageCodes?: (string[]|null); - - /** Agent timeZone */ - timeZone?: (string|null); - - /** Agent description */ - description?: (string|null); - - /** Agent avatarUri */ - avatarUri?: (string|null); - - /** Agent enableLogging */ - enableLogging?: (boolean|null); - - /** Agent matchMode */ - matchMode?: (google.cloud.dialogflow.v2beta1.Agent.MatchMode|keyof typeof google.cloud.dialogflow.v2beta1.Agent.MatchMode|null); + /** Properties of a SessionEntityType. */ + interface ISessionEntityType { - /** Agent classificationThreshold */ - classificationThreshold?: (number|null); + /** SessionEntityType name */ + name?: (string|null); - /** Agent apiVersion */ - apiVersion?: (google.cloud.dialogflow.v2beta1.Agent.ApiVersion|keyof typeof google.cloud.dialogflow.v2beta1.Agent.ApiVersion|null); + /** SessionEntityType entityOverrideMode */ + entityOverrideMode?: (google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode|keyof typeof google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode|null); - /** Agent tier */ - tier?: (google.cloud.dialogflow.v2beta1.Agent.Tier|keyof typeof google.cloud.dialogflow.v2beta1.Agent.Tier|null); + /** SessionEntityType entities */ + entities?: (google.cloud.dialogflow.v2.EntityType.IEntity[]|null); } - /** Represents an Agent. */ - class Agent implements IAgent { + /** Represents a SessionEntityType. */ + class SessionEntityType implements ISessionEntityType { /** - * Constructs a new Agent. + * Constructs a new SessionEntityType. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IAgent); - - /** Agent parent. */ - public parent: string; - - /** Agent displayName. */ - public displayName: string; - - /** Agent defaultLanguageCode. */ - public defaultLanguageCode: string; - - /** Agent supportedLanguageCodes. */ - public supportedLanguageCodes: string[]; - - /** Agent timeZone. */ - public timeZone: string; - - /** Agent description. */ - public description: string; - - /** Agent avatarUri. */ - public avatarUri: string; - - /** Agent enableLogging. */ - public enableLogging: boolean; - - /** Agent matchMode. */ - public matchMode: (google.cloud.dialogflow.v2beta1.Agent.MatchMode|keyof typeof google.cloud.dialogflow.v2beta1.Agent.MatchMode); + constructor(properties?: google.cloud.dialogflow.v2.ISessionEntityType); - /** Agent classificationThreshold. */ - public classificationThreshold: number; + /** SessionEntityType name. */ + public name: string; - /** Agent apiVersion. */ - public apiVersion: (google.cloud.dialogflow.v2beta1.Agent.ApiVersion|keyof typeof google.cloud.dialogflow.v2beta1.Agent.ApiVersion); + /** SessionEntityType entityOverrideMode. */ + public entityOverrideMode: (google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode|keyof typeof google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode); - /** Agent tier. */ - public tier: (google.cloud.dialogflow.v2beta1.Agent.Tier|keyof typeof google.cloud.dialogflow.v2beta1.Agent.Tier); + /** SessionEntityType entities. */ + public entities: google.cloud.dialogflow.v2.EntityType.IEntity[]; /** - * Creates a new Agent instance using the specified properties. + * Creates a new SessionEntityType instance using the specified properties. * @param [properties] Properties to set - * @returns Agent instance + * @returns SessionEntityType instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IAgent): google.cloud.dialogflow.v2beta1.Agent; + public static create(properties?: google.cloud.dialogflow.v2.ISessionEntityType): google.cloud.dialogflow.v2.SessionEntityType; /** - * Encodes the specified Agent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Agent.verify|verify} messages. - * @param message Agent message or plain object to encode + * Encodes the specified SessionEntityType message. Does not implicitly {@link google.cloud.dialogflow.v2.SessionEntityType.verify|verify} messages. + * @param message SessionEntityType message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ISessionEntityType, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Agent.verify|verify} messages. - * @param message Agent message or plain object to encode + * Encodes the specified SessionEntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SessionEntityType.verify|verify} messages. + * @param message SessionEntityType message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISessionEntityType, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Agent message from the specified reader or buffer. + * Decodes a SessionEntityType message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Agent + * @returns SessionEntityType * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Agent; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SessionEntityType; /** - * Decodes an Agent message from the specified reader or buffer, length delimited. + * Decodes a SessionEntityType message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Agent + * @returns SessionEntityType * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Agent; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SessionEntityType; /** - * Verifies an Agent message. + * Verifies a SessionEntityType message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Agent message from a plain object. Also converts values to their respective internal types. + * Creates a SessionEntityType message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Agent + * @returns SessionEntityType */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Agent; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SessionEntityType; /** - * Creates a plain object from an Agent message. Also converts values to other types if specified. - * @param message Agent + * Creates a plain object from a SessionEntityType message. Also converts values to other types if specified. + * @param message SessionEntityType * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Agent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.SessionEntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Agent to JSON. + * Converts this SessionEntityType to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Agent { - - /** MatchMode enum. */ - enum MatchMode { - MATCH_MODE_UNSPECIFIED = 0, - MATCH_MODE_HYBRID = 1, - MATCH_MODE_ML_ONLY = 2 - } - - /** ApiVersion enum. */ - enum ApiVersion { - API_VERSION_UNSPECIFIED = 0, - API_VERSION_V1 = 1, - API_VERSION_V2 = 2, - API_VERSION_V2_BETA_1 = 3 - } + namespace SessionEntityType { - /** Tier enum. */ - enum Tier { - TIER_UNSPECIFIED = 0, - TIER_STANDARD = 1, - TIER_ENTERPRISE = 2, - TIER_ENTERPRISE_PLUS = 3 + /** EntityOverrideMode enum. */ + enum EntityOverrideMode { + ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0, + ENTITY_OVERRIDE_MODE_OVERRIDE = 1, + ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2 } } - /** Properties of a GetAgentRequest. */ - interface IGetAgentRequest { + /** Properties of a ListSessionEntityTypesRequest. */ + interface IListSessionEntityTypesRequest { - /** GetAgentRequest parent */ + /** ListSessionEntityTypesRequest parent */ parent?: (string|null); + + /** ListSessionEntityTypesRequest pageSize */ + pageSize?: (number|null); + + /** ListSessionEntityTypesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a GetAgentRequest. */ - class GetAgentRequest implements IGetAgentRequest { + /** Represents a ListSessionEntityTypesRequest. */ + class ListSessionEntityTypesRequest implements IListSessionEntityTypesRequest { /** - * Constructs a new GetAgentRequest. + * Constructs a new ListSessionEntityTypesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IGetAgentRequest); + constructor(properties?: google.cloud.dialogflow.v2.IListSessionEntityTypesRequest); - /** GetAgentRequest parent. */ + /** ListSessionEntityTypesRequest parent. */ public parent: string; + /** ListSessionEntityTypesRequest pageSize. */ + public pageSize: number; + + /** ListSessionEntityTypesRequest pageToken. */ + public pageToken: string; + /** - * Creates a new GetAgentRequest instance using the specified properties. + * Creates a new ListSessionEntityTypesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetAgentRequest instance + * @returns ListSessionEntityTypesRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IGetAgentRequest): google.cloud.dialogflow.v2beta1.GetAgentRequest; + public static create(properties?: google.cloud.dialogflow.v2.IListSessionEntityTypesRequest): google.cloud.dialogflow.v2.ListSessionEntityTypesRequest; /** - * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetAgentRequest.verify|verify} messages. - * @param message GetAgentRequest message or plain object to encode + * Encodes the specified ListSessionEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesRequest.verify|verify} messages. + * @param message ListSessionEntityTypesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetAgentRequest.verify|verify} messages. - * @param message GetAgentRequest message or plain object to encode + * Encodes the specified ListSessionEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesRequest.verify|verify} messages. + * @param message ListSessionEntityTypesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListSessionEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetAgentRequest message from the specified reader or buffer. + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetAgentRequest + * @returns ListSessionEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetAgentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListSessionEntityTypesRequest; /** - * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetAgentRequest + * @returns ListSessionEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetAgentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListSessionEntityTypesRequest; /** - * Verifies a GetAgentRequest message. + * Verifies a ListSessionEntityTypesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSessionEntityTypesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetAgentRequest + * @returns ListSessionEntityTypesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetAgentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListSessionEntityTypesRequest; /** - * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. - * @param message GetAgentRequest + * Creates a plain object from a ListSessionEntityTypesRequest message. Also converts values to other types if specified. + * @param message ListSessionEntityTypesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.GetAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.ListSessionEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetAgentRequest to JSON. + * Converts this ListSessionEntityTypesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SetAgentRequest. */ - interface ISetAgentRequest { + /** Properties of a ListSessionEntityTypesResponse. */ + interface IListSessionEntityTypesResponse { - /** SetAgentRequest agent */ - agent?: (google.cloud.dialogflow.v2beta1.IAgent|null); + /** ListSessionEntityTypesResponse sessionEntityTypes */ + sessionEntityTypes?: (google.cloud.dialogflow.v2.ISessionEntityType[]|null); - /** SetAgentRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ListSessionEntityTypesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a SetAgentRequest. */ - class SetAgentRequest implements ISetAgentRequest { + /** Represents a ListSessionEntityTypesResponse. */ + class ListSessionEntityTypesResponse implements IListSessionEntityTypesResponse { /** - * Constructs a new SetAgentRequest. + * Constructs a new ListSessionEntityTypesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ISetAgentRequest); + constructor(properties?: google.cloud.dialogflow.v2.IListSessionEntityTypesResponse); - /** SetAgentRequest agent. */ - public agent?: (google.cloud.dialogflow.v2beta1.IAgent|null); + /** ListSessionEntityTypesResponse sessionEntityTypes. */ + public sessionEntityTypes: google.cloud.dialogflow.v2.ISessionEntityType[]; - /** SetAgentRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ListSessionEntityTypesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new SetAgentRequest instance using the specified properties. + * Creates a new ListSessionEntityTypesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns SetAgentRequest instance + * @returns ListSessionEntityTypesResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ISetAgentRequest): google.cloud.dialogflow.v2beta1.SetAgentRequest; + public static create(properties?: google.cloud.dialogflow.v2.IListSessionEntityTypesResponse): google.cloud.dialogflow.v2.ListSessionEntityTypesResponse; /** - * Encodes the specified SetAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SetAgentRequest.verify|verify} messages. - * @param message SetAgentRequest message or plain object to encode + * Encodes the specified ListSessionEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.verify|verify} messages. + * @param message ListSessionEntityTypesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ISetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IListSessionEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SetAgentRequest.verify|verify} messages. - * @param message SetAgentRequest message or plain object to encode + * Encodes the specified ListSessionEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.verify|verify} messages. + * @param message ListSessionEntityTypesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListSessionEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SetAgentRequest message from the specified reader or buffer. + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SetAgentRequest + * @returns ListSessionEntityTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SetAgentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListSessionEntityTypesResponse; /** - * Decodes a SetAgentRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SetAgentRequest + * @returns ListSessionEntityTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SetAgentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListSessionEntityTypesResponse; /** - * Verifies a SetAgentRequest message. + * Verifies a ListSessionEntityTypesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SetAgentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSessionEntityTypesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SetAgentRequest + * @returns ListSessionEntityTypesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SetAgentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListSessionEntityTypesResponse; /** - * Creates a plain object from a SetAgentRequest message. Also converts values to other types if specified. - * @param message SetAgentRequest + * Creates a plain object from a ListSessionEntityTypesResponse message. Also converts values to other types if specified. + * @param message ListSessionEntityTypesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.SetAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.ListSessionEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SetAgentRequest to JSON. + * Converts this ListSessionEntityTypesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteAgentRequest. */ - interface IDeleteAgentRequest { + /** Properties of a GetSessionEntityTypeRequest. */ + interface IGetSessionEntityTypeRequest { - /** DeleteAgentRequest parent */ - parent?: (string|null); + /** GetSessionEntityTypeRequest name */ + name?: (string|null); } - /** Represents a DeleteAgentRequest. */ - class DeleteAgentRequest implements IDeleteAgentRequest { + /** Represents a GetSessionEntityTypeRequest. */ + class GetSessionEntityTypeRequest implements IGetSessionEntityTypeRequest { /** - * Constructs a new DeleteAgentRequest. + * Constructs a new GetSessionEntityTypeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteAgentRequest); + constructor(properties?: google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest); - /** DeleteAgentRequest parent. */ - public parent: string; + /** GetSessionEntityTypeRequest name. */ + public name: string; /** - * Creates a new DeleteAgentRequest instance using the specified properties. + * Creates a new GetSessionEntityTypeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteAgentRequest instance + * @returns GetSessionEntityTypeRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteAgentRequest): google.cloud.dialogflow.v2beta1.DeleteAgentRequest; + public static create(properties?: google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest): google.cloud.dialogflow.v2.GetSessionEntityTypeRequest; /** - * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAgentRequest.verify|verify} messages. - * @param message DeleteAgentRequest message or plain object to encode + * Encodes the specified GetSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetSessionEntityTypeRequest.verify|verify} messages. + * @param message GetSessionEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAgentRequest.verify|verify} messages. - * @param message DeleteAgentRequest message or plain object to encode + * Encodes the specified GetSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetSessionEntityTypeRequest.verify|verify} messages. + * @param message GetSessionEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteAgentRequest + * @returns GetSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteAgentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetSessionEntityTypeRequest; /** - * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteAgentRequest + * @returns GetSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteAgentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetSessionEntityTypeRequest; /** - * Verifies a DeleteAgentRequest message. + * Verifies a GetSessionEntityTypeRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteAgentRequest + * @returns GetSessionEntityTypeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteAgentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetSessionEntityTypeRequest; /** - * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. - * @param message DeleteAgentRequest + * Creates a plain object from a GetSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message GetSessionEntityTypeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.GetSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteAgentRequest to JSON. + * Converts this GetSessionEntityTypeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SubAgent. */ - interface ISubAgent { + /** Properties of a CreateSessionEntityTypeRequest. */ + interface ICreateSessionEntityTypeRequest { - /** SubAgent project */ - project?: (string|null); + /** CreateSessionEntityTypeRequest parent */ + parent?: (string|null); - /** SubAgent environment */ - environment?: (string|null); + /** CreateSessionEntityTypeRequest sessionEntityType */ + sessionEntityType?: (google.cloud.dialogflow.v2.ISessionEntityType|null); } - /** Represents a SubAgent. */ - class SubAgent implements ISubAgent { + /** Represents a CreateSessionEntityTypeRequest. */ + class CreateSessionEntityTypeRequest implements ICreateSessionEntityTypeRequest { /** - * Constructs a new SubAgent. + * Constructs a new CreateSessionEntityTypeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ISubAgent); + constructor(properties?: google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest); - /** SubAgent project. */ - public project: string; + /** CreateSessionEntityTypeRequest parent. */ + public parent: string; - /** SubAgent environment. */ - public environment: string; + /** CreateSessionEntityTypeRequest sessionEntityType. */ + public sessionEntityType?: (google.cloud.dialogflow.v2.ISessionEntityType|null); /** - * Creates a new SubAgent instance using the specified properties. + * Creates a new CreateSessionEntityTypeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SubAgent instance + * @returns CreateSessionEntityTypeRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ISubAgent): google.cloud.dialogflow.v2beta1.SubAgent; + public static create(properties?: google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest): google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest; /** - * Encodes the specified SubAgent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SubAgent.verify|verify} messages. - * @param message SubAgent message or plain object to encode + * Encodes the specified CreateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest.verify|verify} messages. + * @param message CreateSessionEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ISubAgent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SubAgent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SubAgent.verify|verify} messages. - * @param message SubAgent message or plain object to encode + * Encodes the specified CreateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest.verify|verify} messages. + * @param message CreateSessionEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISubAgent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SubAgent message from the specified reader or buffer. + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SubAgent + * @returns CreateSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SubAgent; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest; /** - * Decodes a SubAgent message from the specified reader or buffer, length delimited. + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SubAgent + * @returns CreateSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SubAgent; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest; /** - * Verifies a SubAgent message. + * Verifies a CreateSessionEntityTypeRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SubAgent message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SubAgent + * @returns CreateSessionEntityTypeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SubAgent; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest; /** - * Creates a plain object from a SubAgent message. Also converts values to other types if specified. - * @param message SubAgent + * Creates a plain object from a CreateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message CreateSessionEntityTypeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.SubAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SubAgent to JSON. + * Converts this CreateSessionEntityTypeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SearchAgentsRequest. */ - interface ISearchAgentsRequest { - - /** SearchAgentsRequest parent */ - parent?: (string|null); + /** Properties of an UpdateSessionEntityTypeRequest. */ + interface IUpdateSessionEntityTypeRequest { - /** SearchAgentsRequest pageSize */ - pageSize?: (number|null); + /** UpdateSessionEntityTypeRequest sessionEntityType */ + sessionEntityType?: (google.cloud.dialogflow.v2.ISessionEntityType|null); - /** SearchAgentsRequest pageToken */ - pageToken?: (string|null); + /** UpdateSessionEntityTypeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a SearchAgentsRequest. */ - class SearchAgentsRequest implements ISearchAgentsRequest { + /** Represents an UpdateSessionEntityTypeRequest. */ + class UpdateSessionEntityTypeRequest implements IUpdateSessionEntityTypeRequest { /** - * Constructs a new SearchAgentsRequest. + * Constructs a new UpdateSessionEntityTypeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ISearchAgentsRequest); - - /** SearchAgentsRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest); - /** SearchAgentsRequest pageSize. */ - public pageSize: number; + /** UpdateSessionEntityTypeRequest sessionEntityType. */ + public sessionEntityType?: (google.cloud.dialogflow.v2.ISessionEntityType|null); - /** SearchAgentsRequest pageToken. */ - public pageToken: string; + /** UpdateSessionEntityTypeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new SearchAgentsRequest instance using the specified properties. + * Creates a new UpdateSessionEntityTypeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SearchAgentsRequest instance + * @returns UpdateSessionEntityTypeRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ISearchAgentsRequest): google.cloud.dialogflow.v2beta1.SearchAgentsRequest; + public static create(properties?: google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest): google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest; /** - * Encodes the specified SearchAgentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsRequest.verify|verify} messages. - * @param message SearchAgentsRequest message or plain object to encode + * Encodes the specified UpdateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @param message UpdateSessionEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SearchAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsRequest.verify|verify} messages. - * @param message SearchAgentsRequest message or plain object to encode + * Encodes the specified UpdateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @param message UpdateSessionEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SearchAgentsRequest message from the specified reader or buffer. + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SearchAgentsRequest + * @returns UpdateSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchAgentsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest; /** - * Decodes a SearchAgentsRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SearchAgentsRequest + * @returns UpdateSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchAgentsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest; /** - * Verifies a SearchAgentsRequest message. + * Verifies an UpdateSessionEntityTypeRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SearchAgentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SearchAgentsRequest + * @returns UpdateSessionEntityTypeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchAgentsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest; /** - * Creates a plain object from a SearchAgentsRequest message. Also converts values to other types if specified. - * @param message SearchAgentsRequest + * Creates a plain object from an UpdateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message UpdateSessionEntityTypeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.SearchAgentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SearchAgentsRequest to JSON. + * Converts this UpdateSessionEntityTypeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SearchAgentsResponse. */ - interface ISearchAgentsResponse { - - /** SearchAgentsResponse agents */ - agents?: (google.cloud.dialogflow.v2beta1.IAgent[]|null); + /** Properties of a DeleteSessionEntityTypeRequest. */ + interface IDeleteSessionEntityTypeRequest { - /** SearchAgentsResponse nextPageToken */ - nextPageToken?: (string|null); + /** DeleteSessionEntityTypeRequest name */ + name?: (string|null); } - /** Represents a SearchAgentsResponse. */ - class SearchAgentsResponse implements ISearchAgentsResponse { + /** Represents a DeleteSessionEntityTypeRequest. */ + class DeleteSessionEntityTypeRequest implements IDeleteSessionEntityTypeRequest { /** - * Constructs a new SearchAgentsResponse. + * Constructs a new DeleteSessionEntityTypeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ISearchAgentsResponse); - - /** SearchAgentsResponse agents. */ - public agents: google.cloud.dialogflow.v2beta1.IAgent[]; + constructor(properties?: google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest); - /** SearchAgentsResponse nextPageToken. */ - public nextPageToken: string; + /** DeleteSessionEntityTypeRequest name. */ + public name: string; /** - * Creates a new SearchAgentsResponse instance using the specified properties. + * Creates a new DeleteSessionEntityTypeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SearchAgentsResponse instance + * @returns DeleteSessionEntityTypeRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ISearchAgentsResponse): google.cloud.dialogflow.v2beta1.SearchAgentsResponse; + public static create(properties?: google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest): google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest; /** - * Encodes the specified SearchAgentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsResponse.verify|verify} messages. - * @param message SearchAgentsResponse message or plain object to encode + * Encodes the specified DeleteSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @param message DeleteSessionEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ISearchAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SearchAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsResponse.verify|verify} messages. - * @param message SearchAgentsResponse message or plain object to encode + * Encodes the specified DeleteSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @param message DeleteSessionEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISearchAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SearchAgentsResponse message from the specified reader or buffer. + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SearchAgentsResponse + * @returns DeleteSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchAgentsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest; /** - * Decodes a SearchAgentsResponse message from the specified reader or buffer, length delimited. + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SearchAgentsResponse + * @returns DeleteSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchAgentsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest; /** - * Verifies a SearchAgentsResponse message. + * Verifies a DeleteSessionEntityTypeRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SearchAgentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SearchAgentsResponse + * @returns DeleteSessionEntityTypeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchAgentsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest; /** - * Creates a plain object from a SearchAgentsResponse message. Also converts values to other types if specified. - * @param message SearchAgentsResponse + * Creates a plain object from a DeleteSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message DeleteSessionEntityTypeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.SearchAgentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SearchAgentsResponse to JSON. + * Converts this DeleteSessionEntityTypeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TrainAgentRequest. */ - interface ITrainAgentRequest { - - /** TrainAgentRequest parent */ - parent?: (string|null); - } - - /** Represents a TrainAgentRequest. */ - class TrainAgentRequest implements ITrainAgentRequest { + /** Represents an EntityTypes */ + class EntityTypes extends $protobuf.rpc.Service { /** - * Constructs a new TrainAgentRequest. - * @param [properties] Properties to set + * Constructs a new EntityTypes service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ITrainAgentRequest); - - /** TrainAgentRequest parent. */ - public parent: string; + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a new TrainAgentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TrainAgentRequest instance + * Creates new EntityTypes service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ITrainAgentRequest): google.cloud.dialogflow.v2beta1.TrainAgentRequest; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): EntityTypes; /** - * Encodes the specified TrainAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TrainAgentRequest.verify|verify} messages. - * @param message TrainAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListEntityTypes. + * @param request ListEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEntityTypesResponse */ - public static encode(message: google.cloud.dialogflow.v2beta1.ITrainAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public listEntityTypes(request: google.cloud.dialogflow.v2.IListEntityTypesRequest, callback: google.cloud.dialogflow.v2.EntityTypes.ListEntityTypesCallback): void; /** - * Encodes the specified TrainAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TrainAgentRequest.verify|verify} messages. - * @param message TrainAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ListEntityTypes. + * @param request ListEntityTypesRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ITrainAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public listEntityTypes(request: google.cloud.dialogflow.v2.IListEntityTypesRequest): Promise; /** - * Decodes a TrainAgentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrainAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetEntityType. + * @param request GetEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EntityType */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.TrainAgentRequest; + public getEntityType(request: google.cloud.dialogflow.v2.IGetEntityTypeRequest, callback: google.cloud.dialogflow.v2.EntityTypes.GetEntityTypeCallback): void; /** - * Decodes a TrainAgentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrainAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetEntityType. + * @param request GetEntityTypeRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.TrainAgentRequest; + public getEntityType(request: google.cloud.dialogflow.v2.IGetEntityTypeRequest): Promise; /** - * Verifies a TrainAgentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls CreateEntityType. + * @param request CreateEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EntityType */ - public static verify(message: { [k: string]: any }): (string|null); + public createEntityType(request: google.cloud.dialogflow.v2.ICreateEntityTypeRequest, callback: google.cloud.dialogflow.v2.EntityTypes.CreateEntityTypeCallback): void; /** - * Creates a TrainAgentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrainAgentRequest + * Calls CreateEntityType. + * @param request CreateEntityTypeRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.TrainAgentRequest; + public createEntityType(request: google.cloud.dialogflow.v2.ICreateEntityTypeRequest): Promise; /** - * Creates a plain object from a TrainAgentRequest message. Also converts values to other types if specified. - * @param message TrainAgentRequest - * @param [options] Conversion options - * @returns Plain object + * Calls UpdateEntityType. + * @param request UpdateEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EntityType */ - public static toObject(message: google.cloud.dialogflow.v2beta1.TrainAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public updateEntityType(request: google.cloud.dialogflow.v2.IUpdateEntityTypeRequest, callback: google.cloud.dialogflow.v2.EntityTypes.UpdateEntityTypeCallback): void; /** - * Converts this TrainAgentRequest to JSON. - * @returns JSON object + * Calls UpdateEntityType. + * @param request UpdateEntityTypeRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ExportAgentRequest. */ - interface IExportAgentRequest { - - /** ExportAgentRequest parent */ - parent?: (string|null); - - /** ExportAgentRequest agentUri */ - agentUri?: (string|null); - } - - /** Represents an ExportAgentRequest. */ - class ExportAgentRequest implements IExportAgentRequest { + public updateEntityType(request: google.cloud.dialogflow.v2.IUpdateEntityTypeRequest): Promise; /** - * Constructs a new ExportAgentRequest. - * @param [properties] Properties to set + * Calls DeleteEntityType. + * @param request DeleteEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IExportAgentRequest); - - /** ExportAgentRequest parent. */ - public parent: string; - - /** ExportAgentRequest agentUri. */ - public agentUri: string; + public deleteEntityType(request: google.cloud.dialogflow.v2.IDeleteEntityTypeRequest, callback: google.cloud.dialogflow.v2.EntityTypes.DeleteEntityTypeCallback): void; /** - * Creates a new ExportAgentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportAgentRequest instance + * Calls DeleteEntityType. + * @param request DeleteEntityTypeRequest message or plain object + * @returns Promise */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IExportAgentRequest): google.cloud.dialogflow.v2beta1.ExportAgentRequest; + public deleteEntityType(request: google.cloud.dialogflow.v2.IDeleteEntityTypeRequest): Promise; /** - * Encodes the specified ExportAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentRequest.verify|verify} messages. - * @param message ExportAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls BatchUpdateEntityTypes. + * @param request BatchUpdateEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static encode(message: google.cloud.dialogflow.v2beta1.IExportAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public batchUpdateEntityTypes(request: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, callback: google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypesCallback): void; /** - * Encodes the specified ExportAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentRequest.verify|verify} messages. - * @param message ExportAgentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls BatchUpdateEntityTypes. + * @param request BatchUpdateEntityTypesRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IExportAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public batchUpdateEntityTypes(request: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest): Promise; /** - * Decodes an ExportAgentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchDeleteEntityTypes. + * @param request BatchDeleteEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ExportAgentRequest; + public batchDeleteEntityTypes(request: google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest, callback: google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntityTypesCallback): void; /** - * Decodes an ExportAgentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportAgentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchDeleteEntityTypes. + * @param request BatchDeleteEntityTypesRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ExportAgentRequest; + public batchDeleteEntityTypes(request: google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest): Promise; /** - * Verifies an ExportAgentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls BatchCreateEntities. + * @param request BatchCreateEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static verify(message: { [k: string]: any }): (string|null); + public batchCreateEntities(request: google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, callback: google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntitiesCallback): void; /** - * Creates an ExportAgentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportAgentRequest + * Calls BatchCreateEntities. + * @param request BatchCreateEntitiesRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ExportAgentRequest; + public batchCreateEntities(request: google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest): Promise; /** - * Creates a plain object from an ExportAgentRequest message. Also converts values to other types if specified. - * @param message ExportAgentRequest - * @param [options] Conversion options - * @returns Plain object + * Calls BatchUpdateEntities. + * @param request BatchUpdateEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ExportAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public batchUpdateEntities(request: google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, callback: google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntitiesCallback): void; /** - * Converts this ExportAgentRequest to JSON. - * @returns JSON object + * Calls BatchUpdateEntities. + * @param request BatchUpdateEntitiesRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ExportAgentResponse. */ - interface IExportAgentResponse { + public batchUpdateEntities(request: google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest): Promise; - /** ExportAgentResponse agentUri */ - agentUri?: (string|null); + /** + * Calls BatchDeleteEntities. + * @param request BatchDeleteEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchDeleteEntities(request: google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, callback: google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntitiesCallback): void; - /** ExportAgentResponse agentContent */ - agentContent?: (Uint8Array|string|null); + /** + * Calls BatchDeleteEntities. + * @param request BatchDeleteEntitiesRequest message or plain object + * @returns Promise + */ + public batchDeleteEntities(request: google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest): Promise; } - /** Represents an ExportAgentResponse. */ - class ExportAgentResponse implements IExportAgentResponse { + namespace EntityTypes { /** - * Constructs a new ExportAgentResponse. - * @param [properties] Properties to set + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#listEntityTypes}. + * @param error Error, if any + * @param [response] ListEntityTypesResponse */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IExportAgentResponse); - - /** ExportAgentResponse agentUri. */ - public agentUri: string; - - /** ExportAgentResponse agentContent. */ - public agentContent: (Uint8Array|string); - - /** ExportAgentResponse agent. */ - public agent?: ("agentUri"|"agentContent"); + type ListEntityTypesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListEntityTypesResponse) => void; /** - * Creates a new ExportAgentResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ExportAgentResponse instance + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#getEntityType}. + * @param error Error, if any + * @param [response] EntityType */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IExportAgentResponse): google.cloud.dialogflow.v2beta1.ExportAgentResponse; + type GetEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.EntityType) => void; /** - * Encodes the specified ExportAgentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentResponse.verify|verify} messages. - * @param message ExportAgentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#createEntityType}. + * @param error Error, if any + * @param [response] EntityType */ - public static encode(message: google.cloud.dialogflow.v2beta1.IExportAgentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type CreateEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.EntityType) => void; /** - * Encodes the specified ExportAgentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentResponse.verify|verify} messages. - * @param message ExportAgentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#updateEntityType}. + * @param error Error, if any + * @param [response] EntityType */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IExportAgentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type UpdateEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.EntityType) => void; /** - * Decodes an ExportAgentResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExportAgentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#deleteEntityType}. + * @param error Error, if any + * @param [response] Empty */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ExportAgentResponse; + type DeleteEntityTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Decodes an ExportAgentResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExportAgentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchUpdateEntityTypes}. + * @param error Error, if any + * @param [response] Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ExportAgentResponse; + type BatchUpdateEntityTypesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Verifies an ExportAgentResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchDeleteEntityTypes}. + * @param error Error, if any + * @param [response] Operation */ - public static verify(message: { [k: string]: any }): (string|null); + type BatchDeleteEntityTypesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates an ExportAgentResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExportAgentResponse + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchCreateEntities}. + * @param error Error, if any + * @param [response] Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ExportAgentResponse; + type BatchCreateEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a plain object from an ExportAgentResponse message. Also converts values to other types if specified. - * @param message ExportAgentResponse - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchUpdateEntities}. + * @param error Error, if any + * @param [response] Operation */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ExportAgentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type BatchUpdateEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Converts this ExportAgentResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchDeleteEntities}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchDeleteEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } - /** Properties of an ImportAgentRequest. */ - interface IImportAgentRequest { + /** Properties of an EntityType. */ + interface IEntityType { - /** ImportAgentRequest parent */ - parent?: (string|null); + /** EntityType name */ + name?: (string|null); - /** ImportAgentRequest agentUri */ - agentUri?: (string|null); + /** EntityType displayName */ + displayName?: (string|null); - /** ImportAgentRequest agentContent */ - agentContent?: (Uint8Array|string|null); + /** EntityType kind */ + kind?: (google.cloud.dialogflow.v2.EntityType.Kind|keyof typeof google.cloud.dialogflow.v2.EntityType.Kind|null); + + /** EntityType autoExpansionMode */ + autoExpansionMode?: (google.cloud.dialogflow.v2.EntityType.AutoExpansionMode|keyof typeof google.cloud.dialogflow.v2.EntityType.AutoExpansionMode|null); + + /** EntityType entities */ + entities?: (google.cloud.dialogflow.v2.EntityType.IEntity[]|null); + + /** EntityType enableFuzzyExtraction */ + enableFuzzyExtraction?: (boolean|null); } - /** Represents an ImportAgentRequest. */ - class ImportAgentRequest implements IImportAgentRequest { + /** Represents an EntityType. */ + class EntityType implements IEntityType { /** - * Constructs a new ImportAgentRequest. + * Constructs a new EntityType. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IImportAgentRequest); + constructor(properties?: google.cloud.dialogflow.v2.IEntityType); - /** ImportAgentRequest parent. */ - public parent: string; + /** EntityType name. */ + public name: string; - /** ImportAgentRequest agentUri. */ - public agentUri: string; + /** EntityType displayName. */ + public displayName: string; - /** ImportAgentRequest agentContent. */ - public agentContent: (Uint8Array|string); + /** EntityType kind. */ + public kind: (google.cloud.dialogflow.v2.EntityType.Kind|keyof typeof google.cloud.dialogflow.v2.EntityType.Kind); - /** ImportAgentRequest agent. */ - public agent?: ("agentUri"|"agentContent"); + /** EntityType autoExpansionMode. */ + public autoExpansionMode: (google.cloud.dialogflow.v2.EntityType.AutoExpansionMode|keyof typeof google.cloud.dialogflow.v2.EntityType.AutoExpansionMode); + + /** EntityType entities. */ + public entities: google.cloud.dialogflow.v2.EntityType.IEntity[]; + + /** EntityType enableFuzzyExtraction. */ + public enableFuzzyExtraction: boolean; /** - * Creates a new ImportAgentRequest instance using the specified properties. + * Creates a new EntityType instance using the specified properties. * @param [properties] Properties to set - * @returns ImportAgentRequest instance + * @returns EntityType instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IImportAgentRequest): google.cloud.dialogflow.v2beta1.ImportAgentRequest; + public static create(properties?: google.cloud.dialogflow.v2.IEntityType): google.cloud.dialogflow.v2.EntityType; /** - * Encodes the specified ImportAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportAgentRequest.verify|verify} messages. - * @param message ImportAgentRequest message or plain object to encode + * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.verify|verify} messages. + * @param message EntityType message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IImportAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ImportAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportAgentRequest.verify|verify} messages. - * @param message ImportAgentRequest message or plain object to encode + * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.verify|verify} messages. + * @param message EntityType message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IImportAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an ImportAgentRequest message from the specified reader or buffer. + * Decodes an EntityType message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ImportAgentRequest + * @returns EntityType * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ImportAgentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.EntityType; /** - * Decodes an ImportAgentRequest message from the specified reader or buffer, length delimited. + * Decodes an EntityType message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ImportAgentRequest + * @returns EntityType * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ImportAgentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.EntityType; /** - * Verifies an ImportAgentRequest message. + * Verifies an EntityType message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an ImportAgentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an EntityType message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ImportAgentRequest + * @returns EntityType */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ImportAgentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.EntityType; /** - * Creates a plain object from an ImportAgentRequest message. Also converts values to other types if specified. - * @param message ImportAgentRequest + * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * @param message EntityType * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ImportAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.EntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ImportAgentRequest to JSON. + * Converts this EntityType to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a RestoreAgentRequest. */ - interface IRestoreAgentRequest { + namespace EntityType { - /** RestoreAgentRequest parent */ + /** Properties of an Entity. */ + interface IEntity { + + /** Entity value */ + value?: (string|null); + + /** Entity synonyms */ + synonyms?: (string[]|null); + } + + /** Represents an Entity. */ + class Entity implements IEntity { + + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.EntityType.IEntity); + + /** Entity value. */ + public value: string; + + /** Entity synonyms. */ + public synonyms: string[]; + + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.dialogflow.v2.EntityType.IEntity): google.cloud.dialogflow.v2.EntityType.Entity; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.EntityType.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.EntityType.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.EntityType.Entity; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.EntityType.Entity; + + /** + * Verifies an Entity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.EntityType.Entity; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.EntityType.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Kind enum. */ + enum Kind { + KIND_UNSPECIFIED = 0, + KIND_MAP = 1, + KIND_LIST = 2, + KIND_REGEXP = 3 + } + + /** AutoExpansionMode enum. */ + enum AutoExpansionMode { + AUTO_EXPANSION_MODE_UNSPECIFIED = 0, + AUTO_EXPANSION_MODE_DEFAULT = 1 + } + } + + /** Properties of a ListEntityTypesRequest. */ + interface IListEntityTypesRequest { + + /** ListEntityTypesRequest parent */ parent?: (string|null); - /** RestoreAgentRequest agentUri */ - agentUri?: (string|null); + /** ListEntityTypesRequest languageCode */ + languageCode?: (string|null); - /** RestoreAgentRequest agentContent */ - agentContent?: (Uint8Array|string|null); + /** ListEntityTypesRequest pageSize */ + pageSize?: (number|null); + + /** ListEntityTypesRequest pageToken */ + pageToken?: (string|null); } - /** Represents a RestoreAgentRequest. */ - class RestoreAgentRequest implements IRestoreAgentRequest { + /** Represents a ListEntityTypesRequest. */ + class ListEntityTypesRequest implements IListEntityTypesRequest { /** - * Constructs a new RestoreAgentRequest. + * Constructs a new ListEntityTypesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IRestoreAgentRequest); + constructor(properties?: google.cloud.dialogflow.v2.IListEntityTypesRequest); - /** RestoreAgentRequest parent. */ + /** ListEntityTypesRequest parent. */ public parent: string; - /** RestoreAgentRequest agentUri. */ - public agentUri: string; + /** ListEntityTypesRequest languageCode. */ + public languageCode: string; - /** RestoreAgentRequest agentContent. */ - public agentContent: (Uint8Array|string); + /** ListEntityTypesRequest pageSize. */ + public pageSize: number; - /** RestoreAgentRequest agent. */ - public agent?: ("agentUri"|"agentContent"); + /** ListEntityTypesRequest pageToken. */ + public pageToken: string; /** - * Creates a new RestoreAgentRequest instance using the specified properties. + * Creates a new ListEntityTypesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns RestoreAgentRequest instance + * @returns ListEntityTypesRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IRestoreAgentRequest): google.cloud.dialogflow.v2beta1.RestoreAgentRequest; + public static create(properties?: google.cloud.dialogflow.v2.IListEntityTypesRequest): google.cloud.dialogflow.v2.ListEntityTypesRequest; /** - * Encodes the specified RestoreAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.RestoreAgentRequest.verify|verify} messages. - * @param message RestoreAgentRequest message or plain object to encode + * Encodes the specified ListEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesRequest.verify|verify} messages. + * @param message ListEntityTypesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IListEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified RestoreAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.RestoreAgentRequest.verify|verify} messages. - * @param message RestoreAgentRequest message or plain object to encode + * Encodes the specified ListEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesRequest.verify|verify} messages. + * @param message ListEntityTypesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a RestoreAgentRequest message from the specified reader or buffer. + * Decodes a ListEntityTypesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns RestoreAgentRequest + * @returns ListEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.RestoreAgentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListEntityTypesRequest; /** - * Decodes a RestoreAgentRequest message from the specified reader or buffer, length delimited. + * Decodes a ListEntityTypesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns RestoreAgentRequest + * @returns ListEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.RestoreAgentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListEntityTypesRequest; /** - * Verifies a RestoreAgentRequest message. + * Verifies a ListEntityTypesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a RestoreAgentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListEntityTypesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns RestoreAgentRequest + * @returns ListEntityTypesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.RestoreAgentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListEntityTypesRequest; /** - * Creates a plain object from a RestoreAgentRequest message. Also converts values to other types if specified. - * @param message RestoreAgentRequest + * Creates a plain object from a ListEntityTypesRequest message. Also converts values to other types if specified. + * @param message ListEntityTypesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.RestoreAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.ListEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this RestoreAgentRequest to JSON. + * Converts this ListEntityTypesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetValidationResultRequest. */ - interface IGetValidationResultRequest { + /** Properties of a ListEntityTypesResponse. */ + interface IListEntityTypesResponse { - /** GetValidationResultRequest parent */ - parent?: (string|null); + /** ListEntityTypesResponse entityTypes */ + entityTypes?: (google.cloud.dialogflow.v2.IEntityType[]|null); - /** GetValidationResultRequest languageCode */ - languageCode?: (string|null); + /** ListEntityTypesResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a GetValidationResultRequest. */ - class GetValidationResultRequest implements IGetValidationResultRequest { + /** Represents a ListEntityTypesResponse. */ + class ListEntityTypesResponse implements IListEntityTypesResponse { /** - * Constructs a new GetValidationResultRequest. + * Constructs a new ListEntityTypesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IGetValidationResultRequest); + constructor(properties?: google.cloud.dialogflow.v2.IListEntityTypesResponse); - /** GetValidationResultRequest parent. */ - public parent: string; + /** ListEntityTypesResponse entityTypes. */ + public entityTypes: google.cloud.dialogflow.v2.IEntityType[]; - /** GetValidationResultRequest languageCode. */ - public languageCode: string; + /** ListEntityTypesResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new GetValidationResultRequest instance using the specified properties. + * Creates a new ListEntityTypesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns GetValidationResultRequest instance + * @returns ListEntityTypesResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IGetValidationResultRequest): google.cloud.dialogflow.v2beta1.GetValidationResultRequest; + public static create(properties?: google.cloud.dialogflow.v2.IListEntityTypesResponse): google.cloud.dialogflow.v2.ListEntityTypesResponse; /** - * Encodes the specified GetValidationResultRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetValidationResultRequest.verify|verify} messages. - * @param message GetValidationResultRequest message or plain object to encode + * Encodes the specified ListEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesResponse.verify|verify} messages. + * @param message ListEntityTypesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IGetValidationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IListEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetValidationResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetValidationResultRequest.verify|verify} messages. - * @param message GetValidationResultRequest message or plain object to encode + * Encodes the specified ListEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesResponse.verify|verify} messages. + * @param message ListEntityTypesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetValidationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetValidationResultRequest message from the specified reader or buffer. + * Decodes a ListEntityTypesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetValidationResultRequest + * @returns ListEntityTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetValidationResultRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListEntityTypesResponse; /** - * Decodes a GetValidationResultRequest message from the specified reader or buffer, length delimited. + * Decodes a ListEntityTypesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetValidationResultRequest + * @returns ListEntityTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetValidationResultRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListEntityTypesResponse; /** - * Verifies a GetValidationResultRequest message. + * Verifies a ListEntityTypesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetValidationResultRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListEntityTypesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetValidationResultRequest + * @returns ListEntityTypesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetValidationResultRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListEntityTypesResponse; /** - * Creates a plain object from a GetValidationResultRequest message. Also converts values to other types if specified. - * @param message GetValidationResultRequest + * Creates a plain object from a ListEntityTypesResponse message. Also converts values to other types if specified. + * @param message ListEntityTypesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.GetValidationResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.ListEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetValidationResultRequest to JSON. + * Converts this ListEntityTypesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents an Environments */ - class Environments extends $protobuf.rpc.Service { - - /** - * Constructs a new Environments service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Environments service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Environments; - - /** - * Calls ListEnvironments. - * @param request ListEnvironmentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEnvironmentsResponse - */ - public listEnvironments(request: google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest, callback: google.cloud.dialogflow.v2beta1.Environments.ListEnvironmentsCallback): void; - - /** - * Calls ListEnvironments. - * @param request ListEnvironmentsRequest message or plain object - * @returns Promise - */ - public listEnvironments(request: google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest): Promise; - } - - namespace Environments { - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Environments#listEnvironments}. - * @param error Error, if any - * @param [response] ListEnvironmentsResponse - */ - type ListEnvironmentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse) => void; - } - - /** Properties of an Environment. */ - interface IEnvironment { + /** Properties of a GetEntityTypeRequest. */ + interface IGetEntityTypeRequest { - /** Environment name */ + /** GetEntityTypeRequest name */ name?: (string|null); - /** Environment description */ - description?: (string|null); - - /** Environment agentVersion */ - agentVersion?: (string|null); - - /** Environment state */ - state?: (google.cloud.dialogflow.v2beta1.Environment.State|keyof typeof google.cloud.dialogflow.v2beta1.Environment.State|null); - - /** Environment updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); + /** GetEntityTypeRequest languageCode */ + languageCode?: (string|null); } - /** Represents an Environment. */ - class Environment implements IEnvironment { + /** Represents a GetEntityTypeRequest. */ + class GetEntityTypeRequest implements IGetEntityTypeRequest { /** - * Constructs a new Environment. + * Constructs a new GetEntityTypeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IEnvironment); + constructor(properties?: google.cloud.dialogflow.v2.IGetEntityTypeRequest); - /** Environment name. */ + /** GetEntityTypeRequest name. */ public name: string; - /** Environment description. */ - public description: string; - - /** Environment agentVersion. */ - public agentVersion: string; - - /** Environment state. */ - public state: (google.cloud.dialogflow.v2beta1.Environment.State|keyof typeof google.cloud.dialogflow.v2beta1.Environment.State); - - /** Environment updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); + /** GetEntityTypeRequest languageCode. */ + public languageCode: string; /** - * Creates a new Environment instance using the specified properties. + * Creates a new GetEntityTypeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns Environment instance + * @returns GetEntityTypeRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IEnvironment): google.cloud.dialogflow.v2beta1.Environment; + public static create(properties?: google.cloud.dialogflow.v2.IGetEntityTypeRequest): google.cloud.dialogflow.v2.GetEntityTypeRequest; /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode + * Encodes the specified GetEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetEntityTypeRequest.verify|verify} messages. + * @param message GetEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IGetEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Environment.verify|verify} messages. - * @param message Environment message or plain object to encode + * Encodes the specified GetEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetEntityTypeRequest.verify|verify} messages. + * @param message GetEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Environment message from the specified reader or buffer. + * Decodes a GetEntityTypeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Environment + * @returns GetEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Environment; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetEntityTypeRequest; /** - * Decodes an Environment message from the specified reader or buffer, length delimited. + * Decodes a GetEntityTypeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Environment + * @returns GetEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Environment; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetEntityTypeRequest; /** - * Verifies an Environment message. + * Verifies a GetEntityTypeRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * Creates a GetEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Environment + * @returns GetEntityTypeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Environment; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetEntityTypeRequest; /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. - * @param message Environment + * Creates a plain object from a GetEntityTypeRequest message. Also converts values to other types if specified. + * @param message GetEntityTypeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.GetEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Environment to JSON. + * Converts this GetEntityTypeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Environment { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - STOPPED = 1, - LOADING = 2, - RUNNING = 3 - } - } - - /** Properties of a ListEnvironmentsRequest. */ - interface IListEnvironmentsRequest { + /** Properties of a CreateEntityTypeRequest. */ + interface ICreateEntityTypeRequest { - /** ListEnvironmentsRequest parent */ + /** CreateEntityTypeRequest parent */ parent?: (string|null); - /** ListEnvironmentsRequest pageSize */ - pageSize?: (number|null); + /** CreateEntityTypeRequest entityType */ + entityType?: (google.cloud.dialogflow.v2.IEntityType|null); - /** ListEnvironmentsRequest pageToken */ - pageToken?: (string|null); + /** CreateEntityTypeRequest languageCode */ + languageCode?: (string|null); } - /** Represents a ListEnvironmentsRequest. */ - class ListEnvironmentsRequest implements IListEnvironmentsRequest { + /** Represents a CreateEntityTypeRequest. */ + class CreateEntityTypeRequest implements ICreateEntityTypeRequest { /** - * Constructs a new ListEnvironmentsRequest. + * Constructs a new CreateEntityTypeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest); + constructor(properties?: google.cloud.dialogflow.v2.ICreateEntityTypeRequest); - /** ListEnvironmentsRequest parent. */ + /** CreateEntityTypeRequest parent. */ public parent: string; - /** ListEnvironmentsRequest pageSize. */ - public pageSize: number; + /** CreateEntityTypeRequest entityType. */ + public entityType?: (google.cloud.dialogflow.v2.IEntityType|null); - /** ListEnvironmentsRequest pageToken. */ - public pageToken: string; + /** CreateEntityTypeRequest languageCode. */ + public languageCode: string; /** - * Creates a new ListEnvironmentsRequest instance using the specified properties. + * Creates a new CreateEntityTypeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListEnvironmentsRequest instance + * @returns CreateEntityTypeRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest): google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest; + public static create(properties?: google.cloud.dialogflow.v2.ICreateEntityTypeRequest): google.cloud.dialogflow.v2.CreateEntityTypeRequest; /** - * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest.verify|verify} messages. - * @param message ListEnvironmentsRequest message or plain object to encode + * Encodes the specified CreateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateEntityTypeRequest.verify|verify} messages. + * @param message CreateEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ICreateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest.verify|verify} messages. - * @param message ListEnvironmentsRequest message or plain object to encode + * Encodes the specified CreateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateEntityTypeRequest.verify|verify} messages. + * @param message CreateEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListEnvironmentsRequest + * @returns CreateEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateEntityTypeRequest; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListEnvironmentsRequest + * @returns CreateEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateEntityTypeRequest; /** - * Verifies a ListEnvironmentsRequest message. + * Verifies a CreateEntityTypeRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListEnvironmentsRequest + * @returns CreateEntityTypeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateEntityTypeRequest; /** - * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. - * @param message ListEnvironmentsRequest + * Creates a plain object from a CreateEntityTypeRequest message. Also converts values to other types if specified. + * @param message CreateEntityTypeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.CreateEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListEnvironmentsRequest to JSON. + * Converts this CreateEntityTypeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListEnvironmentsResponse. */ - interface IListEnvironmentsResponse { + /** Properties of an UpdateEntityTypeRequest. */ + interface IUpdateEntityTypeRequest { - /** ListEnvironmentsResponse environments */ - environments?: (google.cloud.dialogflow.v2beta1.IEnvironment[]|null); + /** UpdateEntityTypeRequest entityType */ + entityType?: (google.cloud.dialogflow.v2.IEntityType|null); - /** ListEnvironmentsResponse nextPageToken */ - nextPageToken?: (string|null); + /** UpdateEntityTypeRequest languageCode */ + languageCode?: (string|null); + + /** UpdateEntityTypeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a ListEnvironmentsResponse. */ - class ListEnvironmentsResponse implements IListEnvironmentsResponse { + /** Represents an UpdateEntityTypeRequest. */ + class UpdateEntityTypeRequest implements IUpdateEntityTypeRequest { /** - * Constructs a new ListEnvironmentsResponse. + * Constructs a new UpdateEntityTypeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse); + constructor(properties?: google.cloud.dialogflow.v2.IUpdateEntityTypeRequest); - /** ListEnvironmentsResponse environments. */ - public environments: google.cloud.dialogflow.v2beta1.IEnvironment[]; + /** UpdateEntityTypeRequest entityType. */ + public entityType?: (google.cloud.dialogflow.v2.IEntityType|null); - /** ListEnvironmentsResponse nextPageToken. */ - public nextPageToken: string; + /** UpdateEntityTypeRequest languageCode. */ + public languageCode: string; + + /** UpdateEntityTypeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new ListEnvironmentsResponse instance using the specified properties. + * Creates a new UpdateEntityTypeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListEnvironmentsResponse instance + * @returns UpdateEntityTypeRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse): google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse; + public static create(properties?: google.cloud.dialogflow.v2.IUpdateEntityTypeRequest): google.cloud.dialogflow.v2.UpdateEntityTypeRequest; /** - * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse.verify|verify} messages. - * @param message ListEnvironmentsResponse message or plain object to encode + * Encodes the specified UpdateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateEntityTypeRequest.verify|verify} messages. + * @param message UpdateEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IUpdateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse.verify|verify} messages. - * @param message ListEnvironmentsResponse message or plain object to encode + * Encodes the specified UpdateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateEntityTypeRequest.verify|verify} messages. + * @param message UpdateEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListEnvironmentsResponse + * @returns UpdateEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateEntityTypeRequest; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListEnvironmentsResponse + * @returns UpdateEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateEntityTypeRequest; /** - * Verifies a ListEnvironmentsResponse message. + * Verifies an UpdateEntityTypeRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListEnvironmentsResponse + * @returns UpdateEntityTypeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateEntityTypeRequest; /** - * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. - * @param message ListEnvironmentsResponse + * Creates a plain object from an UpdateEntityTypeRequest message. Also converts values to other types if specified. + * @param message UpdateEntityTypeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.UpdateEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListEnvironmentsResponse to JSON. + * Converts this UpdateEntityTypeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SpeechContext. */ - interface ISpeechContext { - - /** SpeechContext phrases */ - phrases?: (string[]|null); + /** Properties of a DeleteEntityTypeRequest. */ + interface IDeleteEntityTypeRequest { - /** SpeechContext boost */ - boost?: (number|null); + /** DeleteEntityTypeRequest name */ + name?: (string|null); } - /** Represents a SpeechContext. */ - class SpeechContext implements ISpeechContext { + /** Represents a DeleteEntityTypeRequest. */ + class DeleteEntityTypeRequest implements IDeleteEntityTypeRequest { /** - * Constructs a new SpeechContext. + * Constructs a new DeleteEntityTypeRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ISpeechContext); - - /** SpeechContext phrases. */ - public phrases: string[]; + constructor(properties?: google.cloud.dialogflow.v2.IDeleteEntityTypeRequest); - /** SpeechContext boost. */ - public boost: number; + /** DeleteEntityTypeRequest name. */ + public name: string; /** - * Creates a new SpeechContext instance using the specified properties. + * Creates a new DeleteEntityTypeRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SpeechContext instance + * @returns DeleteEntityTypeRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ISpeechContext): google.cloud.dialogflow.v2beta1.SpeechContext; + public static create(properties?: google.cloud.dialogflow.v2.IDeleteEntityTypeRequest): google.cloud.dialogflow.v2.DeleteEntityTypeRequest; /** - * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechContext.verify|verify} messages. - * @param message SpeechContext message or plain object to encode + * Encodes the specified DeleteEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteEntityTypeRequest.verify|verify} messages. + * @param message DeleteEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IDeleteEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechContext.verify|verify} messages. - * @param message SpeechContext message or plain object to encode + * Encodes the specified DeleteEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteEntityTypeRequest.verify|verify} messages. + * @param message DeleteEntityTypeRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SpeechContext message from the specified reader or buffer. + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SpeechContext + * @returns DeleteEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SpeechContext; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteEntityTypeRequest; /** - * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SpeechContext + * @returns DeleteEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SpeechContext; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteEntityTypeRequest; /** - * Verifies a SpeechContext message. + * Verifies a DeleteEntityTypeRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SpeechContext + * @returns DeleteEntityTypeRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SpeechContext; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteEntityTypeRequest; /** - * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. - * @param message SpeechContext + * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. + * @param message DeleteEntityTypeRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.SpeechContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.DeleteEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SpeechContext to JSON. + * Converts this DeleteEntityTypeRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** AudioEncoding enum. */ - enum AudioEncoding { - AUDIO_ENCODING_UNSPECIFIED = 0, - AUDIO_ENCODING_LINEAR_16 = 1, - AUDIO_ENCODING_FLAC = 2, - AUDIO_ENCODING_MULAW = 3, - AUDIO_ENCODING_AMR = 4, - AUDIO_ENCODING_AMR_WB = 5, - AUDIO_ENCODING_OGG_OPUS = 6, - AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7 - } + /** Properties of a BatchUpdateEntityTypesRequest. */ + interface IBatchUpdateEntityTypesRequest { - /** Properties of a SpeechWordInfo. */ - interface ISpeechWordInfo { + /** BatchUpdateEntityTypesRequest parent */ + parent?: (string|null); - /** SpeechWordInfo word */ - word?: (string|null); + /** BatchUpdateEntityTypesRequest entityTypeBatchUri */ + entityTypeBatchUri?: (string|null); - /** SpeechWordInfo startOffset */ - startOffset?: (google.protobuf.IDuration|null); + /** BatchUpdateEntityTypesRequest entityTypeBatchInline */ + entityTypeBatchInline?: (google.cloud.dialogflow.v2.IEntityTypeBatch|null); - /** SpeechWordInfo endOffset */ - endOffset?: (google.protobuf.IDuration|null); + /** BatchUpdateEntityTypesRequest languageCode */ + languageCode?: (string|null); - /** SpeechWordInfo confidence */ - confidence?: (number|null); + /** BatchUpdateEntityTypesRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a SpeechWordInfo. */ - class SpeechWordInfo implements ISpeechWordInfo { + /** Represents a BatchUpdateEntityTypesRequest. */ + class BatchUpdateEntityTypesRequest implements IBatchUpdateEntityTypesRequest { /** - * Constructs a new SpeechWordInfo. + * Constructs a new BatchUpdateEntityTypesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ISpeechWordInfo); + constructor(properties?: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest); - /** SpeechWordInfo word. */ - public word: string; + /** BatchUpdateEntityTypesRequest parent. */ + public parent: string; - /** SpeechWordInfo startOffset. */ - public startOffset?: (google.protobuf.IDuration|null); + /** BatchUpdateEntityTypesRequest entityTypeBatchUri. */ + public entityTypeBatchUri: string; - /** SpeechWordInfo endOffset. */ - public endOffset?: (google.protobuf.IDuration|null); + /** BatchUpdateEntityTypesRequest entityTypeBatchInline. */ + public entityTypeBatchInline?: (google.cloud.dialogflow.v2.IEntityTypeBatch|null); - /** SpeechWordInfo confidence. */ - public confidence: number; + /** BatchUpdateEntityTypesRequest languageCode. */ + public languageCode: string; + + /** BatchUpdateEntityTypesRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** BatchUpdateEntityTypesRequest entityTypeBatch. */ + public entityTypeBatch?: ("entityTypeBatchUri"|"entityTypeBatchInline"); /** - * Creates a new SpeechWordInfo instance using the specified properties. + * Creates a new BatchUpdateEntityTypesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SpeechWordInfo instance + * @returns BatchUpdateEntityTypesRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ISpeechWordInfo): google.cloud.dialogflow.v2beta1.SpeechWordInfo; + public static create(properties?: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest): google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest; /** - * Encodes the specified SpeechWordInfo message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechWordInfo.verify|verify} messages. - * @param message SpeechWordInfo message or plain object to encode + * Encodes the specified BatchUpdateEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.verify|verify} messages. + * @param message BatchUpdateEntityTypesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ISpeechWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SpeechWordInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechWordInfo.verify|verify} messages. - * @param message SpeechWordInfo message or plain object to encode + * Encodes the specified BatchUpdateEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.verify|verify} messages. + * @param message BatchUpdateEntityTypesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISpeechWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SpeechWordInfo message from the specified reader or buffer. + * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SpeechWordInfo + * @returns BatchUpdateEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SpeechWordInfo; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest; /** - * Decodes a SpeechWordInfo message from the specified reader or buffer, length delimited. + * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SpeechWordInfo + * @returns BatchUpdateEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SpeechWordInfo; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest; /** - * Verifies a SpeechWordInfo message. + * Verifies a BatchUpdateEntityTypesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SpeechWordInfo message from a plain object. Also converts values to their respective internal types. + * Creates a BatchUpdateEntityTypesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SpeechWordInfo + * @returns BatchUpdateEntityTypesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SpeechWordInfo; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest; /** - * Creates a plain object from a SpeechWordInfo message. Also converts values to other types if specified. - * @param message SpeechWordInfo + * Creates a plain object from a BatchUpdateEntityTypesRequest message. Also converts values to other types if specified. + * @param message BatchUpdateEntityTypesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.SpeechWordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SpeechWordInfo to JSON. + * Converts this BatchUpdateEntityTypesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** SpeechModelVariant enum. */ - enum SpeechModelVariant { - SPEECH_MODEL_VARIANT_UNSPECIFIED = 0, - USE_BEST_AVAILABLE = 1, - USE_STANDARD = 2, - USE_ENHANCED = 3 - } - - /** Properties of an InputAudioConfig. */ - interface IInputAudioConfig { - - /** InputAudioConfig audioEncoding */ - audioEncoding?: (google.cloud.dialogflow.v2beta1.AudioEncoding|keyof typeof google.cloud.dialogflow.v2beta1.AudioEncoding|null); - - /** InputAudioConfig sampleRateHertz */ - sampleRateHertz?: (number|null); - - /** InputAudioConfig languageCode */ - languageCode?: (string|null); - - /** InputAudioConfig enableWordInfo */ - enableWordInfo?: (boolean|null); - - /** InputAudioConfig phraseHints */ - phraseHints?: (string[]|null); - - /** InputAudioConfig speechContexts */ - speechContexts?: (google.cloud.dialogflow.v2beta1.ISpeechContext[]|null); - - /** InputAudioConfig model */ - model?: (string|null); - - /** InputAudioConfig modelVariant */ - modelVariant?: (google.cloud.dialogflow.v2beta1.SpeechModelVariant|keyof typeof google.cloud.dialogflow.v2beta1.SpeechModelVariant|null); + /** Properties of a BatchUpdateEntityTypesResponse. */ + interface IBatchUpdateEntityTypesResponse { - /** InputAudioConfig singleUtterance */ - singleUtterance?: (boolean|null); + /** BatchUpdateEntityTypesResponse entityTypes */ + entityTypes?: (google.cloud.dialogflow.v2.IEntityType[]|null); } - /** Represents an InputAudioConfig. */ - class InputAudioConfig implements IInputAudioConfig { + /** Represents a BatchUpdateEntityTypesResponse. */ + class BatchUpdateEntityTypesResponse implements IBatchUpdateEntityTypesResponse { /** - * Constructs a new InputAudioConfig. + * Constructs a new BatchUpdateEntityTypesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IInputAudioConfig); - - /** InputAudioConfig audioEncoding. */ - public audioEncoding: (google.cloud.dialogflow.v2beta1.AudioEncoding|keyof typeof google.cloud.dialogflow.v2beta1.AudioEncoding); - - /** InputAudioConfig sampleRateHertz. */ - public sampleRateHertz: number; - - /** InputAudioConfig languageCode. */ - public languageCode: string; - - /** InputAudioConfig enableWordInfo. */ - public enableWordInfo: boolean; - - /** InputAudioConfig phraseHints. */ - public phraseHints: string[]; - - /** InputAudioConfig speechContexts. */ - public speechContexts: google.cloud.dialogflow.v2beta1.ISpeechContext[]; - - /** InputAudioConfig model. */ - public model: string; - - /** InputAudioConfig modelVariant. */ - public modelVariant: (google.cloud.dialogflow.v2beta1.SpeechModelVariant|keyof typeof google.cloud.dialogflow.v2beta1.SpeechModelVariant); + constructor(properties?: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse); - /** InputAudioConfig singleUtterance. */ - public singleUtterance: boolean; + /** BatchUpdateEntityTypesResponse entityTypes. */ + public entityTypes: google.cloud.dialogflow.v2.IEntityType[]; /** - * Creates a new InputAudioConfig instance using the specified properties. + * Creates a new BatchUpdateEntityTypesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns InputAudioConfig instance + * @returns BatchUpdateEntityTypesResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IInputAudioConfig): google.cloud.dialogflow.v2beta1.InputAudioConfig; + public static create(properties?: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse): google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse; /** - * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputAudioConfig.verify|verify} messages. - * @param message InputAudioConfig message or plain object to encode + * Encodes the specified BatchUpdateEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.verify|verify} messages. + * @param message BatchUpdateEntityTypesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputAudioConfig.verify|verify} messages. - * @param message InputAudioConfig message or plain object to encode + * Encodes the specified BatchUpdateEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.verify|verify} messages. + * @param message BatchUpdateEntityTypesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an InputAudioConfig message from the specified reader or buffer. + * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns InputAudioConfig + * @returns BatchUpdateEntityTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.InputAudioConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse; /** - * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns InputAudioConfig + * @returns BatchUpdateEntityTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.InputAudioConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse; /** - * Verifies an InputAudioConfig message. + * Verifies a BatchUpdateEntityTypesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * Creates a BatchUpdateEntityTypesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns InputAudioConfig + * @returns BatchUpdateEntityTypesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.InputAudioConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse; /** - * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. - * @param message InputAudioConfig + * Creates a plain object from a BatchUpdateEntityTypesResponse message. Also converts values to other types if specified. + * @param message BatchUpdateEntityTypesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.InputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this InputAudioConfig to JSON. + * Converts this BatchUpdateEntityTypesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a VoiceSelectionParams. */ - interface IVoiceSelectionParams { + /** Properties of a BatchDeleteEntityTypesRequest. */ + interface IBatchDeleteEntityTypesRequest { - /** VoiceSelectionParams name */ - name?: (string|null); + /** BatchDeleteEntityTypesRequest parent */ + parent?: (string|null); - /** VoiceSelectionParams ssmlGender */ - ssmlGender?: (google.cloud.dialogflow.v2beta1.SsmlVoiceGender|keyof typeof google.cloud.dialogflow.v2beta1.SsmlVoiceGender|null); + /** BatchDeleteEntityTypesRequest entityTypeNames */ + entityTypeNames?: (string[]|null); } - /** Represents a VoiceSelectionParams. */ - class VoiceSelectionParams implements IVoiceSelectionParams { + /** Represents a BatchDeleteEntityTypesRequest. */ + class BatchDeleteEntityTypesRequest implements IBatchDeleteEntityTypesRequest { /** - * Constructs a new VoiceSelectionParams. + * Constructs a new BatchDeleteEntityTypesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IVoiceSelectionParams); + constructor(properties?: google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest); - /** VoiceSelectionParams name. */ - public name: string; + /** BatchDeleteEntityTypesRequest parent. */ + public parent: string; - /** VoiceSelectionParams ssmlGender. */ - public ssmlGender: (google.cloud.dialogflow.v2beta1.SsmlVoiceGender|keyof typeof google.cloud.dialogflow.v2beta1.SsmlVoiceGender); + /** BatchDeleteEntityTypesRequest entityTypeNames. */ + public entityTypeNames: string[]; /** - * Creates a new VoiceSelectionParams instance using the specified properties. + * Creates a new BatchDeleteEntityTypesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns VoiceSelectionParams instance + * @returns BatchDeleteEntityTypesRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IVoiceSelectionParams): google.cloud.dialogflow.v2beta1.VoiceSelectionParams; + public static create(properties?: google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest): google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest; /** - * Encodes the specified VoiceSelectionParams message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.VoiceSelectionParams.verify|verify} messages. - * @param message VoiceSelectionParams message or plain object to encode + * Encodes the specified BatchDeleteEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest.verify|verify} messages. + * @param message BatchDeleteEntityTypesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IVoiceSelectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified VoiceSelectionParams message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.VoiceSelectionParams.verify|verify} messages. - * @param message VoiceSelectionParams message or plain object to encode + * Encodes the specified BatchDeleteEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest.verify|verify} messages. + * @param message BatchDeleteEntityTypesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IVoiceSelectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a VoiceSelectionParams message from the specified reader or buffer. + * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns VoiceSelectionParams + * @returns BatchDeleteEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.VoiceSelectionParams; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest; /** - * Decodes a VoiceSelectionParams message from the specified reader or buffer, length delimited. + * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns VoiceSelectionParams + * @returns BatchDeleteEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.VoiceSelectionParams; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest; /** - * Verifies a VoiceSelectionParams message. + * Verifies a BatchDeleteEntityTypesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a VoiceSelectionParams message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDeleteEntityTypesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns VoiceSelectionParams + * @returns BatchDeleteEntityTypesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.VoiceSelectionParams; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest; /** - * Creates a plain object from a VoiceSelectionParams message. Also converts values to other types if specified. - * @param message VoiceSelectionParams + * Creates a plain object from a BatchDeleteEntityTypesRequest message. Also converts values to other types if specified. + * @param message BatchDeleteEntityTypesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.VoiceSelectionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this VoiceSelectionParams to JSON. + * Converts this BatchDeleteEntityTypesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SynthesizeSpeechConfig. */ - interface ISynthesizeSpeechConfig { - - /** SynthesizeSpeechConfig speakingRate */ - speakingRate?: (number|null); - - /** SynthesizeSpeechConfig pitch */ - pitch?: (number|null); + /** Properties of a BatchCreateEntitiesRequest. */ + interface IBatchCreateEntitiesRequest { - /** SynthesizeSpeechConfig volumeGainDb */ - volumeGainDb?: (number|null); + /** BatchCreateEntitiesRequest parent */ + parent?: (string|null); - /** SynthesizeSpeechConfig effectsProfileId */ - effectsProfileId?: (string[]|null); + /** BatchCreateEntitiesRequest entities */ + entities?: (google.cloud.dialogflow.v2.EntityType.IEntity[]|null); - /** SynthesizeSpeechConfig voice */ - voice?: (google.cloud.dialogflow.v2beta1.IVoiceSelectionParams|null); + /** BatchCreateEntitiesRequest languageCode */ + languageCode?: (string|null); } - /** Represents a SynthesizeSpeechConfig. */ - class SynthesizeSpeechConfig implements ISynthesizeSpeechConfig { + /** Represents a BatchCreateEntitiesRequest. */ + class BatchCreateEntitiesRequest implements IBatchCreateEntitiesRequest { /** - * Constructs a new SynthesizeSpeechConfig. + * Constructs a new BatchCreateEntitiesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig); - - /** SynthesizeSpeechConfig speakingRate. */ - public speakingRate: number; - - /** SynthesizeSpeechConfig pitch. */ - public pitch: number; + constructor(properties?: google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest); - /** SynthesizeSpeechConfig volumeGainDb. */ - public volumeGainDb: number; + /** BatchCreateEntitiesRequest parent. */ + public parent: string; - /** SynthesizeSpeechConfig effectsProfileId. */ - public effectsProfileId: string[]; + /** BatchCreateEntitiesRequest entities. */ + public entities: google.cloud.dialogflow.v2.EntityType.IEntity[]; - /** SynthesizeSpeechConfig voice. */ - public voice?: (google.cloud.dialogflow.v2beta1.IVoiceSelectionParams|null); + /** BatchCreateEntitiesRequest languageCode. */ + public languageCode: string; /** - * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * Creates a new BatchCreateEntitiesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SynthesizeSpeechConfig instance + * @returns BatchCreateEntitiesRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig): google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig; + public static create(properties?: google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest): google.cloud.dialogflow.v2.BatchCreateEntitiesRequest; /** - * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.verify|verify} messages. - * @param message SynthesizeSpeechConfig message or plain object to encode + * Encodes the specified BatchCreateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.verify|verify} messages. + * @param message BatchCreateEntitiesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.verify|verify} messages. - * @param message SynthesizeSpeechConfig message or plain object to encode + * Encodes the specified BatchCreateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.verify|verify} messages. + * @param message BatchCreateEntitiesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SynthesizeSpeechConfig + * @returns BatchCreateEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchCreateEntitiesRequest; /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SynthesizeSpeechConfig + * @returns BatchCreateEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchCreateEntitiesRequest; /** - * Verifies a SynthesizeSpeechConfig message. + * Verifies a BatchCreateEntitiesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateEntitiesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SynthesizeSpeechConfig + * @returns BatchCreateEntitiesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchCreateEntitiesRequest; /** - * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. - * @param message SynthesizeSpeechConfig + * Creates a plain object from a BatchCreateEntitiesRequest message. Also converts values to other types if specified. + * @param message BatchCreateEntitiesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.BatchCreateEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SynthesizeSpeechConfig to JSON. + * Converts this BatchCreateEntitiesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** SsmlVoiceGender enum. */ - enum SsmlVoiceGender { - SSML_VOICE_GENDER_UNSPECIFIED = 0, - SSML_VOICE_GENDER_MALE = 1, - SSML_VOICE_GENDER_FEMALE = 2, - SSML_VOICE_GENDER_NEUTRAL = 3 - } + /** Properties of a BatchUpdateEntitiesRequest. */ + interface IBatchUpdateEntitiesRequest { - /** Properties of an OutputAudioConfig. */ - interface IOutputAudioConfig { + /** BatchUpdateEntitiesRequest parent */ + parent?: (string|null); - /** OutputAudioConfig audioEncoding */ - audioEncoding?: (google.cloud.dialogflow.v2beta1.OutputAudioEncoding|keyof typeof google.cloud.dialogflow.v2beta1.OutputAudioEncoding|null); + /** BatchUpdateEntitiesRequest entities */ + entities?: (google.cloud.dialogflow.v2.EntityType.IEntity[]|null); - /** OutputAudioConfig sampleRateHertz */ - sampleRateHertz?: (number|null); + /** BatchUpdateEntitiesRequest languageCode */ + languageCode?: (string|null); - /** OutputAudioConfig synthesizeSpeechConfig */ - synthesizeSpeechConfig?: (google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig|null); + /** BatchUpdateEntitiesRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents an OutputAudioConfig. */ - class OutputAudioConfig implements IOutputAudioConfig { + /** Represents a BatchUpdateEntitiesRequest. */ + class BatchUpdateEntitiesRequest implements IBatchUpdateEntitiesRequest { /** - * Constructs a new OutputAudioConfig. + * Constructs a new BatchUpdateEntitiesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IOutputAudioConfig); + constructor(properties?: google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest); - /** OutputAudioConfig audioEncoding. */ - public audioEncoding: (google.cloud.dialogflow.v2beta1.OutputAudioEncoding|keyof typeof google.cloud.dialogflow.v2beta1.OutputAudioEncoding); + /** BatchUpdateEntitiesRequest parent. */ + public parent: string; - /** OutputAudioConfig sampleRateHertz. */ - public sampleRateHertz: number; + /** BatchUpdateEntitiesRequest entities. */ + public entities: google.cloud.dialogflow.v2.EntityType.IEntity[]; - /** OutputAudioConfig synthesizeSpeechConfig. */ - public synthesizeSpeechConfig?: (google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig|null); + /** BatchUpdateEntitiesRequest languageCode. */ + public languageCode: string; + + /** BatchUpdateEntitiesRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new OutputAudioConfig instance using the specified properties. + * Creates a new BatchUpdateEntitiesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns OutputAudioConfig instance + * @returns BatchUpdateEntitiesRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IOutputAudioConfig): google.cloud.dialogflow.v2beta1.OutputAudioConfig; + public static create(properties?: google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest): google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest; /** - * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify|verify} messages. - * @param message OutputAudioConfig message or plain object to encode + * Encodes the specified BatchUpdateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.verify|verify} messages. + * @param message BatchUpdateEntitiesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify|verify} messages. - * @param message OutputAudioConfig message or plain object to encode + * Encodes the specified BatchUpdateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.verify|verify} messages. + * @param message BatchUpdateEntitiesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an OutputAudioConfig message from the specified reader or buffer. + * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns OutputAudioConfig + * @returns BatchUpdateEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.OutputAudioConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest; /** - * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns OutputAudioConfig + * @returns BatchUpdateEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.OutputAudioConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest; /** - * Verifies an OutputAudioConfig message. + * Verifies a BatchUpdateEntitiesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * Creates a BatchUpdateEntitiesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns OutputAudioConfig + * @returns BatchUpdateEntitiesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.OutputAudioConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest; /** - * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. - * @param message OutputAudioConfig + * Creates a plain object from a BatchUpdateEntitiesRequest message. Also converts values to other types if specified. + * @param message BatchUpdateEntitiesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.OutputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this OutputAudioConfig to JSON. + * Converts this BatchUpdateEntitiesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a TelephonyDtmfEvents. */ - interface ITelephonyDtmfEvents { + /** Properties of a BatchDeleteEntitiesRequest. */ + interface IBatchDeleteEntitiesRequest { - /** TelephonyDtmfEvents dtmfEvents */ - dtmfEvents?: (google.cloud.dialogflow.v2beta1.TelephonyDtmf[]|null); + /** BatchDeleteEntitiesRequest parent */ + parent?: (string|null); + + /** BatchDeleteEntitiesRequest entityValues */ + entityValues?: (string[]|null); + + /** BatchDeleteEntitiesRequest languageCode */ + languageCode?: (string|null); } - /** Represents a TelephonyDtmfEvents. */ - class TelephonyDtmfEvents implements ITelephonyDtmfEvents { + /** Represents a BatchDeleteEntitiesRequest. */ + class BatchDeleteEntitiesRequest implements IBatchDeleteEntitiesRequest { /** - * Constructs a new TelephonyDtmfEvents. + * Constructs a new BatchDeleteEntitiesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents); + constructor(properties?: google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest); - /** TelephonyDtmfEvents dtmfEvents. */ - public dtmfEvents: google.cloud.dialogflow.v2beta1.TelephonyDtmf[]; + /** BatchDeleteEntitiesRequest parent. */ + public parent: string; + + /** BatchDeleteEntitiesRequest entityValues. */ + public entityValues: string[]; + + /** BatchDeleteEntitiesRequest languageCode. */ + public languageCode: string; /** - * Creates a new TelephonyDtmfEvents instance using the specified properties. + * Creates a new BatchDeleteEntitiesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TelephonyDtmfEvents instance + * @returns BatchDeleteEntitiesRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents): google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents; + public static create(properties?: google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest): google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest; /** - * Encodes the specified TelephonyDtmfEvents message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.verify|verify} messages. - * @param message TelephonyDtmfEvents message or plain object to encode + * Encodes the specified BatchDeleteEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.verify|verify} messages. + * @param message BatchDeleteEntitiesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TelephonyDtmfEvents message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.verify|verify} messages. - * @param message TelephonyDtmfEvents message or plain object to encode + * Encodes the specified BatchDeleteEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.verify|verify} messages. + * @param message BatchDeleteEntitiesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TelephonyDtmfEvents message from the specified reader or buffer. + * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TelephonyDtmfEvents + * @returns BatchDeleteEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest; /** - * Decodes a TelephonyDtmfEvents message from the specified reader or buffer, length delimited. + * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TelephonyDtmfEvents + * @returns BatchDeleteEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest; /** - * Verifies a TelephonyDtmfEvents message. + * Verifies a BatchDeleteEntitiesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TelephonyDtmfEvents message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDeleteEntitiesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TelephonyDtmfEvents + * @returns BatchDeleteEntitiesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest; /** - * Creates a plain object from a TelephonyDtmfEvents message. Also converts values to other types if specified. - * @param message TelephonyDtmfEvents + * Creates a plain object from a BatchDeleteEntitiesRequest message. Also converts values to other types if specified. + * @param message BatchDeleteEntitiesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TelephonyDtmfEvents to JSON. + * Converts this BatchDeleteEntitiesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** OutputAudioEncoding enum. */ - enum OutputAudioEncoding { - OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0, - OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1, - OUTPUT_AUDIO_ENCODING_MP3 = 2, - OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3 - } - - /** TelephonyDtmf enum. */ - enum TelephonyDtmf { - TELEPHONY_DTMF_UNSPECIFIED = 0, - DTMF_ONE = 1, - DTMF_TWO = 2, - DTMF_THREE = 3, - DTMF_FOUR = 4, - DTMF_FIVE = 5, - DTMF_SIX = 6, - DTMF_SEVEN = 7, - DTMF_EIGHT = 8, - DTMF_NINE = 9, - DTMF_ZERO = 10, - DTMF_A = 11, - DTMF_B = 12, - DTMF_C = 13, - DTMF_D = 14, - DTMF_STAR = 15, - DTMF_POUND = 16 - } - - /** Properties of a ValidationError. */ - interface IValidationError { - - /** ValidationError severity */ - severity?: (google.cloud.dialogflow.v2beta1.ValidationError.Severity|keyof typeof google.cloud.dialogflow.v2beta1.ValidationError.Severity|null); - - /** ValidationError entries */ - entries?: (string[]|null); + /** Properties of an EntityTypeBatch. */ + interface IEntityTypeBatch { - /** ValidationError errorMessage */ - errorMessage?: (string|null); + /** EntityTypeBatch entityTypes */ + entityTypes?: (google.cloud.dialogflow.v2.IEntityType[]|null); } - /** Represents a ValidationError. */ - class ValidationError implements IValidationError { + /** Represents an EntityTypeBatch. */ + class EntityTypeBatch implements IEntityTypeBatch { /** - * Constructs a new ValidationError. + * Constructs a new EntityTypeBatch. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IValidationError); - - /** ValidationError severity. */ - public severity: (google.cloud.dialogflow.v2beta1.ValidationError.Severity|keyof typeof google.cloud.dialogflow.v2beta1.ValidationError.Severity); - - /** ValidationError entries. */ - public entries: string[]; + constructor(properties?: google.cloud.dialogflow.v2.IEntityTypeBatch); - /** ValidationError errorMessage. */ - public errorMessage: string; + /** EntityTypeBatch entityTypes. */ + public entityTypes: google.cloud.dialogflow.v2.IEntityType[]; /** - * Creates a new ValidationError instance using the specified properties. + * Creates a new EntityTypeBatch instance using the specified properties. * @param [properties] Properties to set - * @returns ValidationError instance + * @returns EntityTypeBatch instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IValidationError): google.cloud.dialogflow.v2beta1.ValidationError; + public static create(properties?: google.cloud.dialogflow.v2.IEntityTypeBatch): google.cloud.dialogflow.v2.EntityTypeBatch; /** - * Encodes the specified ValidationError message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationError.verify|verify} messages. - * @param message ValidationError message or plain object to encode + * Encodes the specified EntityTypeBatch message. Does not implicitly {@link google.cloud.dialogflow.v2.EntityTypeBatch.verify|verify} messages. + * @param message EntityTypeBatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IValidationError, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IEntityTypeBatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ValidationError message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationError.verify|verify} messages. - * @param message ValidationError message or plain object to encode + * Encodes the specified EntityTypeBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EntityTypeBatch.verify|verify} messages. + * @param message EntityTypeBatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IValidationError, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IEntityTypeBatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ValidationError message from the specified reader or buffer. + * Decodes an EntityTypeBatch message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ValidationError + * @returns EntityTypeBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ValidationError; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.EntityTypeBatch; /** - * Decodes a ValidationError message from the specified reader or buffer, length delimited. + * Decodes an EntityTypeBatch message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ValidationError + * @returns EntityTypeBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ValidationError; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.EntityTypeBatch; /** - * Verifies a ValidationError message. + * Verifies an EntityTypeBatch message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ValidationError message from a plain object. Also converts values to their respective internal types. + * Creates an EntityTypeBatch message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ValidationError + * @returns EntityTypeBatch */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ValidationError; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.EntityTypeBatch; /** - * Creates a plain object from a ValidationError message. Also converts values to other types if specified. - * @param message ValidationError + * Creates a plain object from an EntityTypeBatch message. Also converts values to other types if specified. + * @param message EntityTypeBatch * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ValidationError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.EntityTypeBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ValidationError to JSON. + * Converts this EntityTypeBatch to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace ValidationError { - - /** Severity enum. */ - enum Severity { - SEVERITY_UNSPECIFIED = 0, - INFO = 1, - WARNING = 2, - ERROR = 3, - CRITICAL = 4 - } - } - - /** Properties of a ValidationResult. */ - interface IValidationResult { - - /** ValidationResult validationErrors */ - validationErrors?: (google.cloud.dialogflow.v2beta1.IValidationError[]|null); - } - - /** Represents a ValidationResult. */ - class ValidationResult implements IValidationResult { + /** Represents a Conversations */ + class Conversations extends $protobuf.rpc.Service { /** - * Constructs a new ValidationResult. - * @param [properties] Properties to set + * Constructs a new Conversations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IValidationResult); - - /** ValidationResult validationErrors. */ - public validationErrors: google.cloud.dialogflow.v2beta1.IValidationError[]; + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates a new ValidationResult instance using the specified properties. - * @param [properties] Properties to set - * @returns ValidationResult instance + * Creates new Conversations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IValidationResult): google.cloud.dialogflow.v2beta1.ValidationResult; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Conversations; /** - * Encodes the specified ValidationResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationResult.verify|verify} messages. - * @param message ValidationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls CreateConversation. + * @param request CreateConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Conversation */ - public static encode(message: google.cloud.dialogflow.v2beta1.IValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + public createConversation(request: google.cloud.dialogflow.v2.ICreateConversationRequest, callback: google.cloud.dialogflow.v2.Conversations.CreateConversationCallback): void; /** - * Encodes the specified ValidationResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationResult.verify|verify} messages. - * @param message ValidationResult message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls CreateConversation. + * @param request CreateConversationRequest message or plain object + * @returns Promise */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + public createConversation(request: google.cloud.dialogflow.v2.ICreateConversationRequest): Promise; /** - * Decodes a ValidationResult message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ValidationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListConversations. + * @param request ListConversationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConversationsResponse */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ValidationResult; + public listConversations(request: google.cloud.dialogflow.v2.IListConversationsRequest, callback: google.cloud.dialogflow.v2.Conversations.ListConversationsCallback): void; /** - * Decodes a ValidationResult message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ValidationResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls ListConversations. + * @param request ListConversationsRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ValidationResult; + public listConversations(request: google.cloud.dialogflow.v2.IListConversationsRequest): Promise; /** - * Verifies a ValidationResult message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls GetConversation. + * @param request GetConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Conversation */ - public static verify(message: { [k: string]: any }): (string|null); + public getConversation(request: google.cloud.dialogflow.v2.IGetConversationRequest, callback: google.cloud.dialogflow.v2.Conversations.GetConversationCallback): void; /** - * Creates a ValidationResult message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ValidationResult + * Calls GetConversation. + * @param request GetConversationRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ValidationResult; + public getConversation(request: google.cloud.dialogflow.v2.IGetConversationRequest): Promise; /** - * Creates a plain object from a ValidationResult message. Also converts values to other types if specified. - * @param message ValidationResult - * @param [options] Conversion options - * @returns Plain object + * Calls CompleteConversation. + * @param request CompleteConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Conversation */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ValidationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public completeConversation(request: google.cloud.dialogflow.v2.ICompleteConversationRequest, callback: google.cloud.dialogflow.v2.Conversations.CompleteConversationCallback): void; /** - * Converts this ValidationResult to JSON. - * @returns JSON object + * Calls CompleteConversation. + * @param request CompleteConversationRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Represents a Contexts */ - class Contexts extends $protobuf.rpc.Service { + public completeConversation(request: google.cloud.dialogflow.v2.ICompleteConversationRequest): Promise; /** - * Constructs a new Contexts service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Calls CreateCallMatcher. + * @param request CreateCallMatcherRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CallMatcher */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + public createCallMatcher(request: google.cloud.dialogflow.v2.ICreateCallMatcherRequest, callback: google.cloud.dialogflow.v2.Conversations.CreateCallMatcherCallback): void; /** - * Creates new Contexts service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. + * Calls CreateCallMatcher. + * @param request CreateCallMatcherRequest message or plain object + * @returns Promise */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Contexts; + public createCallMatcher(request: google.cloud.dialogflow.v2.ICreateCallMatcherRequest): Promise; /** - * Calls ListContexts. - * @param request ListContextsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListContextsResponse + * Calls ListCallMatchers. + * @param request ListCallMatchersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCallMatchersResponse */ - public listContexts(request: google.cloud.dialogflow.v2beta1.IListContextsRequest, callback: google.cloud.dialogflow.v2beta1.Contexts.ListContextsCallback): void; + public listCallMatchers(request: google.cloud.dialogflow.v2.IListCallMatchersRequest, callback: google.cloud.dialogflow.v2.Conversations.ListCallMatchersCallback): void; /** - * Calls ListContexts. - * @param request ListContextsRequest message or plain object + * Calls ListCallMatchers. + * @param request ListCallMatchersRequest message or plain object * @returns Promise */ - public listContexts(request: google.cloud.dialogflow.v2beta1.IListContextsRequest): Promise; + public listCallMatchers(request: google.cloud.dialogflow.v2.IListCallMatchersRequest): Promise; /** - * Calls GetContext. - * @param request GetContextRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Context - */ - public getContext(request: google.cloud.dialogflow.v2beta1.IGetContextRequest, callback: google.cloud.dialogflow.v2beta1.Contexts.GetContextCallback): void; - - /** - * Calls GetContext. - * @param request GetContextRequest message or plain object - * @returns Promise - */ - public getContext(request: google.cloud.dialogflow.v2beta1.IGetContextRequest): Promise; - - /** - * Calls CreateContext. - * @param request CreateContextRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Context + * Calls DeleteCallMatcher. + * @param request DeleteCallMatcherRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public createContext(request: google.cloud.dialogflow.v2beta1.ICreateContextRequest, callback: google.cloud.dialogflow.v2beta1.Contexts.CreateContextCallback): void; + public deleteCallMatcher(request: google.cloud.dialogflow.v2.IDeleteCallMatcherRequest, callback: google.cloud.dialogflow.v2.Conversations.DeleteCallMatcherCallback): void; /** - * Calls CreateContext. - * @param request CreateContextRequest message or plain object + * Calls DeleteCallMatcher. + * @param request DeleteCallMatcherRequest message or plain object * @returns Promise */ - public createContext(request: google.cloud.dialogflow.v2beta1.ICreateContextRequest): Promise; + public deleteCallMatcher(request: google.cloud.dialogflow.v2.IDeleteCallMatcherRequest): Promise; /** - * Calls UpdateContext. - * @param request UpdateContextRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Context + * Calls ListMessages. + * @param request ListMessagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMessagesResponse */ - public updateContext(request: google.cloud.dialogflow.v2beta1.IUpdateContextRequest, callback: google.cloud.dialogflow.v2beta1.Contexts.UpdateContextCallback): void; + public listMessages(request: google.cloud.dialogflow.v2.IListMessagesRequest, callback: google.cloud.dialogflow.v2.Conversations.ListMessagesCallback): void; /** - * Calls UpdateContext. - * @param request UpdateContextRequest message or plain object + * Calls ListMessages. + * @param request ListMessagesRequest message or plain object * @returns Promise */ - public updateContext(request: google.cloud.dialogflow.v2beta1.IUpdateContextRequest): Promise; - - /** - * Calls DeleteContext. - * @param request DeleteContextRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteContext(request: google.cloud.dialogflow.v2beta1.IDeleteContextRequest, callback: google.cloud.dialogflow.v2beta1.Contexts.DeleteContextCallback): void; + public listMessages(request: google.cloud.dialogflow.v2.IListMessagesRequest): Promise; + } - /** - * Calls DeleteContext. - * @param request DeleteContextRequest message or plain object - * @returns Promise - */ - public deleteContext(request: google.cloud.dialogflow.v2beta1.IDeleteContextRequest): Promise; + namespace Conversations { /** - * Calls DeleteAllContexts. - * @param request DeleteAllContextsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#createConversation}. + * @param error Error, if any + * @param [response] Conversation */ - public deleteAllContexts(request: google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest, callback: google.cloud.dialogflow.v2beta1.Contexts.DeleteAllContextsCallback): void; + type CreateConversationCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Conversation) => void; /** - * Calls DeleteAllContexts. - * @param request DeleteAllContextsRequest message or plain object - * @returns Promise + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#listConversations}. + * @param error Error, if any + * @param [response] ListConversationsResponse */ - public deleteAllContexts(request: google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest): Promise; - } - - namespace Contexts { + type ListConversationsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListConversationsResponse) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#listContexts}. + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#getConversation}. * @param error Error, if any - * @param [response] ListContextsResponse + * @param [response] Conversation */ - type ListContextsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListContextsResponse) => void; + type GetConversationCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Conversation) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#getContext}. + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#completeConversation}. * @param error Error, if any - * @param [response] Context + * @param [response] Conversation */ - type GetContextCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Context) => void; + type CompleteConversationCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Conversation) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#createContext}. + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#createCallMatcher}. * @param error Error, if any - * @param [response] Context + * @param [response] CallMatcher */ - type CreateContextCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Context) => void; + type CreateCallMatcherCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.CallMatcher) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#updateContext}. + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#listCallMatchers}. * @param error Error, if any - * @param [response] Context + * @param [response] ListCallMatchersResponse */ - type UpdateContextCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Context) => void; + type ListCallMatchersCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListCallMatchersResponse) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#deleteContext}. + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#deleteCallMatcher}. * @param error Error, if any * @param [response] Empty */ - type DeleteContextCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + type DeleteCallMatcherCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#deleteAllContexts}. + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#listMessages}. * @param error Error, if any - * @param [response] Empty + * @param [response] ListMessagesResponse */ - type DeleteAllContextsCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + type ListMessagesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListMessagesResponse) => void; } - /** Properties of a Context. */ - interface IContext { + /** Properties of a Conversation. */ + interface IConversation { - /** Context name */ + /** Conversation name */ name?: (string|null); - /** Context lifespanCount */ - lifespanCount?: (number|null); + /** Conversation lifecycleState */ + lifecycleState?: (google.cloud.dialogflow.v2.Conversation.LifecycleState|keyof typeof google.cloud.dialogflow.v2.Conversation.LifecycleState|null); - /** Context parameters */ - parameters?: (google.protobuf.IStruct|null); + /** Conversation conversationProfile */ + conversationProfile?: (string|null); + + /** Conversation phoneNumber */ + phoneNumber?: (google.cloud.dialogflow.v2.IConversationPhoneNumber|null); + + /** Conversation startTime */ + startTime?: (google.protobuf.ITimestamp|null); + + /** Conversation endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** Conversation conversationStage */ + conversationStage?: (google.cloud.dialogflow.v2.Conversation.ConversationStage|keyof typeof google.cloud.dialogflow.v2.Conversation.ConversationStage|null); } - /** Represents a Context. */ - class Context implements IContext { + /** Represents a Conversation. */ + class Conversation implements IConversation { /** - * Constructs a new Context. + * Constructs a new Conversation. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IContext); + constructor(properties?: google.cloud.dialogflow.v2.IConversation); - /** Context name. */ + /** Conversation name. */ public name: string; - /** Context lifespanCount. */ - public lifespanCount: number; + /** Conversation lifecycleState. */ + public lifecycleState: (google.cloud.dialogflow.v2.Conversation.LifecycleState|keyof typeof google.cloud.dialogflow.v2.Conversation.LifecycleState); - /** Context parameters. */ - public parameters?: (google.protobuf.IStruct|null); + /** Conversation conversationProfile. */ + public conversationProfile: string; + + /** Conversation phoneNumber. */ + public phoneNumber?: (google.cloud.dialogflow.v2.IConversationPhoneNumber|null); + + /** Conversation startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); + + /** Conversation endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** Conversation conversationStage. */ + public conversationStage: (google.cloud.dialogflow.v2.Conversation.ConversationStage|keyof typeof google.cloud.dialogflow.v2.Conversation.ConversationStage); /** - * Creates a new Context instance using the specified properties. + * Creates a new Conversation instance using the specified properties. * @param [properties] Properties to set - * @returns Context instance + * @returns Conversation instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IContext): google.cloud.dialogflow.v2beta1.Context; + public static create(properties?: google.cloud.dialogflow.v2.IConversation): google.cloud.dialogflow.v2.Conversation; /** - * Encodes the specified Context message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Context.verify|verify} messages. - * @param message Context message or plain object to encode + * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.dialogflow.v2.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Context message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Context.verify|verify} messages. - * @param message Context message or plain object to encode + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IContext, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Context message from the specified reader or buffer. + * Decodes a Conversation message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Context + * @returns Conversation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Context; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Conversation; /** - * Decodes a Context message from the specified reader or buffer, length delimited. + * Decodes a Conversation message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Context + * @returns Conversation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Context; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Conversation; /** - * Verifies a Context message. + * Verifies a Conversation message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Context message from a plain object. Also converts values to their respective internal types. + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Context + * @returns Conversation */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Context; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Conversation; /** - * Creates a plain object from a Context message. Also converts values to other types if specified. - * @param message Context + * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * @param message Conversation * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Context, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.Conversation, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Context to JSON. + * Converts this Conversation to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListContextsRequest. */ - interface IListContextsRequest { + namespace Conversation { - /** ListContextsRequest parent */ - parent?: (string|null); + /** LifecycleState enum. */ + enum LifecycleState { + LIFECYCLE_STATE_UNSPECIFIED = 0, + IN_PROGRESS = 1, + COMPLETED = 2 + } - /** ListContextsRequest pageSize */ - pageSize?: (number|null); + /** ConversationStage enum. */ + enum ConversationStage { + CONVERSATION_STAGE_UNSPECIFIED = 0, + VIRTUAL_AGENT_STAGE = 1, + HUMAN_ASSIST_STAGE = 2 + } + } - /** ListContextsRequest pageToken */ - pageToken?: (string|null); + /** Properties of a CallMatcher. */ + interface ICallMatcher { + + /** CallMatcher name */ + name?: (string|null); + + /** CallMatcher toHeader */ + toHeader?: (string|null); + + /** CallMatcher fromHeader */ + fromHeader?: (string|null); + + /** CallMatcher callIdHeader */ + callIdHeader?: (string|null); + + /** CallMatcher customHeaders */ + customHeaders?: (google.cloud.dialogflow.v2.CallMatcher.ICustomHeaders|null); } - /** Represents a ListContextsRequest. */ - class ListContextsRequest implements IListContextsRequest { + /** Represents a CallMatcher. */ + class CallMatcher implements ICallMatcher { /** - * Constructs a new ListContextsRequest. + * Constructs a new CallMatcher. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListContextsRequest); + constructor(properties?: google.cloud.dialogflow.v2.ICallMatcher); - /** ListContextsRequest parent. */ - public parent: string; + /** CallMatcher name. */ + public name: string; - /** ListContextsRequest pageSize. */ - public pageSize: number; + /** CallMatcher toHeader. */ + public toHeader: string; - /** ListContextsRequest pageToken. */ - public pageToken: string; + /** CallMatcher fromHeader. */ + public fromHeader: string; + + /** CallMatcher callIdHeader. */ + public callIdHeader: string; + + /** CallMatcher customHeaders. */ + public customHeaders?: (google.cloud.dialogflow.v2.CallMatcher.ICustomHeaders|null); /** - * Creates a new ListContextsRequest instance using the specified properties. + * Creates a new CallMatcher instance using the specified properties. * @param [properties] Properties to set - * @returns ListContextsRequest instance + * @returns CallMatcher instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListContextsRequest): google.cloud.dialogflow.v2beta1.ListContextsRequest; + public static create(properties?: google.cloud.dialogflow.v2.ICallMatcher): google.cloud.dialogflow.v2.CallMatcher; /** - * Encodes the specified ListContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsRequest.verify|verify} messages. - * @param message ListContextsRequest message or plain object to encode + * Encodes the specified CallMatcher message. Does not implicitly {@link google.cloud.dialogflow.v2.CallMatcher.verify|verify} messages. + * @param message CallMatcher message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ICallMatcher, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsRequest.verify|verify} messages. - * @param message ListContextsRequest message or plain object to encode + * Encodes the specified CallMatcher message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CallMatcher.verify|verify} messages. + * @param message CallMatcher message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ICallMatcher, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListContextsRequest message from the specified reader or buffer. + * Decodes a CallMatcher message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListContextsRequest + * @returns CallMatcher * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListContextsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CallMatcher; /** - * Decodes a ListContextsRequest message from the specified reader or buffer, length delimited. + * Decodes a CallMatcher message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListContextsRequest + * @returns CallMatcher * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListContextsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CallMatcher; /** - * Verifies a ListContextsRequest message. + * Verifies a CallMatcher message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListContextsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CallMatcher message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListContextsRequest + * @returns CallMatcher */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListContextsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CallMatcher; /** - * Creates a plain object from a ListContextsRequest message. Also converts values to other types if specified. - * @param message ListContextsRequest + * Creates a plain object from a CallMatcher message. Also converts values to other types if specified. + * @param message CallMatcher * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListContextsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.CallMatcher, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListContextsRequest to JSON. + * Converts this CallMatcher to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListContextsResponse. */ - interface IListContextsResponse { + namespace CallMatcher { - /** ListContextsResponse contexts */ - contexts?: (google.cloud.dialogflow.v2beta1.IContext[]|null); + /** Properties of a CustomHeaders. */ + interface ICustomHeaders { - /** ListContextsResponse nextPageToken */ - nextPageToken?: (string|null); + /** CustomHeaders ciscoGuid */ + ciscoGuid?: (string|null); + } + + /** Represents a CustomHeaders. */ + class CustomHeaders implements ICustomHeaders { + + /** + * Constructs a new CustomHeaders. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.CallMatcher.ICustomHeaders); + + /** CustomHeaders ciscoGuid. */ + public ciscoGuid: string; + + /** + * Creates a new CustomHeaders instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHeaders instance + */ + public static create(properties?: google.cloud.dialogflow.v2.CallMatcher.ICustomHeaders): google.cloud.dialogflow.v2.CallMatcher.CustomHeaders; + + /** + * Encodes the specified CustomHeaders message. Does not implicitly {@link google.cloud.dialogflow.v2.CallMatcher.CustomHeaders.verify|verify} messages. + * @param message CustomHeaders message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.CallMatcher.ICustomHeaders, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHeaders message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CallMatcher.CustomHeaders.verify|verify} messages. + * @param message CustomHeaders message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.CallMatcher.ICustomHeaders, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHeaders message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CallMatcher.CustomHeaders; + + /** + * Decodes a CustomHeaders message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CallMatcher.CustomHeaders; + + /** + * Verifies a CustomHeaders message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHeaders message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHeaders + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CallMatcher.CustomHeaders; + + /** + * Creates a plain object from a CustomHeaders message. Also converts values to other types if specified. + * @param message CustomHeaders + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.CallMatcher.CustomHeaders, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHeaders to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } - /** Represents a ListContextsResponse. */ - class ListContextsResponse implements IListContextsResponse { + /** Properties of a CreateConversationRequest. */ + interface ICreateConversationRequest { + + /** CreateConversationRequest parent */ + parent?: (string|null); + + /** CreateConversationRequest conversation */ + conversation?: (google.cloud.dialogflow.v2.IConversation|null); + + /** CreateConversationRequest conversationId */ + conversationId?: (string|null); + } + + /** Represents a CreateConversationRequest. */ + class CreateConversationRequest implements ICreateConversationRequest { /** - * Constructs a new ListContextsResponse. + * Constructs a new CreateConversationRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListContextsResponse); + constructor(properties?: google.cloud.dialogflow.v2.ICreateConversationRequest); - /** ListContextsResponse contexts. */ - public contexts: google.cloud.dialogflow.v2beta1.IContext[]; + /** CreateConversationRequest parent. */ + public parent: string; - /** ListContextsResponse nextPageToken. */ - public nextPageToken: string; + /** CreateConversationRequest conversation. */ + public conversation?: (google.cloud.dialogflow.v2.IConversation|null); + + /** CreateConversationRequest conversationId. */ + public conversationId: string; /** - * Creates a new ListContextsResponse instance using the specified properties. + * Creates a new CreateConversationRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListContextsResponse instance + * @returns CreateConversationRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListContextsResponse): google.cloud.dialogflow.v2beta1.ListContextsResponse; + public static create(properties?: google.cloud.dialogflow.v2.ICreateConversationRequest): google.cloud.dialogflow.v2.CreateConversationRequest; /** - * Encodes the specified ListContextsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsResponse.verify|verify} messages. - * @param message ListContextsResponse message or plain object to encode + * Encodes the specified CreateConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateConversationRequest.verify|verify} messages. + * @param message CreateConversationRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListContextsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ICreateConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListContextsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsResponse.verify|verify} messages. - * @param message ListContextsResponse message or plain object to encode + * Encodes the specified CreateConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateConversationRequest.verify|verify} messages. + * @param message CreateConversationRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListContextsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListContextsResponse message from the specified reader or buffer. + * Decodes a CreateConversationRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListContextsResponse + * @returns CreateConversationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListContextsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateConversationRequest; /** - * Decodes a ListContextsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateConversationRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListContextsResponse + * @returns CreateConversationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListContextsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateConversationRequest; /** - * Verifies a ListContextsResponse message. + * Verifies a CreateConversationRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListContextsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateConversationRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListContextsResponse + * @returns CreateConversationRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListContextsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateConversationRequest; /** - * Creates a plain object from a ListContextsResponse message. Also converts values to other types if specified. - * @param message ListContextsResponse + * Creates a plain object from a CreateConversationRequest message. Also converts values to other types if specified. + * @param message CreateConversationRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListContextsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.CreateConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListContextsResponse to JSON. + * Converts this CreateConversationRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetContextRequest. */ - interface IGetContextRequest { + /** Properties of a ListConversationsRequest. */ + interface IListConversationsRequest { - /** GetContextRequest name */ - name?: (string|null); + /** ListConversationsRequest parent */ + parent?: (string|null); + + /** ListConversationsRequest pageSize */ + pageSize?: (number|null); + + /** ListConversationsRequest pageToken */ + pageToken?: (string|null); + + /** ListConversationsRequest filter */ + filter?: (string|null); } - /** Represents a GetContextRequest. */ - class GetContextRequest implements IGetContextRequest { + /** Represents a ListConversationsRequest. */ + class ListConversationsRequest implements IListConversationsRequest { /** - * Constructs a new GetContextRequest. + * Constructs a new ListConversationsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IGetContextRequest); + constructor(properties?: google.cloud.dialogflow.v2.IListConversationsRequest); - /** GetContextRequest name. */ - public name: string; + /** ListConversationsRequest parent. */ + public parent: string; + + /** ListConversationsRequest pageSize. */ + public pageSize: number; + + /** ListConversationsRequest pageToken. */ + public pageToken: string; + + /** ListConversationsRequest filter. */ + public filter: string; /** - * Creates a new GetContextRequest instance using the specified properties. + * Creates a new ListConversationsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetContextRequest instance + * @returns ListConversationsRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IGetContextRequest): google.cloud.dialogflow.v2beta1.GetContextRequest; + public static create(properties?: google.cloud.dialogflow.v2.IListConversationsRequest): google.cloud.dialogflow.v2.ListConversationsRequest; /** - * Encodes the specified GetContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetContextRequest.verify|verify} messages. - * @param message GetContextRequest message or plain object to encode + * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationsRequest.verify|verify} messages. + * @param message ListConversationsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IGetContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetContextRequest.verify|verify} messages. - * @param message GetContextRequest message or plain object to encode + * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationsRequest.verify|verify} messages. + * @param message ListConversationsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetContextRequest message from the specified reader or buffer. + * Decodes a ListConversationsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetContextRequest + * @returns ListConversationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetContextRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListConversationsRequest; /** - * Decodes a GetContextRequest message from the specified reader or buffer, length delimited. + * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetContextRequest + * @returns ListConversationsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetContextRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListConversationsRequest; /** - * Verifies a GetContextRequest message. + * Verifies a ListConversationsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetContextRequest + * @returns ListConversationsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetContextRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListConversationsRequest; /** - * Creates a plain object from a GetContextRequest message. Also converts values to other types if specified. - * @param message GetContextRequest + * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. + * @param message ListConversationsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.GetContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.ListConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetContextRequest to JSON. + * Converts this ListConversationsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateContextRequest. */ - interface ICreateContextRequest { + /** Properties of a ListConversationsResponse. */ + interface IListConversationsResponse { - /** CreateContextRequest parent */ - parent?: (string|null); + /** ListConversationsResponse conversations */ + conversations?: (google.cloud.dialogflow.v2.IConversation[]|null); - /** CreateContextRequest context */ - context?: (google.cloud.dialogflow.v2beta1.IContext|null); + /** ListConversationsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a CreateContextRequest. */ - class CreateContextRequest implements ICreateContextRequest { + /** Represents a ListConversationsResponse. */ + class ListConversationsResponse implements IListConversationsResponse { /** - * Constructs a new CreateContextRequest. + * Constructs a new ListConversationsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateContextRequest); + constructor(properties?: google.cloud.dialogflow.v2.IListConversationsResponse); - /** CreateContextRequest parent. */ - public parent: string; + /** ListConversationsResponse conversations. */ + public conversations: google.cloud.dialogflow.v2.IConversation[]; - /** CreateContextRequest context. */ - public context?: (google.cloud.dialogflow.v2beta1.IContext|null); + /** ListConversationsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new CreateContextRequest instance using the specified properties. + * Creates a new ListConversationsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns CreateContextRequest instance + * @returns ListConversationsResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateContextRequest): google.cloud.dialogflow.v2beta1.CreateContextRequest; + public static create(properties?: google.cloud.dialogflow.v2.IListConversationsResponse): google.cloud.dialogflow.v2.ListConversationsResponse; /** - * Encodes the specified CreateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateContextRequest.verify|verify} messages. - * @param message CreateContextRequest message or plain object to encode + * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationsResponse.verify|verify} messages. + * @param message ListConversationsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ICreateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateContextRequest.verify|verify} messages. - * @param message CreateContextRequest message or plain object to encode + * Encodes the specified ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationsResponse.verify|verify} messages. + * @param message ListConversationsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateContextRequest message from the specified reader or buffer. + * Decodes a ListConversationsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateContextRequest + * @returns ListConversationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateContextRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListConversationsResponse; /** - * Decodes a CreateContextRequest message from the specified reader or buffer, length delimited. + * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateContextRequest + * @returns ListConversationsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateContextRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListConversationsResponse; /** - * Verifies a CreateContextRequest message. + * Verifies a ListConversationsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateContextRequest + * @returns ListConversationsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateContextRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListConversationsResponse; /** - * Creates a plain object from a CreateContextRequest message. Also converts values to other types if specified. - * @param message CreateContextRequest + * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. + * @param message ListConversationsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.CreateContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.ListConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateContextRequest to JSON. + * Converts this ListConversationsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateContextRequest. */ - interface IUpdateContextRequest { - - /** UpdateContextRequest context */ - context?: (google.cloud.dialogflow.v2beta1.IContext|null); + /** Properties of a GetConversationRequest. */ + interface IGetConversationRequest { - /** UpdateContextRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** GetConversationRequest name */ + name?: (string|null); } - /** Represents an UpdateContextRequest. */ - class UpdateContextRequest implements IUpdateContextRequest { + /** Represents a GetConversationRequest. */ + class GetConversationRequest implements IGetConversationRequest { /** - * Constructs a new UpdateContextRequest. + * Constructs a new GetConversationRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateContextRequest); - - /** UpdateContextRequest context. */ - public context?: (google.cloud.dialogflow.v2beta1.IContext|null); + constructor(properties?: google.cloud.dialogflow.v2.IGetConversationRequest); - /** UpdateContextRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** GetConversationRequest name. */ + public name: string; /** - * Creates a new UpdateContextRequest instance using the specified properties. + * Creates a new GetConversationRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateContextRequest instance + * @returns GetConversationRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateContextRequest): google.cloud.dialogflow.v2beta1.UpdateContextRequest; + public static create(properties?: google.cloud.dialogflow.v2.IGetConversationRequest): google.cloud.dialogflow.v2.GetConversationRequest; /** - * Encodes the specified UpdateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateContextRequest.verify|verify} messages. - * @param message UpdateContextRequest message or plain object to encode + * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetConversationRequest.verify|verify} messages. + * @param message GetConversationRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateContextRequest.verify|verify} messages. - * @param message UpdateContextRequest message or plain object to encode + * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetConversationRequest.verify|verify} messages. + * @param message GetConversationRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateContextRequest message from the specified reader or buffer. + * Decodes a GetConversationRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateContextRequest + * @returns GetConversationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateContextRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetConversationRequest; /** - * Decodes an UpdateContextRequest message from the specified reader or buffer, length delimited. + * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateContextRequest + * @returns GetConversationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateContextRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetConversationRequest; /** - * Verifies an UpdateContextRequest message. + * Verifies a GetConversationRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateContextRequest + * @returns GetConversationRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateContextRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetConversationRequest; /** - * Creates a plain object from an UpdateContextRequest message. Also converts values to other types if specified. - * @param message UpdateContextRequest + * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. + * @param message GetConversationRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.GetConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateContextRequest to JSON. + * Converts this GetConversationRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteContextRequest. */ - interface IDeleteContextRequest { + /** Properties of a CompleteConversationRequest. */ + interface ICompleteConversationRequest { - /** DeleteContextRequest name */ + /** CompleteConversationRequest name */ name?: (string|null); } - /** Represents a DeleteContextRequest. */ - class DeleteContextRequest implements IDeleteContextRequest { + /** Represents a CompleteConversationRequest. */ + class CompleteConversationRequest implements ICompleteConversationRequest { /** - * Constructs a new DeleteContextRequest. + * Constructs a new CompleteConversationRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteContextRequest); + constructor(properties?: google.cloud.dialogflow.v2.ICompleteConversationRequest); - /** DeleteContextRequest name. */ + /** CompleteConversationRequest name. */ public name: string; /** - * Creates a new DeleteContextRequest instance using the specified properties. + * Creates a new CompleteConversationRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteContextRequest instance + * @returns CompleteConversationRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteContextRequest): google.cloud.dialogflow.v2beta1.DeleteContextRequest; + public static create(properties?: google.cloud.dialogflow.v2.ICompleteConversationRequest): google.cloud.dialogflow.v2.CompleteConversationRequest; /** - * Encodes the specified DeleteContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteContextRequest.verify|verify} messages. - * @param message DeleteContextRequest message or plain object to encode + * Encodes the specified CompleteConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CompleteConversationRequest.verify|verify} messages. + * @param message CompleteConversationRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ICompleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteContextRequest.verify|verify} messages. - * @param message DeleteContextRequest message or plain object to encode + * Encodes the specified CompleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CompleteConversationRequest.verify|verify} messages. + * @param message CompleteConversationRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ICompleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteContextRequest message from the specified reader or buffer. + * Decodes a CompleteConversationRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteContextRequest + * @returns CompleteConversationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteContextRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CompleteConversationRequest; /** - * Decodes a DeleteContextRequest message from the specified reader or buffer, length delimited. + * Decodes a CompleteConversationRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteContextRequest + * @returns CompleteConversationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteContextRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CompleteConversationRequest; /** - * Verifies a DeleteContextRequest message. + * Verifies a CompleteConversationRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CompleteConversationRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteContextRequest + * @returns CompleteConversationRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteContextRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CompleteConversationRequest; /** - * Creates a plain object from a DeleteContextRequest message. Also converts values to other types if specified. - * @param message DeleteContextRequest + * Creates a plain object from a CompleteConversationRequest message. Also converts values to other types if specified. + * @param message CompleteConversationRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.CompleteConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteContextRequest to JSON. + * Converts this CompleteConversationRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteAllContextsRequest. */ - interface IDeleteAllContextsRequest { + /** Properties of a CreateCallMatcherRequest. */ + interface ICreateCallMatcherRequest { - /** DeleteAllContextsRequest parent */ + /** CreateCallMatcherRequest parent */ parent?: (string|null); + + /** CreateCallMatcherRequest callMatcher */ + callMatcher?: (google.cloud.dialogflow.v2.ICallMatcher|null); } - /** Represents a DeleteAllContextsRequest. */ - class DeleteAllContextsRequest implements IDeleteAllContextsRequest { + /** Represents a CreateCallMatcherRequest. */ + class CreateCallMatcherRequest implements ICreateCallMatcherRequest { /** - * Constructs a new DeleteAllContextsRequest. + * Constructs a new CreateCallMatcherRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest); + constructor(properties?: google.cloud.dialogflow.v2.ICreateCallMatcherRequest); - /** DeleteAllContextsRequest parent. */ + /** CreateCallMatcherRequest parent. */ public parent: string; + /** CreateCallMatcherRequest callMatcher. */ + public callMatcher?: (google.cloud.dialogflow.v2.ICallMatcher|null); + /** - * Creates a new DeleteAllContextsRequest instance using the specified properties. + * Creates a new CreateCallMatcherRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteAllContextsRequest instance + * @returns CreateCallMatcherRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest): google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest; + public static create(properties?: google.cloud.dialogflow.v2.ICreateCallMatcherRequest): google.cloud.dialogflow.v2.CreateCallMatcherRequest; /** - * Encodes the specified DeleteAllContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest.verify|verify} messages. - * @param message DeleteAllContextsRequest message or plain object to encode + * Encodes the specified CreateCallMatcherRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateCallMatcherRequest.verify|verify} messages. + * @param message CreateCallMatcherRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2.ICreateCallMatcherRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteAllContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest.verify|verify} messages. - * @param message DeleteAllContextsRequest message or plain object to encode + * Encodes the specified CreateCallMatcherRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateCallMatcherRequest.verify|verify} messages. + * @param message CreateCallMatcherRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateCallMatcherRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteAllContextsRequest message from the specified reader or buffer. + * Decodes a CreateCallMatcherRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteAllContextsRequest + * @returns CreateCallMatcherRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateCallMatcherRequest; /** - * Decodes a DeleteAllContextsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateCallMatcherRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteAllContextsRequest + * @returns CreateCallMatcherRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateCallMatcherRequest; /** - * Verifies a DeleteAllContextsRequest message. + * Verifies a CreateCallMatcherRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteAllContextsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateCallMatcherRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteAllContextsRequest + * @returns CreateCallMatcherRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateCallMatcherRequest; /** - * Creates a plain object from a DeleteAllContextsRequest message. Also converts values to other types if specified. - * @param message DeleteAllContextsRequest + * Creates a plain object from a CreateCallMatcherRequest message. Also converts values to other types if specified. + * @param message CreateCallMatcherRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2.CreateCallMatcherRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteAllContextsRequest to JSON. + * Converts this CreateCallMatcherRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a Documents */ - class Documents extends $protobuf.rpc.Service { + /** Properties of a ListCallMatchersRequest. */ + interface IListCallMatchersRequest { + + /** ListCallMatchersRequest parent */ + parent?: (string|null); + + /** ListCallMatchersRequest pageSize */ + pageSize?: (number|null); + + /** ListCallMatchersRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListCallMatchersRequest. */ + class ListCallMatchersRequest implements IListCallMatchersRequest { /** - * Constructs a new Documents service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited + * Constructs a new ListCallMatchersRequest. + * @param [properties] Properties to set */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + constructor(properties?: google.cloud.dialogflow.v2.IListCallMatchersRequest); + + /** ListCallMatchersRequest parent. */ + public parent: string; + + /** ListCallMatchersRequest pageSize. */ + public pageSize: number; + + /** ListCallMatchersRequest pageToken. */ + public pageToken: string; /** - * Creates new Documents service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. + * Creates a new ListCallMatchersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCallMatchersRequest instance */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Documents; + public static create(properties?: google.cloud.dialogflow.v2.IListCallMatchersRequest): google.cloud.dialogflow.v2.ListCallMatchersRequest; /** - * Calls ListDocuments. - * @param request ListDocumentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDocumentsResponse + * Encodes the specified ListCallMatchersRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListCallMatchersRequest.verify|verify} messages. + * @param message ListCallMatchersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listDocuments(request: google.cloud.dialogflow.v2beta1.IListDocumentsRequest, callback: google.cloud.dialogflow.v2beta1.Documents.ListDocumentsCallback): void; + public static encode(message: google.cloud.dialogflow.v2.IListCallMatchersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls ListDocuments. - * @param request ListDocumentsRequest message or plain object - * @returns Promise + * Encodes the specified ListCallMatchersRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListCallMatchersRequest.verify|verify} messages. + * @param message ListCallMatchersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public listDocuments(request: google.cloud.dialogflow.v2beta1.IListDocumentsRequest): Promise; + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListCallMatchersRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls GetDocument. - * @param request GetDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Document + * Decodes a ListCallMatchersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCallMatchersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public getDocument(request: google.cloud.dialogflow.v2beta1.IGetDocumentRequest, callback: google.cloud.dialogflow.v2beta1.Documents.GetDocumentCallback): void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListCallMatchersRequest; /** - * Calls GetDocument. - * @param request GetDocumentRequest message or plain object + * Decodes a ListCallMatchersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCallMatchersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListCallMatchersRequest; + + /** + * Verifies a ListCallMatchersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCallMatchersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCallMatchersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListCallMatchersRequest; + + /** + * Creates a plain object from a ListCallMatchersRequest message. Also converts values to other types if specified. + * @param message ListCallMatchersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListCallMatchersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCallMatchersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListCallMatchersResponse. */ + interface IListCallMatchersResponse { + + /** ListCallMatchersResponse callMatchers */ + callMatchers?: (google.cloud.dialogflow.v2.ICallMatcher[]|null); + + /** ListCallMatchersResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListCallMatchersResponse. */ + class ListCallMatchersResponse implements IListCallMatchersResponse { + + /** + * Constructs a new ListCallMatchersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListCallMatchersResponse); + + /** ListCallMatchersResponse callMatchers. */ + public callMatchers: google.cloud.dialogflow.v2.ICallMatcher[]; + + /** ListCallMatchersResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListCallMatchersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCallMatchersResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListCallMatchersResponse): google.cloud.dialogflow.v2.ListCallMatchersResponse; + + /** + * Encodes the specified ListCallMatchersResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListCallMatchersResponse.verify|verify} messages. + * @param message ListCallMatchersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListCallMatchersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListCallMatchersResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListCallMatchersResponse.verify|verify} messages. + * @param message ListCallMatchersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListCallMatchersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListCallMatchersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCallMatchersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListCallMatchersResponse; + + /** + * Decodes a ListCallMatchersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCallMatchersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListCallMatchersResponse; + + /** + * Verifies a ListCallMatchersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListCallMatchersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCallMatchersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListCallMatchersResponse; + + /** + * Creates a plain object from a ListCallMatchersResponse message. Also converts values to other types if specified. + * @param message ListCallMatchersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListCallMatchersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListCallMatchersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteCallMatcherRequest. */ + interface IDeleteCallMatcherRequest { + + /** DeleteCallMatcherRequest name */ + name?: (string|null); + } + + /** Represents a DeleteCallMatcherRequest. */ + class DeleteCallMatcherRequest implements IDeleteCallMatcherRequest { + + /** + * Constructs a new DeleteCallMatcherRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IDeleteCallMatcherRequest); + + /** DeleteCallMatcherRequest name. */ + public name: string; + + /** + * Creates a new DeleteCallMatcherRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCallMatcherRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IDeleteCallMatcherRequest): google.cloud.dialogflow.v2.DeleteCallMatcherRequest; + + /** + * Encodes the specified DeleteCallMatcherRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteCallMatcherRequest.verify|verify} messages. + * @param message DeleteCallMatcherRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IDeleteCallMatcherRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteCallMatcherRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteCallMatcherRequest.verify|verify} messages. + * @param message DeleteCallMatcherRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteCallMatcherRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteCallMatcherRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCallMatcherRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteCallMatcherRequest; + + /** + * Decodes a DeleteCallMatcherRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCallMatcherRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteCallMatcherRequest; + + /** + * Verifies a DeleteCallMatcherRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteCallMatcherRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCallMatcherRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteCallMatcherRequest; + + /** + * Creates a plain object from a DeleteCallMatcherRequest message. Also converts values to other types if specified. + * @param message DeleteCallMatcherRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.DeleteCallMatcherRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteCallMatcherRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListMessagesRequest. */ + interface IListMessagesRequest { + + /** ListMessagesRequest parent */ + parent?: (string|null); + + /** ListMessagesRequest filter */ + filter?: (string|null); + + /** ListMessagesRequest pageSize */ + pageSize?: (number|null); + + /** ListMessagesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListMessagesRequest. */ + class ListMessagesRequest implements IListMessagesRequest { + + /** + * Constructs a new ListMessagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListMessagesRequest); + + /** ListMessagesRequest parent. */ + public parent: string; + + /** ListMessagesRequest filter. */ + public filter: string; + + /** ListMessagesRequest pageSize. */ + public pageSize: number; + + /** ListMessagesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListMessagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMessagesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListMessagesRequest): google.cloud.dialogflow.v2.ListMessagesRequest; + + /** + * Encodes the specified ListMessagesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListMessagesRequest.verify|verify} messages. + * @param message ListMessagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMessagesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListMessagesRequest.verify|verify} messages. + * @param message ListMessagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListMessagesRequest; + + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListMessagesRequest; + + /** + * Verifies a ListMessagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMessagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMessagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListMessagesRequest; + + /** + * Creates a plain object from a ListMessagesRequest message. Also converts values to other types if specified. + * @param message ListMessagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListMessagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMessagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListMessagesResponse. */ + interface IListMessagesResponse { + + /** ListMessagesResponse messages */ + messages?: (google.cloud.dialogflow.v2.IMessage[]|null); + + /** ListMessagesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListMessagesResponse. */ + class ListMessagesResponse implements IListMessagesResponse { + + /** + * Constructs a new ListMessagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListMessagesResponse); + + /** ListMessagesResponse messages. */ + public messages: google.cloud.dialogflow.v2.IMessage[]; + + /** ListMessagesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListMessagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMessagesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListMessagesResponse): google.cloud.dialogflow.v2.ListMessagesResponse; + + /** + * Encodes the specified ListMessagesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListMessagesResponse.verify|verify} messages. + * @param message ListMessagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListMessagesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListMessagesResponse.verify|verify} messages. + * @param message ListMessagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListMessagesResponse; + + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListMessagesResponse; + + /** + * Verifies a ListMessagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListMessagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMessagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListMessagesResponse; + + /** + * Creates a plain object from a ListMessagesResponse message. Also converts values to other types if specified. + * @param message ListMessagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListMessagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListMessagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ConversationPhoneNumber. */ + interface IConversationPhoneNumber { + + /** ConversationPhoneNumber phoneNumber */ + phoneNumber?: (string|null); + } + + /** Represents a ConversationPhoneNumber. */ + class ConversationPhoneNumber implements IConversationPhoneNumber { + + /** + * Constructs a new ConversationPhoneNumber. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IConversationPhoneNumber); + + /** ConversationPhoneNumber phoneNumber. */ + public phoneNumber: string; + + /** + * Creates a new ConversationPhoneNumber instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationPhoneNumber instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IConversationPhoneNumber): google.cloud.dialogflow.v2.ConversationPhoneNumber; + + /** + * Encodes the specified ConversationPhoneNumber message. Does not implicitly {@link google.cloud.dialogflow.v2.ConversationPhoneNumber.verify|verify} messages. + * @param message ConversationPhoneNumber message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IConversationPhoneNumber, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationPhoneNumber message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ConversationPhoneNumber.verify|verify} messages. + * @param message ConversationPhoneNumber message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IConversationPhoneNumber, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationPhoneNumber message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationPhoneNumber + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ConversationPhoneNumber; + + /** + * Decodes a ConversationPhoneNumber message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationPhoneNumber + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ConversationPhoneNumber; + + /** + * Verifies a ConversationPhoneNumber message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConversationPhoneNumber message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationPhoneNumber + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ConversationPhoneNumber; + + /** + * Creates a plain object from a ConversationPhoneNumber message. Also converts values to other types if specified. + * @param message ConversationPhoneNumber + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ConversationPhoneNumber, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationPhoneNumber to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ConversationEvent. */ + interface IConversationEvent { + + /** ConversationEvent conversation */ + conversation?: (string|null); + + /** ConversationEvent type */ + type?: (google.cloud.dialogflow.v2.ConversationEvent.Type|keyof typeof google.cloud.dialogflow.v2.ConversationEvent.Type|null); + + /** ConversationEvent errorStatus */ + errorStatus?: (google.rpc.IStatus|null); + + /** ConversationEvent newMessagePayload */ + newMessagePayload?: (google.cloud.dialogflow.v2.IMessage|null); + } + + /** Represents a ConversationEvent. */ + class ConversationEvent implements IConversationEvent { + + /** + * Constructs a new ConversationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IConversationEvent); + + /** ConversationEvent conversation. */ + public conversation: string; + + /** ConversationEvent type. */ + public type: (google.cloud.dialogflow.v2.ConversationEvent.Type|keyof typeof google.cloud.dialogflow.v2.ConversationEvent.Type); + + /** ConversationEvent errorStatus. */ + public errorStatus?: (google.rpc.IStatus|null); + + /** ConversationEvent newMessagePayload. */ + public newMessagePayload?: (google.cloud.dialogflow.v2.IMessage|null); + + /** ConversationEvent payload. */ + public payload?: "newMessagePayload"; + + /** + * Creates a new ConversationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationEvent instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IConversationEvent): google.cloud.dialogflow.v2.ConversationEvent; + + /** + * Encodes the specified ConversationEvent message. Does not implicitly {@link google.cloud.dialogflow.v2.ConversationEvent.verify|verify} messages. + * @param message ConversationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IConversationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationEvent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ConversationEvent.verify|verify} messages. + * @param message ConversationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IConversationEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ConversationEvent; + + /** + * Decodes a ConversationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ConversationEvent; + + /** + * Verifies a ConversationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConversationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ConversationEvent; + + /** + * Creates a plain object from a ConversationEvent message. Also converts values to other types if specified. + * @param message ConversationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ConversationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ConversationEvent { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + CONVERSATION_STARTED = 1, + CONVERSATION_FINISHED = 2, + HUMAN_INTERVENTION_NEEDED = 3, + NEW_MESSAGE = 5, + UNRECOVERABLE_ERROR = 4 + } + } + + /** Represents a ConversationProfiles */ + class ConversationProfiles extends $protobuf.rpc.Service { + + /** + * Constructs a new ConversationProfiles service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new ConversationProfiles service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ConversationProfiles; + + /** + * Calls ListConversationProfiles. + * @param request ListConversationProfilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConversationProfilesResponse + */ + public listConversationProfiles(request: google.cloud.dialogflow.v2.IListConversationProfilesRequest, callback: google.cloud.dialogflow.v2.ConversationProfiles.ListConversationProfilesCallback): void; + + /** + * Calls ListConversationProfiles. + * @param request ListConversationProfilesRequest message or plain object * @returns Promise */ - public getDocument(request: google.cloud.dialogflow.v2beta1.IGetDocumentRequest): Promise; + public listConversationProfiles(request: google.cloud.dialogflow.v2.IListConversationProfilesRequest): Promise; /** - * Calls CreateDocument. - * @param request CreateDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Calls GetConversationProfile. + * @param request GetConversationProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConversationProfile */ - public createDocument(request: google.cloud.dialogflow.v2beta1.ICreateDocumentRequest, callback: google.cloud.dialogflow.v2beta1.Documents.CreateDocumentCallback): void; + public getConversationProfile(request: google.cloud.dialogflow.v2.IGetConversationProfileRequest, callback: google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfileCallback): void; /** - * Calls CreateDocument. - * @param request CreateDocumentRequest message or plain object + * Calls GetConversationProfile. + * @param request GetConversationProfileRequest message or plain object * @returns Promise */ - public createDocument(request: google.cloud.dialogflow.v2beta1.ICreateDocumentRequest): Promise; + public getConversationProfile(request: google.cloud.dialogflow.v2.IGetConversationProfileRequest): Promise; + + /** + * Calls CreateConversationProfile. + * @param request CreateConversationProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConversationProfile + */ + public createConversationProfile(request: google.cloud.dialogflow.v2.ICreateConversationProfileRequest, callback: google.cloud.dialogflow.v2.ConversationProfiles.CreateConversationProfileCallback): void; + + /** + * Calls CreateConversationProfile. + * @param request CreateConversationProfileRequest message or plain object + * @returns Promise + */ + public createConversationProfile(request: google.cloud.dialogflow.v2.ICreateConversationProfileRequest): Promise; + + /** + * Calls UpdateConversationProfile. + * @param request UpdateConversationProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConversationProfile + */ + public updateConversationProfile(request: google.cloud.dialogflow.v2.IUpdateConversationProfileRequest, callback: google.cloud.dialogflow.v2.ConversationProfiles.UpdateConversationProfileCallback): void; + + /** + * Calls UpdateConversationProfile. + * @param request UpdateConversationProfileRequest message or plain object + * @returns Promise + */ + public updateConversationProfile(request: google.cloud.dialogflow.v2.IUpdateConversationProfileRequest): Promise; + + /** + * Calls DeleteConversationProfile. + * @param request DeleteConversationProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteConversationProfile(request: google.cloud.dialogflow.v2.IDeleteConversationProfileRequest, callback: google.cloud.dialogflow.v2.ConversationProfiles.DeleteConversationProfileCallback): void; + + /** + * Calls DeleteConversationProfile. + * @param request DeleteConversationProfileRequest message or plain object + * @returns Promise + */ + public deleteConversationProfile(request: google.cloud.dialogflow.v2.IDeleteConversationProfileRequest): Promise; + } + + namespace ConversationProfiles { + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.ConversationProfiles#listConversationProfiles}. + * @param error Error, if any + * @param [response] ListConversationProfilesResponse + */ + type ListConversationProfilesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListConversationProfilesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.ConversationProfiles#getConversationProfile}. + * @param error Error, if any + * @param [response] ConversationProfile + */ + type GetConversationProfileCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ConversationProfile) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.ConversationProfiles#createConversationProfile}. + * @param error Error, if any + * @param [response] ConversationProfile + */ + type CreateConversationProfileCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ConversationProfile) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.ConversationProfiles#updateConversationProfile}. + * @param error Error, if any + * @param [response] ConversationProfile + */ + type UpdateConversationProfileCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ConversationProfile) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.ConversationProfiles#deleteConversationProfile}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteConversationProfileCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a ConversationProfile. */ + interface IConversationProfile { + + /** ConversationProfile name */ + name?: (string|null); + + /** ConversationProfile displayName */ + displayName?: (string|null); + + /** ConversationProfile createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ConversationProfile updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ConversationProfile automatedAgentConfig */ + automatedAgentConfig?: (google.cloud.dialogflow.v2.IAutomatedAgentConfig|null); + + /** ConversationProfile humanAgentAssistantConfig */ + humanAgentAssistantConfig?: (google.cloud.dialogflow.v2.IHumanAgentAssistantConfig|null); + + /** ConversationProfile humanAgentHandoffConfig */ + humanAgentHandoffConfig?: (google.cloud.dialogflow.v2.IHumanAgentHandoffConfig|null); + + /** ConversationProfile notificationConfig */ + notificationConfig?: (google.cloud.dialogflow.v2.INotificationConfig|null); + + /** ConversationProfile loggingConfig */ + loggingConfig?: (google.cloud.dialogflow.v2.ILoggingConfig|null); + + /** ConversationProfile newMessageEventNotificationConfig */ + newMessageEventNotificationConfig?: (google.cloud.dialogflow.v2.INotificationConfig|null); + + /** ConversationProfile sttConfig */ + sttConfig?: (google.cloud.dialogflow.v2.ISpeechToTextConfig|null); + + /** ConversationProfile languageCode */ + languageCode?: (string|null); + } + + /** Represents a ConversationProfile. */ + class ConversationProfile implements IConversationProfile { + + /** + * Constructs a new ConversationProfile. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IConversationProfile); + + /** ConversationProfile name. */ + public name: string; + + /** ConversationProfile displayName. */ + public displayName: string; + + /** ConversationProfile createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ConversationProfile updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ConversationProfile automatedAgentConfig. */ + public automatedAgentConfig?: (google.cloud.dialogflow.v2.IAutomatedAgentConfig|null); + + /** ConversationProfile humanAgentAssistantConfig. */ + public humanAgentAssistantConfig?: (google.cloud.dialogflow.v2.IHumanAgentAssistantConfig|null); + + /** ConversationProfile humanAgentHandoffConfig. */ + public humanAgentHandoffConfig?: (google.cloud.dialogflow.v2.IHumanAgentHandoffConfig|null); + + /** ConversationProfile notificationConfig. */ + public notificationConfig?: (google.cloud.dialogflow.v2.INotificationConfig|null); + + /** ConversationProfile loggingConfig. */ + public loggingConfig?: (google.cloud.dialogflow.v2.ILoggingConfig|null); + + /** ConversationProfile newMessageEventNotificationConfig. */ + public newMessageEventNotificationConfig?: (google.cloud.dialogflow.v2.INotificationConfig|null); + + /** ConversationProfile sttConfig. */ + public sttConfig?: (google.cloud.dialogflow.v2.ISpeechToTextConfig|null); + + /** ConversationProfile languageCode. */ + public languageCode: string; + + /** + * Creates a new ConversationProfile instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationProfile instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IConversationProfile): google.cloud.dialogflow.v2.ConversationProfile; + + /** + * Encodes the specified ConversationProfile message. Does not implicitly {@link google.cloud.dialogflow.v2.ConversationProfile.verify|verify} messages. + * @param message ConversationProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IConversationProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationProfile message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ConversationProfile.verify|verify} messages. + * @param message ConversationProfile message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IConversationProfile, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationProfile message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ConversationProfile; + + /** + * Decodes a ConversationProfile message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationProfile + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ConversationProfile; + + /** + * Verifies a ConversationProfile message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConversationProfile message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationProfile + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ConversationProfile; + + /** + * Creates a plain object from a ConversationProfile message. Also converts values to other types if specified. + * @param message ConversationProfile + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ConversationProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationProfile to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListConversationProfilesRequest. */ + interface IListConversationProfilesRequest { + + /** ListConversationProfilesRequest parent */ + parent?: (string|null); + + /** ListConversationProfilesRequest pageSize */ + pageSize?: (number|null); + + /** ListConversationProfilesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListConversationProfilesRequest. */ + class ListConversationProfilesRequest implements IListConversationProfilesRequest { + + /** + * Constructs a new ListConversationProfilesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListConversationProfilesRequest); + + /** ListConversationProfilesRequest parent. */ + public parent: string; + + /** ListConversationProfilesRequest pageSize. */ + public pageSize: number; + + /** ListConversationProfilesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListConversationProfilesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversationProfilesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListConversationProfilesRequest): google.cloud.dialogflow.v2.ListConversationProfilesRequest; + + /** + * Encodes the specified ListConversationProfilesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationProfilesRequest.verify|verify} messages. + * @param message ListConversationProfilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListConversationProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConversationProfilesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationProfilesRequest.verify|verify} messages. + * @param message ListConversationProfilesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListConversationProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConversationProfilesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConversationProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListConversationProfilesRequest; + + /** + * Decodes a ListConversationProfilesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConversationProfilesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListConversationProfilesRequest; + + /** + * Verifies a ListConversationProfilesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConversationProfilesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConversationProfilesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListConversationProfilesRequest; + + /** + * Creates a plain object from a ListConversationProfilesRequest message. Also converts values to other types if specified. + * @param message ListConversationProfilesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListConversationProfilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConversationProfilesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListConversationProfilesResponse. */ + interface IListConversationProfilesResponse { + + /** ListConversationProfilesResponse conversationProfiles */ + conversationProfiles?: (google.cloud.dialogflow.v2.IConversationProfile[]|null); + + /** ListConversationProfilesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListConversationProfilesResponse. */ + class ListConversationProfilesResponse implements IListConversationProfilesResponse { + + /** + * Constructs a new ListConversationProfilesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListConversationProfilesResponse); + + /** ListConversationProfilesResponse conversationProfiles. */ + public conversationProfiles: google.cloud.dialogflow.v2.IConversationProfile[]; + + /** ListConversationProfilesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListConversationProfilesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversationProfilesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListConversationProfilesResponse): google.cloud.dialogflow.v2.ListConversationProfilesResponse; + + /** + * Encodes the specified ListConversationProfilesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationProfilesResponse.verify|verify} messages. + * @param message ListConversationProfilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListConversationProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListConversationProfilesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationProfilesResponse.verify|verify} messages. + * @param message ListConversationProfilesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListConversationProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListConversationProfilesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConversationProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListConversationProfilesResponse; + + /** + * Decodes a ListConversationProfilesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConversationProfilesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListConversationProfilesResponse; + + /** + * Verifies a ListConversationProfilesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListConversationProfilesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConversationProfilesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListConversationProfilesResponse; + + /** + * Creates a plain object from a ListConversationProfilesResponse message. Also converts values to other types if specified. + * @param message ListConversationProfilesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListConversationProfilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListConversationProfilesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetConversationProfileRequest. */ + interface IGetConversationProfileRequest { + + /** GetConversationProfileRequest name */ + name?: (string|null); + } + + /** Represents a GetConversationProfileRequest. */ + class GetConversationProfileRequest implements IGetConversationProfileRequest { + + /** + * Constructs a new GetConversationProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IGetConversationProfileRequest); + + /** GetConversationProfileRequest name. */ + public name: string; + + /** + * Creates a new GetConversationProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConversationProfileRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IGetConversationProfileRequest): google.cloud.dialogflow.v2.GetConversationProfileRequest; + + /** + * Encodes the specified GetConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetConversationProfileRequest.verify|verify} messages. + * @param message GetConversationProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IGetConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetConversationProfileRequest.verify|verify} messages. + * @param message GetConversationProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetConversationProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConversationProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetConversationProfileRequest; + + /** + * Decodes a GetConversationProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConversationProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetConversationProfileRequest; + + /** + * Verifies a GetConversationProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetConversationProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConversationProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetConversationProfileRequest; + + /** + * Creates a plain object from a GetConversationProfileRequest message. Also converts values to other types if specified. + * @param message GetConversationProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.GetConversationProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetConversationProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateConversationProfileRequest. */ + interface ICreateConversationProfileRequest { + + /** CreateConversationProfileRequest parent */ + parent?: (string|null); + + /** CreateConversationProfileRequest conversationProfile */ + conversationProfile?: (google.cloud.dialogflow.v2.IConversationProfile|null); + } + + /** Represents a CreateConversationProfileRequest. */ + class CreateConversationProfileRequest implements ICreateConversationProfileRequest { + + /** + * Constructs a new CreateConversationProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.ICreateConversationProfileRequest); + + /** CreateConversationProfileRequest parent. */ + public parent: string; + + /** CreateConversationProfileRequest conversationProfile. */ + public conversationProfile?: (google.cloud.dialogflow.v2.IConversationProfile|null); + + /** + * Creates a new CreateConversationProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateConversationProfileRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.ICreateConversationProfileRequest): google.cloud.dialogflow.v2.CreateConversationProfileRequest; + + /** + * Encodes the specified CreateConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateConversationProfileRequest.verify|verify} messages. + * @param message CreateConversationProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.ICreateConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateConversationProfileRequest.verify|verify} messages. + * @param message CreateConversationProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateConversationProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateConversationProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateConversationProfileRequest; + + /** + * Decodes a CreateConversationProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateConversationProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateConversationProfileRequest; + + /** + * Verifies a CreateConversationProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateConversationProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateConversationProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateConversationProfileRequest; + + /** + * Creates a plain object from a CreateConversationProfileRequest message. Also converts values to other types if specified. + * @param message CreateConversationProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.CreateConversationProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateConversationProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateConversationProfileRequest. */ + interface IUpdateConversationProfileRequest { + + /** UpdateConversationProfileRequest conversationProfile */ + conversationProfile?: (google.cloud.dialogflow.v2.IConversationProfile|null); + + /** UpdateConversationProfileRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateConversationProfileRequest. */ + class UpdateConversationProfileRequest implements IUpdateConversationProfileRequest { + + /** + * Constructs a new UpdateConversationProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IUpdateConversationProfileRequest); + + /** UpdateConversationProfileRequest conversationProfile. */ + public conversationProfile?: (google.cloud.dialogflow.v2.IConversationProfile|null); + + /** UpdateConversationProfileRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateConversationProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateConversationProfileRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IUpdateConversationProfileRequest): google.cloud.dialogflow.v2.UpdateConversationProfileRequest; + + /** + * Encodes the specified UpdateConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateConversationProfileRequest.verify|verify} messages. + * @param message UpdateConversationProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IUpdateConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateConversationProfileRequest.verify|verify} messages. + * @param message UpdateConversationProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateConversationProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateConversationProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateConversationProfileRequest; + + /** + * Decodes an UpdateConversationProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateConversationProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateConversationProfileRequest; + + /** + * Verifies an UpdateConversationProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateConversationProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateConversationProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateConversationProfileRequest; + + /** + * Creates a plain object from an UpdateConversationProfileRequest message. Also converts values to other types if specified. + * @param message UpdateConversationProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.UpdateConversationProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateConversationProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteConversationProfileRequest. */ + interface IDeleteConversationProfileRequest { + + /** DeleteConversationProfileRequest name */ + name?: (string|null); + } + + /** Represents a DeleteConversationProfileRequest. */ + class DeleteConversationProfileRequest implements IDeleteConversationProfileRequest { + + /** + * Constructs a new DeleteConversationProfileRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IDeleteConversationProfileRequest); + + /** DeleteConversationProfileRequest name. */ + public name: string; + + /** + * Creates a new DeleteConversationProfileRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteConversationProfileRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IDeleteConversationProfileRequest): google.cloud.dialogflow.v2.DeleteConversationProfileRequest; + + /** + * Encodes the specified DeleteConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteConversationProfileRequest.verify|verify} messages. + * @param message DeleteConversationProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IDeleteConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteConversationProfileRequest.verify|verify} messages. + * @param message DeleteConversationProfileRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteConversationProfileRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteConversationProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteConversationProfileRequest; + + /** + * Decodes a DeleteConversationProfileRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteConversationProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteConversationProfileRequest; + + /** + * Verifies a DeleteConversationProfileRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteConversationProfileRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteConversationProfileRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteConversationProfileRequest; + + /** + * Creates a plain object from a DeleteConversationProfileRequest message. Also converts values to other types if specified. + * @param message DeleteConversationProfileRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.DeleteConversationProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteConversationProfileRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AutomatedAgentConfig. */ + interface IAutomatedAgentConfig { + + /** AutomatedAgentConfig agent */ + agent?: (string|null); + } + + /** Represents an AutomatedAgentConfig. */ + class AutomatedAgentConfig implements IAutomatedAgentConfig { + + /** + * Constructs a new AutomatedAgentConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IAutomatedAgentConfig); + + /** AutomatedAgentConfig agent. */ + public agent: string; + + /** + * Creates a new AutomatedAgentConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AutomatedAgentConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IAutomatedAgentConfig): google.cloud.dialogflow.v2.AutomatedAgentConfig; + + /** + * Encodes the specified AutomatedAgentConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.AutomatedAgentConfig.verify|verify} messages. + * @param message AutomatedAgentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IAutomatedAgentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutomatedAgentConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AutomatedAgentConfig.verify|verify} messages. + * @param message AutomatedAgentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IAutomatedAgentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutomatedAgentConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutomatedAgentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.AutomatedAgentConfig; + + /** + * Decodes an AutomatedAgentConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutomatedAgentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.AutomatedAgentConfig; + + /** + * Verifies an AutomatedAgentConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutomatedAgentConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutomatedAgentConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.AutomatedAgentConfig; + + /** + * Creates a plain object from an AutomatedAgentConfig message. Also converts values to other types if specified. + * @param message AutomatedAgentConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.AutomatedAgentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutomatedAgentConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HumanAgentAssistantConfig. */ + interface IHumanAgentAssistantConfig { + + /** HumanAgentAssistantConfig notificationConfig */ + notificationConfig?: (google.cloud.dialogflow.v2.INotificationConfig|null); + + /** HumanAgentAssistantConfig humanAgentSuggestionConfig */ + humanAgentSuggestionConfig?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig|null); + + /** HumanAgentAssistantConfig endUserSuggestionConfig */ + endUserSuggestionConfig?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig|null); + + /** HumanAgentAssistantConfig messageAnalysisConfig */ + messageAnalysisConfig?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IMessageAnalysisConfig|null); + } + + /** Represents a HumanAgentAssistantConfig. */ + class HumanAgentAssistantConfig implements IHumanAgentAssistantConfig { + + /** + * Constructs a new HumanAgentAssistantConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IHumanAgentAssistantConfig); + + /** HumanAgentAssistantConfig notificationConfig. */ + public notificationConfig?: (google.cloud.dialogflow.v2.INotificationConfig|null); + + /** HumanAgentAssistantConfig humanAgentSuggestionConfig. */ + public humanAgentSuggestionConfig?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig|null); + + /** HumanAgentAssistantConfig endUserSuggestionConfig. */ + public endUserSuggestionConfig?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig|null); + + /** HumanAgentAssistantConfig messageAnalysisConfig. */ + public messageAnalysisConfig?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IMessageAnalysisConfig|null); + + /** + * Creates a new HumanAgentAssistantConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns HumanAgentAssistantConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IHumanAgentAssistantConfig): google.cloud.dialogflow.v2.HumanAgentAssistantConfig; + + /** + * Encodes the specified HumanAgentAssistantConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.verify|verify} messages. + * @param message HumanAgentAssistantConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IHumanAgentAssistantConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HumanAgentAssistantConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.verify|verify} messages. + * @param message HumanAgentAssistantConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IHumanAgentAssistantConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HumanAgentAssistantConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HumanAgentAssistantConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentAssistantConfig; + + /** + * Decodes a HumanAgentAssistantConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HumanAgentAssistantConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentAssistantConfig; + + /** + * Verifies a HumanAgentAssistantConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HumanAgentAssistantConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HumanAgentAssistantConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentAssistantConfig; + + /** + * Creates a plain object from a HumanAgentAssistantConfig message. Also converts values to other types if specified. + * @param message HumanAgentAssistantConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HumanAgentAssistantConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HumanAgentAssistantConfig { + + /** Properties of a SuggestionTriggerSettings. */ + interface ISuggestionTriggerSettings { + + /** SuggestionTriggerSettings noSmalltalk */ + noSmalltalk?: (boolean|null); + + /** SuggestionTriggerSettings onlyEndUser */ + onlyEndUser?: (boolean|null); + } + + /** Represents a SuggestionTriggerSettings. */ + class SuggestionTriggerSettings implements ISuggestionTriggerSettings { + + /** + * Constructs a new SuggestionTriggerSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionTriggerSettings); + + /** SuggestionTriggerSettings noSmalltalk. */ + public noSmalltalk: boolean; + + /** SuggestionTriggerSettings onlyEndUser. */ + public onlyEndUser: boolean; + + /** + * Creates a new SuggestionTriggerSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionTriggerSettings instance + */ + public static create(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionTriggerSettings): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings; + + /** + * Encodes the specified SuggestionTriggerSettings message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings.verify|verify} messages. + * @param message SuggestionTriggerSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionTriggerSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionTriggerSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings.verify|verify} messages. + * @param message SuggestionTriggerSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionTriggerSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionTriggerSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionTriggerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings; + + /** + * Decodes a SuggestionTriggerSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionTriggerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings; + + /** + * Verifies a SuggestionTriggerSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionTriggerSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionTriggerSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings; + + /** + * Creates a plain object from a SuggestionTriggerSettings message. Also converts values to other types if specified. + * @param message SuggestionTriggerSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionTriggerSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestionFeatureConfig. */ + interface ISuggestionFeatureConfig { + + /** SuggestionFeatureConfig suggestionFeature */ + suggestionFeature?: (google.cloud.dialogflow.v2.ISuggestionFeature|null); + + /** SuggestionFeatureConfig enableEventBasedSuggestion */ + enableEventBasedSuggestion?: (boolean|null); + + /** SuggestionFeatureConfig suggestionTriggerSettings */ + suggestionTriggerSettings?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionTriggerSettings|null); + + /** SuggestionFeatureConfig queryConfig */ + queryConfig?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionQueryConfig|null); + + /** SuggestionFeatureConfig conversationModelConfig */ + conversationModelConfig?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IConversationModelConfig|null); + } + + /** Represents a SuggestionFeatureConfig. */ + class SuggestionFeatureConfig implements ISuggestionFeatureConfig { + + /** + * Constructs a new SuggestionFeatureConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionFeatureConfig); + + /** SuggestionFeatureConfig suggestionFeature. */ + public suggestionFeature?: (google.cloud.dialogflow.v2.ISuggestionFeature|null); + + /** SuggestionFeatureConfig enableEventBasedSuggestion. */ + public enableEventBasedSuggestion: boolean; + + /** SuggestionFeatureConfig suggestionTriggerSettings. */ + public suggestionTriggerSettings?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionTriggerSettings|null); + + /** SuggestionFeatureConfig queryConfig. */ + public queryConfig?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionQueryConfig|null); + + /** SuggestionFeatureConfig conversationModelConfig. */ + public conversationModelConfig?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IConversationModelConfig|null); + + /** + * Creates a new SuggestionFeatureConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionFeatureConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionFeatureConfig): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig; + + /** + * Encodes the specified SuggestionFeatureConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.verify|verify} messages. + * @param message SuggestionFeatureConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionFeatureConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionFeatureConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.verify|verify} messages. + * @param message SuggestionFeatureConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionFeatureConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionFeatureConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionFeatureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig; + + /** + * Decodes a SuggestionFeatureConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionFeatureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig; + + /** + * Verifies a SuggestionFeatureConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionFeatureConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionFeatureConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig; + + /** + * Creates a plain object from a SuggestionFeatureConfig message. Also converts values to other types if specified. + * @param message SuggestionFeatureConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionFeatureConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestionConfig. */ + interface ISuggestionConfig { + + /** SuggestionConfig featureConfigs */ + featureConfigs?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionFeatureConfig[]|null); + + /** SuggestionConfig groupSuggestionResponses */ + groupSuggestionResponses?: (boolean|null); + } + + /** Represents a SuggestionConfig. */ + class SuggestionConfig implements ISuggestionConfig { + + /** + * Constructs a new SuggestionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig); + + /** SuggestionConfig featureConfigs. */ + public featureConfigs: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionFeatureConfig[]; + + /** SuggestionConfig groupSuggestionResponses. */ + public groupSuggestionResponses: boolean; + + /** + * Creates a new SuggestionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig; + + /** + * Encodes the specified SuggestionConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.verify|verify} messages. + * @param message SuggestionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.verify|verify} messages. + * @param message SuggestionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig; + + /** + * Decodes a SuggestionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig; + + /** + * Verifies a SuggestionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig; + + /** + * Creates a plain object from a SuggestionConfig message. Also converts values to other types if specified. + * @param message SuggestionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestionQueryConfig. */ + interface ISuggestionQueryConfig { + + /** SuggestionQueryConfig knowledgeBaseQuerySource */ + knowledgeBaseQuerySource?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource|null); + + /** SuggestionQueryConfig documentQuerySource */ + documentQuerySource?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource|null); + + /** SuggestionQueryConfig dialogflowQuerySource */ + dialogflowQuerySource?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource|null); + + /** SuggestionQueryConfig maxResults */ + maxResults?: (number|null); + + /** SuggestionQueryConfig confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** SuggestionQueryConfig contextFilterSettings */ + contextFilterSettings?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings|null); + } + + /** Represents a SuggestionQueryConfig. */ + class SuggestionQueryConfig implements ISuggestionQueryConfig { + + /** + * Constructs a new SuggestionQueryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionQueryConfig); + + /** SuggestionQueryConfig knowledgeBaseQuerySource. */ + public knowledgeBaseQuerySource?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource|null); + + /** SuggestionQueryConfig documentQuerySource. */ + public documentQuerySource?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource|null); + + /** SuggestionQueryConfig dialogflowQuerySource. */ + public dialogflowQuerySource?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource|null); + + /** SuggestionQueryConfig maxResults. */ + public maxResults: number; + + /** SuggestionQueryConfig confidenceThreshold. */ + public confidenceThreshold: number; + + /** SuggestionQueryConfig contextFilterSettings. */ + public contextFilterSettings?: (google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings|null); + + /** SuggestionQueryConfig querySource. */ + public querySource?: ("knowledgeBaseQuerySource"|"documentQuerySource"|"dialogflowQuerySource"); + + /** + * Creates a new SuggestionQueryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionQueryConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionQueryConfig): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig; + + /** + * Encodes the specified SuggestionQueryConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.verify|verify} messages. + * @param message SuggestionQueryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionQueryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionQueryConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.verify|verify} messages. + * @param message SuggestionQueryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionQueryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionQueryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig; + + /** + * Decodes a SuggestionQueryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig; + + /** + * Verifies a SuggestionQueryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionQueryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionQueryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig; + + /** + * Creates a plain object from a SuggestionQueryConfig message. Also converts values to other types if specified. + * @param message SuggestionQueryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionQueryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SuggestionQueryConfig { + + /** Properties of a KnowledgeBaseQuerySource. */ + interface IKnowledgeBaseQuerySource { + + /** KnowledgeBaseQuerySource knowledgeBases */ + knowledgeBases?: (string[]|null); + } + + /** Represents a KnowledgeBaseQuerySource. */ + class KnowledgeBaseQuerySource implements IKnowledgeBaseQuerySource { + + /** + * Constructs a new KnowledgeBaseQuerySource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource); + + /** KnowledgeBaseQuerySource knowledgeBases. */ + public knowledgeBases: string[]; + + /** + * Creates a new KnowledgeBaseQuerySource instance using the specified properties. + * @param [properties] Properties to set + * @returns KnowledgeBaseQuerySource instance + */ + public static create(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource; + + /** + * Encodes the specified KnowledgeBaseQuerySource message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.verify|verify} messages. + * @param message KnowledgeBaseQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KnowledgeBaseQuerySource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.verify|verify} messages. + * @param message KnowledgeBaseQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KnowledgeBaseQuerySource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KnowledgeBaseQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource; + + /** + * Decodes a KnowledgeBaseQuerySource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KnowledgeBaseQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource; + + /** + * Verifies a KnowledgeBaseQuerySource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KnowledgeBaseQuerySource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KnowledgeBaseQuerySource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource; + + /** + * Creates a plain object from a KnowledgeBaseQuerySource message. Also converts values to other types if specified. + * @param message KnowledgeBaseQuerySource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KnowledgeBaseQuerySource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DocumentQuerySource. */ + interface IDocumentQuerySource { + + /** DocumentQuerySource documents */ + documents?: (string[]|null); + } + + /** Represents a DocumentQuerySource. */ + class DocumentQuerySource implements IDocumentQuerySource { + + /** + * Constructs a new DocumentQuerySource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource); + + /** DocumentQuerySource documents. */ + public documents: string[]; + + /** + * Creates a new DocumentQuerySource instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentQuerySource instance + */ + public static create(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource; + + /** + * Encodes the specified DocumentQuerySource message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.verify|verify} messages. + * @param message DocumentQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DocumentQuerySource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.verify|verify} messages. + * @param message DocumentQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DocumentQuerySource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource; + + /** + * Decodes a DocumentQuerySource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource; + + /** + * Verifies a DocumentQuerySource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DocumentQuerySource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentQuerySource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource; + + /** + * Creates a plain object from a DocumentQuerySource message. Also converts values to other types if specified. + * @param message DocumentQuerySource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DocumentQuerySource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DialogflowQuerySource. */ + interface IDialogflowQuerySource { + + /** DialogflowQuerySource agent */ + agent?: (string|null); + } + + /** Represents a DialogflowQuerySource. */ + class DialogflowQuerySource implements IDialogflowQuerySource { + + /** + * Constructs a new DialogflowQuerySource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource); + + /** DialogflowQuerySource agent. */ + public agent: string; + + /** + * Creates a new DialogflowQuerySource instance using the specified properties. + * @param [properties] Properties to set + * @returns DialogflowQuerySource instance + */ + public static create(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource; + + /** + * Encodes the specified DialogflowQuerySource message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.verify|verify} messages. + * @param message DialogflowQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DialogflowQuerySource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.verify|verify} messages. + * @param message DialogflowQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DialogflowQuerySource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DialogflowQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource; + + /** + * Decodes a DialogflowQuerySource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DialogflowQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource; + + /** + * Verifies a DialogflowQuerySource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DialogflowQuerySource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DialogflowQuerySource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource; + + /** + * Creates a plain object from a DialogflowQuerySource message. Also converts values to other types if specified. + * @param message DialogflowQuerySource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DialogflowQuerySource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ContextFilterSettings. */ + interface IContextFilterSettings { + + /** ContextFilterSettings dropHandoffMessages */ + dropHandoffMessages?: (boolean|null); + + /** ContextFilterSettings dropVirtualAgentMessages */ + dropVirtualAgentMessages?: (boolean|null); + + /** ContextFilterSettings dropIvrMessages */ + dropIvrMessages?: (boolean|null); + } + + /** Represents a ContextFilterSettings. */ + class ContextFilterSettings implements IContextFilterSettings { + + /** + * Constructs a new ContextFilterSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings); + + /** ContextFilterSettings dropHandoffMessages. */ + public dropHandoffMessages: boolean; + + /** ContextFilterSettings dropVirtualAgentMessages. */ + public dropVirtualAgentMessages: boolean; + + /** ContextFilterSettings dropIvrMessages. */ + public dropIvrMessages: boolean; + + /** + * Creates a new ContextFilterSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ContextFilterSettings instance + */ + public static create(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings; + + /** + * Encodes the specified ContextFilterSettings message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.verify|verify} messages. + * @param message ContextFilterSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ContextFilterSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.verify|verify} messages. + * @param message ContextFilterSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ContextFilterSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContextFilterSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings; + + /** + * Decodes a ContextFilterSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContextFilterSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings; + + /** + * Verifies a ContextFilterSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ContextFilterSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContextFilterSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings; + + /** + * Creates a plain object from a ContextFilterSettings message. Also converts values to other types if specified. + * @param message ContextFilterSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ContextFilterSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ConversationModelConfig. */ + interface IConversationModelConfig { + + /** ConversationModelConfig model */ + model?: (string|null); + } + + /** Represents a ConversationModelConfig. */ + class ConversationModelConfig implements IConversationModelConfig { + + /** + * Constructs a new ConversationModelConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IConversationModelConfig); + + /** ConversationModelConfig model. */ + public model: string; + + /** + * Creates a new ConversationModelConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationModelConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IConversationModelConfig): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig; + + /** + * Encodes the specified ConversationModelConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.verify|verify} messages. + * @param message ConversationModelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IConversationModelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConversationModelConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.verify|verify} messages. + * @param message ConversationModelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IConversationModelConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ConversationModelConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig; + + /** + * Decodes a ConversationModelConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig; + + /** + * Verifies a ConversationModelConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ConversationModelConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationModelConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig; + + /** + * Creates a plain object from a ConversationModelConfig message. Also converts values to other types if specified. + * @param message ConversationModelConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ConversationModelConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MessageAnalysisConfig. */ + interface IMessageAnalysisConfig { + + /** MessageAnalysisConfig enableEntityExtraction */ + enableEntityExtraction?: (boolean|null); + + /** MessageAnalysisConfig enableSentimentAnalysis */ + enableSentimentAnalysis?: (boolean|null); + } + + /** Represents a MessageAnalysisConfig. */ + class MessageAnalysisConfig implements IMessageAnalysisConfig { + + /** + * Constructs a new MessageAnalysisConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IMessageAnalysisConfig); + + /** MessageAnalysisConfig enableEntityExtraction. */ + public enableEntityExtraction: boolean; + + /** MessageAnalysisConfig enableSentimentAnalysis. */ + public enableSentimentAnalysis: boolean; + + /** + * Creates a new MessageAnalysisConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageAnalysisConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IMessageAnalysisConfig): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig; + + /** + * Encodes the specified MessageAnalysisConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig.verify|verify} messages. + * @param message MessageAnalysisConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IMessageAnalysisConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageAnalysisConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig.verify|verify} messages. + * @param message MessageAnalysisConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IMessageAnalysisConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageAnalysisConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageAnalysisConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig; + + /** + * Decodes a MessageAnalysisConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageAnalysisConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig; + + /** + * Verifies a MessageAnalysisConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageAnalysisConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageAnalysisConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig; + + /** + * Creates a plain object from a MessageAnalysisConfig message. Also converts values to other types if specified. + * @param message MessageAnalysisConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageAnalysisConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a HumanAgentHandoffConfig. */ + interface IHumanAgentHandoffConfig { + + /** HumanAgentHandoffConfig livePersonConfig */ + livePersonConfig?: (google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ILivePersonConfig|null); + + /** HumanAgentHandoffConfig salesforceLiveAgentConfig */ + salesforceLiveAgentConfig?: (google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig|null); + } + + /** Represents a HumanAgentHandoffConfig. */ + class HumanAgentHandoffConfig implements IHumanAgentHandoffConfig { + + /** + * Constructs a new HumanAgentHandoffConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IHumanAgentHandoffConfig); + + /** HumanAgentHandoffConfig livePersonConfig. */ + public livePersonConfig?: (google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ILivePersonConfig|null); + + /** HumanAgentHandoffConfig salesforceLiveAgentConfig. */ + public salesforceLiveAgentConfig?: (google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig|null); + + /** HumanAgentHandoffConfig agentService. */ + public agentService?: ("livePersonConfig"|"salesforceLiveAgentConfig"); + + /** + * Creates a new HumanAgentHandoffConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns HumanAgentHandoffConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IHumanAgentHandoffConfig): google.cloud.dialogflow.v2.HumanAgentHandoffConfig; + + /** + * Encodes the specified HumanAgentHandoffConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentHandoffConfig.verify|verify} messages. + * @param message HumanAgentHandoffConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IHumanAgentHandoffConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HumanAgentHandoffConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentHandoffConfig.verify|verify} messages. + * @param message HumanAgentHandoffConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IHumanAgentHandoffConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HumanAgentHandoffConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HumanAgentHandoffConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentHandoffConfig; + + /** + * Decodes a HumanAgentHandoffConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HumanAgentHandoffConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentHandoffConfig; + + /** + * Verifies a HumanAgentHandoffConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HumanAgentHandoffConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HumanAgentHandoffConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentHandoffConfig; + + /** + * Creates a plain object from a HumanAgentHandoffConfig message. Also converts values to other types if specified. + * @param message HumanAgentHandoffConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentHandoffConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HumanAgentHandoffConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HumanAgentHandoffConfig { + + /** Properties of a LivePersonConfig. */ + interface ILivePersonConfig { + + /** LivePersonConfig accountNumber */ + accountNumber?: (string|null); + } + + /** Represents a LivePersonConfig. */ + class LivePersonConfig implements ILivePersonConfig { + + /** + * Constructs a new LivePersonConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ILivePersonConfig); + + /** LivePersonConfig accountNumber. */ + public accountNumber: string; + + /** + * Creates a new LivePersonConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LivePersonConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ILivePersonConfig): google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig; + + /** + * Encodes the specified LivePersonConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig.verify|verify} messages. + * @param message LivePersonConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ILivePersonConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LivePersonConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig.verify|verify} messages. + * @param message LivePersonConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ILivePersonConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LivePersonConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LivePersonConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig; + + /** + * Decodes a LivePersonConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LivePersonConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig; + + /** + * Verifies a LivePersonConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LivePersonConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LivePersonConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig; + + /** + * Creates a plain object from a LivePersonConfig message. Also converts values to other types if specified. + * @param message LivePersonConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LivePersonConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SalesforceLiveAgentConfig. */ + interface ISalesforceLiveAgentConfig { + + /** SalesforceLiveAgentConfig organizationId */ + organizationId?: (string|null); + + /** SalesforceLiveAgentConfig deploymentId */ + deploymentId?: (string|null); + + /** SalesforceLiveAgentConfig buttonId */ + buttonId?: (string|null); + + /** SalesforceLiveAgentConfig endpointDomain */ + endpointDomain?: (string|null); + } + + /** Represents a SalesforceLiveAgentConfig. */ + class SalesforceLiveAgentConfig implements ISalesforceLiveAgentConfig { + + /** + * Constructs a new SalesforceLiveAgentConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig); + + /** SalesforceLiveAgentConfig organizationId. */ + public organizationId: string; + + /** SalesforceLiveAgentConfig deploymentId. */ + public deploymentId: string; + + /** SalesforceLiveAgentConfig buttonId. */ + public buttonId: string; + + /** SalesforceLiveAgentConfig endpointDomain. */ + public endpointDomain: string; + + /** + * Creates a new SalesforceLiveAgentConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SalesforceLiveAgentConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig): google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig; + + /** + * Encodes the specified SalesforceLiveAgentConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.verify|verify} messages. + * @param message SalesforceLiveAgentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SalesforceLiveAgentConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.verify|verify} messages. + * @param message SalesforceLiveAgentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SalesforceLiveAgentConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SalesforceLiveAgentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig; + + /** + * Decodes a SalesforceLiveAgentConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SalesforceLiveAgentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig; + + /** + * Verifies a SalesforceLiveAgentConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SalesforceLiveAgentConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SalesforceLiveAgentConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig; + + /** + * Creates a plain object from a SalesforceLiveAgentConfig message. Also converts values to other types if specified. + * @param message SalesforceLiveAgentConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SalesforceLiveAgentConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a NotificationConfig. */ + interface INotificationConfig { + + /** NotificationConfig topic */ + topic?: (string|null); + + /** NotificationConfig messageFormat */ + messageFormat?: (google.cloud.dialogflow.v2.NotificationConfig.MessageFormat|keyof typeof google.cloud.dialogflow.v2.NotificationConfig.MessageFormat|null); + } + + /** Represents a NotificationConfig. */ + class NotificationConfig implements INotificationConfig { + + /** + * Constructs a new NotificationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.INotificationConfig); + + /** NotificationConfig topic. */ + public topic: string; + + /** NotificationConfig messageFormat. */ + public messageFormat: (google.cloud.dialogflow.v2.NotificationConfig.MessageFormat|keyof typeof google.cloud.dialogflow.v2.NotificationConfig.MessageFormat); + + /** + * Creates a new NotificationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.INotificationConfig): google.cloud.dialogflow.v2.NotificationConfig; + + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.NotificationConfig; + + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.NotificationConfig; + + /** + * Verifies a NotificationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.NotificationConfig; + + /** + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @param message NotificationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.NotificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NotificationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace NotificationConfig { + + /** MessageFormat enum. */ + enum MessageFormat { + MESSAGE_FORMAT_UNSPECIFIED = 0, + PROTO = 1, + JSON = 2 + } + } + + /** Properties of a LoggingConfig. */ + interface ILoggingConfig { + + /** LoggingConfig enableStackdriverLogging */ + enableStackdriverLogging?: (boolean|null); + } + + /** Represents a LoggingConfig. */ + class LoggingConfig implements ILoggingConfig { + + /** + * Constructs a new LoggingConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.ILoggingConfig); + + /** LoggingConfig enableStackdriverLogging. */ + public enableStackdriverLogging: boolean; + + /** + * Creates a new LoggingConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LoggingConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2.ILoggingConfig): google.cloud.dialogflow.v2.LoggingConfig; + + /** + * Encodes the specified LoggingConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.LoggingConfig.verify|verify} messages. + * @param message LoggingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.LoggingConfig.verify|verify} messages. + * @param message LoggingConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.LoggingConfig; + + /** + * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.LoggingConfig; + + /** + * Verifies a LoggingConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LoggingConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.LoggingConfig; + + /** + * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. + * @param message LoggingConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.LoggingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LoggingConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestionFeature. */ + interface ISuggestionFeature { + + /** SuggestionFeature type */ + type?: (google.cloud.dialogflow.v2.SuggestionFeature.Type|keyof typeof google.cloud.dialogflow.v2.SuggestionFeature.Type|null); + } + + /** Represents a SuggestionFeature. */ + class SuggestionFeature implements ISuggestionFeature { + + /** + * Constructs a new SuggestionFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.ISuggestionFeature); + + /** SuggestionFeature type. */ + public type: (google.cloud.dialogflow.v2.SuggestionFeature.Type|keyof typeof google.cloud.dialogflow.v2.SuggestionFeature.Type); + + /** + * Creates a new SuggestionFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionFeature instance + */ + public static create(properties?: google.cloud.dialogflow.v2.ISuggestionFeature): google.cloud.dialogflow.v2.SuggestionFeature; + + /** + * Encodes the specified SuggestionFeature message. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestionFeature.verify|verify} messages. + * @param message SuggestionFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.ISuggestionFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionFeature message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestionFeature.verify|verify} messages. + * @param message SuggestionFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.ISuggestionFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.SuggestionFeature; + + /** + * Decodes a SuggestionFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.SuggestionFeature; + + /** + * Verifies a SuggestionFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionFeature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.SuggestionFeature; + + /** + * Creates a plain object from a SuggestionFeature message. Also converts values to other types if specified. + * @param message SuggestionFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.SuggestionFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SuggestionFeature { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ARTICLE_SUGGESTION = 1, + FAQ = 2 + } + } + + /** Represents a Documents */ + class Documents extends $protobuf.rpc.Service { + + /** + * Constructs a new Documents service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Documents service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Documents; + + /** + * Calls ListDocuments. + * @param request ListDocumentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDocumentsResponse + */ + public listDocuments(request: google.cloud.dialogflow.v2.IListDocumentsRequest, callback: google.cloud.dialogflow.v2.Documents.ListDocumentsCallback): void; + + /** + * Calls ListDocuments. + * @param request ListDocumentsRequest message or plain object + * @returns Promise + */ + public listDocuments(request: google.cloud.dialogflow.v2.IListDocumentsRequest): Promise; + + /** + * Calls GetDocument. + * @param request GetDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Document + */ + public getDocument(request: google.cloud.dialogflow.v2.IGetDocumentRequest, callback: google.cloud.dialogflow.v2.Documents.GetDocumentCallback): void; + + /** + * Calls GetDocument. + * @param request GetDocumentRequest message or plain object + * @returns Promise + */ + public getDocument(request: google.cloud.dialogflow.v2.IGetDocumentRequest): Promise; + + /** + * Calls CreateDocument. + * @param request CreateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createDocument(request: google.cloud.dialogflow.v2.ICreateDocumentRequest, callback: google.cloud.dialogflow.v2.Documents.CreateDocumentCallback): void; + + /** + * Calls CreateDocument. + * @param request CreateDocumentRequest message or plain object + * @returns Promise + */ + public createDocument(request: google.cloud.dialogflow.v2.ICreateDocumentRequest): Promise; + + /** + * Calls DeleteDocument. + * @param request DeleteDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteDocument(request: google.cloud.dialogflow.v2.IDeleteDocumentRequest, callback: google.cloud.dialogflow.v2.Documents.DeleteDocumentCallback): void; + + /** + * Calls DeleteDocument. + * @param request DeleteDocumentRequest message or plain object + * @returns Promise + */ + public deleteDocument(request: google.cloud.dialogflow.v2.IDeleteDocumentRequest): Promise; + + /** + * Calls UpdateDocument. + * @param request UpdateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDocument(request: google.cloud.dialogflow.v2.IUpdateDocumentRequest, callback: google.cloud.dialogflow.v2.Documents.UpdateDocumentCallback): void; + + /** + * Calls UpdateDocument. + * @param request UpdateDocumentRequest message or plain object + * @returns Promise + */ + public updateDocument(request: google.cloud.dialogflow.v2.IUpdateDocumentRequest): Promise; + + /** + * Calls ReloadDocument. + * @param request ReloadDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public reloadDocument(request: google.cloud.dialogflow.v2.IReloadDocumentRequest, callback: google.cloud.dialogflow.v2.Documents.ReloadDocumentCallback): void; + + /** + * Calls ReloadDocument. + * @param request ReloadDocumentRequest message or plain object + * @returns Promise + */ + public reloadDocument(request: google.cloud.dialogflow.v2.IReloadDocumentRequest): Promise; + } + + namespace Documents { + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Documents#listDocuments}. + * @param error Error, if any + * @param [response] ListDocumentsResponse + */ + type ListDocumentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListDocumentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Documents#getDocument}. + * @param error Error, if any + * @param [response] Document + */ + type GetDocumentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.Document) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Documents#createDocument}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Documents#deleteDocument}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Documents#updateDocument}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Documents#reloadDocument}. + * @param error Error, if any + * @param [response] Operation + */ + type ReloadDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a Document. */ + interface IDocument { + + /** Document name */ + name?: (string|null); + + /** Document displayName */ + displayName?: (string|null); + + /** Document mimeType */ + mimeType?: (string|null); + + /** Document knowledgeTypes */ + knowledgeTypes?: (google.cloud.dialogflow.v2.Document.KnowledgeType[]|null); + + /** Document contentUri */ + contentUri?: (string|null); + + /** Document rawContent */ + rawContent?: (Uint8Array|string|null); + + /** Document enableAutoReload */ + enableAutoReload?: (boolean|null); + + /** Document latestReloadStatus */ + latestReloadStatus?: (google.cloud.dialogflow.v2.Document.IReloadStatus|null); + + /** Document metadata */ + metadata?: ({ [k: string]: string }|null); + } + + /** Represents a Document. */ + class Document implements IDocument { + + /** + * Constructs a new Document. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IDocument); + + /** Document name. */ + public name: string; + + /** Document displayName. */ + public displayName: string; + + /** Document mimeType. */ + public mimeType: string; + + /** Document knowledgeTypes. */ + public knowledgeTypes: google.cloud.dialogflow.v2.Document.KnowledgeType[]; + + /** Document contentUri. */ + public contentUri: string; + + /** Document rawContent. */ + public rawContent: (Uint8Array|string); + + /** Document enableAutoReload. */ + public enableAutoReload: boolean; + + /** Document latestReloadStatus. */ + public latestReloadStatus?: (google.cloud.dialogflow.v2.Document.IReloadStatus|null); + + /** Document metadata. */ + public metadata: { [k: string]: string }; + + /** Document source. */ + public source?: ("contentUri"|"rawContent"); + + /** + * Creates a new Document instance using the specified properties. + * @param [properties] Properties to set + * @returns Document instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IDocument): google.cloud.dialogflow.v2.Document; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.dialogflow.v2.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Document.verify|verify} messages. + * @param message Document message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Document message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Document; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Document; + + /** + * Verifies a Document message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Document + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Document; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Document to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Document { + + /** Properties of a ReloadStatus. */ + interface IReloadStatus { + + /** ReloadStatus time */ + time?: (google.protobuf.ITimestamp|null); + + /** ReloadStatus status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents a ReloadStatus. */ + class ReloadStatus implements IReloadStatus { + + /** + * Constructs a new ReloadStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.Document.IReloadStatus); + + /** ReloadStatus time. */ + public time?: (google.protobuf.ITimestamp|null); + + /** ReloadStatus status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new ReloadStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ReloadStatus instance + */ + public static create(properties?: google.cloud.dialogflow.v2.Document.IReloadStatus): google.cloud.dialogflow.v2.Document.ReloadStatus; + + /** + * Encodes the specified ReloadStatus message. Does not implicitly {@link google.cloud.dialogflow.v2.Document.ReloadStatus.verify|verify} messages. + * @param message ReloadStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.Document.IReloadStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReloadStatus message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Document.ReloadStatus.verify|verify} messages. + * @param message ReloadStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.Document.IReloadStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReloadStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReloadStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Document.ReloadStatus; + + /** + * Decodes a ReloadStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReloadStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Document.ReloadStatus; + + /** + * Verifies a ReloadStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReloadStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReloadStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Document.ReloadStatus; + + /** + * Creates a plain object from a ReloadStatus message. Also converts values to other types if specified. + * @param message ReloadStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Document.ReloadStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReloadStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** KnowledgeType enum. */ + enum KnowledgeType { + KNOWLEDGE_TYPE_UNSPECIFIED = 0, + FAQ = 1, + EXTRACTIVE_QA = 2, + ARTICLE_SUGGESTION = 3 + } + } + + /** Properties of a GetDocumentRequest. */ + interface IGetDocumentRequest { + + /** GetDocumentRequest name */ + name?: (string|null); + } + + /** Represents a GetDocumentRequest. */ + class GetDocumentRequest implements IGetDocumentRequest { + + /** + * Constructs a new GetDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IGetDocumentRequest); + + /** GetDocumentRequest name. */ + public name: string; + + /** + * Creates a new GetDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDocumentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IGetDocumentRequest): google.cloud.dialogflow.v2.GetDocumentRequest; + + /** + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetDocumentRequest.verify|verify} messages. + * @param message GetDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetDocumentRequest.verify|verify} messages. + * @param message GetDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetDocumentRequest; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetDocumentRequest; + + /** + * Verifies a GetDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetDocumentRequest; + + /** + * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. + * @param message GetDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.GetDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListDocumentsRequest. */ + interface IListDocumentsRequest { + + /** ListDocumentsRequest parent */ + parent?: (string|null); + + /** ListDocumentsRequest pageSize */ + pageSize?: (number|null); + + /** ListDocumentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListDocumentsRequest. */ + class ListDocumentsRequest implements IListDocumentsRequest { + + /** + * Constructs a new ListDocumentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListDocumentsRequest); + + /** ListDocumentsRequest parent. */ + public parent: string; + + /** ListDocumentsRequest pageSize. */ + public pageSize: number; + + /** ListDocumentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListDocumentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDocumentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListDocumentsRequest): google.cloud.dialogflow.v2.ListDocumentsRequest; + + /** + * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListDocumentsRequest.verify|verify} messages. + * @param message ListDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListDocumentsRequest.verify|verify} messages. + * @param message ListDocumentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListDocumentsRequest; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListDocumentsRequest; + + /** + * Verifies a ListDocumentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDocumentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListDocumentsRequest; + + /** + * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. + * @param message ListDocumentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDocumentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListDocumentsResponse. */ + interface IListDocumentsResponse { + + /** ListDocumentsResponse documents */ + documents?: (google.cloud.dialogflow.v2.IDocument[]|null); + + /** ListDocumentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListDocumentsResponse. */ + class ListDocumentsResponse implements IListDocumentsResponse { + + /** + * Constructs a new ListDocumentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListDocumentsResponse); + + /** ListDocumentsResponse documents. */ + public documents: google.cloud.dialogflow.v2.IDocument[]; + + /** ListDocumentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListDocumentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDocumentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListDocumentsResponse): google.cloud.dialogflow.v2.ListDocumentsResponse; + + /** + * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListDocumentsResponse.verify|verify} messages. + * @param message ListDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListDocumentsResponse.verify|verify} messages. + * @param message ListDocumentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListDocumentsResponse; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListDocumentsResponse; + + /** + * Verifies a ListDocumentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDocumentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListDocumentsResponse; + + /** + * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. + * @param message ListDocumentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDocumentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateDocumentRequest. */ + interface ICreateDocumentRequest { + + /** CreateDocumentRequest parent */ + parent?: (string|null); + + /** CreateDocumentRequest document */ + document?: (google.cloud.dialogflow.v2.IDocument|null); + } + + /** Represents a CreateDocumentRequest. */ + class CreateDocumentRequest implements ICreateDocumentRequest { + + /** + * Constructs a new CreateDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.ICreateDocumentRequest); + + /** CreateDocumentRequest parent. */ + public parent: string; + + /** CreateDocumentRequest document. */ + public document?: (google.cloud.dialogflow.v2.IDocument|null); + + /** + * Creates a new CreateDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDocumentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.ICreateDocumentRequest): google.cloud.dialogflow.v2.CreateDocumentRequest; + + /** + * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateDocumentRequest.verify|verify} messages. + * @param message CreateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateDocumentRequest.verify|verify} messages. + * @param message CreateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateDocumentRequest; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateDocumentRequest; + + /** + * Verifies a CreateDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateDocumentRequest; + + /** + * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. + * @param message CreateDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.CreateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteDocumentRequest. */ + interface IDeleteDocumentRequest { + + /** DeleteDocumentRequest name */ + name?: (string|null); + } + + /** Represents a DeleteDocumentRequest. */ + class DeleteDocumentRequest implements IDeleteDocumentRequest { + + /** + * Constructs a new DeleteDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IDeleteDocumentRequest); + + /** DeleteDocumentRequest name. */ + public name: string; + + /** + * Creates a new DeleteDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteDocumentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IDeleteDocumentRequest): google.cloud.dialogflow.v2.DeleteDocumentRequest; + + /** + * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteDocumentRequest.verify|verify} messages. + * @param message DeleteDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteDocumentRequest.verify|verify} messages. + * @param message DeleteDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteDocumentRequest; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteDocumentRequest; + + /** + * Verifies a DeleteDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteDocumentRequest; + + /** + * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. + * @param message DeleteDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.DeleteDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateDocumentRequest. */ + interface IUpdateDocumentRequest { + + /** UpdateDocumentRequest document */ + document?: (google.cloud.dialogflow.v2.IDocument|null); + + /** UpdateDocumentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateDocumentRequest. */ + class UpdateDocumentRequest implements IUpdateDocumentRequest { + + /** + * Constructs a new UpdateDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IUpdateDocumentRequest); + + /** UpdateDocumentRequest document. */ + public document?: (google.cloud.dialogflow.v2.IDocument|null); + + /** UpdateDocumentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDocumentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IUpdateDocumentRequest): google.cloud.dialogflow.v2.UpdateDocumentRequest; + + /** + * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateDocumentRequest.verify|verify} messages. + * @param message UpdateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateDocumentRequest.verify|verify} messages. + * @param message UpdateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateDocumentRequest; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateDocumentRequest; + + /** + * Verifies an UpdateDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateDocumentRequest; + + /** + * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. + * @param message UpdateDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.UpdateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReloadDocumentRequest. */ + interface IReloadDocumentRequest { + + /** ReloadDocumentRequest name */ + name?: (string|null); + + /** ReloadDocumentRequest contentUri */ + contentUri?: (string|null); + } + + /** Represents a ReloadDocumentRequest. */ + class ReloadDocumentRequest implements IReloadDocumentRequest { + + /** + * Constructs a new ReloadDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IReloadDocumentRequest); + + /** ReloadDocumentRequest name. */ + public name: string; + + /** ReloadDocumentRequest contentUri. */ + public contentUri: string; + + /** ReloadDocumentRequest source. */ + public source?: "contentUri"; + + /** + * Creates a new ReloadDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ReloadDocumentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IReloadDocumentRequest): google.cloud.dialogflow.v2.ReloadDocumentRequest; + + /** + * Encodes the specified ReloadDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ReloadDocumentRequest.verify|verify} messages. + * @param message ReloadDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IReloadDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReloadDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ReloadDocumentRequest.verify|verify} messages. + * @param message ReloadDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IReloadDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReloadDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReloadDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ReloadDocumentRequest; + + /** + * Decodes a ReloadDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReloadDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ReloadDocumentRequest; + + /** + * Verifies a ReloadDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReloadDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReloadDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ReloadDocumentRequest; + + /** + * Creates a plain object from a ReloadDocumentRequest message. Also converts values to other types if specified. + * @param message ReloadDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ReloadDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReloadDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a KnowledgeOperationMetadata. */ + interface IKnowledgeOperationMetadata { + + /** KnowledgeOperationMetadata state */ + state?: (google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State|keyof typeof google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State|null); + } + + /** Represents a KnowledgeOperationMetadata. */ + class KnowledgeOperationMetadata implements IKnowledgeOperationMetadata { + + /** + * Constructs a new KnowledgeOperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IKnowledgeOperationMetadata); + + /** KnowledgeOperationMetadata state. */ + public state: (google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State|keyof typeof google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State); + + /** + * Creates a new KnowledgeOperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns KnowledgeOperationMetadata instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IKnowledgeOperationMetadata): google.cloud.dialogflow.v2.KnowledgeOperationMetadata; + + /** + * Encodes the specified KnowledgeOperationMetadata message. Does not implicitly {@link google.cloud.dialogflow.v2.KnowledgeOperationMetadata.verify|verify} messages. + * @param message KnowledgeOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IKnowledgeOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KnowledgeOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.KnowledgeOperationMetadata.verify|verify} messages. + * @param message KnowledgeOperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IKnowledgeOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KnowledgeOperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KnowledgeOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.KnowledgeOperationMetadata; + + /** + * Decodes a KnowledgeOperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KnowledgeOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.KnowledgeOperationMetadata; + + /** + * Verifies a KnowledgeOperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KnowledgeOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KnowledgeOperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.KnowledgeOperationMetadata; + + /** + * Creates a plain object from a KnowledgeOperationMetadata message. Also converts values to other types if specified. + * @param message KnowledgeOperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.KnowledgeOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KnowledgeOperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace KnowledgeOperationMetadata { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + RUNNING = 2, + DONE = 3 + } + } + + /** Represents an Environments */ + class Environments extends $protobuf.rpc.Service { + + /** + * Constructs a new Environments service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Environments service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Environments; + + /** + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + */ + public listEnvironments(request: google.cloud.dialogflow.v2.IListEnvironmentsRequest, callback: google.cloud.dialogflow.v2.Environments.ListEnvironmentsCallback): void; + + /** + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @returns Promise + */ + public listEnvironments(request: google.cloud.dialogflow.v2.IListEnvironmentsRequest): Promise; + } + + namespace Environments { + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Environments#listEnvironments}. + * @param error Error, if any + * @param [response] ListEnvironmentsResponse + */ + type ListEnvironmentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListEnvironmentsResponse) => void; + } + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment name */ + name?: (string|null); + + /** Environment description */ + description?: (string|null); + + /** Environment agentVersion */ + agentVersion?: (string|null); + + /** Environment state */ + state?: (google.cloud.dialogflow.v2.Environment.State|keyof typeof google.cloud.dialogflow.v2.Environment.State|null); + + /** Environment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Environment. */ + class Environment implements IEnvironment { + + /** + * Constructs a new Environment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IEnvironment); + + /** Environment name. */ + public name: string; + + /** Environment description. */ + public description: string; + + /** Environment agentVersion. */ + public agentVersion: string; + + /** Environment state. */ + public state: (google.cloud.dialogflow.v2.Environment.State|keyof typeof google.cloud.dialogflow.v2.Environment.State); + + /** Environment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Environment instance using the specified properties. + * @param [properties] Properties to set + * @returns Environment instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IEnvironment): google.cloud.dialogflow.v2.Environment; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dialogflow.v2.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.Environment; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.Environment; + + /** + * Verifies an Environment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Environment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.Environment; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Environment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Environment { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + STOPPED = 1, + LOADING = 2, + RUNNING = 3 + } + } + + /** Properties of a ListEnvironmentsRequest. */ + interface IListEnvironmentsRequest { + + /** ListEnvironmentsRequest parent */ + parent?: (string|null); + + /** ListEnvironmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListEnvironmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEnvironmentsRequest. */ + class ListEnvironmentsRequest implements IListEnvironmentsRequest { + + /** + * Constructs a new ListEnvironmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListEnvironmentsRequest); + + /** ListEnvironmentsRequest parent. */ + public parent: string; + + /** ListEnvironmentsRequest pageSize. */ + public pageSize: number; + + /** ListEnvironmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEnvironmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEnvironmentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListEnvironmentsRequest): google.cloud.dialogflow.v2.ListEnvironmentsRequest; + + /** + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListEnvironmentsRequest; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListEnvironmentsRequest; + + /** + * Verifies a ListEnvironmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEnvironmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListEnvironmentsRequest; + + /** + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * @param message ListEnvironmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListEnvironmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEnvironmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListEnvironmentsResponse. */ + interface IListEnvironmentsResponse { + + /** ListEnvironmentsResponse environments */ + environments?: (google.cloud.dialogflow.v2.IEnvironment[]|null); + + /** ListEnvironmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEnvironmentsResponse. */ + class ListEnvironmentsResponse implements IListEnvironmentsResponse { + + /** + * Constructs a new ListEnvironmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListEnvironmentsResponse); + + /** ListEnvironmentsResponse environments. */ + public environments: google.cloud.dialogflow.v2.IEnvironment[]; + + /** ListEnvironmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEnvironmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEnvironmentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListEnvironmentsResponse): google.cloud.dialogflow.v2.ListEnvironmentsResponse; + + /** + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListEnvironmentsResponse; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListEnvironmentsResponse; + + /** + * Verifies a ListEnvironmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEnvironmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListEnvironmentsResponse; + + /** + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @param message ListEnvironmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListEnvironmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEnvironmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a HumanAgentAssistantEvent. */ + interface IHumanAgentAssistantEvent { + + /** HumanAgentAssistantEvent conversation */ + conversation?: (string|null); + + /** HumanAgentAssistantEvent participant */ + participant?: (string|null); + + /** HumanAgentAssistantEvent suggestionResults */ + suggestionResults?: (google.cloud.dialogflow.v2.ISuggestionResult[]|null); + } + + /** Represents a HumanAgentAssistantEvent. */ + class HumanAgentAssistantEvent implements IHumanAgentAssistantEvent { + + /** + * Constructs a new HumanAgentAssistantEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IHumanAgentAssistantEvent); + + /** HumanAgentAssistantEvent conversation. */ + public conversation: string; + + /** HumanAgentAssistantEvent participant. */ + public participant: string; + + /** HumanAgentAssistantEvent suggestionResults. */ + public suggestionResults: google.cloud.dialogflow.v2.ISuggestionResult[]; + + /** + * Creates a new HumanAgentAssistantEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns HumanAgentAssistantEvent instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IHumanAgentAssistantEvent): google.cloud.dialogflow.v2.HumanAgentAssistantEvent; + + /** + * Encodes the specified HumanAgentAssistantEvent message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantEvent.verify|verify} messages. + * @param message HumanAgentAssistantEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IHumanAgentAssistantEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HumanAgentAssistantEvent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantEvent.verify|verify} messages. + * @param message HumanAgentAssistantEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IHumanAgentAssistantEvent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HumanAgentAssistantEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HumanAgentAssistantEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.HumanAgentAssistantEvent; + + /** + * Decodes a HumanAgentAssistantEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HumanAgentAssistantEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.HumanAgentAssistantEvent; + + /** + * Verifies a HumanAgentAssistantEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HumanAgentAssistantEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HumanAgentAssistantEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.HumanAgentAssistantEvent; + + /** + * Creates a plain object from a HumanAgentAssistantEvent message. Also converts values to other types if specified. + * @param message HumanAgentAssistantEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.HumanAgentAssistantEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HumanAgentAssistantEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents a KnowledgeBases */ + class KnowledgeBases extends $protobuf.rpc.Service { + + /** + * Constructs a new KnowledgeBases service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new KnowledgeBases service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): KnowledgeBases; + + /** + * Calls ListKnowledgeBases. + * @param request ListKnowledgeBasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListKnowledgeBasesResponse + */ + public listKnowledgeBases(request: google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, callback: google.cloud.dialogflow.v2.KnowledgeBases.ListKnowledgeBasesCallback): void; + + /** + * Calls ListKnowledgeBases. + * @param request ListKnowledgeBasesRequest message or plain object + * @returns Promise + */ + public listKnowledgeBases(request: google.cloud.dialogflow.v2.IListKnowledgeBasesRequest): Promise; + + /** + * Calls GetKnowledgeBase. + * @param request GetKnowledgeBaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and KnowledgeBase + */ + public getKnowledgeBase(request: google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest, callback: google.cloud.dialogflow.v2.KnowledgeBases.GetKnowledgeBaseCallback): void; + + /** + * Calls GetKnowledgeBase. + * @param request GetKnowledgeBaseRequest message or plain object + * @returns Promise + */ + public getKnowledgeBase(request: google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest): Promise; + + /** + * Calls CreateKnowledgeBase. + * @param request CreateKnowledgeBaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and KnowledgeBase + */ + public createKnowledgeBase(request: google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest, callback: google.cloud.dialogflow.v2.KnowledgeBases.CreateKnowledgeBaseCallback): void; + + /** + * Calls CreateKnowledgeBase. + * @param request CreateKnowledgeBaseRequest message or plain object + * @returns Promise + */ + public createKnowledgeBase(request: google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest): Promise; + + /** + * Calls DeleteKnowledgeBase. + * @param request DeleteKnowledgeBaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteKnowledgeBase(request: google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest, callback: google.cloud.dialogflow.v2.KnowledgeBases.DeleteKnowledgeBaseCallback): void; + + /** + * Calls DeleteKnowledgeBase. + * @param request DeleteKnowledgeBaseRequest message or plain object + * @returns Promise + */ + public deleteKnowledgeBase(request: google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest): Promise; + + /** + * Calls UpdateKnowledgeBase. + * @param request UpdateKnowledgeBaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and KnowledgeBase + */ + public updateKnowledgeBase(request: google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest, callback: google.cloud.dialogflow.v2.KnowledgeBases.UpdateKnowledgeBaseCallback): void; + + /** + * Calls UpdateKnowledgeBase. + * @param request UpdateKnowledgeBaseRequest message or plain object + * @returns Promise + */ + public updateKnowledgeBase(request: google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest): Promise; + } + + namespace KnowledgeBases { + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.KnowledgeBases#listKnowledgeBases}. + * @param error Error, if any + * @param [response] ListKnowledgeBasesResponse + */ + type ListKnowledgeBasesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.ListKnowledgeBasesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.KnowledgeBases#getKnowledgeBase}. + * @param error Error, if any + * @param [response] KnowledgeBase + */ + type GetKnowledgeBaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.KnowledgeBase) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.KnowledgeBases#createKnowledgeBase}. + * @param error Error, if any + * @param [response] KnowledgeBase + */ + type CreateKnowledgeBaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.KnowledgeBase) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.KnowledgeBases#deleteKnowledgeBase}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteKnowledgeBaseCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.KnowledgeBases#updateKnowledgeBase}. + * @param error Error, if any + * @param [response] KnowledgeBase + */ + type UpdateKnowledgeBaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2.KnowledgeBase) => void; + } + + /** Properties of a KnowledgeBase. */ + interface IKnowledgeBase { + + /** KnowledgeBase name */ + name?: (string|null); + + /** KnowledgeBase displayName */ + displayName?: (string|null); + + /** KnowledgeBase languageCode */ + languageCode?: (string|null); + } + + /** Represents a KnowledgeBase. */ + class KnowledgeBase implements IKnowledgeBase { + + /** + * Constructs a new KnowledgeBase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IKnowledgeBase); + + /** KnowledgeBase name. */ + public name: string; + + /** KnowledgeBase displayName. */ + public displayName: string; + + /** KnowledgeBase languageCode. */ + public languageCode: string; + + /** + * Creates a new KnowledgeBase instance using the specified properties. + * @param [properties] Properties to set + * @returns KnowledgeBase instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IKnowledgeBase): google.cloud.dialogflow.v2.KnowledgeBase; + + /** + * Encodes the specified KnowledgeBase message. Does not implicitly {@link google.cloud.dialogflow.v2.KnowledgeBase.verify|verify} messages. + * @param message KnowledgeBase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IKnowledgeBase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KnowledgeBase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.KnowledgeBase.verify|verify} messages. + * @param message KnowledgeBase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IKnowledgeBase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KnowledgeBase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KnowledgeBase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.KnowledgeBase; + + /** + * Decodes a KnowledgeBase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KnowledgeBase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.KnowledgeBase; + + /** + * Verifies a KnowledgeBase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KnowledgeBase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KnowledgeBase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.KnowledgeBase; + + /** + * Creates a plain object from a KnowledgeBase message. Also converts values to other types if specified. + * @param message KnowledgeBase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.KnowledgeBase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KnowledgeBase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListKnowledgeBasesRequest. */ + interface IListKnowledgeBasesRequest { + + /** ListKnowledgeBasesRequest parent */ + parent?: (string|null); + + /** ListKnowledgeBasesRequest pageSize */ + pageSize?: (number|null); + + /** ListKnowledgeBasesRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListKnowledgeBasesRequest. */ + class ListKnowledgeBasesRequest implements IListKnowledgeBasesRequest { + + /** + * Constructs a new ListKnowledgeBasesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListKnowledgeBasesRequest); + + /** ListKnowledgeBasesRequest parent. */ + public parent: string; + + /** ListKnowledgeBasesRequest pageSize. */ + public pageSize: number; + + /** ListKnowledgeBasesRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListKnowledgeBasesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListKnowledgeBasesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListKnowledgeBasesRequest): google.cloud.dialogflow.v2.ListKnowledgeBasesRequest; + + /** + * Encodes the specified ListKnowledgeBasesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListKnowledgeBasesRequest.verify|verify} messages. + * @param message ListKnowledgeBasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListKnowledgeBasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListKnowledgeBasesRequest.verify|verify} messages. + * @param message ListKnowledgeBasesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListKnowledgeBasesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListKnowledgeBasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListKnowledgeBasesRequest; + + /** + * Decodes a ListKnowledgeBasesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListKnowledgeBasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListKnowledgeBasesRequest; + + /** + * Verifies a ListKnowledgeBasesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListKnowledgeBasesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListKnowledgeBasesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListKnowledgeBasesRequest; + + /** + * Creates a plain object from a ListKnowledgeBasesRequest message. Also converts values to other types if specified. + * @param message ListKnowledgeBasesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListKnowledgeBasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListKnowledgeBasesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListKnowledgeBasesResponse. */ + interface IListKnowledgeBasesResponse { + + /** ListKnowledgeBasesResponse knowledgeBases */ + knowledgeBases?: (google.cloud.dialogflow.v2.IKnowledgeBase[]|null); + + /** ListKnowledgeBasesResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListKnowledgeBasesResponse. */ + class ListKnowledgeBasesResponse implements IListKnowledgeBasesResponse { + + /** + * Constructs a new ListKnowledgeBasesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IListKnowledgeBasesResponse); + + /** ListKnowledgeBasesResponse knowledgeBases. */ + public knowledgeBases: google.cloud.dialogflow.v2.IKnowledgeBase[]; + + /** ListKnowledgeBasesResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListKnowledgeBasesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListKnowledgeBasesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IListKnowledgeBasesResponse): google.cloud.dialogflow.v2.ListKnowledgeBasesResponse; + + /** + * Encodes the specified ListKnowledgeBasesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListKnowledgeBasesResponse.verify|verify} messages. + * @param message ListKnowledgeBasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IListKnowledgeBasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListKnowledgeBasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListKnowledgeBasesResponse.verify|verify} messages. + * @param message ListKnowledgeBasesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IListKnowledgeBasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListKnowledgeBasesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListKnowledgeBasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.ListKnowledgeBasesResponse; + + /** + * Decodes a ListKnowledgeBasesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListKnowledgeBasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.ListKnowledgeBasesResponse; + + /** + * Verifies a ListKnowledgeBasesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListKnowledgeBasesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListKnowledgeBasesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.ListKnowledgeBasesResponse; + + /** + * Creates a plain object from a ListKnowledgeBasesResponse message. Also converts values to other types if specified. + * @param message ListKnowledgeBasesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.ListKnowledgeBasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListKnowledgeBasesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetKnowledgeBaseRequest. */ + interface IGetKnowledgeBaseRequest { + + /** GetKnowledgeBaseRequest name */ + name?: (string|null); + } + + /** Represents a GetKnowledgeBaseRequest. */ + class GetKnowledgeBaseRequest implements IGetKnowledgeBaseRequest { + + /** + * Constructs a new GetKnowledgeBaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest); + + /** GetKnowledgeBaseRequest name. */ + public name: string; + + /** + * Creates a new GetKnowledgeBaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetKnowledgeBaseRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest): google.cloud.dialogflow.v2.GetKnowledgeBaseRequest; + + /** + * Encodes the specified GetKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetKnowledgeBaseRequest.verify|verify} messages. + * @param message GetKnowledgeBaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetKnowledgeBaseRequest.verify|verify} messages. + * @param message GetKnowledgeBaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetKnowledgeBaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.GetKnowledgeBaseRequest; + + /** + * Decodes a GetKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.GetKnowledgeBaseRequest; + + /** + * Verifies a GetKnowledgeBaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetKnowledgeBaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.GetKnowledgeBaseRequest; + + /** + * Creates a plain object from a GetKnowledgeBaseRequest message. Also converts values to other types if specified. + * @param message GetKnowledgeBaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.GetKnowledgeBaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetKnowledgeBaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateKnowledgeBaseRequest. */ + interface ICreateKnowledgeBaseRequest { + + /** CreateKnowledgeBaseRequest parent */ + parent?: (string|null); + + /** CreateKnowledgeBaseRequest knowledgeBase */ + knowledgeBase?: (google.cloud.dialogflow.v2.IKnowledgeBase|null); + } + + /** Represents a CreateKnowledgeBaseRequest. */ + class CreateKnowledgeBaseRequest implements ICreateKnowledgeBaseRequest { + + /** + * Constructs a new CreateKnowledgeBaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest); + + /** CreateKnowledgeBaseRequest parent. */ + public parent: string; + + /** CreateKnowledgeBaseRequest knowledgeBase. */ + public knowledgeBase?: (google.cloud.dialogflow.v2.IKnowledgeBase|null); + + /** + * Creates a new CreateKnowledgeBaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateKnowledgeBaseRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest): google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest; + + /** + * Encodes the specified CreateKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest.verify|verify} messages. + * @param message CreateKnowledgeBaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest.verify|verify} messages. + * @param message CreateKnowledgeBaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateKnowledgeBaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest; + + /** + * Decodes a CreateKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest; + + /** + * Verifies a CreateKnowledgeBaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateKnowledgeBaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest; + + /** + * Creates a plain object from a CreateKnowledgeBaseRequest message. Also converts values to other types if specified. + * @param message CreateKnowledgeBaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateKnowledgeBaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteKnowledgeBaseRequest. */ + interface IDeleteKnowledgeBaseRequest { + + /** DeleteKnowledgeBaseRequest name */ + name?: (string|null); + + /** DeleteKnowledgeBaseRequest force */ + force?: (boolean|null); + } + + /** Represents a DeleteKnowledgeBaseRequest. */ + class DeleteKnowledgeBaseRequest implements IDeleteKnowledgeBaseRequest { + + /** + * Constructs a new DeleteKnowledgeBaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest); + + /** DeleteKnowledgeBaseRequest name. */ + public name: string; + + /** DeleteKnowledgeBaseRequest force. */ + public force: boolean; + + /** + * Creates a new DeleteKnowledgeBaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteKnowledgeBaseRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest): google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest; + + /** + * Encodes the specified DeleteKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest.verify|verify} messages. + * @param message DeleteKnowledgeBaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest.verify|verify} messages. + * @param message DeleteKnowledgeBaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteKnowledgeBaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest; + + /** + * Decodes a DeleteKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest; + + /** + * Verifies a DeleteKnowledgeBaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteKnowledgeBaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest; + + /** + * Creates a plain object from a DeleteKnowledgeBaseRequest message. Also converts values to other types if specified. + * @param message DeleteKnowledgeBaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteKnowledgeBaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateKnowledgeBaseRequest. */ + interface IUpdateKnowledgeBaseRequest { + + /** UpdateKnowledgeBaseRequest knowledgeBase */ + knowledgeBase?: (google.cloud.dialogflow.v2.IKnowledgeBase|null); + + /** UpdateKnowledgeBaseRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateKnowledgeBaseRequest. */ + class UpdateKnowledgeBaseRequest implements IUpdateKnowledgeBaseRequest { + + /** + * Constructs a new UpdateKnowledgeBaseRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest); + + /** UpdateKnowledgeBaseRequest knowledgeBase. */ + public knowledgeBase?: (google.cloud.dialogflow.v2.IKnowledgeBase|null); + + /** UpdateKnowledgeBaseRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateKnowledgeBaseRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateKnowledgeBaseRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest): google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest; + + /** + * Encodes the specified UpdateKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest.verify|verify} messages. + * @param message UpdateKnowledgeBaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest.verify|verify} messages. + * @param message UpdateKnowledgeBaseRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateKnowledgeBaseRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest; + + /** + * Decodes an UpdateKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest; + + /** + * Verifies an UpdateKnowledgeBaseRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateKnowledgeBaseRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest; + + /** + * Creates a plain object from an UpdateKnowledgeBaseRequest message. Also converts values to other types if specified. + * @param message UpdateKnowledgeBaseRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateKnowledgeBaseRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebhookRequest. */ + interface IWebhookRequest { + + /** WebhookRequest session */ + session?: (string|null); + + /** WebhookRequest responseId */ + responseId?: (string|null); + + /** WebhookRequest queryResult */ + queryResult?: (google.cloud.dialogflow.v2.IQueryResult|null); + + /** WebhookRequest originalDetectIntentRequest */ + originalDetectIntentRequest?: (google.cloud.dialogflow.v2.IOriginalDetectIntentRequest|null); + } + + /** Represents a WebhookRequest. */ + class WebhookRequest implements IWebhookRequest { + + /** + * Constructs a new WebhookRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IWebhookRequest); + + /** WebhookRequest session. */ + public session: string; + + /** WebhookRequest responseId. */ + public responseId: string; + + /** WebhookRequest queryResult. */ + public queryResult?: (google.cloud.dialogflow.v2.IQueryResult|null); + + /** WebhookRequest originalDetectIntentRequest. */ + public originalDetectIntentRequest?: (google.cloud.dialogflow.v2.IOriginalDetectIntentRequest|null); + + /** + * Creates a new WebhookRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns WebhookRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IWebhookRequest): google.cloud.dialogflow.v2.WebhookRequest; + + /** + * Encodes the specified WebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookRequest.verify|verify} messages. + * @param message WebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookRequest.verify|verify} messages. + * @param message WebhookRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IWebhookRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebhookRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.WebhookRequest; + + /** + * Decodes a WebhookRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.WebhookRequest; + + /** + * Verifies a WebhookRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebhookRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebhookRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.WebhookRequest; + + /** + * Creates a plain object from a WebhookRequest message. Also converts values to other types if specified. + * @param message WebhookRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.WebhookRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebhookRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a WebhookResponse. */ + interface IWebhookResponse { + + /** WebhookResponse fulfillmentText */ + fulfillmentText?: (string|null); + + /** WebhookResponse fulfillmentMessages */ + fulfillmentMessages?: (google.cloud.dialogflow.v2.Intent.IMessage[]|null); + + /** WebhookResponse source */ + source?: (string|null); + + /** WebhookResponse payload */ + payload?: (google.protobuf.IStruct|null); + + /** WebhookResponse outputContexts */ + outputContexts?: (google.cloud.dialogflow.v2.IContext[]|null); + + /** WebhookResponse followupEventInput */ + followupEventInput?: (google.cloud.dialogflow.v2.IEventInput|null); + + /** WebhookResponse sessionEntityTypes */ + sessionEntityTypes?: (google.cloud.dialogflow.v2.ISessionEntityType[]|null); + } + + /** Represents a WebhookResponse. */ + class WebhookResponse implements IWebhookResponse { + + /** + * Constructs a new WebhookResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IWebhookResponse); + + /** WebhookResponse fulfillmentText. */ + public fulfillmentText: string; + + /** WebhookResponse fulfillmentMessages. */ + public fulfillmentMessages: google.cloud.dialogflow.v2.Intent.IMessage[]; + + /** WebhookResponse source. */ + public source: string; + + /** WebhookResponse payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** WebhookResponse outputContexts. */ + public outputContexts: google.cloud.dialogflow.v2.IContext[]; + + /** WebhookResponse followupEventInput. */ + public followupEventInput?: (google.cloud.dialogflow.v2.IEventInput|null); + + /** WebhookResponse sessionEntityTypes. */ + public sessionEntityTypes: google.cloud.dialogflow.v2.ISessionEntityType[]; + + /** + * Creates a new WebhookResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns WebhookResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IWebhookResponse): google.cloud.dialogflow.v2.WebhookResponse; + + /** + * Encodes the specified WebhookResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookResponse.verify|verify} messages. + * @param message WebhookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IWebhookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WebhookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookResponse.verify|verify} messages. + * @param message WebhookResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IWebhookResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WebhookResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.WebhookResponse; + + /** + * Decodes a WebhookResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.WebhookResponse; + + /** + * Verifies a WebhookResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WebhookResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WebhookResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.WebhookResponse; + + /** + * Creates a plain object from a WebhookResponse message. Also converts values to other types if specified. + * @param message WebhookResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.WebhookResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WebhookResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OriginalDetectIntentRequest. */ + interface IOriginalDetectIntentRequest { + + /** OriginalDetectIntentRequest source */ + source?: (string|null); + + /** OriginalDetectIntentRequest version */ + version?: (string|null); + + /** OriginalDetectIntentRequest payload */ + payload?: (google.protobuf.IStruct|null); + } + + /** Represents an OriginalDetectIntentRequest. */ + class OriginalDetectIntentRequest implements IOriginalDetectIntentRequest { + + /** + * Constructs a new OriginalDetectIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2.IOriginalDetectIntentRequest); + + /** OriginalDetectIntentRequest source. */ + public source: string; + + /** OriginalDetectIntentRequest version. */ + public version: string; + + /** OriginalDetectIntentRequest payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** + * Creates a new OriginalDetectIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns OriginalDetectIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2.IOriginalDetectIntentRequest): google.cloud.dialogflow.v2.OriginalDetectIntentRequest; + + /** + * Encodes the specified OriginalDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.OriginalDetectIntentRequest.verify|verify} messages. + * @param message OriginalDetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2.IOriginalDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OriginalDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.OriginalDetectIntentRequest.verify|verify} messages. + * @param message OriginalDetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2.IOriginalDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OriginalDetectIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OriginalDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2.OriginalDetectIntentRequest; + + /** + * Decodes an OriginalDetectIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OriginalDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2.OriginalDetectIntentRequest; + + /** + * Verifies an OriginalDetectIntentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OriginalDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OriginalDetectIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2.OriginalDetectIntentRequest; + + /** + * Creates a plain object from an OriginalDetectIntentRequest message. Also converts values to other types if specified. + * @param message OriginalDetectIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2.OriginalDetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OriginalDetectIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Namespace v2beta1. */ + namespace v2beta1 { + + /** Represents an Agents */ + class Agents extends $protobuf.rpc.Service { + + /** + * Constructs a new Agents service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Agents service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Agents; + + /** + * Calls GetAgent. + * @param request GetAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public getAgent(request: google.cloud.dialogflow.v2beta1.IGetAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.GetAgentCallback): void; + + /** + * Calls GetAgent. + * @param request GetAgentRequest message or plain object + * @returns Promise + */ + public getAgent(request: google.cloud.dialogflow.v2beta1.IGetAgentRequest): Promise; + + /** + * Calls SetAgent. + * @param request SetAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Agent + */ + public setAgent(request: google.cloud.dialogflow.v2beta1.ISetAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.SetAgentCallback): void; + + /** + * Calls SetAgent. + * @param request SetAgentRequest message or plain object + * @returns Promise + */ + public setAgent(request: google.cloud.dialogflow.v2beta1.ISetAgentRequest): Promise; + + /** + * Calls DeleteAgent. + * @param request DeleteAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAgent(request: google.cloud.dialogflow.v2beta1.IDeleteAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.DeleteAgentCallback): void; + + /** + * Calls DeleteAgent. + * @param request DeleteAgentRequest message or plain object + * @returns Promise + */ + public deleteAgent(request: google.cloud.dialogflow.v2beta1.IDeleteAgentRequest): Promise; + + /** + * Calls SearchAgents. + * @param request SearchAgentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SearchAgentsResponse + */ + public searchAgents(request: google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, callback: google.cloud.dialogflow.v2beta1.Agents.SearchAgentsCallback): void; + + /** + * Calls SearchAgents. + * @param request SearchAgentsRequest message or plain object + * @returns Promise + */ + public searchAgents(request: google.cloud.dialogflow.v2beta1.ISearchAgentsRequest): Promise; + + /** + * Calls TrainAgent. + * @param request TrainAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public trainAgent(request: google.cloud.dialogflow.v2beta1.ITrainAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.TrainAgentCallback): void; + + /** + * Calls TrainAgent. + * @param request TrainAgentRequest message or plain object + * @returns Promise + */ + public trainAgent(request: google.cloud.dialogflow.v2beta1.ITrainAgentRequest): Promise; + + /** + * Calls ExportAgent. + * @param request ExportAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public exportAgent(request: google.cloud.dialogflow.v2beta1.IExportAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.ExportAgentCallback): void; + + /** + * Calls ExportAgent. + * @param request ExportAgentRequest message or plain object + * @returns Promise + */ + public exportAgent(request: google.cloud.dialogflow.v2beta1.IExportAgentRequest): Promise; + + /** + * Calls ImportAgent. + * @param request ImportAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public importAgent(request: google.cloud.dialogflow.v2beta1.IImportAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.ImportAgentCallback): void; + + /** + * Calls ImportAgent. + * @param request ImportAgentRequest message or plain object + * @returns Promise + */ + public importAgent(request: google.cloud.dialogflow.v2beta1.IImportAgentRequest): Promise; + + /** + * Calls RestoreAgent. + * @param request RestoreAgentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreAgent(request: google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, callback: google.cloud.dialogflow.v2beta1.Agents.RestoreAgentCallback): void; + + /** + * Calls RestoreAgent. + * @param request RestoreAgentRequest message or plain object + * @returns Promise + */ + public restoreAgent(request: google.cloud.dialogflow.v2beta1.IRestoreAgentRequest): Promise; + + /** + * Calls GetValidationResult. + * @param request GetValidationResultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ValidationResult + */ + public getValidationResult(request: google.cloud.dialogflow.v2beta1.IGetValidationResultRequest, callback: google.cloud.dialogflow.v2beta1.Agents.GetValidationResultCallback): void; + + /** + * Calls GetValidationResult. + * @param request GetValidationResultRequest message or plain object + * @returns Promise + */ + public getValidationResult(request: google.cloud.dialogflow.v2beta1.IGetValidationResultRequest): Promise; + } + + namespace Agents { + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#getAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type GetAgentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Agent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#setAgent}. + * @param error Error, if any + * @param [response] Agent + */ + type SetAgentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Agent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#deleteAgent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAgentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#searchAgents}. + * @param error Error, if any + * @param [response] SearchAgentsResponse + */ + type SearchAgentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.SearchAgentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#trainAgent}. + * @param error Error, if any + * @param [response] Operation + */ + type TrainAgentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#exportAgent}. + * @param error Error, if any + * @param [response] Operation + */ + type ExportAgentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#importAgent}. + * @param error Error, if any + * @param [response] Operation + */ + type ImportAgentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#restoreAgent}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreAgentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#getValidationResult}. + * @param error Error, if any + * @param [response] ValidationResult + */ + type GetValidationResultCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ValidationResult) => void; + } + + /** Properties of an Agent. */ + interface IAgent { + + /** Agent parent */ + parent?: (string|null); + + /** Agent displayName */ + displayName?: (string|null); + + /** Agent defaultLanguageCode */ + defaultLanguageCode?: (string|null); + + /** Agent supportedLanguageCodes */ + supportedLanguageCodes?: (string[]|null); + + /** Agent timeZone */ + timeZone?: (string|null); + + /** Agent description */ + description?: (string|null); + + /** Agent avatarUri */ + avatarUri?: (string|null); + + /** Agent enableLogging */ + enableLogging?: (boolean|null); + + /** Agent matchMode */ + matchMode?: (google.cloud.dialogflow.v2beta1.Agent.MatchMode|keyof typeof google.cloud.dialogflow.v2beta1.Agent.MatchMode|null); + + /** Agent classificationThreshold */ + classificationThreshold?: (number|null); + + /** Agent apiVersion */ + apiVersion?: (google.cloud.dialogflow.v2beta1.Agent.ApiVersion|keyof typeof google.cloud.dialogflow.v2beta1.Agent.ApiVersion|null); + + /** Agent tier */ + tier?: (google.cloud.dialogflow.v2beta1.Agent.Tier|keyof typeof google.cloud.dialogflow.v2beta1.Agent.Tier|null); + } + + /** Represents an Agent. */ + class Agent implements IAgent { + + /** + * Constructs a new Agent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IAgent); + + /** Agent parent. */ + public parent: string; + + /** Agent displayName. */ + public displayName: string; + + /** Agent defaultLanguageCode. */ + public defaultLanguageCode: string; + + /** Agent supportedLanguageCodes. */ + public supportedLanguageCodes: string[]; + + /** Agent timeZone. */ + public timeZone: string; + + /** Agent description. */ + public description: string; + + /** Agent avatarUri. */ + public avatarUri: string; + + /** Agent enableLogging. */ + public enableLogging: boolean; + + /** Agent matchMode. */ + public matchMode: (google.cloud.dialogflow.v2beta1.Agent.MatchMode|keyof typeof google.cloud.dialogflow.v2beta1.Agent.MatchMode); + + /** Agent classificationThreshold. */ + public classificationThreshold: number; + + /** Agent apiVersion. */ + public apiVersion: (google.cloud.dialogflow.v2beta1.Agent.ApiVersion|keyof typeof google.cloud.dialogflow.v2beta1.Agent.ApiVersion); + + /** Agent tier. */ + public tier: (google.cloud.dialogflow.v2beta1.Agent.Tier|keyof typeof google.cloud.dialogflow.v2beta1.Agent.Tier); + + /** + * Creates a new Agent instance using the specified properties. + * @param [properties] Properties to set + * @returns Agent instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IAgent): google.cloud.dialogflow.v2beta1.Agent; + + /** + * Encodes the specified Agent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Agent.verify|verify} messages. + * @param message Agent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Agent.verify|verify} messages. + * @param message Agent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Agent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Agent; + + /** + * Decodes an Agent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Agent; + + /** + * Verifies an Agent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Agent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Agent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Agent; + + /** + * Creates a plain object from an Agent message. Also converts values to other types if specified. + * @param message Agent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Agent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Agent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Agent { + + /** MatchMode enum. */ + enum MatchMode { + MATCH_MODE_UNSPECIFIED = 0, + MATCH_MODE_HYBRID = 1, + MATCH_MODE_ML_ONLY = 2 + } + + /** ApiVersion enum. */ + enum ApiVersion { + API_VERSION_UNSPECIFIED = 0, + API_VERSION_V1 = 1, + API_VERSION_V2 = 2, + API_VERSION_V2_BETA_1 = 3 + } + + /** Tier enum. */ + enum Tier { + TIER_UNSPECIFIED = 0, + TIER_STANDARD = 1, + TIER_ENTERPRISE = 2, + TIER_ENTERPRISE_PLUS = 3 + } + } + + /** Properties of a GetAgentRequest. */ + interface IGetAgentRequest { + + /** GetAgentRequest parent */ + parent?: (string|null); + } + + /** Represents a GetAgentRequest. */ + class GetAgentRequest implements IGetAgentRequest { + + /** + * Constructs a new GetAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IGetAgentRequest); + + /** GetAgentRequest parent. */ + public parent: string; + + /** + * Creates a new GetAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IGetAgentRequest): google.cloud.dialogflow.v2beta1.GetAgentRequest; + + /** + * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetAgentRequest.verify|verify} messages. + * @param message GetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetAgentRequest.verify|verify} messages. + * @param message GetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetAgentRequest; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetAgentRequest; + + /** + * Verifies a GetAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetAgentRequest; + + /** + * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * @param message GetAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.GetAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SetAgentRequest. */ + interface ISetAgentRequest { + + /** SetAgentRequest agent */ + agent?: (google.cloud.dialogflow.v2beta1.IAgent|null); + + /** SetAgentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a SetAgentRequest. */ + class SetAgentRequest implements ISetAgentRequest { + + /** + * Constructs a new SetAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISetAgentRequest); + + /** SetAgentRequest agent. */ + public agent?: (google.cloud.dialogflow.v2beta1.IAgent|null); + + /** SetAgentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new SetAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SetAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISetAgentRequest): google.cloud.dialogflow.v2beta1.SetAgentRequest; + + /** + * Encodes the specified SetAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SetAgentRequest.verify|verify} messages. + * @param message SetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SetAgentRequest.verify|verify} messages. + * @param message SetAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISetAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SetAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SetAgentRequest; + + /** + * Decodes a SetAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SetAgentRequest; + + /** + * Verifies a SetAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SetAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SetAgentRequest; + + /** + * Creates a plain object from a SetAgentRequest message. Also converts values to other types if specified. + * @param message SetAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SetAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SetAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteAgentRequest. */ + interface IDeleteAgentRequest { + + /** DeleteAgentRequest parent */ + parent?: (string|null); + } + + /** Represents a DeleteAgentRequest. */ + class DeleteAgentRequest implements IDeleteAgentRequest { + + /** + * Constructs a new DeleteAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteAgentRequest); + + /** DeleteAgentRequest parent. */ + public parent: string; + + /** + * Creates a new DeleteAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteAgentRequest): google.cloud.dialogflow.v2beta1.DeleteAgentRequest; + + /** + * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAgentRequest.verify|verify} messages. + * @param message DeleteAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAgentRequest.verify|verify} messages. + * @param message DeleteAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteAgentRequest; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteAgentRequest; + + /** + * Verifies a DeleteAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteAgentRequest; + + /** + * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * @param message DeleteAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SubAgent. */ + interface ISubAgent { + + /** SubAgent project */ + project?: (string|null); + + /** SubAgent environment */ + environment?: (string|null); + } + + /** Represents a SubAgent. */ + class SubAgent implements ISubAgent { + + /** + * Constructs a new SubAgent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISubAgent); + + /** SubAgent project. */ + public project: string; + + /** SubAgent environment. */ + public environment: string; + + /** + * Creates a new SubAgent instance using the specified properties. + * @param [properties] Properties to set + * @returns SubAgent instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISubAgent): google.cloud.dialogflow.v2beta1.SubAgent; + + /** + * Encodes the specified SubAgent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SubAgent.verify|verify} messages. + * @param message SubAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISubAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SubAgent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SubAgent.verify|verify} messages. + * @param message SubAgent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISubAgent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SubAgent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SubAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SubAgent; + + /** + * Decodes a SubAgent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SubAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SubAgent; + + /** + * Verifies a SubAgent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SubAgent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SubAgent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SubAgent; + + /** + * Creates a plain object from a SubAgent message. Also converts values to other types if specified. + * @param message SubAgent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SubAgent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SubAgent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SearchAgentsRequest. */ + interface ISearchAgentsRequest { + + /** SearchAgentsRequest parent */ + parent?: (string|null); + + /** SearchAgentsRequest pageSize */ + pageSize?: (number|null); + + /** SearchAgentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a SearchAgentsRequest. */ + class SearchAgentsRequest implements ISearchAgentsRequest { + + /** + * Constructs a new SearchAgentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISearchAgentsRequest); + + /** SearchAgentsRequest parent. */ + public parent: string; + + /** SearchAgentsRequest pageSize. */ + public pageSize: number; + + /** SearchAgentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new SearchAgentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAgentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISearchAgentsRequest): google.cloud.dialogflow.v2beta1.SearchAgentsRequest; + + /** + * Encodes the specified SearchAgentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsRequest.verify|verify} messages. + * @param message SearchAgentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsRequest.verify|verify} messages. + * @param message SearchAgentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISearchAgentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAgentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchAgentsRequest; + + /** + * Decodes a SearchAgentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchAgentsRequest; + + /** + * Verifies a SearchAgentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAgentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAgentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchAgentsRequest; + + /** + * Creates a plain object from a SearchAgentsRequest message. Also converts values to other types if specified. + * @param message SearchAgentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SearchAgentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAgentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SearchAgentsResponse. */ + interface ISearchAgentsResponse { + + /** SearchAgentsResponse agents */ + agents?: (google.cloud.dialogflow.v2beta1.IAgent[]|null); + + /** SearchAgentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a SearchAgentsResponse. */ + class SearchAgentsResponse implements ISearchAgentsResponse { + + /** + * Constructs a new SearchAgentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISearchAgentsResponse); + + /** SearchAgentsResponse agents. */ + public agents: google.cloud.dialogflow.v2beta1.IAgent[]; + + /** SearchAgentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new SearchAgentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SearchAgentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISearchAgentsResponse): google.cloud.dialogflow.v2beta1.SearchAgentsResponse; + + /** + * Encodes the specified SearchAgentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsResponse.verify|verify} messages. + * @param message SearchAgentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISearchAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SearchAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsResponse.verify|verify} messages. + * @param message SearchAgentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISearchAgentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SearchAgentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SearchAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SearchAgentsResponse; + + /** + * Decodes a SearchAgentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SearchAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SearchAgentsResponse; + + /** + * Verifies a SearchAgentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SearchAgentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SearchAgentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SearchAgentsResponse; + + /** + * Creates a plain object from a SearchAgentsResponse message. Also converts values to other types if specified. + * @param message SearchAgentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SearchAgentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SearchAgentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TrainAgentRequest. */ + interface ITrainAgentRequest { + + /** TrainAgentRequest parent */ + parent?: (string|null); + } + + /** Represents a TrainAgentRequest. */ + class TrainAgentRequest implements ITrainAgentRequest { + + /** + * Constructs a new TrainAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ITrainAgentRequest); + + /** TrainAgentRequest parent. */ + public parent: string; + + /** + * Creates a new TrainAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ITrainAgentRequest): google.cloud.dialogflow.v2beta1.TrainAgentRequest; + + /** + * Encodes the specified TrainAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TrainAgentRequest.verify|verify} messages. + * @param message TrainAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ITrainAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TrainAgentRequest.verify|verify} messages. + * @param message TrainAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ITrainAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.TrainAgentRequest; + + /** + * Decodes a TrainAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.TrainAgentRequest; + + /** + * Verifies a TrainAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrainAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.TrainAgentRequest; + + /** + * Creates a plain object from a TrainAgentRequest message. Also converts values to other types if specified. + * @param message TrainAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.TrainAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExportAgentRequest. */ + interface IExportAgentRequest { + + /** ExportAgentRequest parent */ + parent?: (string|null); + + /** ExportAgentRequest agentUri */ + agentUri?: (string|null); + } + + /** Represents an ExportAgentRequest. */ + class ExportAgentRequest implements IExportAgentRequest { + + /** + * Constructs a new ExportAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IExportAgentRequest); + + /** ExportAgentRequest parent. */ + public parent: string; + + /** ExportAgentRequest agentUri. */ + public agentUri: string; + + /** + * Creates a new ExportAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IExportAgentRequest): google.cloud.dialogflow.v2beta1.ExportAgentRequest; + + /** + * Encodes the specified ExportAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentRequest.verify|verify} messages. + * @param message ExportAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IExportAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentRequest.verify|verify} messages. + * @param message ExportAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IExportAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ExportAgentRequest; + + /** + * Decodes an ExportAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ExportAgentRequest; + + /** + * Verifies an ExportAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ExportAgentRequest; + + /** + * Creates a plain object from an ExportAgentRequest message. Also converts values to other types if specified. + * @param message ExportAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ExportAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ExportAgentResponse. */ + interface IExportAgentResponse { + + /** ExportAgentResponse agentUri */ + agentUri?: (string|null); + + /** ExportAgentResponse agentContent */ + agentContent?: (Uint8Array|string|null); + } + + /** Represents an ExportAgentResponse. */ + class ExportAgentResponse implements IExportAgentResponse { + + /** + * Constructs a new ExportAgentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IExportAgentResponse); + + /** ExportAgentResponse agentUri. */ + public agentUri: string; + + /** ExportAgentResponse agentContent. */ + public agentContent: (Uint8Array|string); + + /** ExportAgentResponse agent. */ + public agent?: ("agentUri"|"agentContent"); + + /** + * Creates a new ExportAgentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ExportAgentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IExportAgentResponse): google.cloud.dialogflow.v2beta1.ExportAgentResponse; + + /** + * Encodes the specified ExportAgentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentResponse.verify|verify} messages. + * @param message ExportAgentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IExportAgentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExportAgentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentResponse.verify|verify} messages. + * @param message ExportAgentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IExportAgentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExportAgentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExportAgentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ExportAgentResponse; + + /** + * Decodes an ExportAgentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExportAgentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ExportAgentResponse; + + /** + * Verifies an ExportAgentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExportAgentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExportAgentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ExportAgentResponse; + + /** + * Creates a plain object from an ExportAgentResponse message. Also converts values to other types if specified. + * @param message ExportAgentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ExportAgentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExportAgentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ImportAgentRequest. */ + interface IImportAgentRequest { + + /** ImportAgentRequest parent */ + parent?: (string|null); + + /** ImportAgentRequest agentUri */ + agentUri?: (string|null); + + /** ImportAgentRequest agentContent */ + agentContent?: (Uint8Array|string|null); + } + + /** Represents an ImportAgentRequest. */ + class ImportAgentRequest implements IImportAgentRequest { + + /** + * Constructs a new ImportAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IImportAgentRequest); + + /** ImportAgentRequest parent. */ + public parent: string; + + /** ImportAgentRequest agentUri. */ + public agentUri: string; + + /** ImportAgentRequest agentContent. */ + public agentContent: (Uint8Array|string); + + /** ImportAgentRequest agent. */ + public agent?: ("agentUri"|"agentContent"); + + /** + * Creates a new ImportAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ImportAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IImportAgentRequest): google.cloud.dialogflow.v2beta1.ImportAgentRequest; + + /** + * Encodes the specified ImportAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportAgentRequest.verify|verify} messages. + * @param message ImportAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IImportAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ImportAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportAgentRequest.verify|verify} messages. + * @param message ImportAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IImportAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ImportAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ImportAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ImportAgentRequest; + + /** + * Decodes an ImportAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ImportAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ImportAgentRequest; + + /** + * Verifies an ImportAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ImportAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ImportAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ImportAgentRequest; + + /** + * Creates a plain object from an ImportAgentRequest message. Also converts values to other types if specified. + * @param message ImportAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ImportAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ImportAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RestoreAgentRequest. */ + interface IRestoreAgentRequest { + + /** RestoreAgentRequest parent */ + parent?: (string|null); + + /** RestoreAgentRequest agentUri */ + agentUri?: (string|null); + + /** RestoreAgentRequest agentContent */ + agentContent?: (Uint8Array|string|null); + } + + /** Represents a RestoreAgentRequest. */ + class RestoreAgentRequest implements IRestoreAgentRequest { + + /** + * Constructs a new RestoreAgentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IRestoreAgentRequest); + + /** RestoreAgentRequest parent. */ + public parent: string; + + /** RestoreAgentRequest agentUri. */ + public agentUri: string; + + /** RestoreAgentRequest agentContent. */ + public agentContent: (Uint8Array|string); + + /** RestoreAgentRequest agent. */ + public agent?: ("agentUri"|"agentContent"); + + /** + * Creates a new RestoreAgentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreAgentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IRestoreAgentRequest): google.cloud.dialogflow.v2beta1.RestoreAgentRequest; + + /** + * Encodes the specified RestoreAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.RestoreAgentRequest.verify|verify} messages. + * @param message RestoreAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.RestoreAgentRequest.verify|verify} messages. + * @param message RestoreAgentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IRestoreAgentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreAgentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.RestoreAgentRequest; + + /** + * Decodes a RestoreAgentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.RestoreAgentRequest; + + /** + * Verifies a RestoreAgentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreAgentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreAgentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.RestoreAgentRequest; + + /** + * Creates a plain object from a RestoreAgentRequest message. Also converts values to other types if specified. + * @param message RestoreAgentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.RestoreAgentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreAgentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetValidationResultRequest. */ + interface IGetValidationResultRequest { + + /** GetValidationResultRequest parent */ + parent?: (string|null); + + /** GetValidationResultRequest languageCode */ + languageCode?: (string|null); + } + + /** Represents a GetValidationResultRequest. */ + class GetValidationResultRequest implements IGetValidationResultRequest { + + /** + * Constructs a new GetValidationResultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IGetValidationResultRequest); + + /** GetValidationResultRequest parent. */ + public parent: string; + + /** GetValidationResultRequest languageCode. */ + public languageCode: string; + + /** + * Creates a new GetValidationResultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetValidationResultRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IGetValidationResultRequest): google.cloud.dialogflow.v2beta1.GetValidationResultRequest; + + /** + * Encodes the specified GetValidationResultRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetValidationResultRequest.verify|verify} messages. + * @param message GetValidationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IGetValidationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetValidationResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetValidationResultRequest.verify|verify} messages. + * @param message GetValidationResultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetValidationResultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetValidationResultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetValidationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetValidationResultRequest; + + /** + * Decodes a GetValidationResultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetValidationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetValidationResultRequest; + + /** + * Verifies a GetValidationResultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetValidationResultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetValidationResultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetValidationResultRequest; + + /** + * Creates a plain object from a GetValidationResultRequest message. Also converts values to other types if specified. + * @param message GetValidationResultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.GetValidationResultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetValidationResultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents an Environments */ + class Environments extends $protobuf.rpc.Service { + + /** + * Constructs a new Environments service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Environments service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Environments; + + /** + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + */ + public listEnvironments(request: google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest, callback: google.cloud.dialogflow.v2beta1.Environments.ListEnvironmentsCallback): void; + + /** + * Calls ListEnvironments. + * @param request ListEnvironmentsRequest message or plain object + * @returns Promise + */ + public listEnvironments(request: google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest): Promise; + } + + namespace Environments { + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Environments#listEnvironments}. + * @param error Error, if any + * @param [response] ListEnvironmentsResponse + */ + type ListEnvironmentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse) => void; + } + + /** Properties of an Environment. */ + interface IEnvironment { + + /** Environment name */ + name?: (string|null); + + /** Environment description */ + description?: (string|null); + + /** Environment agentVersion */ + agentVersion?: (string|null); + + /** Environment state */ + state?: (google.cloud.dialogflow.v2beta1.Environment.State|keyof typeof google.cloud.dialogflow.v2beta1.Environment.State|null); + + /** Environment updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an Environment. */ + class Environment implements IEnvironment { + + /** + * Constructs a new Environment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IEnvironment); + + /** Environment name. */ + public name: string; + + /** Environment description. */ + public description: string; + + /** Environment agentVersion. */ + public agentVersion: string; + + /** Environment state. */ + public state: (google.cloud.dialogflow.v2beta1.Environment.State|keyof typeof google.cloud.dialogflow.v2beta1.Environment.State); + + /** Environment updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new Environment instance using the specified properties. + * @param [properties] Properties to set + * @returns Environment instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IEnvironment): google.cloud.dialogflow.v2beta1.Environment; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Environment.verify|verify} messages. + * @param message Environment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Environment; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Environment; + + /** + * Verifies an Environment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Environment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Environment; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @param message Environment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Environment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Environment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Environment { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + STOPPED = 1, + LOADING = 2, + RUNNING = 3 + } + } + + /** Properties of a ListEnvironmentsRequest. */ + interface IListEnvironmentsRequest { + + /** ListEnvironmentsRequest parent */ + parent?: (string|null); + + /** ListEnvironmentsRequest pageSize */ + pageSize?: (number|null); + + /** ListEnvironmentsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListEnvironmentsRequest. */ + class ListEnvironmentsRequest implements IListEnvironmentsRequest { + + /** + * Constructs a new ListEnvironmentsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest); + + /** ListEnvironmentsRequest parent. */ + public parent: string; + + /** ListEnvironmentsRequest pageSize. */ + public pageSize: number; + + /** ListEnvironmentsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListEnvironmentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEnvironmentsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest): google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest; + + /** + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest.verify|verify} messages. + * @param message ListEnvironmentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest; + + /** + * Verifies a ListEnvironmentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEnvironmentsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest; + + /** + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * @param message ListEnvironmentsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEnvironmentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListEnvironmentsResponse. */ + interface IListEnvironmentsResponse { + + /** ListEnvironmentsResponse environments */ + environments?: (google.cloud.dialogflow.v2beta1.IEnvironment[]|null); + + /** ListEnvironmentsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListEnvironmentsResponse. */ + class ListEnvironmentsResponse implements IListEnvironmentsResponse { + + /** + * Constructs a new ListEnvironmentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse); + + /** ListEnvironmentsResponse environments. */ + public environments: google.cloud.dialogflow.v2beta1.IEnvironment[]; + + /** ListEnvironmentsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListEnvironmentsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEnvironmentsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse): google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse; + + /** + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse.verify|verify} messages. + * @param message ListEnvironmentsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse; + + /** + * Verifies a ListEnvironmentsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEnvironmentsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse; + + /** + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @param message ListEnvironmentsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListEnvironmentsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SpeechContext. */ + interface ISpeechContext { + + /** SpeechContext phrases */ + phrases?: (string[]|null); + + /** SpeechContext boost */ + boost?: (number|null); + } + + /** Represents a SpeechContext. */ + class SpeechContext implements ISpeechContext { + + /** + * Constructs a new SpeechContext. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISpeechContext); + + /** SpeechContext phrases. */ + public phrases: string[]; + + /** SpeechContext boost. */ + public boost: number; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechContext instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISpeechContext): google.cloud.dialogflow.v2beta1.SpeechContext; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechContext.verify|verify} messages. + * @param message SpeechContext message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISpeechContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SpeechContext; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SpeechContext; + + /** + * Verifies a SpeechContext message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechContext + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SpeechContext; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @param message SpeechContext + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SpeechContext, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechContext to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** AudioEncoding enum. */ + enum AudioEncoding { + AUDIO_ENCODING_UNSPECIFIED = 0, + AUDIO_ENCODING_LINEAR_16 = 1, + AUDIO_ENCODING_FLAC = 2, + AUDIO_ENCODING_MULAW = 3, + AUDIO_ENCODING_AMR = 4, + AUDIO_ENCODING_AMR_WB = 5, + AUDIO_ENCODING_OGG_OPUS = 6, + AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE = 7 + } + + /** Properties of a SpeechWordInfo. */ + interface ISpeechWordInfo { + + /** SpeechWordInfo word */ + word?: (string|null); + + /** SpeechWordInfo startOffset */ + startOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo endOffset */ + endOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo confidence */ + confidence?: (number|null); + } + + /** Represents a SpeechWordInfo. */ + class SpeechWordInfo implements ISpeechWordInfo { + + /** + * Constructs a new SpeechWordInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISpeechWordInfo); + + /** SpeechWordInfo word. */ + public word: string; + + /** SpeechWordInfo startOffset. */ + public startOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo endOffset. */ + public endOffset?: (google.protobuf.IDuration|null); + + /** SpeechWordInfo confidence. */ + public confidence: number; + + /** + * Creates a new SpeechWordInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechWordInfo instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISpeechWordInfo): google.cloud.dialogflow.v2beta1.SpeechWordInfo; + + /** + * Encodes the specified SpeechWordInfo message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechWordInfo.verify|verify} messages. + * @param message SpeechWordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISpeechWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechWordInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechWordInfo.verify|verify} messages. + * @param message SpeechWordInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISpeechWordInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechWordInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechWordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SpeechWordInfo; + + /** + * Decodes a SpeechWordInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechWordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SpeechWordInfo; + + /** + * Verifies a SpeechWordInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechWordInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechWordInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SpeechWordInfo; + + /** + * Creates a plain object from a SpeechWordInfo message. Also converts values to other types if specified. + * @param message SpeechWordInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SpeechWordInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechWordInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** SpeechModelVariant enum. */ + enum SpeechModelVariant { + SPEECH_MODEL_VARIANT_UNSPECIFIED = 0, + USE_BEST_AVAILABLE = 1, + USE_STANDARD = 2, + USE_ENHANCED = 3 + } + + /** Properties of an InputAudioConfig. */ + interface IInputAudioConfig { + + /** InputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.dialogflow.v2beta1.AudioEncoding|keyof typeof google.cloud.dialogflow.v2beta1.AudioEncoding|null); + + /** InputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** InputAudioConfig languageCode */ + languageCode?: (string|null); + + /** InputAudioConfig enableWordInfo */ + enableWordInfo?: (boolean|null); + + /** InputAudioConfig phraseHints */ + phraseHints?: (string[]|null); + + /** InputAudioConfig speechContexts */ + speechContexts?: (google.cloud.dialogflow.v2beta1.ISpeechContext[]|null); + + /** InputAudioConfig model */ + model?: (string|null); + + /** InputAudioConfig modelVariant */ + modelVariant?: (google.cloud.dialogflow.v2beta1.SpeechModelVariant|keyof typeof google.cloud.dialogflow.v2beta1.SpeechModelVariant|null); + + /** InputAudioConfig singleUtterance */ + singleUtterance?: (boolean|null); + + /** InputAudioConfig disableNoSpeechRecognizedEvent */ + disableNoSpeechRecognizedEvent?: (boolean|null); + } + + /** Represents an InputAudioConfig. */ + class InputAudioConfig implements IInputAudioConfig { + + /** + * Constructs a new InputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IInputAudioConfig); + + /** InputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.dialogflow.v2beta1.AudioEncoding|keyof typeof google.cloud.dialogflow.v2beta1.AudioEncoding); + + /** InputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** InputAudioConfig languageCode. */ + public languageCode: string; + + /** InputAudioConfig enableWordInfo. */ + public enableWordInfo: boolean; + + /** InputAudioConfig phraseHints. */ + public phraseHints: string[]; + + /** InputAudioConfig speechContexts. */ + public speechContexts: google.cloud.dialogflow.v2beta1.ISpeechContext[]; + + /** InputAudioConfig model. */ + public model: string; + + /** InputAudioConfig modelVariant. */ + public modelVariant: (google.cloud.dialogflow.v2beta1.SpeechModelVariant|keyof typeof google.cloud.dialogflow.v2beta1.SpeechModelVariant); + + /** InputAudioConfig singleUtterance. */ + public singleUtterance: boolean; + + /** InputAudioConfig disableNoSpeechRecognizedEvent. */ + public disableNoSpeechRecognizedEvent: boolean; + + /** + * Creates a new InputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputAudioConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IInputAudioConfig): google.cloud.dialogflow.v2beta1.InputAudioConfig; + + /** + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputAudioConfig.verify|verify} messages. + * @param message InputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IInputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.InputAudioConfig; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.InputAudioConfig; + + /** + * Verifies an InputAudioConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.InputAudioConfig; + + /** + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @param message InputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.InputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a VoiceSelectionParams. */ + interface IVoiceSelectionParams { + + /** VoiceSelectionParams name */ + name?: (string|null); + + /** VoiceSelectionParams ssmlGender */ + ssmlGender?: (google.cloud.dialogflow.v2beta1.SsmlVoiceGender|keyof typeof google.cloud.dialogflow.v2beta1.SsmlVoiceGender|null); + } + + /** Represents a VoiceSelectionParams. */ + class VoiceSelectionParams implements IVoiceSelectionParams { + + /** + * Constructs a new VoiceSelectionParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IVoiceSelectionParams); + + /** VoiceSelectionParams name. */ + public name: string; + + /** VoiceSelectionParams ssmlGender. */ + public ssmlGender: (google.cloud.dialogflow.v2beta1.SsmlVoiceGender|keyof typeof google.cloud.dialogflow.v2beta1.SsmlVoiceGender); + + /** + * Creates a new VoiceSelectionParams instance using the specified properties. + * @param [properties] Properties to set + * @returns VoiceSelectionParams instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IVoiceSelectionParams): google.cloud.dialogflow.v2beta1.VoiceSelectionParams; + + /** + * Encodes the specified VoiceSelectionParams message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.VoiceSelectionParams.verify|verify} messages. + * @param message VoiceSelectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IVoiceSelectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified VoiceSelectionParams message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.VoiceSelectionParams.verify|verify} messages. + * @param message VoiceSelectionParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IVoiceSelectionParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns VoiceSelectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.VoiceSelectionParams; + + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns VoiceSelectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.VoiceSelectionParams; + + /** + * Verifies a VoiceSelectionParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a VoiceSelectionParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns VoiceSelectionParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.VoiceSelectionParams; + + /** + * Creates a plain object from a VoiceSelectionParams message. Also converts values to other types if specified. + * @param message VoiceSelectionParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.VoiceSelectionParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this VoiceSelectionParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SynthesizeSpeechConfig. */ + interface ISynthesizeSpeechConfig { + + /** SynthesizeSpeechConfig speakingRate */ + speakingRate?: (number|null); + + /** SynthesizeSpeechConfig pitch */ + pitch?: (number|null); + + /** SynthesizeSpeechConfig volumeGainDb */ + volumeGainDb?: (number|null); + + /** SynthesizeSpeechConfig effectsProfileId */ + effectsProfileId?: (string[]|null); + + /** SynthesizeSpeechConfig voice */ + voice?: (google.cloud.dialogflow.v2beta1.IVoiceSelectionParams|null); + } + + /** Represents a SynthesizeSpeechConfig. */ + class SynthesizeSpeechConfig implements ISynthesizeSpeechConfig { + + /** + * Constructs a new SynthesizeSpeechConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig); + + /** SynthesizeSpeechConfig speakingRate. */ + public speakingRate: number; + + /** SynthesizeSpeechConfig pitch. */ + public pitch: number; + + /** SynthesizeSpeechConfig volumeGainDb. */ + public volumeGainDb: number; + + /** SynthesizeSpeechConfig effectsProfileId. */ + public effectsProfileId: string[]; + + /** SynthesizeSpeechConfig voice. */ + public voice?: (google.cloud.dialogflow.v2beta1.IVoiceSelectionParams|null); + + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SynthesizeSpeechConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig): google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig; + + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.verify|verify} messages. + * @param message SynthesizeSpeechConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig; + + /** + * Verifies a SynthesizeSpeechConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SynthesizeSpeechConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig; + + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @param message SynthesizeSpeechConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** SsmlVoiceGender enum. */ + enum SsmlVoiceGender { + SSML_VOICE_GENDER_UNSPECIFIED = 0, + SSML_VOICE_GENDER_MALE = 1, + SSML_VOICE_GENDER_FEMALE = 2, + SSML_VOICE_GENDER_NEUTRAL = 3 + } + + /** Properties of an OutputAudioConfig. */ + interface IOutputAudioConfig { + + /** OutputAudioConfig audioEncoding */ + audioEncoding?: (google.cloud.dialogflow.v2beta1.OutputAudioEncoding|keyof typeof google.cloud.dialogflow.v2beta1.OutputAudioEncoding|null); + + /** OutputAudioConfig sampleRateHertz */ + sampleRateHertz?: (number|null); + + /** OutputAudioConfig synthesizeSpeechConfig */ + synthesizeSpeechConfig?: (google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig|null); + } + + /** Represents an OutputAudioConfig. */ + class OutputAudioConfig implements IOutputAudioConfig { + + /** + * Constructs a new OutputAudioConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IOutputAudioConfig); + + /** OutputAudioConfig audioEncoding. */ + public audioEncoding: (google.cloud.dialogflow.v2beta1.OutputAudioEncoding|keyof typeof google.cloud.dialogflow.v2beta1.OutputAudioEncoding); + + /** OutputAudioConfig sampleRateHertz. */ + public sampleRateHertz: number; + + /** OutputAudioConfig synthesizeSpeechConfig. */ + public synthesizeSpeechConfig?: (google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig|null); + + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputAudioConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IOutputAudioConfig): google.cloud.dialogflow.v2beta1.OutputAudioConfig; + + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify|verify} messages. + * @param message OutputAudioConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IOutputAudioConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.OutputAudioConfig; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.OutputAudioConfig; + + /** + * Verifies an OutputAudioConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputAudioConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.OutputAudioConfig; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @param message OutputAudioConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.OutputAudioConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputAudioConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TelephonyDtmfEvents. */ + interface ITelephonyDtmfEvents { + + /** TelephonyDtmfEvents dtmfEvents */ + dtmfEvents?: (google.cloud.dialogflow.v2beta1.TelephonyDtmf[]|null); + } + + /** Represents a TelephonyDtmfEvents. */ + class TelephonyDtmfEvents implements ITelephonyDtmfEvents { + + /** + * Constructs a new TelephonyDtmfEvents. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents); + + /** TelephonyDtmfEvents dtmfEvents. */ + public dtmfEvents: google.cloud.dialogflow.v2beta1.TelephonyDtmf[]; + + /** + * Creates a new TelephonyDtmfEvents instance using the specified properties. + * @param [properties] Properties to set + * @returns TelephonyDtmfEvents instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents): google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents; + + /** + * Encodes the specified TelephonyDtmfEvents message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.verify|verify} messages. + * @param message TelephonyDtmfEvents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TelephonyDtmfEvents message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.verify|verify} messages. + * @param message TelephonyDtmfEvents message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TelephonyDtmfEvents message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TelephonyDtmfEvents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents; + + /** + * Decodes a TelephonyDtmfEvents message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TelephonyDtmfEvents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents; + + /** + * Verifies a TelephonyDtmfEvents message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TelephonyDtmfEvents message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TelephonyDtmfEvents + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents; + + /** + * Creates a plain object from a TelephonyDtmfEvents message. Also converts values to other types if specified. + * @param message TelephonyDtmfEvents + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TelephonyDtmfEvents to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** OutputAudioEncoding enum. */ + enum OutputAudioEncoding { + OUTPUT_AUDIO_ENCODING_UNSPECIFIED = 0, + OUTPUT_AUDIO_ENCODING_LINEAR_16 = 1, + OUTPUT_AUDIO_ENCODING_MP3 = 2, + OUTPUT_AUDIO_ENCODING_OGG_OPUS = 3 + } + + /** Properties of a SpeechToTextConfig. */ + interface ISpeechToTextConfig { + + /** SpeechToTextConfig speechModelVariant */ + speechModelVariant?: (google.cloud.dialogflow.v2beta1.SpeechModelVariant|keyof typeof google.cloud.dialogflow.v2beta1.SpeechModelVariant|null); + } + + /** Represents a SpeechToTextConfig. */ + class SpeechToTextConfig implements ISpeechToTextConfig { + + /** + * Constructs a new SpeechToTextConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISpeechToTextConfig); + + /** SpeechToTextConfig speechModelVariant. */ + public speechModelVariant: (google.cloud.dialogflow.v2beta1.SpeechModelVariant|keyof typeof google.cloud.dialogflow.v2beta1.SpeechModelVariant); + + /** + * Creates a new SpeechToTextConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SpeechToTextConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISpeechToTextConfig): google.cloud.dialogflow.v2beta1.SpeechToTextConfig; + + /** + * Encodes the specified SpeechToTextConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechToTextConfig.verify|verify} messages. + * @param message SpeechToTextConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISpeechToTextConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SpeechToTextConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechToTextConfig.verify|verify} messages. + * @param message SpeechToTextConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISpeechToTextConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SpeechToTextConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SpeechToTextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SpeechToTextConfig; + + /** + * Decodes a SpeechToTextConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SpeechToTextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SpeechToTextConfig; + + /** + * Verifies a SpeechToTextConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SpeechToTextConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SpeechToTextConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SpeechToTextConfig; + + /** + * Creates a plain object from a SpeechToTextConfig message. Also converts values to other types if specified. + * @param message SpeechToTextConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SpeechToTextConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SpeechToTextConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** TelephonyDtmf enum. */ + enum TelephonyDtmf { + TELEPHONY_DTMF_UNSPECIFIED = 0, + DTMF_ONE = 1, + DTMF_TWO = 2, + DTMF_THREE = 3, + DTMF_FOUR = 4, + DTMF_FIVE = 5, + DTMF_SIX = 6, + DTMF_SEVEN = 7, + DTMF_EIGHT = 8, + DTMF_NINE = 9, + DTMF_ZERO = 10, + DTMF_A = 11, + DTMF_B = 12, + DTMF_C = 13, + DTMF_D = 14, + DTMF_STAR = 15, + DTMF_POUND = 16 + } + + /** Properties of a ValidationError. */ + interface IValidationError { + + /** ValidationError severity */ + severity?: (google.cloud.dialogflow.v2beta1.ValidationError.Severity|keyof typeof google.cloud.dialogflow.v2beta1.ValidationError.Severity|null); + + /** ValidationError entries */ + entries?: (string[]|null); + + /** ValidationError errorMessage */ + errorMessage?: (string|null); + } + + /** Represents a ValidationError. */ + class ValidationError implements IValidationError { + + /** + * Constructs a new ValidationError. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IValidationError); + + /** ValidationError severity. */ + public severity: (google.cloud.dialogflow.v2beta1.ValidationError.Severity|keyof typeof google.cloud.dialogflow.v2beta1.ValidationError.Severity); + + /** ValidationError entries. */ + public entries: string[]; + + /** ValidationError errorMessage. */ + public errorMessage: string; + + /** + * Creates a new ValidationError instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidationError instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IValidationError): google.cloud.dialogflow.v2beta1.ValidationError; + + /** + * Encodes the specified ValidationError message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationError.verify|verify} messages. + * @param message ValidationError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IValidationError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidationError message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationError.verify|verify} messages. + * @param message ValidationError message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IValidationError, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidationError message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ValidationError; + + /** + * Decodes a ValidationError message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ValidationError; + + /** + * Verifies a ValidationError message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValidationError message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidationError + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ValidationError; + + /** + * Creates a plain object from a ValidationError message. Also converts values to other types if specified. + * @param message ValidationError + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ValidationError, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidationError to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ValidationError { + + /** Severity enum. */ + enum Severity { + SEVERITY_UNSPECIFIED = 0, + INFO = 1, + WARNING = 2, + ERROR = 3, + CRITICAL = 4 + } + } + + /** Properties of a ValidationResult. */ + interface IValidationResult { + + /** ValidationResult validationErrors */ + validationErrors?: (google.cloud.dialogflow.v2beta1.IValidationError[]|null); + } + + /** Represents a ValidationResult. */ + class ValidationResult implements IValidationResult { + + /** + * Constructs a new ValidationResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IValidationResult); + + /** ValidationResult validationErrors. */ + public validationErrors: google.cloud.dialogflow.v2beta1.IValidationError[]; + + /** + * Creates a new ValidationResult instance using the specified properties. + * @param [properties] Properties to set + * @returns ValidationResult instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IValidationResult): google.cloud.dialogflow.v2beta1.ValidationResult; + + /** + * Encodes the specified ValidationResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationResult.verify|verify} messages. + * @param message ValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ValidationResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationResult.verify|verify} messages. + * @param message ValidationResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IValidationResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ValidationResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ValidationResult; + + /** + * Decodes a ValidationResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ValidationResult; + + /** + * Verifies a ValidationResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ValidationResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ValidationResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ValidationResult; + + /** + * Creates a plain object from a ValidationResult message. Also converts values to other types if specified. + * @param message ValidationResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ValidationResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ValidationResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents an AnswerRecords */ + class AnswerRecords extends $protobuf.rpc.Service { + + /** + * Constructs a new AnswerRecords service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new AnswerRecords service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): AnswerRecords; + + /** + * Calls GetAnswerRecord. + * @param request GetAnswerRecordRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnswerRecord + */ + public getAnswerRecord(request: google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest, callback: google.cloud.dialogflow.v2beta1.AnswerRecords.GetAnswerRecordCallback): void; + + /** + * Calls GetAnswerRecord. + * @param request GetAnswerRecordRequest message or plain object + * @returns Promise + */ + public getAnswerRecord(request: google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest): Promise; + + /** + * Calls ListAnswerRecords. + * @param request ListAnswerRecordsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListAnswerRecordsResponse + */ + public listAnswerRecords(request: google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, callback: google.cloud.dialogflow.v2beta1.AnswerRecords.ListAnswerRecordsCallback): void; + + /** + * Calls ListAnswerRecords. + * @param request ListAnswerRecordsRequest message or plain object + * @returns Promise + */ + public listAnswerRecords(request: google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest): Promise; + + /** + * Calls UpdateAnswerRecord. + * @param request UpdateAnswerRecordRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnswerRecord + */ + public updateAnswerRecord(request: google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest, callback: google.cloud.dialogflow.v2beta1.AnswerRecords.UpdateAnswerRecordCallback): void; + + /** + * Calls UpdateAnswerRecord. + * @param request UpdateAnswerRecordRequest message or plain object + * @returns Promise + */ + public updateAnswerRecord(request: google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest): Promise; + } + + namespace AnswerRecords { + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.AnswerRecords#getAnswerRecord}. + * @param error Error, if any + * @param [response] AnswerRecord + */ + type GetAnswerRecordCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.AnswerRecord) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.AnswerRecords#listAnswerRecords}. + * @param error Error, if any + * @param [response] ListAnswerRecordsResponse + */ + type ListAnswerRecordsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.AnswerRecords#updateAnswerRecord}. + * @param error Error, if any + * @param [response] AnswerRecord + */ + type UpdateAnswerRecordCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.AnswerRecord) => void; + } + + /** Properties of an AnswerRecord. */ + interface IAnswerRecord { + + /** AnswerRecord name */ + name?: (string|null); + + /** AnswerRecord answerFeedback */ + answerFeedback?: (google.cloud.dialogflow.v2beta1.IAnswerFeedback|null); + + /** AnswerRecord agentAssistantRecord */ + agentAssistantRecord?: (google.cloud.dialogflow.v2beta1.IAgentAssistantRecord|null); + } + + /** Represents an AnswerRecord. */ + class AnswerRecord implements IAnswerRecord { + + /** + * Constructs a new AnswerRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IAnswerRecord); + + /** AnswerRecord name. */ + public name: string; + + /** AnswerRecord answerFeedback. */ + public answerFeedback?: (google.cloud.dialogflow.v2beta1.IAnswerFeedback|null); + + /** AnswerRecord agentAssistantRecord. */ + public agentAssistantRecord?: (google.cloud.dialogflow.v2beta1.IAgentAssistantRecord|null); + + /** AnswerRecord record. */ + public record?: "agentAssistantRecord"; + + /** + * Creates a new AnswerRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns AnswerRecord instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IAnswerRecord): google.cloud.dialogflow.v2beta1.AnswerRecord; + + /** + * Encodes the specified AnswerRecord message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnswerRecord.verify|verify} messages. + * @param message AnswerRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IAnswerRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnswerRecord message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnswerRecord.verify|verify} messages. + * @param message AnswerRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IAnswerRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnswerRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnswerRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.AnswerRecord; + + /** + * Decodes an AnswerRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnswerRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.AnswerRecord; + + /** + * Verifies an AnswerRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnswerRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnswerRecord + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.AnswerRecord; + + /** + * Creates a plain object from an AnswerRecord message. Also converts values to other types if specified. + * @param message AnswerRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.AnswerRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnswerRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AgentAssistantRecord. */ + interface IAgentAssistantRecord { + + /** AgentAssistantRecord articleSuggestionAnswer */ + articleSuggestionAnswer?: (google.cloud.dialogflow.v2beta1.IArticleAnswer|null); + + /** AgentAssistantRecord faqAnswer */ + faqAnswer?: (google.cloud.dialogflow.v2beta1.IFaqAnswer|null); + } + + /** Represents an AgentAssistantRecord. */ + class AgentAssistantRecord implements IAgentAssistantRecord { + + /** + * Constructs a new AgentAssistantRecord. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IAgentAssistantRecord); + + /** AgentAssistantRecord articleSuggestionAnswer. */ + public articleSuggestionAnswer?: (google.cloud.dialogflow.v2beta1.IArticleAnswer|null); + + /** AgentAssistantRecord faqAnswer. */ + public faqAnswer?: (google.cloud.dialogflow.v2beta1.IFaqAnswer|null); + + /** AgentAssistantRecord answer. */ + public answer?: ("articleSuggestionAnswer"|"faqAnswer"); + + /** + * Creates a new AgentAssistantRecord instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentAssistantRecord instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IAgentAssistantRecord): google.cloud.dialogflow.v2beta1.AgentAssistantRecord; + + /** + * Encodes the specified AgentAssistantRecord message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AgentAssistantRecord.verify|verify} messages. + * @param message AgentAssistantRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IAgentAssistantRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentAssistantRecord message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AgentAssistantRecord.verify|verify} messages. + * @param message AgentAssistantRecord message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IAgentAssistantRecord, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentAssistantRecord message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentAssistantRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.AgentAssistantRecord; + + /** + * Decodes an AgentAssistantRecord message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentAssistantRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.AgentAssistantRecord; + + /** + * Verifies an AgentAssistantRecord message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AgentAssistantRecord message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentAssistantRecord + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.AgentAssistantRecord; + + /** + * Creates a plain object from an AgentAssistantRecord message. Also converts values to other types if specified. + * @param message AgentAssistantRecord + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.AgentAssistantRecord, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentAssistantRecord to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnswerFeedback. */ + interface IAnswerFeedback { + + /** AnswerFeedback correctnessLevel */ + correctnessLevel?: (google.cloud.dialogflow.v2beta1.AnswerFeedback.CorrectnessLevel|keyof typeof google.cloud.dialogflow.v2beta1.AnswerFeedback.CorrectnessLevel|null); + + /** AnswerFeedback agentAssistantDetailFeedback */ + agentAssistantDetailFeedback?: (google.cloud.dialogflow.v2beta1.IAgentAssistantFeedback|null); + + /** AnswerFeedback clicked */ + clicked?: (boolean|null); + + /** AnswerFeedback clickTime */ + clickTime?: (google.protobuf.ITimestamp|null); + + /** AnswerFeedback displayed */ + displayed?: (boolean|null); + + /** AnswerFeedback displayTime */ + displayTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents an AnswerFeedback. */ + class AnswerFeedback implements IAnswerFeedback { + + /** + * Constructs a new AnswerFeedback. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IAnswerFeedback); + + /** AnswerFeedback correctnessLevel. */ + public correctnessLevel: (google.cloud.dialogflow.v2beta1.AnswerFeedback.CorrectnessLevel|keyof typeof google.cloud.dialogflow.v2beta1.AnswerFeedback.CorrectnessLevel); + + /** AnswerFeedback agentAssistantDetailFeedback. */ + public agentAssistantDetailFeedback?: (google.cloud.dialogflow.v2beta1.IAgentAssistantFeedback|null); + + /** AnswerFeedback clicked. */ + public clicked: boolean; + + /** AnswerFeedback clickTime. */ + public clickTime?: (google.protobuf.ITimestamp|null); + + /** AnswerFeedback displayed. */ + public displayed: boolean; + + /** AnswerFeedback displayTime. */ + public displayTime?: (google.protobuf.ITimestamp|null); + + /** AnswerFeedback detailFeedback. */ + public detailFeedback?: "agentAssistantDetailFeedback"; + + /** + * Creates a new AnswerFeedback instance using the specified properties. + * @param [properties] Properties to set + * @returns AnswerFeedback instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IAnswerFeedback): google.cloud.dialogflow.v2beta1.AnswerFeedback; + + /** + * Encodes the specified AnswerFeedback message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnswerFeedback.verify|verify} messages. + * @param message AnswerFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IAnswerFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnswerFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnswerFeedback.verify|verify} messages. + * @param message AnswerFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IAnswerFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnswerFeedback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnswerFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.AnswerFeedback; + + /** + * Decodes an AnswerFeedback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnswerFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.AnswerFeedback; + + /** + * Verifies an AnswerFeedback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnswerFeedback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnswerFeedback + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.AnswerFeedback; + + /** + * Creates a plain object from an AnswerFeedback message. Also converts values to other types if specified. + * @param message AnswerFeedback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.AnswerFeedback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnswerFeedback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AnswerFeedback { + + /** CorrectnessLevel enum. */ + enum CorrectnessLevel { + CORRECTNESS_LEVEL_UNSPECIFIED = 0, + NOT_CORRECT = 1, + PARTIALLY_CORRECT = 2, + FULLY_CORRECT = 3 + } + } + + /** Properties of an AgentAssistantFeedback. */ + interface IAgentAssistantFeedback { + + /** AgentAssistantFeedback answerRelevance */ + answerRelevance?: (google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.AnswerRelevance|keyof typeof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.AnswerRelevance|null); + + /** AgentAssistantFeedback documentCorrectness */ + documentCorrectness?: (google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentCorrectness|keyof typeof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentCorrectness|null); + + /** AgentAssistantFeedback documentEfficiency */ + documentEfficiency?: (google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentEfficiency|keyof typeof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentEfficiency|null); + + /** AgentAssistantFeedback summarizationFeedback */ + summarizationFeedback?: (google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.ISummarizationFeedback|null); + } + + /** Represents an AgentAssistantFeedback. */ + class AgentAssistantFeedback implements IAgentAssistantFeedback { + + /** + * Constructs a new AgentAssistantFeedback. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IAgentAssistantFeedback); + + /** AgentAssistantFeedback answerRelevance. */ + public answerRelevance: (google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.AnswerRelevance|keyof typeof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.AnswerRelevance); + + /** AgentAssistantFeedback documentCorrectness. */ + public documentCorrectness: (google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentCorrectness|keyof typeof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentCorrectness); + + /** AgentAssistantFeedback documentEfficiency. */ + public documentEfficiency: (google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentEfficiency|keyof typeof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentEfficiency); + + /** AgentAssistantFeedback summarizationFeedback. */ + public summarizationFeedback?: (google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.ISummarizationFeedback|null); + + /** + * Creates a new AgentAssistantFeedback instance using the specified properties. + * @param [properties] Properties to set + * @returns AgentAssistantFeedback instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IAgentAssistantFeedback): google.cloud.dialogflow.v2beta1.AgentAssistantFeedback; + + /** + * Encodes the specified AgentAssistantFeedback message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.verify|verify} messages. + * @param message AgentAssistantFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IAgentAssistantFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AgentAssistantFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.verify|verify} messages. + * @param message AgentAssistantFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IAgentAssistantFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AgentAssistantFeedback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AgentAssistantFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.AgentAssistantFeedback; + + /** + * Decodes an AgentAssistantFeedback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AgentAssistantFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.AgentAssistantFeedback; + + /** + * Verifies an AgentAssistantFeedback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AgentAssistantFeedback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AgentAssistantFeedback + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.AgentAssistantFeedback; + + /** + * Creates a plain object from an AgentAssistantFeedback message. Also converts values to other types if specified. + * @param message AgentAssistantFeedback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.AgentAssistantFeedback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AgentAssistantFeedback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace AgentAssistantFeedback { + + /** Properties of a SummarizationFeedback. */ + interface ISummarizationFeedback { + + /** SummarizationFeedback startTimestamp */ + startTimestamp?: (google.protobuf.ITimestamp|null); + + /** SummarizationFeedback submitTimestamp */ + submitTimestamp?: (google.protobuf.ITimestamp|null); + + /** SummarizationFeedback summaryText */ + summaryText?: (string|null); + } + + /** Represents a SummarizationFeedback. */ + class SummarizationFeedback implements ISummarizationFeedback { + + /** + * Constructs a new SummarizationFeedback. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.ISummarizationFeedback); + + /** SummarizationFeedback startTimestamp. */ + public startTimestamp?: (google.protobuf.ITimestamp|null); + + /** SummarizationFeedback submitTimestamp. */ + public submitTimestamp?: (google.protobuf.ITimestamp|null); + + /** SummarizationFeedback summaryText. */ + public summaryText: string; + + /** + * Creates a new SummarizationFeedback instance using the specified properties. + * @param [properties] Properties to set + * @returns SummarizationFeedback instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.ISummarizationFeedback): google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback; + + /** + * Encodes the specified SummarizationFeedback message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback.verify|verify} messages. + * @param message SummarizationFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.ISummarizationFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SummarizationFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback.verify|verify} messages. + * @param message SummarizationFeedback message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.ISummarizationFeedback, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SummarizationFeedback message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SummarizationFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback; + + /** + * Decodes a SummarizationFeedback message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SummarizationFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback; + + /** + * Verifies a SummarizationFeedback message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SummarizationFeedback message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SummarizationFeedback + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback; + + /** + * Creates a plain object from a SummarizationFeedback message. Also converts values to other types if specified. + * @param message SummarizationFeedback + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SummarizationFeedback to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** AnswerRelevance enum. */ + enum AnswerRelevance { + ANSWER_RELEVANCE_UNSPECIFIED = 0, + IRRELEVANT = 1, + RELEVANT = 2 + } + + /** DocumentCorrectness enum. */ + enum DocumentCorrectness { + DOCUMENT_CORRECTNESS_UNSPECIFIED = 0, + INCORRECT = 1, + CORRECT = 2 + } + + /** DocumentEfficiency enum. */ + enum DocumentEfficiency { + DOCUMENT_EFFICIENCY_UNSPECIFIED = 0, + INEFFICIENT = 1, + EFFICIENT = 2 + } + } + + /** Properties of a GetAnswerRecordRequest. */ + interface IGetAnswerRecordRequest { + + /** GetAnswerRecordRequest name */ + name?: (string|null); + } + + /** Represents a GetAnswerRecordRequest. */ + class GetAnswerRecordRequest implements IGetAnswerRecordRequest { + + /** + * Constructs a new GetAnswerRecordRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest); + + /** GetAnswerRecordRequest name. */ + public name: string; + + /** + * Creates a new GetAnswerRecordRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetAnswerRecordRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest): google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest; + + /** + * Encodes the specified GetAnswerRecordRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest.verify|verify} messages. + * @param message GetAnswerRecordRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetAnswerRecordRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest.verify|verify} messages. + * @param message GetAnswerRecordRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetAnswerRecordRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetAnswerRecordRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest; + + /** + * Decodes a GetAnswerRecordRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetAnswerRecordRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest; + + /** + * Verifies a GetAnswerRecordRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetAnswerRecordRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetAnswerRecordRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest; + + /** + * Creates a plain object from a GetAnswerRecordRequest message. Also converts values to other types if specified. + * @param message GetAnswerRecordRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetAnswerRecordRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAnswerRecordsRequest. */ + interface IListAnswerRecordsRequest { + + /** ListAnswerRecordsRequest parent */ + parent?: (string|null); + + /** ListAnswerRecordsRequest pageSize */ + pageSize?: (number|null); + + /** ListAnswerRecordsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListAnswerRecordsRequest. */ + class ListAnswerRecordsRequest implements IListAnswerRecordsRequest { + + /** + * Constructs a new ListAnswerRecordsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest); + + /** ListAnswerRecordsRequest parent. */ + public parent: string; + + /** ListAnswerRecordsRequest pageSize. */ + public pageSize: number; + + /** ListAnswerRecordsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListAnswerRecordsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnswerRecordsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest): google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest; + + /** + * Encodes the specified ListAnswerRecordsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest.verify|verify} messages. + * @param message ListAnswerRecordsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnswerRecordsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest.verify|verify} messages. + * @param message ListAnswerRecordsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnswerRecordsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnswerRecordsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest; + + /** + * Decodes a ListAnswerRecordsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnswerRecordsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest; + + /** + * Verifies a ListAnswerRecordsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnswerRecordsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnswerRecordsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest; + + /** + * Creates a plain object from a ListAnswerRecordsRequest message. Also converts values to other types if specified. + * @param message ListAnswerRecordsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnswerRecordsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListAnswerRecordsResponse. */ + interface IListAnswerRecordsResponse { + + /** ListAnswerRecordsResponse answerRecords */ + answerRecords?: (google.cloud.dialogflow.v2beta1.IAnswerRecord[]|null); + + /** ListAnswerRecordsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListAnswerRecordsResponse. */ + class ListAnswerRecordsResponse implements IListAnswerRecordsResponse { + + /** + * Constructs a new ListAnswerRecordsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse); + + /** ListAnswerRecordsResponse answerRecords. */ + public answerRecords: google.cloud.dialogflow.v2beta1.IAnswerRecord[]; + + /** ListAnswerRecordsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListAnswerRecordsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListAnswerRecordsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse): google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse; + + /** + * Encodes the specified ListAnswerRecordsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.verify|verify} messages. + * @param message ListAnswerRecordsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListAnswerRecordsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.verify|verify} messages. + * @param message ListAnswerRecordsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListAnswerRecordsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListAnswerRecordsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse; + + /** + * Decodes a ListAnswerRecordsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListAnswerRecordsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse; + + /** + * Verifies a ListAnswerRecordsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListAnswerRecordsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListAnswerRecordsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse; + + /** + * Creates a plain object from a ListAnswerRecordsResponse message. Also converts values to other types if specified. + * @param message ListAnswerRecordsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListAnswerRecordsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateAnswerRecordRequest. */ + interface IUpdateAnswerRecordRequest { + + /** UpdateAnswerRecordRequest answerRecord */ + answerRecord?: (google.cloud.dialogflow.v2beta1.IAnswerRecord|null); + + /** UpdateAnswerRecordRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateAnswerRecordRequest. */ + class UpdateAnswerRecordRequest implements IUpdateAnswerRecordRequest { + + /** + * Constructs a new UpdateAnswerRecordRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest); + + /** UpdateAnswerRecordRequest answerRecord. */ + public answerRecord?: (google.cloud.dialogflow.v2beta1.IAnswerRecord|null); + + /** UpdateAnswerRecordRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateAnswerRecordRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateAnswerRecordRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest): google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest; + + /** + * Encodes the specified UpdateAnswerRecordRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest.verify|verify} messages. + * @param message UpdateAnswerRecordRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateAnswerRecordRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest.verify|verify} messages. + * @param message UpdateAnswerRecordRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateAnswerRecordRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateAnswerRecordRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest; + + /** + * Decodes an UpdateAnswerRecordRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateAnswerRecordRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest; + + /** + * Verifies an UpdateAnswerRecordRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateAnswerRecordRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateAnswerRecordRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest; + + /** + * Creates a plain object from an UpdateAnswerRecordRequest message. Also converts values to other types if specified. + * @param message UpdateAnswerRecordRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateAnswerRecordRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents a Participants */ + class Participants extends $protobuf.rpc.Service { + + /** + * Constructs a new Participants service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Participants service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Participants; + + /** + * Calls CreateParticipant. + * @param request CreateParticipantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Participant + */ + public createParticipant(request: google.cloud.dialogflow.v2beta1.ICreateParticipantRequest, callback: google.cloud.dialogflow.v2beta1.Participants.CreateParticipantCallback): void; + + /** + * Calls CreateParticipant. + * @param request CreateParticipantRequest message or plain object + * @returns Promise + */ + public createParticipant(request: google.cloud.dialogflow.v2beta1.ICreateParticipantRequest): Promise; + + /** + * Calls GetParticipant. + * @param request GetParticipantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Participant + */ + public getParticipant(request: google.cloud.dialogflow.v2beta1.IGetParticipantRequest, callback: google.cloud.dialogflow.v2beta1.Participants.GetParticipantCallback): void; + + /** + * Calls GetParticipant. + * @param request GetParticipantRequest message or plain object + * @returns Promise + */ + public getParticipant(request: google.cloud.dialogflow.v2beta1.IGetParticipantRequest): Promise; + + /** + * Calls ListParticipants. + * @param request ListParticipantsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListParticipantsResponse + */ + public listParticipants(request: google.cloud.dialogflow.v2beta1.IListParticipantsRequest, callback: google.cloud.dialogflow.v2beta1.Participants.ListParticipantsCallback): void; + + /** + * Calls ListParticipants. + * @param request ListParticipantsRequest message or plain object + * @returns Promise + */ + public listParticipants(request: google.cloud.dialogflow.v2beta1.IListParticipantsRequest): Promise; + + /** + * Calls UpdateParticipant. + * @param request UpdateParticipantRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Participant + */ + public updateParticipant(request: google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest, callback: google.cloud.dialogflow.v2beta1.Participants.UpdateParticipantCallback): void; + + /** + * Calls UpdateParticipant. + * @param request UpdateParticipantRequest message or plain object + * @returns Promise + */ + public updateParticipant(request: google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest): Promise; + + /** + * Calls AnalyzeContent. + * @param request AnalyzeContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and AnalyzeContentResponse + */ + public analyzeContent(request: google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, callback: google.cloud.dialogflow.v2beta1.Participants.AnalyzeContentCallback): void; + + /** + * Calls AnalyzeContent. + * @param request AnalyzeContentRequest message or plain object + * @returns Promise + */ + public analyzeContent(request: google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest): Promise; + + /** + * Calls StreamingAnalyzeContent. + * @param request StreamingAnalyzeContentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingAnalyzeContentResponse + */ + public streamingAnalyzeContent(request: google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentRequest, callback: google.cloud.dialogflow.v2beta1.Participants.StreamingAnalyzeContentCallback): void; + + /** + * Calls StreamingAnalyzeContent. + * @param request StreamingAnalyzeContentRequest message or plain object + * @returns Promise + */ + public streamingAnalyzeContent(request: google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentRequest): Promise; + + /** + * Calls SuggestArticles. + * @param request SuggestArticlesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SuggestArticlesResponse + */ + public suggestArticles(request: google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest, callback: google.cloud.dialogflow.v2beta1.Participants.SuggestArticlesCallback): void; + + /** + * Calls SuggestArticles. + * @param request SuggestArticlesRequest message or plain object + * @returns Promise + */ + public suggestArticles(request: google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest): Promise; + + /** + * Calls SuggestFaqAnswers. + * @param request SuggestFaqAnswersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SuggestFaqAnswersResponse + */ + public suggestFaqAnswers(request: google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, callback: google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswersCallback): void; + + /** + * Calls SuggestFaqAnswers. + * @param request SuggestFaqAnswersRequest message or plain object + * @returns Promise + */ + public suggestFaqAnswers(request: google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest): Promise; + + /** + * Calls SuggestSmartReplies. + * @param request SuggestSmartRepliesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SuggestSmartRepliesResponse + */ + public suggestSmartReplies(request: google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest, callback: google.cloud.dialogflow.v2beta1.Participants.SuggestSmartRepliesCallback): void; + + /** + * Calls SuggestSmartReplies. + * @param request SuggestSmartRepliesRequest message or plain object + * @returns Promise + */ + public suggestSmartReplies(request: google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest): Promise; + + /** + * Calls ListSuggestions. + * @param request ListSuggestionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSuggestionsResponse + */ + public listSuggestions(request: google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, callback: google.cloud.dialogflow.v2beta1.Participants.ListSuggestionsCallback): void; + + /** + * Calls ListSuggestions. + * @param request ListSuggestionsRequest message or plain object + * @returns Promise + */ + public listSuggestions(request: google.cloud.dialogflow.v2beta1.IListSuggestionsRequest): Promise; + + /** + * Calls CompileSuggestion. + * @param request CompileSuggestionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CompileSuggestionResponse + */ + public compileSuggestion(request: google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, callback: google.cloud.dialogflow.v2beta1.Participants.CompileSuggestionCallback): void; + + /** + * Calls CompileSuggestion. + * @param request CompileSuggestionRequest message or plain object + * @returns Promise + */ + public compileSuggestion(request: google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest): Promise; + } + + namespace Participants { + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#createParticipant}. + * @param error Error, if any + * @param [response] Participant + */ + type CreateParticipantCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Participant) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#getParticipant}. + * @param error Error, if any + * @param [response] Participant + */ + type GetParticipantCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Participant) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#listParticipants}. + * @param error Error, if any + * @param [response] ListParticipantsResponse + */ + type ListParticipantsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListParticipantsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#updateParticipant}. + * @param error Error, if any + * @param [response] Participant + */ + type UpdateParticipantCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Participant) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#analyzeContent}. + * @param error Error, if any + * @param [response] AnalyzeContentResponse + */ + type AnalyzeContentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.AnalyzeContentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#streamingAnalyzeContent}. + * @param error Error, if any + * @param [response] StreamingAnalyzeContentResponse + */ + type StreamingAnalyzeContentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#suggestArticles}. + * @param error Error, if any + * @param [response] SuggestArticlesResponse + */ + type SuggestArticlesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.SuggestArticlesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#suggestFaqAnswers}. + * @param error Error, if any + * @param [response] SuggestFaqAnswersResponse + */ + type SuggestFaqAnswersCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#suggestSmartReplies}. + * @param error Error, if any + * @param [response] SuggestSmartRepliesResponse + */ + type SuggestSmartRepliesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#listSuggestions}. + * @param error Error, if any + * @param [response] ListSuggestionsResponse + */ + type ListSuggestionsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListSuggestionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#compileSuggestion}. + * @param error Error, if any + * @param [response] CompileSuggestionResponse + */ + type CompileSuggestionCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.CompileSuggestionResponse) => void; + } + + /** Properties of a Participant. */ + interface IParticipant { + + /** Participant name */ + name?: (string|null); + + /** Participant role */ + role?: (google.cloud.dialogflow.v2beta1.Participant.Role|keyof typeof google.cloud.dialogflow.v2beta1.Participant.Role|null); + + /** Participant obfuscatedExternalUserId */ + obfuscatedExternalUserId?: (string|null); + } + + /** Represents a Participant. */ + class Participant implements IParticipant { + + /** + * Constructs a new Participant. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IParticipant); + + /** Participant name. */ + public name: string; + + /** Participant role. */ + public role: (google.cloud.dialogflow.v2beta1.Participant.Role|keyof typeof google.cloud.dialogflow.v2beta1.Participant.Role); + + /** Participant obfuscatedExternalUserId. */ + public obfuscatedExternalUserId: string; + + /** + * Creates a new Participant instance using the specified properties. + * @param [properties] Properties to set + * @returns Participant instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IParticipant): google.cloud.dialogflow.v2beta1.Participant; + + /** + * Encodes the specified Participant message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Participant.verify|verify} messages. + * @param message Participant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IParticipant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Participant message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Participant.verify|verify} messages. + * @param message Participant message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IParticipant, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Participant message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Participant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Participant; + + /** + * Decodes a Participant message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Participant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Participant; + + /** + * Verifies a Participant message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Participant message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Participant + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Participant; + + /** + * Creates a plain object from a Participant message. Also converts values to other types if specified. + * @param message Participant + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Participant, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Participant to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Participant { + + /** Role enum. */ + enum Role { + ROLE_UNSPECIFIED = 0, + HUMAN_AGENT = 1, + AUTOMATED_AGENT = 2, + END_USER = 3 + } + } + + /** Properties of a Message. */ + interface IMessage { + + /** Message name */ + name?: (string|null); + + /** Message content */ + content?: (string|null); + + /** Message languageCode */ + languageCode?: (string|null); + + /** Message participant */ + participant?: (string|null); + + /** Message participantRole */ + participantRole?: (google.cloud.dialogflow.v2beta1.Participant.Role|keyof typeof google.cloud.dialogflow.v2beta1.Participant.Role|null); + + /** Message createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Message sendTime */ + sendTime?: (google.protobuf.ITimestamp|null); + + /** Message messageAnnotation */ + messageAnnotation?: (google.cloud.dialogflow.v2beta1.IMessageAnnotation|null); + + /** Message sentimentAnalysis */ + sentimentAnalysis?: (google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IMessage); + + /** Message name. */ + public name: string; + + /** Message content. */ + public content: string; + + /** Message languageCode. */ + public languageCode: string; + + /** Message participant. */ + public participant: string; + + /** Message participantRole. */ + public participantRole: (google.cloud.dialogflow.v2beta1.Participant.Role|keyof typeof google.cloud.dialogflow.v2beta1.Participant.Role); + + /** Message createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Message sendTime. */ + public sendTime?: (google.protobuf.ITimestamp|null); + + /** Message messageAnnotation. */ + public messageAnnotation?: (google.cloud.dialogflow.v2beta1.IMessageAnnotation|null); + + /** Message sentimentAnalysis. */ + public sentimentAnalysis?: (google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult|null); + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IMessage): google.cloud.dialogflow.v2beta1.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateParticipantRequest. */ + interface ICreateParticipantRequest { + + /** CreateParticipantRequest parent */ + parent?: (string|null); + + /** CreateParticipantRequest participant */ + participant?: (google.cloud.dialogflow.v2beta1.IParticipant|null); + } + + /** Represents a CreateParticipantRequest. */ + class CreateParticipantRequest implements ICreateParticipantRequest { + + /** + * Constructs a new CreateParticipantRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateParticipantRequest); + + /** CreateParticipantRequest parent. */ + public parent: string; + + /** CreateParticipantRequest participant. */ + public participant?: (google.cloud.dialogflow.v2beta1.IParticipant|null); + + /** + * Creates a new CreateParticipantRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateParticipantRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateParticipantRequest): google.cloud.dialogflow.v2beta1.CreateParticipantRequest; + + /** + * Encodes the specified CreateParticipantRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateParticipantRequest.verify|verify} messages. + * @param message CreateParticipantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ICreateParticipantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateParticipantRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateParticipantRequest.verify|verify} messages. + * @param message CreateParticipantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateParticipantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateParticipantRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateParticipantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateParticipantRequest; + + /** + * Decodes a CreateParticipantRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateParticipantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateParticipantRequest; + + /** + * Verifies a CreateParticipantRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateParticipantRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateParticipantRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateParticipantRequest; + + /** + * Creates a plain object from a CreateParticipantRequest message. Also converts values to other types if specified. + * @param message CreateParticipantRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CreateParticipantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateParticipantRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetParticipantRequest. */ + interface IGetParticipantRequest { + + /** GetParticipantRequest name */ + name?: (string|null); + } + + /** Represents a GetParticipantRequest. */ + class GetParticipantRequest implements IGetParticipantRequest { + + /** + * Constructs a new GetParticipantRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IGetParticipantRequest); + + /** GetParticipantRequest name. */ + public name: string; + + /** + * Creates a new GetParticipantRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetParticipantRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IGetParticipantRequest): google.cloud.dialogflow.v2beta1.GetParticipantRequest; + + /** + * Encodes the specified GetParticipantRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetParticipantRequest.verify|verify} messages. + * @param message GetParticipantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IGetParticipantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetParticipantRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetParticipantRequest.verify|verify} messages. + * @param message GetParticipantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetParticipantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetParticipantRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetParticipantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetParticipantRequest; + + /** + * Decodes a GetParticipantRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetParticipantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetParticipantRequest; + + /** + * Verifies a GetParticipantRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetParticipantRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetParticipantRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetParticipantRequest; + + /** + * Creates a plain object from a GetParticipantRequest message. Also converts values to other types if specified. + * @param message GetParticipantRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.GetParticipantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetParticipantRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListParticipantsRequest. */ + interface IListParticipantsRequest { + + /** ListParticipantsRequest parent */ + parent?: (string|null); + + /** ListParticipantsRequest pageSize */ + pageSize?: (number|null); + + /** ListParticipantsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListParticipantsRequest. */ + class ListParticipantsRequest implements IListParticipantsRequest { + + /** + * Constructs a new ListParticipantsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListParticipantsRequest); + + /** ListParticipantsRequest parent. */ + public parent: string; + + /** ListParticipantsRequest pageSize. */ + public pageSize: number; + + /** ListParticipantsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListParticipantsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListParticipantsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListParticipantsRequest): google.cloud.dialogflow.v2beta1.ListParticipantsRequest; + + /** + * Encodes the specified ListParticipantsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListParticipantsRequest.verify|verify} messages. + * @param message ListParticipantsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListParticipantsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListParticipantsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListParticipantsRequest.verify|verify} messages. + * @param message ListParticipantsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListParticipantsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListParticipantsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListParticipantsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListParticipantsRequest; + + /** + * Decodes a ListParticipantsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListParticipantsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListParticipantsRequest; + + /** + * Verifies a ListParticipantsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListParticipantsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListParticipantsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListParticipantsRequest; + + /** + * Creates a plain object from a ListParticipantsRequest message. Also converts values to other types if specified. + * @param message ListParticipantsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListParticipantsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListParticipantsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListParticipantsResponse. */ + interface IListParticipantsResponse { + + /** ListParticipantsResponse participants */ + participants?: (google.cloud.dialogflow.v2beta1.IParticipant[]|null); + + /** ListParticipantsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListParticipantsResponse. */ + class ListParticipantsResponse implements IListParticipantsResponse { + + /** + * Constructs a new ListParticipantsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListParticipantsResponse); + + /** ListParticipantsResponse participants. */ + public participants: google.cloud.dialogflow.v2beta1.IParticipant[]; + + /** ListParticipantsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListParticipantsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListParticipantsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListParticipantsResponse): google.cloud.dialogflow.v2beta1.ListParticipantsResponse; + + /** + * Encodes the specified ListParticipantsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListParticipantsResponse.verify|verify} messages. + * @param message ListParticipantsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListParticipantsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListParticipantsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListParticipantsResponse.verify|verify} messages. + * @param message ListParticipantsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListParticipantsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListParticipantsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListParticipantsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListParticipantsResponse; + + /** + * Decodes a ListParticipantsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListParticipantsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListParticipantsResponse; + + /** + * Verifies a ListParticipantsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListParticipantsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListParticipantsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListParticipantsResponse; + + /** + * Creates a plain object from a ListParticipantsResponse message. Also converts values to other types if specified. + * @param message ListParticipantsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListParticipantsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListParticipantsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateParticipantRequest. */ + interface IUpdateParticipantRequest { + + /** UpdateParticipantRequest participant */ + participant?: (google.cloud.dialogflow.v2beta1.IParticipant|null); + + /** UpdateParticipantRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateParticipantRequest. */ + class UpdateParticipantRequest implements IUpdateParticipantRequest { + + /** + * Constructs a new UpdateParticipantRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest); + + /** UpdateParticipantRequest participant. */ + public participant?: (google.cloud.dialogflow.v2beta1.IParticipant|null); + + /** UpdateParticipantRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateParticipantRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateParticipantRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest): google.cloud.dialogflow.v2beta1.UpdateParticipantRequest; + + /** + * Encodes the specified UpdateParticipantRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateParticipantRequest.verify|verify} messages. + * @param message UpdateParticipantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateParticipantRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateParticipantRequest.verify|verify} messages. + * @param message UpdateParticipantRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateParticipantRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateParticipantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateParticipantRequest; + + /** + * Decodes an UpdateParticipantRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateParticipantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateParticipantRequest; + + /** + * Verifies an UpdateParticipantRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateParticipantRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateParticipantRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateParticipantRequest; + + /** + * Creates a plain object from an UpdateParticipantRequest message. Also converts values to other types if specified. + * @param message UpdateParticipantRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateParticipantRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateParticipantRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InputText. */ + interface IInputText { + + /** InputText text */ + text?: (string|null); + + /** InputText languageCode */ + languageCode?: (string|null); + } + + /** Represents an InputText. */ + class InputText implements IInputText { + + /** + * Constructs a new InputText. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IInputText); + + /** InputText text. */ + public text: string; + + /** InputText languageCode. */ + public languageCode: string; + + /** + * Creates a new InputText instance using the specified properties. + * @param [properties] Properties to set + * @returns InputText instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IInputText): google.cloud.dialogflow.v2beta1.InputText; + + /** + * Encodes the specified InputText message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputText.verify|verify} messages. + * @param message InputText message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IInputText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputText message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputText.verify|verify} messages. + * @param message InputText message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IInputText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputText message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.InputText; + + /** + * Decodes an InputText message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.InputText; + + /** + * Verifies an InputText message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputText message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputText + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.InputText; + + /** + * Creates a plain object from an InputText message. Also converts values to other types if specified. + * @param message InputText + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.InputText, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputText to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InputAudio. */ + interface IInputAudio { + + /** InputAudio config */ + config?: (google.cloud.dialogflow.v2beta1.IInputAudioConfig|null); + + /** InputAudio audio */ + audio?: (Uint8Array|string|null); + } + + /** Represents an InputAudio. */ + class InputAudio implements IInputAudio { + + /** + * Constructs a new InputAudio. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IInputAudio); + + /** InputAudio config. */ + public config?: (google.cloud.dialogflow.v2beta1.IInputAudioConfig|null); + + /** InputAudio audio. */ + public audio: (Uint8Array|string); + + /** + * Creates a new InputAudio instance using the specified properties. + * @param [properties] Properties to set + * @returns InputAudio instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IInputAudio): google.cloud.dialogflow.v2beta1.InputAudio; + + /** + * Encodes the specified InputAudio message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputAudio.verify|verify} messages. + * @param message InputAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IInputAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputAudio.verify|verify} messages. + * @param message InputAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IInputAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputAudio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.InputAudio; + + /** + * Decodes an InputAudio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.InputAudio; + + /** + * Verifies an InputAudio message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputAudio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputAudio + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.InputAudio; + + /** + * Creates a plain object from an InputAudio message. Also converts values to other types if specified. + * @param message InputAudio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.InputAudio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputAudio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AudioInput. */ + interface IAudioInput { + + /** AudioInput config */ + config?: (google.cloud.dialogflow.v2beta1.IInputAudioConfig|null); + + /** AudioInput audio */ + audio?: (Uint8Array|string|null); + } + + /** Represents an AudioInput. */ + class AudioInput implements IAudioInput { + + /** + * Constructs a new AudioInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IAudioInput); + + /** AudioInput config. */ + public config?: (google.cloud.dialogflow.v2beta1.IInputAudioConfig|null); + + /** AudioInput audio. */ + public audio: (Uint8Array|string); + + /** + * Creates a new AudioInput instance using the specified properties. + * @param [properties] Properties to set + * @returns AudioInput instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IAudioInput): google.cloud.dialogflow.v2beta1.AudioInput; + + /** + * Encodes the specified AudioInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AudioInput.verify|verify} messages. + * @param message AudioInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IAudioInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AudioInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AudioInput.verify|verify} messages. + * @param message AudioInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IAudioInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AudioInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AudioInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.AudioInput; + + /** + * Decodes an AudioInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AudioInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.AudioInput; + + /** + * Verifies an AudioInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AudioInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AudioInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.AudioInput; + + /** + * Creates a plain object from an AudioInput message. Also converts values to other types if specified. + * @param message AudioInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.AudioInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AudioInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OutputAudio. */ + interface IOutputAudio { + + /** OutputAudio config */ + config?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + + /** OutputAudio audio */ + audio?: (Uint8Array|string|null); + } + + /** Represents an OutputAudio. */ + class OutputAudio implements IOutputAudio { + + /** + * Constructs a new OutputAudio. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IOutputAudio); + + /** OutputAudio config. */ + public config?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + + /** OutputAudio audio. */ + public audio: (Uint8Array|string); + + /** + * Creates a new OutputAudio instance using the specified properties. + * @param [properties] Properties to set + * @returns OutputAudio instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IOutputAudio): google.cloud.dialogflow.v2beta1.OutputAudio; + + /** + * Encodes the specified OutputAudio message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.OutputAudio.verify|verify} messages. + * @param message OutputAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IOutputAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OutputAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.OutputAudio.verify|verify} messages. + * @param message OutputAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IOutputAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OutputAudio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OutputAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.OutputAudio; + + /** + * Decodes an OutputAudio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OutputAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.OutputAudio; + + /** + * Verifies an OutputAudio message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OutputAudio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OutputAudio + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.OutputAudio; + + /** + * Creates a plain object from an OutputAudio message. Also converts values to other types if specified. + * @param message OutputAudio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.OutputAudio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OutputAudio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AutomatedAgentReply. */ + interface IAutomatedAgentReply { + + /** AutomatedAgentReply detectIntentResponse */ + detectIntentResponse?: (google.cloud.dialogflow.v2beta1.IDetectIntentResponse|null); + + /** AutomatedAgentReply responseMessages */ + responseMessages?: (google.cloud.dialogflow.v2beta1.IResponseMessage[]|null); + + /** AutomatedAgentReply intent */ + intent?: (string|null); + + /** AutomatedAgentReply event */ + event?: (string|null); + + /** AutomatedAgentReply cxSessionParameters */ + cxSessionParameters?: (google.protobuf.IStruct|null); + } + + /** Represents an AutomatedAgentReply. */ + class AutomatedAgentReply implements IAutomatedAgentReply { + + /** + * Constructs a new AutomatedAgentReply. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IAutomatedAgentReply); + + /** AutomatedAgentReply detectIntentResponse. */ + public detectIntentResponse?: (google.cloud.dialogflow.v2beta1.IDetectIntentResponse|null); + + /** AutomatedAgentReply responseMessages. */ + public responseMessages: google.cloud.dialogflow.v2beta1.IResponseMessage[]; + + /** AutomatedAgentReply intent. */ + public intent: string; + + /** AutomatedAgentReply event. */ + public event: string; + + /** AutomatedAgentReply cxSessionParameters. */ + public cxSessionParameters?: (google.protobuf.IStruct|null); + + /** AutomatedAgentReply response. */ + public response?: "detectIntentResponse"; + + /** AutomatedAgentReply match. */ + public match?: ("intent"|"event"); + + /** + * Creates a new AutomatedAgentReply instance using the specified properties. + * @param [properties] Properties to set + * @returns AutomatedAgentReply instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IAutomatedAgentReply): google.cloud.dialogflow.v2beta1.AutomatedAgentReply; + + /** + * Encodes the specified AutomatedAgentReply message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AutomatedAgentReply.verify|verify} messages. + * @param message AutomatedAgentReply message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IAutomatedAgentReply, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AutomatedAgentReply message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AutomatedAgentReply.verify|verify} messages. + * @param message AutomatedAgentReply message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IAutomatedAgentReply, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AutomatedAgentReply message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AutomatedAgentReply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.AutomatedAgentReply; + + /** + * Decodes an AutomatedAgentReply message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AutomatedAgentReply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.AutomatedAgentReply; + + /** + * Verifies an AutomatedAgentReply message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AutomatedAgentReply message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AutomatedAgentReply + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.AutomatedAgentReply; + + /** + * Creates a plain object from an AutomatedAgentReply message. Also converts values to other types if specified. + * @param message AutomatedAgentReply + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.AutomatedAgentReply, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AutomatedAgentReply to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestionFeature. */ + interface ISuggestionFeature { + + /** SuggestionFeature type */ + type?: (google.cloud.dialogflow.v2beta1.SuggestionFeature.Type|keyof typeof google.cloud.dialogflow.v2beta1.SuggestionFeature.Type|null); + } + + /** Represents a SuggestionFeature. */ + class SuggestionFeature implements ISuggestionFeature { + + /** + * Constructs a new SuggestionFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISuggestionFeature); + + /** SuggestionFeature type. */ + public type: (google.cloud.dialogflow.v2beta1.SuggestionFeature.Type|keyof typeof google.cloud.dialogflow.v2beta1.SuggestionFeature.Type); + + /** + * Creates a new SuggestionFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionFeature instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISuggestionFeature): google.cloud.dialogflow.v2beta1.SuggestionFeature; + + /** + * Encodes the specified SuggestionFeature message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestionFeature.verify|verify} messages. + * @param message SuggestionFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISuggestionFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionFeature message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestionFeature.verify|verify} messages. + * @param message SuggestionFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISuggestionFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SuggestionFeature; + + /** + * Decodes a SuggestionFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SuggestionFeature; + + /** + * Verifies a SuggestionFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionFeature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SuggestionFeature; + + /** + * Creates a plain object from a SuggestionFeature message. Also converts values to other types if specified. + * @param message SuggestionFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SuggestionFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SuggestionFeature { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ARTICLE_SUGGESTION = 1, + FAQ = 2, + SMART_REPLY = 3 + } + } + + /** Properties of an AnalyzeContentRequest. */ + interface IAnalyzeContentRequest { + + /** AnalyzeContentRequest participant */ + participant?: (string|null); + + /** AnalyzeContentRequest text */ + text?: (google.cloud.dialogflow.v2beta1.IInputText|null); + + /** AnalyzeContentRequest audio */ + audio?: (google.cloud.dialogflow.v2beta1.IInputAudio|null); + + /** AnalyzeContentRequest textInput */ + textInput?: (google.cloud.dialogflow.v2beta1.ITextInput|null); + + /** AnalyzeContentRequest audioInput */ + audioInput?: (google.cloud.dialogflow.v2beta1.IAudioInput|null); + + /** AnalyzeContentRequest eventInput */ + eventInput?: (google.cloud.dialogflow.v2beta1.IEventInput|null); + + /** AnalyzeContentRequest replyAudioConfig */ + replyAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + + /** AnalyzeContentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.v2beta1.IQueryParameters|null); + + /** AnalyzeContentRequest messageSendTime */ + messageSendTime?: (google.protobuf.ITimestamp|null); + + /** AnalyzeContentRequest requestId */ + requestId?: (string|null); + } + + /** Represents an AnalyzeContentRequest. */ + class AnalyzeContentRequest implements IAnalyzeContentRequest { + + /** + * Constructs a new AnalyzeContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest); + + /** AnalyzeContentRequest participant. */ + public participant: string; + + /** AnalyzeContentRequest text. */ + public text?: (google.cloud.dialogflow.v2beta1.IInputText|null); + + /** AnalyzeContentRequest audio. */ + public audio?: (google.cloud.dialogflow.v2beta1.IInputAudio|null); + + /** AnalyzeContentRequest textInput. */ + public textInput?: (google.cloud.dialogflow.v2beta1.ITextInput|null); + + /** AnalyzeContentRequest audioInput. */ + public audioInput?: (google.cloud.dialogflow.v2beta1.IAudioInput|null); + + /** AnalyzeContentRequest eventInput. */ + public eventInput?: (google.cloud.dialogflow.v2beta1.IEventInput|null); + + /** AnalyzeContentRequest replyAudioConfig. */ + public replyAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + + /** AnalyzeContentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.v2beta1.IQueryParameters|null); + + /** AnalyzeContentRequest messageSendTime. */ + public messageSendTime?: (google.protobuf.ITimestamp|null); + + /** AnalyzeContentRequest requestId. */ + public requestId: string; + + /** AnalyzeContentRequest input. */ + public input?: ("text"|"audio"|"textInput"|"audioInput"|"eventInput"); + + /** + * Creates a new AnalyzeContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeContentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest): google.cloud.dialogflow.v2beta1.AnalyzeContentRequest; + + /** + * Encodes the specified AnalyzeContentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.verify|verify} messages. + * @param message AnalyzeContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeContentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.verify|verify} messages. + * @param message AnalyzeContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.AnalyzeContentRequest; + + /** + * Decodes an AnalyzeContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.AnalyzeContentRequest; + + /** + * Verifies an AnalyzeContentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnalyzeContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.AnalyzeContentRequest; + + /** + * Creates a plain object from an AnalyzeContentRequest message. Also converts values to other types if specified. + * @param message AnalyzeContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.AnalyzeContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DtmfParameters. */ + interface IDtmfParameters { + + /** DtmfParameters acceptsDtmfInput */ + acceptsDtmfInput?: (boolean|null); + } + + /** Represents a DtmfParameters. */ + class DtmfParameters implements IDtmfParameters { + + /** + * Constructs a new DtmfParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IDtmfParameters); + + /** DtmfParameters acceptsDtmfInput. */ + public acceptsDtmfInput: boolean; + + /** + * Creates a new DtmfParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns DtmfParameters instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IDtmfParameters): google.cloud.dialogflow.v2beta1.DtmfParameters; + + /** + * Encodes the specified DtmfParameters message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DtmfParameters.verify|verify} messages. + * @param message DtmfParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IDtmfParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DtmfParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DtmfParameters.verify|verify} messages. + * @param message DtmfParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDtmfParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DtmfParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DtmfParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DtmfParameters; + + /** + * Decodes a DtmfParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DtmfParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DtmfParameters; + + /** + * Verifies a DtmfParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DtmfParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DtmfParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DtmfParameters; + + /** + * Creates a plain object from a DtmfParameters message. Also converts values to other types if specified. + * @param message DtmfParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.DtmfParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DtmfParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnalyzeContentResponse. */ + interface IAnalyzeContentResponse { + + /** AnalyzeContentResponse replyText */ + replyText?: (string|null); + + /** AnalyzeContentResponse replyAudio */ + replyAudio?: (google.cloud.dialogflow.v2beta1.IOutputAudio|null); + + /** AnalyzeContentResponse automatedAgentReply */ + automatedAgentReply?: (google.cloud.dialogflow.v2beta1.IAutomatedAgentReply|null); + + /** AnalyzeContentResponse message */ + message?: (google.cloud.dialogflow.v2beta1.IMessage|null); + + /** AnalyzeContentResponse humanAgentSuggestionResults */ + humanAgentSuggestionResults?: (google.cloud.dialogflow.v2beta1.ISuggestionResult[]|null); + + /** AnalyzeContentResponse endUserSuggestionResults */ + endUserSuggestionResults?: (google.cloud.dialogflow.v2beta1.ISuggestionResult[]|null); + + /** AnalyzeContentResponse dtmfParameters */ + dtmfParameters?: (google.cloud.dialogflow.v2beta1.IDtmfParameters|null); + } + + /** Represents an AnalyzeContentResponse. */ + class AnalyzeContentResponse implements IAnalyzeContentResponse { + + /** + * Constructs a new AnalyzeContentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse); + + /** AnalyzeContentResponse replyText. */ + public replyText: string; + + /** AnalyzeContentResponse replyAudio. */ + public replyAudio?: (google.cloud.dialogflow.v2beta1.IOutputAudio|null); + + /** AnalyzeContentResponse automatedAgentReply. */ + public automatedAgentReply?: (google.cloud.dialogflow.v2beta1.IAutomatedAgentReply|null); + + /** AnalyzeContentResponse message. */ + public message?: (google.cloud.dialogflow.v2beta1.IMessage|null); + + /** AnalyzeContentResponse humanAgentSuggestionResults. */ + public humanAgentSuggestionResults: google.cloud.dialogflow.v2beta1.ISuggestionResult[]; + + /** AnalyzeContentResponse endUserSuggestionResults. */ + public endUserSuggestionResults: google.cloud.dialogflow.v2beta1.ISuggestionResult[]; + + /** AnalyzeContentResponse dtmfParameters. */ + public dtmfParameters?: (google.cloud.dialogflow.v2beta1.IDtmfParameters|null); + + /** + * Creates a new AnalyzeContentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns AnalyzeContentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse): google.cloud.dialogflow.v2beta1.AnalyzeContentResponse; + + /** + * Encodes the specified AnalyzeContentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.verify|verify} messages. + * @param message AnalyzeContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnalyzeContentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.verify|verify} messages. + * @param message AnalyzeContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnalyzeContentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnalyzeContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.AnalyzeContentResponse; + + /** + * Decodes an AnalyzeContentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnalyzeContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.AnalyzeContentResponse; + + /** + * Verifies an AnalyzeContentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnalyzeContentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnalyzeContentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.AnalyzeContentResponse; + + /** + * Creates a plain object from an AnalyzeContentResponse message. Also converts values to other types if specified. + * @param message AnalyzeContentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.AnalyzeContentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnalyzeContentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an InputTextConfig. */ + interface IInputTextConfig { + + /** InputTextConfig languageCode */ + languageCode?: (string|null); + } + + /** Represents an InputTextConfig. */ + class InputTextConfig implements IInputTextConfig { + + /** + * Constructs a new InputTextConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IInputTextConfig); + + /** InputTextConfig languageCode. */ + public languageCode: string; + + /** + * Creates a new InputTextConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns InputTextConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IInputTextConfig): google.cloud.dialogflow.v2beta1.InputTextConfig; + + /** + * Encodes the specified InputTextConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputTextConfig.verify|verify} messages. + * @param message InputTextConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IInputTextConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InputTextConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputTextConfig.verify|verify} messages. + * @param message InputTextConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IInputTextConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InputTextConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InputTextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.InputTextConfig; + + /** + * Decodes an InputTextConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InputTextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.InputTextConfig; + + /** + * Verifies an InputTextConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InputTextConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InputTextConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.InputTextConfig; + + /** + * Creates a plain object from an InputTextConfig message. Also converts values to other types if specified. + * @param message InputTextConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.InputTextConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InputTextConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StreamingAnalyzeContentRequest. */ + interface IStreamingAnalyzeContentRequest { + + /** StreamingAnalyzeContentRequest participant */ + participant?: (string|null); + + /** StreamingAnalyzeContentRequest audioConfig */ + audioConfig?: (google.cloud.dialogflow.v2beta1.IInputAudioConfig|null); + + /** StreamingAnalyzeContentRequest textConfig */ + textConfig?: (google.cloud.dialogflow.v2beta1.IInputTextConfig|null); + + /** StreamingAnalyzeContentRequest replyAudioConfig */ + replyAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + + /** StreamingAnalyzeContentRequest inputAudio */ + inputAudio?: (Uint8Array|string|null); + + /** StreamingAnalyzeContentRequest inputText */ + inputText?: (string|null); + + /** StreamingAnalyzeContentRequest inputDtmf */ + inputDtmf?: (google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents|null); + + /** StreamingAnalyzeContentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.v2beta1.IQueryParameters|null); + + /** StreamingAnalyzeContentRequest enableExtendedStreaming */ + enableExtendedStreaming?: (boolean|null); + } + + /** Represents a StreamingAnalyzeContentRequest. */ + class StreamingAnalyzeContentRequest implements IStreamingAnalyzeContentRequest { + + /** + * Constructs a new StreamingAnalyzeContentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentRequest); + + /** StreamingAnalyzeContentRequest participant. */ + public participant: string; + + /** StreamingAnalyzeContentRequest audioConfig. */ + public audioConfig?: (google.cloud.dialogflow.v2beta1.IInputAudioConfig|null); + + /** StreamingAnalyzeContentRequest textConfig. */ + public textConfig?: (google.cloud.dialogflow.v2beta1.IInputTextConfig|null); + + /** StreamingAnalyzeContentRequest replyAudioConfig. */ + public replyAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + + /** StreamingAnalyzeContentRequest inputAudio. */ + public inputAudio: (Uint8Array|string); + + /** StreamingAnalyzeContentRequest inputText. */ + public inputText: string; + + /** StreamingAnalyzeContentRequest inputDtmf. */ + public inputDtmf?: (google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents|null); + + /** StreamingAnalyzeContentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.v2beta1.IQueryParameters|null); + + /** StreamingAnalyzeContentRequest enableExtendedStreaming. */ + public enableExtendedStreaming: boolean; + + /** StreamingAnalyzeContentRequest config. */ + public config?: ("audioConfig"|"textConfig"); + + /** StreamingAnalyzeContentRequest input. */ + public input?: ("inputAudio"|"inputText"|"inputDtmf"); + + /** + * Creates a new StreamingAnalyzeContentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingAnalyzeContentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentRequest): google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest; + + /** + * Encodes the specified StreamingAnalyzeContentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.verify|verify} messages. + * @param message StreamingAnalyzeContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingAnalyzeContentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.verify|verify} messages. + * @param message StreamingAnalyzeContentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingAnalyzeContentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingAnalyzeContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest; + + /** + * Decodes a StreamingAnalyzeContentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingAnalyzeContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest; + + /** + * Verifies a StreamingAnalyzeContentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingAnalyzeContentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingAnalyzeContentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest; + + /** + * Creates a plain object from a StreamingAnalyzeContentRequest message. Also converts values to other types if specified. + * @param message StreamingAnalyzeContentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingAnalyzeContentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StreamingAnalyzeContentResponse. */ + interface IStreamingAnalyzeContentResponse { + + /** StreamingAnalyzeContentResponse recognitionResult */ + recognitionResult?: (google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null); + + /** StreamingAnalyzeContentResponse replyText */ + replyText?: (string|null); + + /** StreamingAnalyzeContentResponse replyAudio */ + replyAudio?: (google.cloud.dialogflow.v2beta1.IOutputAudio|null); + + /** StreamingAnalyzeContentResponse automatedAgentReply */ + automatedAgentReply?: (google.cloud.dialogflow.v2beta1.IAutomatedAgentReply|null); + + /** StreamingAnalyzeContentResponse message */ + message?: (google.cloud.dialogflow.v2beta1.IMessage|null); + + /** StreamingAnalyzeContentResponse humanAgentSuggestionResults */ + humanAgentSuggestionResults?: (google.cloud.dialogflow.v2beta1.ISuggestionResult[]|null); + + /** StreamingAnalyzeContentResponse endUserSuggestionResults */ + endUserSuggestionResults?: (google.cloud.dialogflow.v2beta1.ISuggestionResult[]|null); + + /** StreamingAnalyzeContentResponse dtmfParameters */ + dtmfParameters?: (google.cloud.dialogflow.v2beta1.IDtmfParameters|null); + } + + /** Represents a StreamingAnalyzeContentResponse. */ + class StreamingAnalyzeContentResponse implements IStreamingAnalyzeContentResponse { + + /** + * Constructs a new StreamingAnalyzeContentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentResponse); + + /** StreamingAnalyzeContentResponse recognitionResult. */ + public recognitionResult?: (google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null); + + /** StreamingAnalyzeContentResponse replyText. */ + public replyText: string; + + /** StreamingAnalyzeContentResponse replyAudio. */ + public replyAudio?: (google.cloud.dialogflow.v2beta1.IOutputAudio|null); + + /** StreamingAnalyzeContentResponse automatedAgentReply. */ + public automatedAgentReply?: (google.cloud.dialogflow.v2beta1.IAutomatedAgentReply|null); + + /** StreamingAnalyzeContentResponse message. */ + public message?: (google.cloud.dialogflow.v2beta1.IMessage|null); + + /** StreamingAnalyzeContentResponse humanAgentSuggestionResults. */ + public humanAgentSuggestionResults: google.cloud.dialogflow.v2beta1.ISuggestionResult[]; + + /** StreamingAnalyzeContentResponse endUserSuggestionResults. */ + public endUserSuggestionResults: google.cloud.dialogflow.v2beta1.ISuggestionResult[]; + + /** StreamingAnalyzeContentResponse dtmfParameters. */ + public dtmfParameters?: (google.cloud.dialogflow.v2beta1.IDtmfParameters|null); + + /** + * Creates a new StreamingAnalyzeContentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingAnalyzeContentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentResponse): google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse; + + /** + * Encodes the specified StreamingAnalyzeContentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.verify|verify} messages. + * @param message StreamingAnalyzeContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingAnalyzeContentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.verify|verify} messages. + * @param message StreamingAnalyzeContentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingAnalyzeContentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingAnalyzeContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse; + + /** + * Decodes a StreamingAnalyzeContentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingAnalyzeContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse; + + /** + * Verifies a StreamingAnalyzeContentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingAnalyzeContentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingAnalyzeContentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse; + + /** + * Creates a plain object from a StreamingAnalyzeContentResponse message. Also converts values to other types if specified. + * @param message StreamingAnalyzeContentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingAnalyzeContentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AnnotatedMessagePart. */ + interface IAnnotatedMessagePart { + + /** AnnotatedMessagePart text */ + text?: (string|null); + + /** AnnotatedMessagePart entityType */ + entityType?: (string|null); + + /** AnnotatedMessagePart formattedValue */ + formattedValue?: (google.protobuf.IValue|null); + } + + /** Represents an AnnotatedMessagePart. */ + class AnnotatedMessagePart implements IAnnotatedMessagePart { + + /** + * Constructs a new AnnotatedMessagePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IAnnotatedMessagePart); + + /** AnnotatedMessagePart text. */ + public text: string; + + /** AnnotatedMessagePart entityType. */ + public entityType: string; + + /** AnnotatedMessagePart formattedValue. */ + public formattedValue?: (google.protobuf.IValue|null); + + /** + * Creates a new AnnotatedMessagePart instance using the specified properties. + * @param [properties] Properties to set + * @returns AnnotatedMessagePart instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IAnnotatedMessagePart): google.cloud.dialogflow.v2beta1.AnnotatedMessagePart; + + /** + * Encodes the specified AnnotatedMessagePart message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnnotatedMessagePart.verify|verify} messages. + * @param message AnnotatedMessagePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IAnnotatedMessagePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AnnotatedMessagePart message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnnotatedMessagePart.verify|verify} messages. + * @param message AnnotatedMessagePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IAnnotatedMessagePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AnnotatedMessagePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AnnotatedMessagePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.AnnotatedMessagePart; + + /** + * Decodes an AnnotatedMessagePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AnnotatedMessagePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.AnnotatedMessagePart; + + /** + * Verifies an AnnotatedMessagePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AnnotatedMessagePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AnnotatedMessagePart + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.AnnotatedMessagePart; + + /** + * Creates a plain object from an AnnotatedMessagePart message. Also converts values to other types if specified. + * @param message AnnotatedMessagePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.AnnotatedMessagePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AnnotatedMessagePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MessageAnnotation. */ + interface IMessageAnnotation { + + /** MessageAnnotation parts */ + parts?: (google.cloud.dialogflow.v2beta1.IAnnotatedMessagePart[]|null); + + /** MessageAnnotation containEntities */ + containEntities?: (boolean|null); + } + + /** Represents a MessageAnnotation. */ + class MessageAnnotation implements IMessageAnnotation { + + /** + * Constructs a new MessageAnnotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IMessageAnnotation); + + /** MessageAnnotation parts. */ + public parts: google.cloud.dialogflow.v2beta1.IAnnotatedMessagePart[]; + + /** MessageAnnotation containEntities. */ + public containEntities: boolean; + + /** + * Creates a new MessageAnnotation instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageAnnotation instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IMessageAnnotation): google.cloud.dialogflow.v2beta1.MessageAnnotation; + + /** + * Encodes the specified MessageAnnotation message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.MessageAnnotation.verify|verify} messages. + * @param message MessageAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IMessageAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageAnnotation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.MessageAnnotation.verify|verify} messages. + * @param message MessageAnnotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IMessageAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageAnnotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.MessageAnnotation; + + /** + * Decodes a MessageAnnotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.MessageAnnotation; + + /** + * Verifies a MessageAnnotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageAnnotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageAnnotation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.MessageAnnotation; + + /** + * Creates a plain object from a MessageAnnotation message. Also converts values to other types if specified. + * @param message MessageAnnotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.MessageAnnotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageAnnotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ArticleAnswer. */ + interface IArticleAnswer { + + /** ArticleAnswer title */ + title?: (string|null); + + /** ArticleAnswer uri */ + uri?: (string|null); + + /** ArticleAnswer snippets */ + snippets?: (string[]|null); + + /** ArticleAnswer metadata */ + metadata?: ({ [k: string]: string }|null); + + /** ArticleAnswer answerRecord */ + answerRecord?: (string|null); + } + + /** Represents an ArticleAnswer. */ + class ArticleAnswer implements IArticleAnswer { + + /** + * Constructs a new ArticleAnswer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IArticleAnswer); + + /** ArticleAnswer title. */ + public title: string; + + /** ArticleAnswer uri. */ + public uri: string; + + /** ArticleAnswer snippets. */ + public snippets: string[]; + + /** ArticleAnswer metadata. */ + public metadata: { [k: string]: string }; + + /** ArticleAnswer answerRecord. */ + public answerRecord: string; + + /** + * Creates a new ArticleAnswer instance using the specified properties. + * @param [properties] Properties to set + * @returns ArticleAnswer instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IArticleAnswer): google.cloud.dialogflow.v2beta1.ArticleAnswer; + + /** + * Encodes the specified ArticleAnswer message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ArticleAnswer.verify|verify} messages. + * @param message ArticleAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IArticleAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ArticleAnswer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ArticleAnswer.verify|verify} messages. + * @param message ArticleAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IArticleAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ArticleAnswer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ArticleAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ArticleAnswer; + + /** + * Decodes an ArticleAnswer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ArticleAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ArticleAnswer; + + /** + * Verifies an ArticleAnswer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ArticleAnswer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ArticleAnswer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ArticleAnswer; + + /** + * Creates a plain object from an ArticleAnswer message. Also converts values to other types if specified. + * @param message ArticleAnswer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ArticleAnswer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ArticleAnswer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FaqAnswer. */ + interface IFaqAnswer { + + /** FaqAnswer answer */ + answer?: (string|null); + + /** FaqAnswer confidence */ + confidence?: (number|null); + + /** FaqAnswer question */ + question?: (string|null); + + /** FaqAnswer source */ + source?: (string|null); + + /** FaqAnswer metadata */ + metadata?: ({ [k: string]: string }|null); + + /** FaqAnswer answerRecord */ + answerRecord?: (string|null); + } + + /** Represents a FaqAnswer. */ + class FaqAnswer implements IFaqAnswer { + + /** + * Constructs a new FaqAnswer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IFaqAnswer); + + /** FaqAnswer answer. */ + public answer: string; + + /** FaqAnswer confidence. */ + public confidence: number; + + /** FaqAnswer question. */ + public question: string; + + /** FaqAnswer source. */ + public source: string; + + /** FaqAnswer metadata. */ + public metadata: { [k: string]: string }; + + /** FaqAnswer answerRecord. */ + public answerRecord: string; + + /** + * Creates a new FaqAnswer instance using the specified properties. + * @param [properties] Properties to set + * @returns FaqAnswer instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IFaqAnswer): google.cloud.dialogflow.v2beta1.FaqAnswer; + + /** + * Encodes the specified FaqAnswer message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.FaqAnswer.verify|verify} messages. + * @param message FaqAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IFaqAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaqAnswer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.FaqAnswer.verify|verify} messages. + * @param message FaqAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IFaqAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaqAnswer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaqAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.FaqAnswer; + + /** + * Decodes a FaqAnswer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaqAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.FaqAnswer; + + /** + * Verifies a FaqAnswer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaqAnswer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaqAnswer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.FaqAnswer; + + /** + * Creates a plain object from a FaqAnswer message. Also converts values to other types if specified. + * @param message FaqAnswer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.FaqAnswer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaqAnswer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SmartReplyAnswer. */ + interface ISmartReplyAnswer { + + /** SmartReplyAnswer reply */ + reply?: (string|null); + + /** SmartReplyAnswer confidence */ + confidence?: (number|null); + + /** SmartReplyAnswer answerRecord */ + answerRecord?: (string|null); + } + + /** Represents a SmartReplyAnswer. */ + class SmartReplyAnswer implements ISmartReplyAnswer { + + /** + * Constructs a new SmartReplyAnswer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISmartReplyAnswer); + + /** SmartReplyAnswer reply. */ + public reply: string; + + /** SmartReplyAnswer confidence. */ + public confidence: number; + + /** SmartReplyAnswer answerRecord. */ + public answerRecord: string; + + /** + * Creates a new SmartReplyAnswer instance using the specified properties. + * @param [properties] Properties to set + * @returns SmartReplyAnswer instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISmartReplyAnswer): google.cloud.dialogflow.v2beta1.SmartReplyAnswer; + + /** + * Encodes the specified SmartReplyAnswer message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SmartReplyAnswer.verify|verify} messages. + * @param message SmartReplyAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISmartReplyAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SmartReplyAnswer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SmartReplyAnswer.verify|verify} messages. + * @param message SmartReplyAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISmartReplyAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SmartReplyAnswer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SmartReplyAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SmartReplyAnswer; + + /** + * Decodes a SmartReplyAnswer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SmartReplyAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SmartReplyAnswer; + + /** + * Verifies a SmartReplyAnswer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SmartReplyAnswer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SmartReplyAnswer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SmartReplyAnswer; + + /** + * Creates a plain object from a SmartReplyAnswer message. Also converts values to other types if specified. + * @param message SmartReplyAnswer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SmartReplyAnswer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SmartReplyAnswer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestionResult. */ + interface ISuggestionResult { + + /** SuggestionResult error */ + error?: (google.rpc.IStatus|null); + + /** SuggestionResult suggestArticlesResponse */ + suggestArticlesResponse?: (google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse|null); + + /** SuggestionResult suggestFaqAnswersResponse */ + suggestFaqAnswersResponse?: (google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse|null); + + /** SuggestionResult suggestSmartRepliesResponse */ + suggestSmartRepliesResponse?: (google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse|null); + } + + /** Represents a SuggestionResult. */ + class SuggestionResult implements ISuggestionResult { + + /** + * Constructs a new SuggestionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISuggestionResult); + + /** SuggestionResult error. */ + public error?: (google.rpc.IStatus|null); + + /** SuggestionResult suggestArticlesResponse. */ + public suggestArticlesResponse?: (google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse|null); + + /** SuggestionResult suggestFaqAnswersResponse. */ + public suggestFaqAnswersResponse?: (google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse|null); + + /** SuggestionResult suggestSmartRepliesResponse. */ + public suggestSmartRepliesResponse?: (google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse|null); + + /** SuggestionResult suggestionResponse. */ + public suggestionResponse?: ("error"|"suggestArticlesResponse"|"suggestFaqAnswersResponse"|"suggestSmartRepliesResponse"); + + /** + * Creates a new SuggestionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionResult instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISuggestionResult): google.cloud.dialogflow.v2beta1.SuggestionResult; + + /** + * Encodes the specified SuggestionResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestionResult.verify|verify} messages. + * @param message SuggestionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISuggestionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestionResult.verify|verify} messages. + * @param message SuggestionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISuggestionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SuggestionResult; + + /** + * Decodes a SuggestionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SuggestionResult; + + /** + * Verifies a SuggestionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SuggestionResult; + + /** + * Creates a plain object from a SuggestionResult message. Also converts values to other types if specified. + * @param message SuggestionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SuggestionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestArticlesRequest. */ + interface ISuggestArticlesRequest { + + /** SuggestArticlesRequest parent */ + parent?: (string|null); + + /** SuggestArticlesRequest latestMessage */ + latestMessage?: (string|null); + + /** SuggestArticlesRequest contextSize */ + contextSize?: (number|null); + } + + /** Represents a SuggestArticlesRequest. */ + class SuggestArticlesRequest implements ISuggestArticlesRequest { + + /** + * Constructs a new SuggestArticlesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest); + + /** SuggestArticlesRequest parent. */ + public parent: string; + + /** SuggestArticlesRequest latestMessage. */ + public latestMessage: string; + + /** SuggestArticlesRequest contextSize. */ + public contextSize: number; + + /** + * Creates a new SuggestArticlesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestArticlesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest): google.cloud.dialogflow.v2beta1.SuggestArticlesRequest; + + /** + * Encodes the specified SuggestArticlesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.verify|verify} messages. + * @param message SuggestArticlesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestArticlesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.verify|verify} messages. + * @param message SuggestArticlesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestArticlesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestArticlesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SuggestArticlesRequest; + + /** + * Decodes a SuggestArticlesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestArticlesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SuggestArticlesRequest; + + /** + * Verifies a SuggestArticlesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestArticlesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestArticlesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SuggestArticlesRequest; + + /** + * Creates a plain object from a SuggestArticlesRequest message. Also converts values to other types if specified. + * @param message SuggestArticlesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SuggestArticlesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestArticlesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestArticlesResponse. */ + interface ISuggestArticlesResponse { + + /** SuggestArticlesResponse articleAnswers */ + articleAnswers?: (google.cloud.dialogflow.v2beta1.IArticleAnswer[]|null); + + /** SuggestArticlesResponse latestMessage */ + latestMessage?: (string|null); + + /** SuggestArticlesResponse contextSize */ + contextSize?: (number|null); + } + + /** Represents a SuggestArticlesResponse. */ + class SuggestArticlesResponse implements ISuggestArticlesResponse { + + /** + * Constructs a new SuggestArticlesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse); + + /** SuggestArticlesResponse articleAnswers. */ + public articleAnswers: google.cloud.dialogflow.v2beta1.IArticleAnswer[]; + + /** SuggestArticlesResponse latestMessage. */ + public latestMessage: string; + + /** SuggestArticlesResponse contextSize. */ + public contextSize: number; + + /** + * Creates a new SuggestArticlesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestArticlesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse): google.cloud.dialogflow.v2beta1.SuggestArticlesResponse; + + /** + * Encodes the specified SuggestArticlesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.verify|verify} messages. + * @param message SuggestArticlesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestArticlesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.verify|verify} messages. + * @param message SuggestArticlesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestArticlesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestArticlesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SuggestArticlesResponse; + + /** + * Decodes a SuggestArticlesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestArticlesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SuggestArticlesResponse; + + /** + * Verifies a SuggestArticlesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestArticlesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestArticlesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SuggestArticlesResponse; + + /** + * Creates a plain object from a SuggestArticlesResponse message. Also converts values to other types if specified. + * @param message SuggestArticlesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SuggestArticlesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestArticlesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestFaqAnswersRequest. */ + interface ISuggestFaqAnswersRequest { + + /** SuggestFaqAnswersRequest parent */ + parent?: (string|null); + + /** SuggestFaqAnswersRequest latestMessage */ + latestMessage?: (string|null); + + /** SuggestFaqAnswersRequest contextSize */ + contextSize?: (number|null); + } + + /** Represents a SuggestFaqAnswersRequest. */ + class SuggestFaqAnswersRequest implements ISuggestFaqAnswersRequest { + + /** + * Constructs a new SuggestFaqAnswersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest); + + /** SuggestFaqAnswersRequest parent. */ + public parent: string; + + /** SuggestFaqAnswersRequest latestMessage. */ + public latestMessage: string; + + /** SuggestFaqAnswersRequest contextSize. */ + public contextSize: number; + + /** + * Creates a new SuggestFaqAnswersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestFaqAnswersRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest): google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest; + + /** + * Encodes the specified SuggestFaqAnswersRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest.verify|verify} messages. + * @param message SuggestFaqAnswersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestFaqAnswersRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest.verify|verify} messages. + * @param message SuggestFaqAnswersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestFaqAnswersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestFaqAnswersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest; + + /** + * Decodes a SuggestFaqAnswersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestFaqAnswersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest; + + /** + * Verifies a SuggestFaqAnswersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestFaqAnswersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestFaqAnswersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest; + + /** + * Creates a plain object from a SuggestFaqAnswersRequest message. Also converts values to other types if specified. + * @param message SuggestFaqAnswersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestFaqAnswersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestFaqAnswersResponse. */ + interface ISuggestFaqAnswersResponse { + + /** SuggestFaqAnswersResponse faqAnswers */ + faqAnswers?: (google.cloud.dialogflow.v2beta1.IFaqAnswer[]|null); + + /** SuggestFaqAnswersResponse latestMessage */ + latestMessage?: (string|null); + + /** SuggestFaqAnswersResponse contextSize */ + contextSize?: (number|null); + } + + /** Represents a SuggestFaqAnswersResponse. */ + class SuggestFaqAnswersResponse implements ISuggestFaqAnswersResponse { + + /** + * Constructs a new SuggestFaqAnswersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse); + + /** SuggestFaqAnswersResponse faqAnswers. */ + public faqAnswers: google.cloud.dialogflow.v2beta1.IFaqAnswer[]; + + /** SuggestFaqAnswersResponse latestMessage. */ + public latestMessage: string; + + /** SuggestFaqAnswersResponse contextSize. */ + public contextSize: number; + + /** + * Creates a new SuggestFaqAnswersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestFaqAnswersResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse): google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse; + + /** + * Encodes the specified SuggestFaqAnswersResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.verify|verify} messages. + * @param message SuggestFaqAnswersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestFaqAnswersResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.verify|verify} messages. + * @param message SuggestFaqAnswersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestFaqAnswersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestFaqAnswersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse; + + /** + * Decodes a SuggestFaqAnswersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestFaqAnswersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse; + + /** + * Verifies a SuggestFaqAnswersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestFaqAnswersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestFaqAnswersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse; + + /** + * Creates a plain object from a SuggestFaqAnswersResponse message. Also converts values to other types if specified. + * @param message SuggestFaqAnswersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestFaqAnswersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestSmartRepliesRequest. */ + interface ISuggestSmartRepliesRequest { + + /** SuggestSmartRepliesRequest parent */ + parent?: (string|null); + + /** SuggestSmartRepliesRequest currentTextInput */ + currentTextInput?: (google.cloud.dialogflow.v2beta1.ITextInput|null); + + /** SuggestSmartRepliesRequest latestMessage */ + latestMessage?: (string|null); + + /** SuggestSmartRepliesRequest contextSize */ + contextSize?: (number|null); + } + + /** Represents a SuggestSmartRepliesRequest. */ + class SuggestSmartRepliesRequest implements ISuggestSmartRepliesRequest { + + /** + * Constructs a new SuggestSmartRepliesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest); + + /** SuggestSmartRepliesRequest parent. */ + public parent: string; + + /** SuggestSmartRepliesRequest currentTextInput. */ + public currentTextInput?: (google.cloud.dialogflow.v2beta1.ITextInput|null); + + /** SuggestSmartRepliesRequest latestMessage. */ + public latestMessage: string; + + /** SuggestSmartRepliesRequest contextSize. */ + public contextSize: number; + + /** + * Creates a new SuggestSmartRepliesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestSmartRepliesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest): google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest; + + /** + * Encodes the specified SuggestSmartRepliesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest.verify|verify} messages. + * @param message SuggestSmartRepliesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestSmartRepliesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest.verify|verify} messages. + * @param message SuggestSmartRepliesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestSmartRepliesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestSmartRepliesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest; + + /** + * Decodes a SuggestSmartRepliesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestSmartRepliesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest; + + /** + * Verifies a SuggestSmartRepliesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestSmartRepliesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestSmartRepliesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest; + + /** + * Creates a plain object from a SuggestSmartRepliesRequest message. Also converts values to other types if specified. + * @param message SuggestSmartRepliesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestSmartRepliesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestSmartRepliesResponse. */ + interface ISuggestSmartRepliesResponse { + + /** SuggestSmartRepliesResponse smartReplyAnswers */ + smartReplyAnswers?: (google.cloud.dialogflow.v2beta1.ISmartReplyAnswer[]|null); + + /** SuggestSmartRepliesResponse latestMessage */ + latestMessage?: (string|null); + + /** SuggestSmartRepliesResponse contextSize */ + contextSize?: (number|null); + } + + /** Represents a SuggestSmartRepliesResponse. */ + class SuggestSmartRepliesResponse implements ISuggestSmartRepliesResponse { + + /** + * Constructs a new SuggestSmartRepliesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse); + + /** SuggestSmartRepliesResponse smartReplyAnswers. */ + public smartReplyAnswers: google.cloud.dialogflow.v2beta1.ISmartReplyAnswer[]; + + /** SuggestSmartRepliesResponse latestMessage. */ + public latestMessage: string; + + /** SuggestSmartRepliesResponse contextSize. */ + public contextSize: number; + + /** + * Creates a new SuggestSmartRepliesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestSmartRepliesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse): google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse; + + /** + * Encodes the specified SuggestSmartRepliesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.verify|verify} messages. + * @param message SuggestSmartRepliesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestSmartRepliesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.verify|verify} messages. + * @param message SuggestSmartRepliesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestSmartRepliesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestSmartRepliesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse; + + /** + * Decodes a SuggestSmartRepliesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestSmartRepliesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse; + + /** + * Verifies a SuggestSmartRepliesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestSmartRepliesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestSmartRepliesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse; + + /** + * Creates a plain object from a SuggestSmartRepliesResponse message. Also converts values to other types if specified. + * @param message SuggestSmartRepliesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestSmartRepliesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Suggestion. */ + interface ISuggestion { + + /** Suggestion name */ + name?: (string|null); + + /** Suggestion articles */ + articles?: (google.cloud.dialogflow.v2beta1.Suggestion.IArticle[]|null); + + /** Suggestion faqAnswers */ + faqAnswers?: (google.cloud.dialogflow.v2beta1.Suggestion.IFaqAnswer[]|null); + + /** Suggestion createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Suggestion latestMessage */ + latestMessage?: (string|null); + } + + /** Represents a Suggestion. */ + class Suggestion implements ISuggestion { + + /** + * Constructs a new Suggestion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISuggestion); + + /** Suggestion name. */ + public name: string; + + /** Suggestion articles. */ + public articles: google.cloud.dialogflow.v2beta1.Suggestion.IArticle[]; + + /** Suggestion faqAnswers. */ + public faqAnswers: google.cloud.dialogflow.v2beta1.Suggestion.IFaqAnswer[]; + + /** Suggestion createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Suggestion latestMessage. */ + public latestMessage: string; + + /** + * Creates a new Suggestion instance using the specified properties. + * @param [properties] Properties to set + * @returns Suggestion instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISuggestion): google.cloud.dialogflow.v2beta1.Suggestion; + + /** + * Encodes the specified Suggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Suggestion.verify|verify} messages. + * @param message Suggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Suggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Suggestion.verify|verify} messages. + * @param message Suggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Suggestion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Suggestion; + + /** + * Decodes a Suggestion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Suggestion; + + /** + * Verifies a Suggestion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Suggestion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Suggestion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Suggestion; + + /** + * Creates a plain object from a Suggestion message. Also converts values to other types if specified. + * @param message Suggestion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Suggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Suggestion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Suggestion { + + /** Properties of an Article. */ + interface IArticle { + + /** Article title */ + title?: (string|null); + + /** Article uri */ + uri?: (string|null); + + /** Article snippets */ + snippets?: (string[]|null); + + /** Article metadata */ + metadata?: ({ [k: string]: string }|null); + + /** Article answerRecord */ + answerRecord?: (string|null); + } + + /** Represents an Article. */ + class Article implements IArticle { + + /** + * Constructs a new Article. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Suggestion.IArticle); + + /** Article title. */ + public title: string; + + /** Article uri. */ + public uri: string; + + /** Article snippets. */ + public snippets: string[]; + + /** Article metadata. */ + public metadata: { [k: string]: string }; + + /** Article answerRecord. */ + public answerRecord: string; + + /** + * Creates a new Article instance using the specified properties. + * @param [properties] Properties to set + * @returns Article instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Suggestion.IArticle): google.cloud.dialogflow.v2beta1.Suggestion.Article; + + /** + * Encodes the specified Article message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Suggestion.Article.verify|verify} messages. + * @param message Article message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Suggestion.IArticle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Article message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Suggestion.Article.verify|verify} messages. + * @param message Article message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Suggestion.IArticle, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Article message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Article + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Suggestion.Article; + + /** + * Decodes an Article message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Article + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Suggestion.Article; + + /** + * Verifies an Article message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Article message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Article + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Suggestion.Article; + + /** + * Creates a plain object from an Article message. Also converts values to other types if specified. + * @param message Article + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Suggestion.Article, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Article to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FaqAnswer. */ + interface IFaqAnswer { + + /** FaqAnswer answer */ + answer?: (string|null); + + /** FaqAnswer confidence */ + confidence?: (number|null); + + /** FaqAnswer question */ + question?: (string|null); + + /** FaqAnswer source */ + source?: (string|null); + + /** FaqAnswer metadata */ + metadata?: ({ [k: string]: string }|null); + + /** FaqAnswer answerRecord */ + answerRecord?: (string|null); + } + + /** Represents a FaqAnswer. */ + class FaqAnswer implements IFaqAnswer { + + /** + * Constructs a new FaqAnswer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Suggestion.IFaqAnswer); + + /** FaqAnswer answer. */ + public answer: string; + + /** FaqAnswer confidence. */ + public confidence: number; + + /** FaqAnswer question. */ + public question: string; + + /** FaqAnswer source. */ + public source: string; + + /** FaqAnswer metadata. */ + public metadata: { [k: string]: string }; + + /** FaqAnswer answerRecord. */ + public answerRecord: string; + + /** + * Creates a new FaqAnswer instance using the specified properties. + * @param [properties] Properties to set + * @returns FaqAnswer instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Suggestion.IFaqAnswer): google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer; + + /** + * Encodes the specified FaqAnswer message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.verify|verify} messages. + * @param message FaqAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Suggestion.IFaqAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FaqAnswer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.verify|verify} messages. + * @param message FaqAnswer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Suggestion.IFaqAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FaqAnswer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FaqAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer; + + /** + * Decodes a FaqAnswer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FaqAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer; + + /** + * Verifies a FaqAnswer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FaqAnswer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FaqAnswer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer; + + /** + * Creates a plain object from a FaqAnswer message. Also converts values to other types if specified. + * @param message FaqAnswer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FaqAnswer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a ListSuggestionsRequest. */ + interface IListSuggestionsRequest { + + /** ListSuggestionsRequest parent */ + parent?: (string|null); + + /** ListSuggestionsRequest pageSize */ + pageSize?: (number|null); + + /** ListSuggestionsRequest pageToken */ + pageToken?: (string|null); + + /** ListSuggestionsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListSuggestionsRequest. */ + class ListSuggestionsRequest implements IListSuggestionsRequest { + + /** + * Constructs a new ListSuggestionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListSuggestionsRequest); + + /** ListSuggestionsRequest parent. */ + public parent: string; + + /** ListSuggestionsRequest pageSize. */ + public pageSize: number; + + /** ListSuggestionsRequest pageToken. */ + public pageToken: string; + + /** ListSuggestionsRequest filter. */ + public filter: string; + + /** + * Creates a new ListSuggestionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSuggestionsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListSuggestionsRequest): google.cloud.dialogflow.v2beta1.ListSuggestionsRequest; + + /** + * Encodes the specified ListSuggestionsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSuggestionsRequest.verify|verify} messages. + * @param message ListSuggestionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSuggestionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSuggestionsRequest.verify|verify} messages. + * @param message ListSuggestionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSuggestionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSuggestionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListSuggestionsRequest; + + /** + * Decodes a ListSuggestionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSuggestionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListSuggestionsRequest; + + /** + * Verifies a ListSuggestionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSuggestionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSuggestionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListSuggestionsRequest; + + /** + * Creates a plain object from a ListSuggestionsRequest message. Also converts values to other types if specified. + * @param message ListSuggestionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListSuggestionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSuggestionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSuggestionsResponse. */ + interface IListSuggestionsResponse { + + /** ListSuggestionsResponse suggestions */ + suggestions?: (google.cloud.dialogflow.v2beta1.ISuggestion[]|null); + + /** ListSuggestionsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListSuggestionsResponse. */ + class ListSuggestionsResponse implements IListSuggestionsResponse { + + /** + * Constructs a new ListSuggestionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListSuggestionsResponse); + + /** ListSuggestionsResponse suggestions. */ + public suggestions: google.cloud.dialogflow.v2beta1.ISuggestion[]; + + /** ListSuggestionsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListSuggestionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSuggestionsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListSuggestionsResponse): google.cloud.dialogflow.v2beta1.ListSuggestionsResponse; + + /** + * Encodes the specified ListSuggestionsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSuggestionsResponse.verify|verify} messages. + * @param message ListSuggestionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListSuggestionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSuggestionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSuggestionsResponse.verify|verify} messages. + * @param message ListSuggestionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListSuggestionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSuggestionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSuggestionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListSuggestionsResponse; + + /** + * Decodes a ListSuggestionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSuggestionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListSuggestionsResponse; + + /** + * Verifies a ListSuggestionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSuggestionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSuggestionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListSuggestionsResponse; + + /** + * Creates a plain object from a ListSuggestionsResponse message. Also converts values to other types if specified. + * @param message ListSuggestionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListSuggestionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSuggestionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CompileSuggestionRequest. */ + interface ICompileSuggestionRequest { + + /** CompileSuggestionRequest parent */ + parent?: (string|null); + + /** CompileSuggestionRequest latestMessage */ + latestMessage?: (string|null); + + /** CompileSuggestionRequest contextSize */ + contextSize?: (number|null); + } + + /** Represents a CompileSuggestionRequest. */ + class CompileSuggestionRequest implements ICompileSuggestionRequest { + + /** + * Constructs a new CompileSuggestionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest); + + /** CompileSuggestionRequest parent. */ + public parent: string; + + /** CompileSuggestionRequest latestMessage. */ + public latestMessage: string; + + /** CompileSuggestionRequest contextSize. */ + public contextSize: number; + + /** + * Creates a new CompileSuggestionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CompileSuggestionRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest): google.cloud.dialogflow.v2beta1.CompileSuggestionRequest; + + /** + * Encodes the specified CompileSuggestionRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CompileSuggestionRequest.verify|verify} messages. + * @param message CompileSuggestionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompileSuggestionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CompileSuggestionRequest.verify|verify} messages. + * @param message CompileSuggestionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompileSuggestionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompileSuggestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CompileSuggestionRequest; + + /** + * Decodes a CompileSuggestionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompileSuggestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CompileSuggestionRequest; + + /** + * Verifies a CompileSuggestionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompileSuggestionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompileSuggestionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CompileSuggestionRequest; + + /** + * Creates a plain object from a CompileSuggestionRequest message. Also converts values to other types if specified. + * @param message CompileSuggestionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CompileSuggestionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompileSuggestionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CompileSuggestionResponse. */ + interface ICompileSuggestionResponse { + + /** CompileSuggestionResponse suggestion */ + suggestion?: (google.cloud.dialogflow.v2beta1.ISuggestion|null); + + /** CompileSuggestionResponse latestMessage */ + latestMessage?: (string|null); + + /** CompileSuggestionResponse contextSize */ + contextSize?: (number|null); + } + + /** Represents a CompileSuggestionResponse. */ + class CompileSuggestionResponse implements ICompileSuggestionResponse { + + /** + * Constructs a new CompileSuggestionResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse); + + /** CompileSuggestionResponse suggestion. */ + public suggestion?: (google.cloud.dialogflow.v2beta1.ISuggestion|null); + + /** CompileSuggestionResponse latestMessage. */ + public latestMessage: string; + + /** CompileSuggestionResponse contextSize. */ + public contextSize: number; + + /** + * Creates a new CompileSuggestionResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns CompileSuggestionResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse): google.cloud.dialogflow.v2beta1.CompileSuggestionResponse; + + /** + * Encodes the specified CompileSuggestionResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CompileSuggestionResponse.verify|verify} messages. + * @param message CompileSuggestionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CompileSuggestionResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CompileSuggestionResponse.verify|verify} messages. + * @param message CompileSuggestionResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CompileSuggestionResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompileSuggestionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CompileSuggestionResponse; + + /** + * Decodes a CompileSuggestionResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompileSuggestionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CompileSuggestionResponse; + + /** + * Verifies a CompileSuggestionResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CompileSuggestionResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompileSuggestionResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CompileSuggestionResponse; + + /** + * Creates a plain object from a CompileSuggestionResponse message. Also converts values to other types if specified. + * @param message CompileSuggestionResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CompileSuggestionResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CompileSuggestionResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ResponseMessage. */ + interface IResponseMessage { + + /** ResponseMessage text */ + text?: (google.cloud.dialogflow.v2beta1.ResponseMessage.IText|null); + + /** ResponseMessage payload */ + payload?: (google.protobuf.IStruct|null); + + /** ResponseMessage liveAgentHandoff */ + liveAgentHandoff?: (google.cloud.dialogflow.v2beta1.ResponseMessage.ILiveAgentHandoff|null); + + /** ResponseMessage endInteraction */ + endInteraction?: (google.cloud.dialogflow.v2beta1.ResponseMessage.IEndInteraction|null); + } + + /** Represents a ResponseMessage. */ + class ResponseMessage implements IResponseMessage { + + /** + * Constructs a new ResponseMessage. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IResponseMessage); + + /** ResponseMessage text. */ + public text?: (google.cloud.dialogflow.v2beta1.ResponseMessage.IText|null); + + /** ResponseMessage payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** ResponseMessage liveAgentHandoff. */ + public liveAgentHandoff?: (google.cloud.dialogflow.v2beta1.ResponseMessage.ILiveAgentHandoff|null); + + /** ResponseMessage endInteraction. */ + public endInteraction?: (google.cloud.dialogflow.v2beta1.ResponseMessage.IEndInteraction|null); + + /** ResponseMessage message. */ + public message?: ("text"|"payload"|"liveAgentHandoff"|"endInteraction"); + + /** + * Creates a new ResponseMessage instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponseMessage instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IResponseMessage): google.cloud.dialogflow.v2beta1.ResponseMessage; + + /** + * Encodes the specified ResponseMessage message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.verify|verify} messages. + * @param message ResponseMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResponseMessage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.verify|verify} messages. + * @param message ResponseMessage message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IResponseMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResponseMessage message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponseMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ResponseMessage; + + /** + * Decodes a ResponseMessage message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponseMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ResponseMessage; + + /** + * Verifies a ResponseMessage message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResponseMessage message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResponseMessage + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ResponseMessage; + + /** + * Creates a plain object from a ResponseMessage message. Also converts values to other types if specified. + * @param message ResponseMessage + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ResponseMessage, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResponseMessage to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ResponseMessage { + + /** Properties of a Text. */ + interface IText { + + /** Text text */ + text?: (string[]|null); + } + + /** Represents a Text. */ + class Text implements IText { + + /** + * Constructs a new Text. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ResponseMessage.IText); + + /** Text text. */ + public text: string[]; + + /** + * Creates a new Text instance using the specified properties. + * @param [properties] Properties to set + * @returns Text instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ResponseMessage.IText): google.cloud.dialogflow.v2beta1.ResponseMessage.Text; + + /** + * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.Text.verify|verify} messages. + * @param message Text message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ResponseMessage.IText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.Text.verify|verify} messages. + * @param message Text message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ResponseMessage.IText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Text message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ResponseMessage.Text; + + /** + * Decodes a Text message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ResponseMessage.Text; + + /** + * Verifies a Text message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Text message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Text + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ResponseMessage.Text; + + /** + * Creates a plain object from a Text message. Also converts values to other types if specified. + * @param message Text + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ResponseMessage.Text, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Text to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LiveAgentHandoff. */ + interface ILiveAgentHandoff { + + /** LiveAgentHandoff metadata */ + metadata?: (google.protobuf.IStruct|null); + } + + /** Represents a LiveAgentHandoff. */ + class LiveAgentHandoff implements ILiveAgentHandoff { + + /** + * Constructs a new LiveAgentHandoff. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ResponseMessage.ILiveAgentHandoff); + + /** LiveAgentHandoff metadata. */ + public metadata?: (google.protobuf.IStruct|null); + + /** + * Creates a new LiveAgentHandoff instance using the specified properties. + * @param [properties] Properties to set + * @returns LiveAgentHandoff instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ResponseMessage.ILiveAgentHandoff): google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff; + + /** + * Encodes the specified LiveAgentHandoff message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff.verify|verify} messages. + * @param message LiveAgentHandoff message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ResponseMessage.ILiveAgentHandoff, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LiveAgentHandoff message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff.verify|verify} messages. + * @param message LiveAgentHandoff message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ResponseMessage.ILiveAgentHandoff, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LiveAgentHandoff message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LiveAgentHandoff + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff; + + /** + * Decodes a LiveAgentHandoff message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LiveAgentHandoff + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff; + + /** + * Verifies a LiveAgentHandoff message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LiveAgentHandoff message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LiveAgentHandoff + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff; + + /** + * Creates a plain object from a LiveAgentHandoff message. Also converts values to other types if specified. + * @param message LiveAgentHandoff + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LiveAgentHandoff to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EndInteraction. */ + interface IEndInteraction { + } + + /** Represents an EndInteraction. */ + class EndInteraction implements IEndInteraction { + + /** + * Constructs a new EndInteraction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ResponseMessage.IEndInteraction); + + /** + * Creates a new EndInteraction instance using the specified properties. + * @param [properties] Properties to set + * @returns EndInteraction instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ResponseMessage.IEndInteraction): google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction; + + /** + * Encodes the specified EndInteraction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction.verify|verify} messages. + * @param message EndInteraction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ResponseMessage.IEndInteraction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EndInteraction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction.verify|verify} messages. + * @param message EndInteraction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ResponseMessage.IEndInteraction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EndInteraction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EndInteraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction; + + /** + * Decodes an EndInteraction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EndInteraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction; + + /** + * Verifies an EndInteraction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EndInteraction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EndInteraction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction; + + /** + * Creates a plain object from an EndInteraction message. Also converts values to other types if specified. + * @param message EndInteraction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EndInteraction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Represents a Sessions */ + class Sessions extends $protobuf.rpc.Service { + + /** + * Constructs a new Sessions service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Sessions service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Sessions; + + /** + * Calls DetectIntent. + * @param request DetectIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DetectIntentResponse + */ + public detectIntent(request: google.cloud.dialogflow.v2beta1.IDetectIntentRequest, callback: google.cloud.dialogflow.v2beta1.Sessions.DetectIntentCallback): void; + + /** + * Calls DetectIntent. + * @param request DetectIntentRequest message or plain object + * @returns Promise + */ + public detectIntent(request: google.cloud.dialogflow.v2beta1.IDetectIntentRequest): Promise; + + /** + * Calls StreamingDetectIntent. + * @param request StreamingDetectIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and StreamingDetectIntentResponse + */ + public streamingDetectIntent(request: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest, callback: google.cloud.dialogflow.v2beta1.Sessions.StreamingDetectIntentCallback): void; + + /** + * Calls StreamingDetectIntent. + * @param request StreamingDetectIntentRequest message or plain object + * @returns Promise + */ + public streamingDetectIntent(request: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest): Promise; + } + + namespace Sessions { + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Sessions#detectIntent}. + * @param error Error, if any + * @param [response] DetectIntentResponse + */ + type DetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.DetectIntentResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Sessions#streamingDetectIntent}. + * @param error Error, if any + * @param [response] StreamingDetectIntentResponse + */ + type StreamingDetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse) => void; + } + + /** Properties of a DetectIntentRequest. */ + interface IDetectIntentRequest { + + /** DetectIntentRequest session */ + session?: (string|null); + + /** DetectIntentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.v2beta1.IQueryParameters|null); + + /** DetectIntentRequest queryInput */ + queryInput?: (google.cloud.dialogflow.v2beta1.IQueryInput|null); + + /** DetectIntentRequest outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + + /** DetectIntentRequest outputAudioConfigMask */ + outputAudioConfigMask?: (google.protobuf.IFieldMask|null); + + /** DetectIntentRequest inputAudio */ + inputAudio?: (Uint8Array|string|null); + } + + /** Represents a DetectIntentRequest. */ + class DetectIntentRequest implements IDetectIntentRequest { + + /** + * Constructs a new DetectIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IDetectIntentRequest); + + /** DetectIntentRequest session. */ + public session: string; + + /** DetectIntentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.v2beta1.IQueryParameters|null); + + /** DetectIntentRequest queryInput. */ + public queryInput?: (google.cloud.dialogflow.v2beta1.IQueryInput|null); + + /** DetectIntentRequest outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + + /** DetectIntentRequest outputAudioConfigMask. */ + public outputAudioConfigMask?: (google.protobuf.IFieldMask|null); + + /** DetectIntentRequest inputAudio. */ + public inputAudio: (Uint8Array|string); + + /** + * Creates a new DetectIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IDetectIntentRequest): google.cloud.dialogflow.v2beta1.DetectIntentRequest; + + /** + * Encodes the specified DetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentRequest.verify|verify} messages. + * @param message DetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentRequest.verify|verify} messages. + * @param message DetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DetectIntentRequest; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DetectIntentRequest; + + /** + * Verifies a DetectIntentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DetectIntentRequest; + + /** + * Creates a plain object from a DetectIntentRequest message. Also converts values to other types if specified. + * @param message DetectIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.DetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DetectIntentResponse. */ + interface IDetectIntentResponse { + + /** DetectIntentResponse responseId */ + responseId?: (string|null); + + /** DetectIntentResponse queryResult */ + queryResult?: (google.cloud.dialogflow.v2beta1.IQueryResult|null); + + /** DetectIntentResponse alternativeQueryResults */ + alternativeQueryResults?: (google.cloud.dialogflow.v2beta1.IQueryResult[]|null); + + /** DetectIntentResponse webhookStatus */ + webhookStatus?: (google.rpc.IStatus|null); + + /** DetectIntentResponse outputAudio */ + outputAudio?: (Uint8Array|string|null); + + /** DetectIntentResponse outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + } + + /** Represents a DetectIntentResponse. */ + class DetectIntentResponse implements IDetectIntentResponse { + + /** + * Constructs a new DetectIntentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IDetectIntentResponse); + + /** DetectIntentResponse responseId. */ + public responseId: string; + + /** DetectIntentResponse queryResult. */ + public queryResult?: (google.cloud.dialogflow.v2beta1.IQueryResult|null); + + /** DetectIntentResponse alternativeQueryResults. */ + public alternativeQueryResults: google.cloud.dialogflow.v2beta1.IQueryResult[]; + + /** DetectIntentResponse webhookStatus. */ + public webhookStatus?: (google.rpc.IStatus|null); + + /** DetectIntentResponse outputAudio. */ + public outputAudio: (Uint8Array|string); + + /** DetectIntentResponse outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + + /** + * Creates a new DetectIntentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns DetectIntentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IDetectIntentResponse): google.cloud.dialogflow.v2beta1.DetectIntentResponse; + + /** + * Encodes the specified DetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentResponse.verify|verify} messages. + * @param message DetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentResponse.verify|verify} messages. + * @param message DetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DetectIntentResponse; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DetectIntentResponse; + + /** + * Verifies a DetectIntentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DetectIntentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DetectIntentResponse; + + /** + * Creates a plain object from a DetectIntentResponse message. Also converts values to other types if specified. + * @param message DetectIntentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.DetectIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DetectIntentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QueryParameters. */ + interface IQueryParameters { + + /** QueryParameters timeZone */ + timeZone?: (string|null); + + /** QueryParameters geoLocation */ + geoLocation?: (google.type.ILatLng|null); + + /** QueryParameters contexts */ + contexts?: (google.cloud.dialogflow.v2beta1.IContext[]|null); + + /** QueryParameters resetContexts */ + resetContexts?: (boolean|null); + + /** QueryParameters sessionEntityTypes */ + sessionEntityTypes?: (google.cloud.dialogflow.v2beta1.ISessionEntityType[]|null); + + /** QueryParameters payload */ + payload?: (google.protobuf.IStruct|null); + + /** QueryParameters knowledgeBaseNames */ + knowledgeBaseNames?: (string[]|null); + + /** QueryParameters sentimentAnalysisRequestConfig */ + sentimentAnalysisRequestConfig?: (google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig|null); + + /** QueryParameters subAgents */ + subAgents?: (google.cloud.dialogflow.v2beta1.ISubAgent[]|null); + + /** QueryParameters webhookHeaders */ + webhookHeaders?: ({ [k: string]: string }|null); + } + + /** Represents a QueryParameters. */ + class QueryParameters implements IQueryParameters { + + /** + * Constructs a new QueryParameters. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IQueryParameters); + + /** QueryParameters timeZone. */ + public timeZone: string; + + /** QueryParameters geoLocation. */ + public geoLocation?: (google.type.ILatLng|null); + + /** QueryParameters contexts. */ + public contexts: google.cloud.dialogflow.v2beta1.IContext[]; + + /** QueryParameters resetContexts. */ + public resetContexts: boolean; + + /** QueryParameters sessionEntityTypes. */ + public sessionEntityTypes: google.cloud.dialogflow.v2beta1.ISessionEntityType[]; + + /** QueryParameters payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** QueryParameters knowledgeBaseNames. */ + public knowledgeBaseNames: string[]; + + /** QueryParameters sentimentAnalysisRequestConfig. */ + public sentimentAnalysisRequestConfig?: (google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig|null); + + /** QueryParameters subAgents. */ + public subAgents: google.cloud.dialogflow.v2beta1.ISubAgent[]; + + /** QueryParameters webhookHeaders. */ + public webhookHeaders: { [k: string]: string }; + + /** + * Creates a new QueryParameters instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryParameters instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IQueryParameters): google.cloud.dialogflow.v2beta1.QueryParameters; + + /** + * Encodes the specified QueryParameters message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryParameters.verify|verify} messages. + * @param message QueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryParameters.verify|verify} messages. + * @param message QueryParameters message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryParameters message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.QueryParameters; + + /** + * Decodes a QueryParameters message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.QueryParameters; + + /** + * Verifies a QueryParameters message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryParameters message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryParameters + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.QueryParameters; + + /** + * Creates a plain object from a QueryParameters message. Also converts values to other types if specified. + * @param message QueryParameters + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.QueryParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryParameters to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QueryInput. */ + interface IQueryInput { + + /** QueryInput audioConfig */ + audioConfig?: (google.cloud.dialogflow.v2beta1.IInputAudioConfig|null); + + /** QueryInput text */ + text?: (google.cloud.dialogflow.v2beta1.ITextInput|null); + + /** QueryInput event */ + event?: (google.cloud.dialogflow.v2beta1.IEventInput|null); + } + + /** Represents a QueryInput. */ + class QueryInput implements IQueryInput { + + /** + * Constructs a new QueryInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IQueryInput); + + /** QueryInput audioConfig. */ + public audioConfig?: (google.cloud.dialogflow.v2beta1.IInputAudioConfig|null); + + /** QueryInput text. */ + public text?: (google.cloud.dialogflow.v2beta1.ITextInput|null); + + /** QueryInput event. */ + public event?: (google.cloud.dialogflow.v2beta1.IEventInput|null); + + /** QueryInput input. */ + public input?: ("audioConfig"|"text"|"event"); + + /** + * Creates a new QueryInput instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryInput instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IQueryInput): google.cloud.dialogflow.v2beta1.QueryInput; + + /** + * Encodes the specified QueryInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryInput.verify|verify} messages. + * @param message QueryInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IQueryInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryInput.verify|verify} messages. + * @param message QueryInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IQueryInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.QueryInput; + + /** + * Decodes a QueryInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.QueryInput; + + /** + * Verifies a QueryInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.QueryInput; + + /** + * Creates a plain object from a QueryInput message. Also converts values to other types if specified. + * @param message QueryInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.QueryInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QueryResult. */ + interface IQueryResult { + + /** QueryResult queryText */ + queryText?: (string|null); + + /** QueryResult languageCode */ + languageCode?: (string|null); + + /** QueryResult speechRecognitionConfidence */ + speechRecognitionConfidence?: (number|null); + + /** QueryResult action */ + action?: (string|null); + + /** QueryResult parameters */ + parameters?: (google.protobuf.IStruct|null); + + /** QueryResult allRequiredParamsPresent */ + allRequiredParamsPresent?: (boolean|null); + + /** QueryResult fulfillmentText */ + fulfillmentText?: (string|null); + + /** QueryResult fulfillmentMessages */ + fulfillmentMessages?: (google.cloud.dialogflow.v2beta1.Intent.IMessage[]|null); + + /** QueryResult webhookSource */ + webhookSource?: (string|null); + + /** QueryResult webhookPayload */ + webhookPayload?: (google.protobuf.IStruct|null); + + /** QueryResult outputContexts */ + outputContexts?: (google.cloud.dialogflow.v2beta1.IContext[]|null); + + /** QueryResult intent */ + intent?: (google.cloud.dialogflow.v2beta1.IIntent|null); + + /** QueryResult intentDetectionConfidence */ + intentDetectionConfidence?: (number|null); + + /** QueryResult diagnosticInfo */ + diagnosticInfo?: (google.protobuf.IStruct|null); + + /** QueryResult sentimentAnalysisResult */ + sentimentAnalysisResult?: (google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult|null); + + /** QueryResult knowledgeAnswers */ + knowledgeAnswers?: (google.cloud.dialogflow.v2beta1.IKnowledgeAnswers|null); + } + + /** Represents a QueryResult. */ + class QueryResult implements IQueryResult { + + /** + * Constructs a new QueryResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IQueryResult); + + /** QueryResult queryText. */ + public queryText: string; + + /** QueryResult languageCode. */ + public languageCode: string; + + /** QueryResult speechRecognitionConfidence. */ + public speechRecognitionConfidence: number; + + /** QueryResult action. */ + public action: string; + + /** QueryResult parameters. */ + public parameters?: (google.protobuf.IStruct|null); + + /** QueryResult allRequiredParamsPresent. */ + public allRequiredParamsPresent: boolean; + + /** QueryResult fulfillmentText. */ + public fulfillmentText: string; + + /** QueryResult fulfillmentMessages. */ + public fulfillmentMessages: google.cloud.dialogflow.v2beta1.Intent.IMessage[]; + + /** QueryResult webhookSource. */ + public webhookSource: string; + + /** QueryResult webhookPayload. */ + public webhookPayload?: (google.protobuf.IStruct|null); + + /** QueryResult outputContexts. */ + public outputContexts: google.cloud.dialogflow.v2beta1.IContext[]; + + /** QueryResult intent. */ + public intent?: (google.cloud.dialogflow.v2beta1.IIntent|null); + + /** QueryResult intentDetectionConfidence. */ + public intentDetectionConfidence: number; + + /** QueryResult diagnosticInfo. */ + public diagnosticInfo?: (google.protobuf.IStruct|null); + + /** QueryResult sentimentAnalysisResult. */ + public sentimentAnalysisResult?: (google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult|null); + + /** QueryResult knowledgeAnswers. */ + public knowledgeAnswers?: (google.cloud.dialogflow.v2beta1.IKnowledgeAnswers|null); + + /** + * Creates a new QueryResult instance using the specified properties. + * @param [properties] Properties to set + * @returns QueryResult instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IQueryResult): google.cloud.dialogflow.v2beta1.QueryResult; + + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryResult.verify|verify} messages. + * @param message QueryResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.QueryResult; + + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.QueryResult; + + /** + * Verifies a QueryResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QueryResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.QueryResult; + + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @param message QueryResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.QueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QueryResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a KnowledgeAnswers. */ + interface IKnowledgeAnswers { + + /** KnowledgeAnswers answers */ + answers?: (google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer[]|null); + } + + /** Represents a KnowledgeAnswers. */ + class KnowledgeAnswers implements IKnowledgeAnswers { + + /** + * Constructs a new KnowledgeAnswers. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IKnowledgeAnswers); + + /** KnowledgeAnswers answers. */ + public answers: google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer[]; + + /** + * Creates a new KnowledgeAnswers instance using the specified properties. + * @param [properties] Properties to set + * @returns KnowledgeAnswers instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IKnowledgeAnswers): google.cloud.dialogflow.v2beta1.KnowledgeAnswers; + + /** + * Encodes the specified KnowledgeAnswers message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.verify|verify} messages. + * @param message KnowledgeAnswers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IKnowledgeAnswers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified KnowledgeAnswers message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.verify|verify} messages. + * @param message KnowledgeAnswers message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IKnowledgeAnswers, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a KnowledgeAnswers message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KnowledgeAnswers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.KnowledgeAnswers; + + /** + * Decodes a KnowledgeAnswers message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KnowledgeAnswers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.KnowledgeAnswers; + + /** + * Verifies a KnowledgeAnswers message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a KnowledgeAnswers message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KnowledgeAnswers + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.KnowledgeAnswers; + + /** + * Creates a plain object from a KnowledgeAnswers message. Also converts values to other types if specified. + * @param message KnowledgeAnswers + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.KnowledgeAnswers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this KnowledgeAnswers to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace KnowledgeAnswers { + + /** Properties of an Answer. */ + interface IAnswer { + + /** Answer source */ + source?: (string|null); + + /** Answer faqQuestion */ + faqQuestion?: (string|null); + + /** Answer answer */ + answer?: (string|null); + + /** Answer matchConfidenceLevel */ + matchConfidenceLevel?: (google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel|keyof typeof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel|null); + + /** Answer matchConfidence */ + matchConfidence?: (number|null); + } + + /** Represents an Answer. */ + class Answer implements IAnswer { + + /** + * Constructs a new Answer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer); + + /** Answer source. */ + public source: string; + + /** Answer faqQuestion. */ + public faqQuestion: string; + + /** Answer answer. */ + public answer: string; + + /** Answer matchConfidenceLevel. */ + public matchConfidenceLevel: (google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel|keyof typeof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel); + + /** Answer matchConfidence. */ + public matchConfidence: number; + + /** + * Creates a new Answer instance using the specified properties. + * @param [properties] Properties to set + * @returns Answer instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer): google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer; + + /** + * Encodes the specified Answer message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.verify|verify} messages. + * @param message Answer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Answer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.verify|verify} messages. + * @param message Answer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Answer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Answer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer; + + /** + * Decodes an Answer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Answer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer; + + /** + * Verifies an Answer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Answer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Answer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer; + + /** + * Creates a plain object from an Answer message. Also converts values to other types if specified. + * @param message Answer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Answer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Answer { + + /** MatchConfidenceLevel enum. */ + enum MatchConfidenceLevel { + MATCH_CONFIDENCE_LEVEL_UNSPECIFIED = 0, + LOW = 1, + MEDIUM = 2, + HIGH = 3 + } + } + } + + /** Properties of a StreamingDetectIntentRequest. */ + interface IStreamingDetectIntentRequest { + + /** StreamingDetectIntentRequest session */ + session?: (string|null); + + /** StreamingDetectIntentRequest queryParams */ + queryParams?: (google.cloud.dialogflow.v2beta1.IQueryParameters|null); + + /** StreamingDetectIntentRequest queryInput */ + queryInput?: (google.cloud.dialogflow.v2beta1.IQueryInput|null); + + /** StreamingDetectIntentRequest singleUtterance */ + singleUtterance?: (boolean|null); + + /** StreamingDetectIntentRequest outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + + /** StreamingDetectIntentRequest outputAudioConfigMask */ + outputAudioConfigMask?: (google.protobuf.IFieldMask|null); + + /** StreamingDetectIntentRequest inputAudio */ + inputAudio?: (Uint8Array|string|null); + } + + /** Represents a StreamingDetectIntentRequest. */ + class StreamingDetectIntentRequest implements IStreamingDetectIntentRequest { + + /** + * Constructs a new StreamingDetectIntentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest); + + /** StreamingDetectIntentRequest session. */ + public session: string; + + /** StreamingDetectIntentRequest queryParams. */ + public queryParams?: (google.cloud.dialogflow.v2beta1.IQueryParameters|null); + + /** StreamingDetectIntentRequest queryInput. */ + public queryInput?: (google.cloud.dialogflow.v2beta1.IQueryInput|null); + + /** StreamingDetectIntentRequest singleUtterance. */ + public singleUtterance: boolean; + + /** StreamingDetectIntentRequest outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + + /** StreamingDetectIntentRequest outputAudioConfigMask. */ + public outputAudioConfigMask?: (google.protobuf.IFieldMask|null); + + /** StreamingDetectIntentRequest inputAudio. */ + public inputAudio: (Uint8Array|string); + + /** + * Creates a new StreamingDetectIntentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingDetectIntentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest): google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest; + + /** + * Encodes the specified StreamingDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.verify|verify} messages. + * @param message StreamingDetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.verify|verify} messages. + * @param message StreamingDetectIntentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest; + + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest; + + /** + * Verifies a StreamingDetectIntentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingDetectIntentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest; + + /** + * Creates a plain object from a StreamingDetectIntentRequest message. Also converts values to other types if specified. + * @param message StreamingDetectIntentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingDetectIntentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StreamingDetectIntentResponse. */ + interface IStreamingDetectIntentResponse { + + /** StreamingDetectIntentResponse responseId */ + responseId?: (string|null); + + /** StreamingDetectIntentResponse recognitionResult */ + recognitionResult?: (google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null); + + /** StreamingDetectIntentResponse queryResult */ + queryResult?: (google.cloud.dialogflow.v2beta1.IQueryResult|null); + + /** StreamingDetectIntentResponse alternativeQueryResults */ + alternativeQueryResults?: (google.cloud.dialogflow.v2beta1.IQueryResult[]|null); + + /** StreamingDetectIntentResponse webhookStatus */ + webhookStatus?: (google.rpc.IStatus|null); + + /** StreamingDetectIntentResponse outputAudio */ + outputAudio?: (Uint8Array|string|null); + + /** StreamingDetectIntentResponse outputAudioConfig */ + outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + } + + /** Represents a StreamingDetectIntentResponse. */ + class StreamingDetectIntentResponse implements IStreamingDetectIntentResponse { + + /** + * Constructs a new StreamingDetectIntentResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse); + + /** StreamingDetectIntentResponse responseId. */ + public responseId: string; + + /** StreamingDetectIntentResponse recognitionResult. */ + public recognitionResult?: (google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null); + + /** StreamingDetectIntentResponse queryResult. */ + public queryResult?: (google.cloud.dialogflow.v2beta1.IQueryResult|null); + + /** StreamingDetectIntentResponse alternativeQueryResults. */ + public alternativeQueryResults: google.cloud.dialogflow.v2beta1.IQueryResult[]; + + /** StreamingDetectIntentResponse webhookStatus. */ + public webhookStatus?: (google.rpc.IStatus|null); + + /** StreamingDetectIntentResponse outputAudio. */ + public outputAudio: (Uint8Array|string); + + /** StreamingDetectIntentResponse outputAudioConfig. */ + public outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + + /** + * Creates a new StreamingDetectIntentResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingDetectIntentResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse): google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse; + + /** + * Encodes the specified StreamingDetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.verify|verify} messages. + * @param message StreamingDetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingDetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.verify|verify} messages. + * @param message StreamingDetectIntentResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingDetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse; + + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingDetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse; + + /** + * Verifies a StreamingDetectIntentResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingDetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingDetectIntentResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse; + + /** + * Creates a plain object from a StreamingDetectIntentResponse message. Also converts values to other types if specified. + * @param message StreamingDetectIntentResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingDetectIntentResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a StreamingRecognitionResult. */ + interface IStreamingRecognitionResult { + + /** StreamingRecognitionResult messageType */ + messageType?: (google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType|keyof typeof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType|null); + + /** StreamingRecognitionResult transcript */ + transcript?: (string|null); + + /** StreamingRecognitionResult isFinal */ + isFinal?: (boolean|null); + + /** StreamingRecognitionResult confidence */ + confidence?: (number|null); + + /** StreamingRecognitionResult stability */ + stability?: (number|null); + + /** StreamingRecognitionResult speechWordInfo */ + speechWordInfo?: (google.cloud.dialogflow.v2beta1.ISpeechWordInfo[]|null); + + /** StreamingRecognitionResult speechEndOffset */ + speechEndOffset?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult dtmfDigits */ + dtmfDigits?: (google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents|null); + } + + /** Represents a StreamingRecognitionResult. */ + class StreamingRecognitionResult implements IStreamingRecognitionResult { + + /** + * Constructs a new StreamingRecognitionResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult); + + /** StreamingRecognitionResult messageType. */ + public messageType: (google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType|keyof typeof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType); + + /** StreamingRecognitionResult transcript. */ + public transcript: string; + + /** StreamingRecognitionResult isFinal. */ + public isFinal: boolean; + + /** StreamingRecognitionResult confidence. */ + public confidence: number; + + /** StreamingRecognitionResult stability. */ + public stability: number; + + /** StreamingRecognitionResult speechWordInfo. */ + public speechWordInfo: google.cloud.dialogflow.v2beta1.ISpeechWordInfo[]; + + /** StreamingRecognitionResult speechEndOffset. */ + public speechEndOffset?: (google.protobuf.IDuration|null); + + /** StreamingRecognitionResult dtmfDigits. */ + public dtmfDigits?: (google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents|null); + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @param [properties] Properties to set + * @returns StreamingRecognitionResult instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult): google.cloud.dialogflow.v2beta1.StreamingRecognitionResult; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.verify|verify} messages. + * @param message StreamingRecognitionResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.StreamingRecognitionResult; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.StreamingRecognitionResult; + + /** + * Verifies a StreamingRecognitionResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StreamingRecognitionResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.StreamingRecognitionResult; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @param message StreamingRecognitionResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.StreamingRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace StreamingRecognitionResult { + + /** MessageType enum. */ + enum MessageType { + MESSAGE_TYPE_UNSPECIFIED = 0, + TRANSCRIPT = 1, + END_OF_SINGLE_UTTERANCE = 2 + } + } + + /** Properties of a TextInput. */ + interface ITextInput { + + /** TextInput text */ + text?: (string|null); + + /** TextInput languageCode */ + languageCode?: (string|null); + } + + /** Represents a TextInput. */ + class TextInput implements ITextInput { + + /** + * Constructs a new TextInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ITextInput); + + /** TextInput text. */ + public text: string; + + /** TextInput languageCode. */ + public languageCode: string; + + /** + * Creates a new TextInput instance using the specified properties. + * @param [properties] Properties to set + * @returns TextInput instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ITextInput): google.cloud.dialogflow.v2beta1.TextInput; + + /** + * Encodes the specified TextInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TextInput.verify|verify} messages. + * @param message TextInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TextInput.verify|verify} messages. + * @param message TextInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TextInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.TextInput; + + /** + * Decodes a TextInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.TextInput; + + /** + * Verifies a TextInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TextInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TextInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.TextInput; + + /** + * Creates a plain object from a TextInput message. Also converts values to other types if specified. + * @param message TextInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.TextInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TextInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EventInput. */ + interface IEventInput { + + /** EventInput name */ + name?: (string|null); + + /** EventInput parameters */ + parameters?: (google.protobuf.IStruct|null); + + /** EventInput languageCode */ + languageCode?: (string|null); + } + + /** Represents an EventInput. */ + class EventInput implements IEventInput { + + /** + * Constructs a new EventInput. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IEventInput); + + /** EventInput name. */ + public name: string; + + /** EventInput parameters. */ + public parameters?: (google.protobuf.IStruct|null); + + /** EventInput languageCode. */ + public languageCode: string; + + /** + * Creates a new EventInput instance using the specified properties. + * @param [properties] Properties to set + * @returns EventInput instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IEventInput): google.cloud.dialogflow.v2beta1.EventInput; + + /** + * Encodes the specified EventInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EventInput.verify|verify} messages. + * @param message EventInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IEventInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EventInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EventInput.verify|verify} messages. + * @param message EventInput message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IEventInput, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EventInput message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EventInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.EventInput; + + /** + * Decodes an EventInput message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EventInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.EventInput; + + /** + * Verifies an EventInput message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EventInput message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EventInput + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.EventInput; + + /** + * Creates a plain object from an EventInput message. Also converts values to other types if specified. + * @param message EventInput + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.EventInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EventInput to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SentimentAnalysisRequestConfig. */ + interface ISentimentAnalysisRequestConfig { + + /** SentimentAnalysisRequestConfig analyzeQueryTextSentiment */ + analyzeQueryTextSentiment?: (boolean|null); + } + + /** Represents a SentimentAnalysisRequestConfig. */ + class SentimentAnalysisRequestConfig implements ISentimentAnalysisRequestConfig { + + /** + * Constructs a new SentimentAnalysisRequestConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig); + + /** SentimentAnalysisRequestConfig analyzeQueryTextSentiment. */ + public analyzeQueryTextSentiment: boolean; + + /** + * Creates a new SentimentAnalysisRequestConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SentimentAnalysisRequestConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig): google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig; + + /** + * Encodes the specified SentimentAnalysisRequestConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.verify|verify} messages. + * @param message SentimentAnalysisRequestConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SentimentAnalysisRequestConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.verify|verify} messages. + * @param message SentimentAnalysisRequestConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SentimentAnalysisRequestConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig; + + /** + * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SentimentAnalysisRequestConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig; + + /** + * Verifies a SentimentAnalysisRequestConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SentimentAnalysisRequestConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SentimentAnalysisRequestConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig; + + /** + * Creates a plain object from a SentimentAnalysisRequestConfig message. Also converts values to other types if specified. + * @param message SentimentAnalysisRequestConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SentimentAnalysisRequestConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SentimentAnalysisResult. */ + interface ISentimentAnalysisResult { + + /** SentimentAnalysisResult queryTextSentiment */ + queryTextSentiment?: (google.cloud.dialogflow.v2beta1.ISentiment|null); + } + + /** Represents a SentimentAnalysisResult. */ + class SentimentAnalysisResult implements ISentimentAnalysisResult { + + /** + * Constructs a new SentimentAnalysisResult. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult); + + /** SentimentAnalysisResult queryTextSentiment. */ + public queryTextSentiment?: (google.cloud.dialogflow.v2beta1.ISentiment|null); + + /** + * Creates a new SentimentAnalysisResult instance using the specified properties. + * @param [properties] Properties to set + * @returns SentimentAnalysisResult instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult): google.cloud.dialogflow.v2beta1.SentimentAnalysisResult; + + /** + * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.verify|verify} messages. + * @param message SentimentAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.verify|verify} messages. + * @param message SentimentAnalysisResult message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SentimentAnalysisResult; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SentimentAnalysisResult; + + /** + * Verifies a SentimentAnalysisResult message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SentimentAnalysisResult + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SentimentAnalysisResult; + + /** + * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * @param message SentimentAnalysisResult + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SentimentAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SentimentAnalysisResult to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Sentiment. */ + interface ISentiment { + + /** Sentiment score */ + score?: (number|null); + + /** Sentiment magnitude */ + magnitude?: (number|null); + } + + /** Represents a Sentiment. */ + class Sentiment implements ISentiment { + + /** + * Constructs a new Sentiment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISentiment); + + /** Sentiment score. */ + public score: number; + + /** Sentiment magnitude. */ + public magnitude: number; + + /** + * Creates a new Sentiment instance using the specified properties. + * @param [properties] Properties to set + * @returns Sentiment instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISentiment): google.cloud.dialogflow.v2beta1.Sentiment; + + /** + * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Sentiment.verify|verify} messages. + * @param message Sentiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISentiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Sentiment.verify|verify} messages. + * @param message Sentiment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISentiment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Sentiment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Sentiment; + + /** + * Decodes a Sentiment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Sentiment; + + /** + * Verifies a Sentiment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Sentiment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Sentiment; + + /** + * Creates a plain object from a Sentiment message. Also converts values to other types if specified. + * @param message Sentiment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Sentiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Sentiment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents a Contexts */ + class Contexts extends $protobuf.rpc.Service { + + /** + * Constructs a new Contexts service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Contexts service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Contexts; + + /** + * Calls ListContexts. + * @param request ListContextsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListContextsResponse + */ + public listContexts(request: google.cloud.dialogflow.v2beta1.IListContextsRequest, callback: google.cloud.dialogflow.v2beta1.Contexts.ListContextsCallback): void; + + /** + * Calls ListContexts. + * @param request ListContextsRequest message or plain object + * @returns Promise + */ + public listContexts(request: google.cloud.dialogflow.v2beta1.IListContextsRequest): Promise; + + /** + * Calls GetContext. + * @param request GetContextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Context + */ + public getContext(request: google.cloud.dialogflow.v2beta1.IGetContextRequest, callback: google.cloud.dialogflow.v2beta1.Contexts.GetContextCallback): void; + + /** + * Calls GetContext. + * @param request GetContextRequest message or plain object + * @returns Promise + */ + public getContext(request: google.cloud.dialogflow.v2beta1.IGetContextRequest): Promise; + + /** + * Calls CreateContext. + * @param request CreateContextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Context + */ + public createContext(request: google.cloud.dialogflow.v2beta1.ICreateContextRequest, callback: google.cloud.dialogflow.v2beta1.Contexts.CreateContextCallback): void; + + /** + * Calls CreateContext. + * @param request CreateContextRequest message or plain object + * @returns Promise + */ + public createContext(request: google.cloud.dialogflow.v2beta1.ICreateContextRequest): Promise; + + /** + * Calls UpdateContext. + * @param request UpdateContextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Context + */ + public updateContext(request: google.cloud.dialogflow.v2beta1.IUpdateContextRequest, callback: google.cloud.dialogflow.v2beta1.Contexts.UpdateContextCallback): void; + + /** + * Calls UpdateContext. + * @param request UpdateContextRequest message or plain object + * @returns Promise + */ + public updateContext(request: google.cloud.dialogflow.v2beta1.IUpdateContextRequest): Promise; + + /** + * Calls DeleteContext. + * @param request DeleteContextRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteContext(request: google.cloud.dialogflow.v2beta1.IDeleteContextRequest, callback: google.cloud.dialogflow.v2beta1.Contexts.DeleteContextCallback): void; + + /** + * Calls DeleteContext. + * @param request DeleteContextRequest message or plain object + * @returns Promise + */ + public deleteContext(request: google.cloud.dialogflow.v2beta1.IDeleteContextRequest): Promise; + + /** + * Calls DeleteAllContexts. + * @param request DeleteAllContextsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteAllContexts(request: google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest, callback: google.cloud.dialogflow.v2beta1.Contexts.DeleteAllContextsCallback): void; + + /** + * Calls DeleteAllContexts. + * @param request DeleteAllContextsRequest message or plain object + * @returns Promise + */ + public deleteAllContexts(request: google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest): Promise; + } + + namespace Contexts { + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#listContexts}. + * @param error Error, if any + * @param [response] ListContextsResponse + */ + type ListContextsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListContextsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#getContext}. + * @param error Error, if any + * @param [response] Context + */ + type GetContextCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Context) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#createContext}. + * @param error Error, if any + * @param [response] Context + */ + type CreateContextCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Context) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#updateContext}. + * @param error Error, if any + * @param [response] Context + */ + type UpdateContextCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Context) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#deleteContext}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteContextCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#deleteAllContexts}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteAllContextsCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } + + /** Properties of a Context. */ + interface IContext { + + /** Context name */ + name?: (string|null); + + /** Context lifespanCount */ + lifespanCount?: (number|null); + + /** Context parameters */ + parameters?: (google.protobuf.IStruct|null); + } + + /** Represents a Context. */ + class Context implements IContext { + + /** + * Constructs a new Context. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IContext); + + /** Context name. */ + public name: string; + + /** Context lifespanCount. */ + public lifespanCount: number; + + /** Context parameters. */ + public parameters?: (google.protobuf.IStruct|null); + + /** + * Creates a new Context instance using the specified properties. + * @param [properties] Properties to set + * @returns Context instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IContext): google.cloud.dialogflow.v2beta1.Context; + + /** + * Encodes the specified Context message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Context.verify|verify} messages. + * @param message Context message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Context message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Context.verify|verify} messages. + * @param message Context message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IContext, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Context message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Context; + + /** + * Decodes a Context message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Context; + + /** + * Verifies a Context message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Context message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Context + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Context; + + /** + * Creates a plain object from a Context message. Also converts values to other types if specified. + * @param message Context + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Context, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Context to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListContextsRequest. */ + interface IListContextsRequest { + + /** ListContextsRequest parent */ + parent?: (string|null); + + /** ListContextsRequest pageSize */ + pageSize?: (number|null); + + /** ListContextsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListContextsRequest. */ + class ListContextsRequest implements IListContextsRequest { + + /** + * Constructs a new ListContextsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListContextsRequest); + + /** ListContextsRequest parent. */ + public parent: string; + + /** ListContextsRequest pageSize. */ + public pageSize: number; + + /** ListContextsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListContextsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContextsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListContextsRequest): google.cloud.dialogflow.v2beta1.ListContextsRequest; + + /** + * Encodes the specified ListContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsRequest.verify|verify} messages. + * @param message ListContextsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsRequest.verify|verify} messages. + * @param message ListContextsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListContextsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListContextsRequest; + + /** + * Decodes a ListContextsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListContextsRequest; + + /** + * Verifies a ListContextsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListContextsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContextsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListContextsRequest; + + /** + * Creates a plain object from a ListContextsRequest message. Also converts values to other types if specified. + * @param message ListContextsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListContextsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListContextsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListContextsResponse. */ + interface IListContextsResponse { + + /** ListContextsResponse contexts */ + contexts?: (google.cloud.dialogflow.v2beta1.IContext[]|null); + + /** ListContextsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListContextsResponse. */ + class ListContextsResponse implements IListContextsResponse { + + /** + * Constructs a new ListContextsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListContextsResponse); + + /** ListContextsResponse contexts. */ + public contexts: google.cloud.dialogflow.v2beta1.IContext[]; + + /** ListContextsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListContextsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListContextsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListContextsResponse): google.cloud.dialogflow.v2beta1.ListContextsResponse; + + /** + * Encodes the specified ListContextsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsResponse.verify|verify} messages. + * @param message ListContextsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListContextsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListContextsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsResponse.verify|verify} messages. + * @param message ListContextsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListContextsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListContextsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListContextsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListContextsResponse; + + /** + * Decodes a ListContextsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListContextsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListContextsResponse; + + /** + * Verifies a ListContextsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListContextsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListContextsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListContextsResponse; + + /** + * Creates a plain object from a ListContextsResponse message. Also converts values to other types if specified. + * @param message ListContextsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListContextsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListContextsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GetContextRequest. */ + interface IGetContextRequest { + + /** GetContextRequest name */ + name?: (string|null); + } + + /** Represents a GetContextRequest. */ + class GetContextRequest implements IGetContextRequest { + + /** + * Constructs a new GetContextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IGetContextRequest); + + /** GetContextRequest name. */ + public name: string; + + /** + * Creates a new GetContextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetContextRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IGetContextRequest): google.cloud.dialogflow.v2beta1.GetContextRequest; + + /** + * Encodes the specified GetContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetContextRequest.verify|verify} messages. + * @param message GetContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IGetContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetContextRequest.verify|verify} messages. + * @param message GetContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetContextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetContextRequest; + + /** + * Decodes a GetContextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetContextRequest; + + /** + * Verifies a GetContextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetContextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetContextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetContextRequest; + + /** + * Creates a plain object from a GetContextRequest message. Also converts values to other types if specified. + * @param message GetContextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.GetContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetContextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a CreateContextRequest. */ + interface ICreateContextRequest { + + /** CreateContextRequest parent */ + parent?: (string|null); + + /** CreateContextRequest context */ + context?: (google.cloud.dialogflow.v2beta1.IContext|null); + } + + /** Represents a CreateContextRequest. */ + class CreateContextRequest implements ICreateContextRequest { + + /** + * Constructs a new CreateContextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateContextRequest); + + /** CreateContextRequest parent. */ + public parent: string; + + /** CreateContextRequest context. */ + public context?: (google.cloud.dialogflow.v2beta1.IContext|null); + + /** + * Creates a new CreateContextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateContextRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateContextRequest): google.cloud.dialogflow.v2beta1.CreateContextRequest; + + /** + * Encodes the specified CreateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateContextRequest.verify|verify} messages. + * @param message CreateContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ICreateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateContextRequest.verify|verify} messages. + * @param message CreateContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateContextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateContextRequest; + + /** + * Decodes a CreateContextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateContextRequest; + + /** + * Verifies a CreateContextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateContextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateContextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateContextRequest; + + /** + * Creates a plain object from a CreateContextRequest message. Also converts values to other types if specified. + * @param message CreateContextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CreateContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateContextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an UpdateContextRequest. */ + interface IUpdateContextRequest { + + /** UpdateContextRequest context */ + context?: (google.cloud.dialogflow.v2beta1.IContext|null); + + /** UpdateContextRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents an UpdateContextRequest. */ + class UpdateContextRequest implements IUpdateContextRequest { + + /** + * Constructs a new UpdateContextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateContextRequest); + + /** UpdateContextRequest context. */ + public context?: (google.cloud.dialogflow.v2beta1.IContext|null); + + /** UpdateContextRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** + * Creates a new UpdateContextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateContextRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateContextRequest): google.cloud.dialogflow.v2beta1.UpdateContextRequest; + + /** + * Encodes the specified UpdateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateContextRequest.verify|verify} messages. + * @param message UpdateContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateContextRequest.verify|verify} messages. + * @param message UpdateContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateContextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateContextRequest; + + /** + * Decodes an UpdateContextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateContextRequest; + + /** + * Verifies an UpdateContextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateContextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateContextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateContextRequest; + + /** + * Creates a plain object from an UpdateContextRequest message. Also converts values to other types if specified. + * @param message UpdateContextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateContextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteContextRequest. */ + interface IDeleteContextRequest { + + /** DeleteContextRequest name */ + name?: (string|null); + } + + /** Represents a DeleteContextRequest. */ + class DeleteContextRequest implements IDeleteContextRequest { + + /** + * Constructs a new DeleteContextRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteContextRequest); + + /** DeleteContextRequest name. */ + public name: string; + + /** + * Creates a new DeleteContextRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteContextRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteContextRequest): google.cloud.dialogflow.v2beta1.DeleteContextRequest; + + /** + * Encodes the specified DeleteContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteContextRequest.verify|verify} messages. + * @param message DeleteContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteContextRequest.verify|verify} messages. + * @param message DeleteContextRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteContextRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteContextRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteContextRequest; + + /** + * Decodes a DeleteContextRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteContextRequest; + + /** + * Verifies a DeleteContextRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteContextRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteContextRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteContextRequest; + + /** + * Creates a plain object from a DeleteContextRequest message. Also converts values to other types if specified. + * @param message DeleteContextRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteContextRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteContextRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DeleteAllContextsRequest. */ + interface IDeleteAllContextsRequest { + + /** DeleteAllContextsRequest parent */ + parent?: (string|null); + } + + /** Represents a DeleteAllContextsRequest. */ + class DeleteAllContextsRequest implements IDeleteAllContextsRequest { + + /** + * Constructs a new DeleteAllContextsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest); + + /** DeleteAllContextsRequest parent. */ + public parent: string; + + /** + * Creates a new DeleteAllContextsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteAllContextsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest): google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest; + + /** + * Encodes the specified DeleteAllContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest.verify|verify} messages. + * @param message DeleteAllContextsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteAllContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest.verify|verify} messages. + * @param message DeleteAllContextsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteAllContextsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteAllContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest; + + /** + * Decodes a DeleteAllContextsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteAllContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest; + + /** + * Verifies a DeleteAllContextsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteAllContextsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteAllContextsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest; + + /** + * Creates a plain object from a DeleteAllContextsRequest message. Also converts values to other types if specified. + * @param message DeleteAllContextsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteAllContextsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsSources. */ + interface IGcsSources { + + /** GcsSources uris */ + uris?: (string[]|null); + } + + /** Represents a GcsSources. */ + class GcsSources implements IGcsSources { + + /** + * Constructs a new GcsSources. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IGcsSources); + + /** GcsSources uris. */ + public uris: string[]; + + /** + * Creates a new GcsSources instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSources instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IGcsSources): google.cloud.dialogflow.v2beta1.GcsSources; + + /** + * Encodes the specified GcsSources message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GcsSources.verify|verify} messages. + * @param message GcsSources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IGcsSources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GcsSources.verify|verify} messages. + * @param message GcsSources message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGcsSources, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsSources message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GcsSources; + + /** + * Decodes a GcsSources message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GcsSources; + + /** + * Verifies a GcsSources message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsSources message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSources + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GcsSources; + + /** + * Creates a plain object from a GcsSources message. Also converts values to other types if specified. + * @param message GcsSources + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.GcsSources, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsSources to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a GcsSource. */ + interface IGcsSource { + + /** GcsSource uri */ + uri?: (string|null); + } + + /** Represents a GcsSource. */ + class GcsSource implements IGcsSource { + + /** + * Constructs a new GcsSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IGcsSource); + + /** GcsSource uri. */ + public uri: string; + + /** + * Creates a new GcsSource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcsSource instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IGcsSource): google.cloud.dialogflow.v2beta1.GcsSource; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GcsSource.verify|verify} messages. + * @param message GcsSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GcsSource; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GcsSource; + + /** + * Verifies a GcsSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcsSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GcsSource; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @param message GcsSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcsSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Represents an Intents */ + class Intents extends $protobuf.rpc.Service { + + /** + * Constructs a new Intents service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + + /** + * Creates new Intents service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Intents; + + /** + * Calls ListIntents. + * @param request ListIntentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListIntentsResponse + */ + public listIntents(request: google.cloud.dialogflow.v2beta1.IListIntentsRequest, callback: google.cloud.dialogflow.v2beta1.Intents.ListIntentsCallback): void; + + /** + * Calls ListIntents. + * @param request ListIntentsRequest message or plain object + * @returns Promise + */ + public listIntents(request: google.cloud.dialogflow.v2beta1.IListIntentsRequest): Promise; + + /** + * Calls GetIntent. + * @param request GetIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Intent + */ + public getIntent(request: google.cloud.dialogflow.v2beta1.IGetIntentRequest, callback: google.cloud.dialogflow.v2beta1.Intents.GetIntentCallback): void; + + /** + * Calls GetIntent. + * @param request GetIntentRequest message or plain object + * @returns Promise + */ + public getIntent(request: google.cloud.dialogflow.v2beta1.IGetIntentRequest): Promise; + + /** + * Calls CreateIntent. + * @param request CreateIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Intent + */ + public createIntent(request: google.cloud.dialogflow.v2beta1.ICreateIntentRequest, callback: google.cloud.dialogflow.v2beta1.Intents.CreateIntentCallback): void; + + /** + * Calls CreateIntent. + * @param request CreateIntentRequest message or plain object + * @returns Promise + */ + public createIntent(request: google.cloud.dialogflow.v2beta1.ICreateIntentRequest): Promise; + + /** + * Calls UpdateIntent. + * @param request UpdateIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Intent + */ + public updateIntent(request: google.cloud.dialogflow.v2beta1.IUpdateIntentRequest, callback: google.cloud.dialogflow.v2beta1.Intents.UpdateIntentCallback): void; + + /** + * Calls UpdateIntent. + * @param request UpdateIntentRequest message or plain object + * @returns Promise + */ + public updateIntent(request: google.cloud.dialogflow.v2beta1.IUpdateIntentRequest): Promise; + + /** + * Calls DeleteIntent. + * @param request DeleteIntentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteIntent(request: google.cloud.dialogflow.v2beta1.IDeleteIntentRequest, callback: google.cloud.dialogflow.v2beta1.Intents.DeleteIntentCallback): void; + + /** + * Calls DeleteIntent. + * @param request DeleteIntentRequest message or plain object + * @returns Promise + */ + public deleteIntent(request: google.cloud.dialogflow.v2beta1.IDeleteIntentRequest): Promise; + + /** + * Calls BatchUpdateIntents. + * @param request BatchUpdateIntentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchUpdateIntents(request: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, callback: google.cloud.dialogflow.v2beta1.Intents.BatchUpdateIntentsCallback): void; + + /** + * Calls BatchUpdateIntents. + * @param request BatchUpdateIntentsRequest message or plain object + * @returns Promise + */ + public batchUpdateIntents(request: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest): Promise; + + /** + * Calls BatchDeleteIntents. + * @param request BatchDeleteIntentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchDeleteIntents(request: google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, callback: google.cloud.dialogflow.v2beta1.Intents.BatchDeleteIntentsCallback): void; + + /** + * Calls BatchDeleteIntents. + * @param request BatchDeleteIntentsRequest message or plain object + * @returns Promise + */ + public batchDeleteIntents(request: google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest): Promise; + } + + namespace Intents { + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#listIntents}. + * @param error Error, if any + * @param [response] ListIntentsResponse + */ + type ListIntentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListIntentsResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#getIntent}. + * @param error Error, if any + * @param [response] Intent + */ + type GetIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Intent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#createIntent}. + * @param error Error, if any + * @param [response] Intent + */ + type CreateIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Intent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#updateIntent}. + * @param error Error, if any + * @param [response] Intent + */ + type UpdateIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Intent) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#deleteIntent}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteIntentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#batchUpdateIntents}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchUpdateIntentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#batchDeleteIntents}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchDeleteIntentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of an Intent. */ + interface IIntent { + + /** Intent name */ + name?: (string|null); + + /** Intent displayName */ + displayName?: (string|null); + + /** Intent webhookState */ + webhookState?: (google.cloud.dialogflow.v2beta1.Intent.WebhookState|keyof typeof google.cloud.dialogflow.v2beta1.Intent.WebhookState|null); + + /** Intent priority */ + priority?: (number|null); + + /** Intent isFallback */ + isFallback?: (boolean|null); + + /** Intent mlEnabled */ + mlEnabled?: (boolean|null); + + /** Intent mlDisabled */ + mlDisabled?: (boolean|null); + + /** Intent liveAgentHandoff */ + liveAgentHandoff?: (boolean|null); + + /** Intent endInteraction */ + endInteraction?: (boolean|null); + + /** Intent inputContextNames */ + inputContextNames?: (string[]|null); + + /** Intent events */ + events?: (string[]|null); + + /** Intent trainingPhrases */ + trainingPhrases?: (google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase[]|null); + + /** Intent action */ + action?: (string|null); + + /** Intent outputContexts */ + outputContexts?: (google.cloud.dialogflow.v2beta1.IContext[]|null); + + /** Intent resetContexts */ + resetContexts?: (boolean|null); + + /** Intent parameters */ + parameters?: (google.cloud.dialogflow.v2beta1.Intent.IParameter[]|null); + + /** Intent messages */ + messages?: (google.cloud.dialogflow.v2beta1.Intent.IMessage[]|null); + + /** Intent defaultResponsePlatforms */ + defaultResponsePlatforms?: (google.cloud.dialogflow.v2beta1.Intent.Message.Platform[]|null); + + /** Intent rootFollowupIntentName */ + rootFollowupIntentName?: (string|null); + + /** Intent parentFollowupIntentName */ + parentFollowupIntentName?: (string|null); + + /** Intent followupIntentInfo */ + followupIntentInfo?: (google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo[]|null); + } + + /** Represents an Intent. */ + class Intent implements IIntent { + + /** + * Constructs a new Intent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IIntent); + + /** Intent name. */ + public name: string; + + /** Intent displayName. */ + public displayName: string; + + /** Intent webhookState. */ + public webhookState: (google.cloud.dialogflow.v2beta1.Intent.WebhookState|keyof typeof google.cloud.dialogflow.v2beta1.Intent.WebhookState); + + /** Intent priority. */ + public priority: number; + + /** Intent isFallback. */ + public isFallback: boolean; + + /** Intent mlEnabled. */ + public mlEnabled: boolean; + + /** Intent mlDisabled. */ + public mlDisabled: boolean; + + /** Intent liveAgentHandoff. */ + public liveAgentHandoff: boolean; + + /** Intent endInteraction. */ + public endInteraction: boolean; + + /** Intent inputContextNames. */ + public inputContextNames: string[]; + + /** Intent events. */ + public events: string[]; + + /** Intent trainingPhrases. */ + public trainingPhrases: google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase[]; + + /** Intent action. */ + public action: string; + + /** Intent outputContexts. */ + public outputContexts: google.cloud.dialogflow.v2beta1.IContext[]; + + /** Intent resetContexts. */ + public resetContexts: boolean; + + /** Intent parameters. */ + public parameters: google.cloud.dialogflow.v2beta1.Intent.IParameter[]; + + /** Intent messages. */ + public messages: google.cloud.dialogflow.v2beta1.Intent.IMessage[]; + + /** Intent defaultResponsePlatforms. */ + public defaultResponsePlatforms: google.cloud.dialogflow.v2beta1.Intent.Message.Platform[]; + + /** Intent rootFollowupIntentName. */ + public rootFollowupIntentName: string; + + /** Intent parentFollowupIntentName. */ + public parentFollowupIntentName: string; + + /** Intent followupIntentInfo. */ + public followupIntentInfo: google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo[]; + + /** + * Creates a new Intent instance using the specified properties. + * @param [properties] Properties to set + * @returns Intent instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IIntent): google.cloud.dialogflow.v2beta1.Intent; + + /** + * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.verify|verify} messages. + * @param message Intent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.verify|verify} messages. + * @param message Intent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Intent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent; + + /** + * Decodes an Intent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent; + + /** + * Verifies an Intent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Intent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Intent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent; + + /** + * Creates a plain object from an Intent message. Also converts values to other types if specified. + * @param message Intent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Intent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Intent { + + /** Properties of a TrainingPhrase. */ + interface ITrainingPhrase { + + /** TrainingPhrase name */ + name?: (string|null); + + /** TrainingPhrase type */ + type?: (google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type|keyof typeof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type|null); + + /** TrainingPhrase parts */ + parts?: (google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart[]|null); + + /** TrainingPhrase timesAddedCount */ + timesAddedCount?: (number|null); + } + + /** Represents a TrainingPhrase. */ + class TrainingPhrase implements ITrainingPhrase { + + /** + * Constructs a new TrainingPhrase. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase); + + /** TrainingPhrase name. */ + public name: string; + + /** TrainingPhrase type. */ + public type: (google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type|keyof typeof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type); + + /** TrainingPhrase parts. */ + public parts: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart[]; + + /** TrainingPhrase timesAddedCount. */ + public timesAddedCount: number; + + /** + * Creates a new TrainingPhrase instance using the specified properties. + * @param [properties] Properties to set + * @returns TrainingPhrase instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase; + + /** + * Encodes the specified TrainingPhrase message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.verify|verify} messages. + * @param message TrainingPhrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TrainingPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.verify|verify} messages. + * @param message TrainingPhrase message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TrainingPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TrainingPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase; + + /** + * Verifies a TrainingPhrase message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TrainingPhrase message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TrainingPhrase + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase; + + /** + * Creates a plain object from a TrainingPhrase message. Also converts values to other types if specified. + * @param message TrainingPhrase + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TrainingPhrase to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace TrainingPhrase { + + /** Properties of a Part. */ + interface IPart { + + /** Part text */ + text?: (string|null); + + /** Part entityType */ + entityType?: (string|null); + + /** Part alias */ + alias?: (string|null); + + /** Part userDefined */ + userDefined?: (boolean|null); + } + + /** Represents a Part. */ + class Part implements IPart { + + /** + * Constructs a new Part. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart); + + /** Part text. */ + public text: string; + + /** Part entityType. */ + public entityType: string; + + /** Part alias. */ + public alias: string; + + /** Part userDefined. */ + public userDefined: boolean; + + /** + * Creates a new Part instance using the specified properties. + * @param [properties] Properties to set + * @returns Part instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part; + + /** + * Encodes the specified Part message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.verify|verify} messages. + * @param message Part message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.verify|verify} messages. + * @param message Part message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Part message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part; + + /** + * Verifies a Part message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Part + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @param message Part + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Part to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + EXAMPLE = 1, + TEMPLATE = 2 + } + } + + /** Properties of a Parameter. */ + interface IParameter { + + /** Parameter name */ + name?: (string|null); + + /** Parameter displayName */ + displayName?: (string|null); + + /** Parameter value */ + value?: (string|null); + + /** Parameter defaultValue */ + defaultValue?: (string|null); + + /** Parameter entityTypeDisplayName */ + entityTypeDisplayName?: (string|null); + + /** Parameter mandatory */ + mandatory?: (boolean|null); + + /** Parameter prompts */ + prompts?: (string[]|null); + + /** Parameter isList */ + isList?: (boolean|null); + } + + /** Represents a Parameter. */ + class Parameter implements IParameter { + + /** + * Constructs a new Parameter. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.IParameter); + + /** Parameter name. */ + public name: string; + + /** Parameter displayName. */ + public displayName: string; + + /** Parameter value. */ + public value: string; + + /** Parameter defaultValue. */ + public defaultValue: string; + + /** Parameter entityTypeDisplayName. */ + public entityTypeDisplayName: string; + + /** Parameter mandatory. */ + public mandatory: boolean; + + /** Parameter prompts. */ + public prompts: string[]; + + /** Parameter isList. */ + public isList: boolean; + + /** + * Creates a new Parameter instance using the specified properties. + * @param [properties] Properties to set + * @returns Parameter instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.IParameter): google.cloud.dialogflow.v2beta1.Intent.Parameter; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Parameter.verify|verify} messages. + * @param message Parameter message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Parameter; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Parameter; + + /** + * Verifies a Parameter message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Parameter + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Parameter; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @param message Parameter + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Parameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Parameter to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Message. */ + interface IMessage { + + /** Message text */ + text?: (google.cloud.dialogflow.v2beta1.Intent.Message.IText|null); + + /** Message image */ + image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + + /** Message quickReplies */ + quickReplies?: (google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies|null); + + /** Message card */ + card?: (google.cloud.dialogflow.v2beta1.Intent.Message.ICard|null); + + /** Message payload */ + payload?: (google.protobuf.IStruct|null); + + /** Message simpleResponses */ + simpleResponses?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses|null); + + /** Message basicCard */ + basicCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard|null); + + /** Message suggestions */ + suggestions?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions|null); + + /** Message linkOutSuggestion */ + linkOutSuggestion?: (google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion|null); + + /** Message listSelect */ + listSelect?: (google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect|null); + + /** Message carouselSelect */ + carouselSelect?: (google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect|null); + + /** Message telephonyPlayAudio */ + telephonyPlayAudio?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio|null); + + /** Message telephonySynthesizeSpeech */ + telephonySynthesizeSpeech?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech|null); + + /** Message telephonyTransferCall */ + telephonyTransferCall?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall|null); + + /** Message rbmText */ + rbmText?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText|null); + + /** Message rbmStandaloneRichCard */ + rbmStandaloneRichCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard|null); + + /** Message rbmCarouselRichCard */ + rbmCarouselRichCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard|null); + + /** Message browseCarouselCard */ + browseCarouselCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard|null); + + /** Message tableCard */ + tableCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard|null); + + /** Message mediaContent */ + mediaContent?: (google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent|null); + + /** Message platform */ + platform?: (google.cloud.dialogflow.v2beta1.Intent.Message.Platform|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.Platform|null); + } + + /** Represents a Message. */ + class Message implements IMessage { + + /** + * Constructs a new Message. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.IMessage); + + /** Message text. */ + public text?: (google.cloud.dialogflow.v2beta1.Intent.Message.IText|null); + + /** Message image. */ + public image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + + /** Message quickReplies. */ + public quickReplies?: (google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies|null); + + /** Message card. */ + public card?: (google.cloud.dialogflow.v2beta1.Intent.Message.ICard|null); + + /** Message payload. */ + public payload?: (google.protobuf.IStruct|null); + + /** Message simpleResponses. */ + public simpleResponses?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses|null); + + /** Message basicCard. */ + public basicCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard|null); + + /** Message suggestions. */ + public suggestions?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions|null); + + /** Message linkOutSuggestion. */ + public linkOutSuggestion?: (google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion|null); + + /** Message listSelect. */ + public listSelect?: (google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect|null); + + /** Message carouselSelect. */ + public carouselSelect?: (google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect|null); + + /** Message telephonyPlayAudio. */ + public telephonyPlayAudio?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio|null); + + /** Message telephonySynthesizeSpeech. */ + public telephonySynthesizeSpeech?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech|null); + + /** Message telephonyTransferCall. */ + public telephonyTransferCall?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall|null); + + /** Message rbmText. */ + public rbmText?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText|null); + + /** Message rbmStandaloneRichCard. */ + public rbmStandaloneRichCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard|null); + + /** Message rbmCarouselRichCard. */ + public rbmCarouselRichCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard|null); + + /** Message browseCarouselCard. */ + public browseCarouselCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard|null); + + /** Message tableCard. */ + public tableCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard|null); + + /** Message mediaContent. */ + public mediaContent?: (google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent|null); + + /** Message platform. */ + public platform: (google.cloud.dialogflow.v2beta1.Intent.Message.Platform|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.Platform); + + /** Message message. */ + public message?: ("text"|"image"|"quickReplies"|"card"|"payload"|"simpleResponses"|"basicCard"|"suggestions"|"linkOutSuggestion"|"listSelect"|"carouselSelect"|"telephonyPlayAudio"|"telephonySynthesizeSpeech"|"telephonyTransferCall"|"rbmText"|"rbmStandaloneRichCard"|"rbmCarouselRichCard"|"browseCarouselCard"|"tableCard"|"mediaContent"); + + /** + * Creates a new Message instance using the specified properties. + * @param [properties] Properties to set + * @returns Message instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.IMessage): google.cloud.dialogflow.v2beta1.Intent.Message; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.verify|verify} messages. + * @param message Message message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Message message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message; + + /** + * Verifies a Message message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Message + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @param message Message + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Message to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Message { + + /** Properties of a Text. */ + interface IText { + + /** Text text */ + text?: (string[]|null); + } + + /** Represents a Text. */ + class Text implements IText { + + /** + * Constructs a new Text. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IText); + + /** Text text. */ + public text: string[]; + + /** + * Creates a new Text instance using the specified properties. + * @param [properties] Properties to set + * @returns Text instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IText): google.cloud.dialogflow.v2beta1.Intent.Message.Text; + + /** + * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Text.verify|verify} messages. + * @param message Text message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Text.verify|verify} messages. + * @param message Text message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IText, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Text message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.Text; + + /** + * Decodes a Text message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.Text; + + /** + * Verifies a Text message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Text message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Text + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.Text; + + /** + * Creates a plain object from a Text message. Also converts values to other types if specified. + * @param message Text + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.Text, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Text to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Image. */ + interface IImage { + + /** Image imageUri */ + imageUri?: (string|null); + + /** Image accessibilityText */ + accessibilityText?: (string|null); + } + + /** Represents an Image. */ + class Image implements IImage { + + /** + * Constructs a new Image. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IImage); + + /** Image imageUri. */ + public imageUri: string; + + /** Image accessibilityText. */ + public accessibilityText: string; + + /** + * Creates a new Image instance using the specified properties. + * @param [properties] Properties to set + * @returns Image instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IImage): google.cloud.dialogflow.v2beta1.Intent.Message.Image; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify|verify} messages. + * @param message Image message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Image message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.Image; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.Image; + + /** + * Verifies an Image message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Image + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.Image; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @param message Image + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Image to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QuickReplies. */ + interface IQuickReplies { + + /** QuickReplies title */ + title?: (string|null); + + /** QuickReplies quickReplies */ + quickReplies?: (string[]|null); + } + + /** Represents a QuickReplies. */ + class QuickReplies implements IQuickReplies { + + /** + * Constructs a new QuickReplies. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies); + + /** QuickReplies title. */ + public title: string; + + /** QuickReplies quickReplies. */ + public quickReplies: string[]; + + /** + * Creates a new QuickReplies instance using the specified properties. + * @param [properties] Properties to set + * @returns QuickReplies instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies): google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies; + + /** + * Encodes the specified QuickReplies message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.verify|verify} messages. + * @param message QuickReplies message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuickReplies message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.verify|verify} messages. + * @param message QuickReplies message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuickReplies message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuickReplies + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies; + + /** + * Decodes a QuickReplies message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuickReplies + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies; + + /** + * Verifies a QuickReplies message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuickReplies message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuickReplies + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies; + + /** + * Creates a plain object from a QuickReplies message. Also converts values to other types if specified. + * @param message QuickReplies + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuickReplies to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Card. */ + interface ICard { + + /** Card title */ + title?: (string|null); + + /** Card subtitle */ + subtitle?: (string|null); + + /** Card imageUri */ + imageUri?: (string|null); + + /** Card buttons */ + buttons?: (google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton[]|null); + } + + /** Represents a Card. */ + class Card implements ICard { + + /** + * Constructs a new Card. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ICard); + + /** Card title. */ + public title: string; + + /** Card subtitle. */ + public subtitle: string; + + /** Card imageUri. */ + public imageUri: string; + + /** Card buttons. */ + public buttons: google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton[]; + + /** + * Creates a new Card instance using the specified properties. + * @param [properties] Properties to set + * @returns Card instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ICard): google.cloud.dialogflow.v2beta1.Intent.Message.Card; + + /** + * Encodes the specified Card message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.verify|verify} messages. + * @param message Card message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ICard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Card message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.verify|verify} messages. + * @param message Card message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ICard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Card message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.Card; + + /** + * Decodes a Card message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.Card; + + /** + * Verifies a Card message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Card message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Card + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.Card; + + /** + * Creates a plain object from a Card message. Also converts values to other types if specified. + * @param message Card + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.Card, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Card to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Card { + + /** Properties of a Button. */ + interface IButton { + + /** Button text */ + text?: (string|null); + + /** Button postback */ + postback?: (string|null); + } + + /** Represents a Button. */ + class Button implements IButton { + + /** + * Constructs a new Button. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton); + + /** Button text. */ + public text: string; + + /** Button postback. */ + public postback: string; + + /** + * Creates a new Button instance using the specified properties. + * @param [properties] Properties to set + * @returns Button instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton): google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button; + + /** + * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.verify|verify} messages. + * @param message Button message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.verify|verify} messages. + * @param message Button message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Button message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button; + + /** + * Decodes a Button message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button; + + /** + * Verifies a Button message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Button message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Button + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button; + + /** + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @param message Button + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Button to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SimpleResponse. */ + interface ISimpleResponse { + + /** SimpleResponse textToSpeech */ + textToSpeech?: (string|null); + + /** SimpleResponse ssml */ + ssml?: (string|null); + + /** SimpleResponse displayText */ + displayText?: (string|null); + } + + /** Represents a SimpleResponse. */ + class SimpleResponse implements ISimpleResponse { + + /** + * Constructs a new SimpleResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse); + + /** SimpleResponse textToSpeech. */ + public textToSpeech: string; + + /** SimpleResponse ssml. */ + public ssml: string; + + /** SimpleResponse displayText. */ + public displayText: string; + + /** + * Creates a new SimpleResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns SimpleResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse; + + /** + * Encodes the specified SimpleResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.verify|verify} messages. + * @param message SimpleResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SimpleResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.verify|verify} messages. + * @param message SimpleResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SimpleResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SimpleResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse; + + /** + * Decodes a SimpleResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SimpleResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse; + + /** + * Verifies a SimpleResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SimpleResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SimpleResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse; + + /** + * Creates a plain object from a SimpleResponse message. Also converts values to other types if specified. + * @param message SimpleResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SimpleResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SimpleResponses. */ + interface ISimpleResponses { + + /** SimpleResponses simpleResponses */ + simpleResponses?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse[]|null); + } + + /** Represents a SimpleResponses. */ + class SimpleResponses implements ISimpleResponses { + + /** + * Constructs a new SimpleResponses. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses); + + /** SimpleResponses simpleResponses. */ + public simpleResponses: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse[]; + + /** + * Creates a new SimpleResponses instance using the specified properties. + * @param [properties] Properties to set + * @returns SimpleResponses instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses; + + /** + * Encodes the specified SimpleResponses message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.verify|verify} messages. + * @param message SimpleResponses message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SimpleResponses message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.verify|verify} messages. + * @param message SimpleResponses message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SimpleResponses message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SimpleResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses; + + /** + * Decodes a SimpleResponses message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SimpleResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses; + + /** + * Verifies a SimpleResponses message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SimpleResponses message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SimpleResponses + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses; + + /** + * Creates a plain object from a SimpleResponses message. Also converts values to other types if specified. + * @param message SimpleResponses + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SimpleResponses to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a BasicCard. */ + interface IBasicCard { + + /** BasicCard title */ + title?: (string|null); + + /** BasicCard subtitle */ + subtitle?: (string|null); + + /** BasicCard formattedText */ + formattedText?: (string|null); + + /** BasicCard image */ + image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + + /** BasicCard buttons */ + buttons?: (google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton[]|null); + } + + /** Represents a BasicCard. */ + class BasicCard implements IBasicCard { + + /** + * Constructs a new BasicCard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard); + + /** BasicCard title. */ + public title: string; + + /** BasicCard subtitle. */ + public subtitle: string; + + /** BasicCard formattedText. */ + public formattedText: string; + + /** BasicCard image. */ + public image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + + /** BasicCard buttons. */ + public buttons: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton[]; + + /** + * Creates a new BasicCard instance using the specified properties. + * @param [properties] Properties to set + * @returns BasicCard instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard; + + /** + * Encodes the specified BasicCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.verify|verify} messages. + * @param message BasicCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BasicCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.verify|verify} messages. + * @param message BasicCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BasicCard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BasicCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard; + + /** + * Decodes a BasicCard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BasicCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard; + + /** + * Verifies a BasicCard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BasicCard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BasicCard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard; + + /** + * Creates a plain object from a BasicCard message. Also converts values to other types if specified. + * @param message BasicCard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BasicCard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace BasicCard { + + /** Properties of a Button. */ + interface IButton { + + /** Button title */ + title?: (string|null); + + /** Button openUriAction */ + openUriAction?: (google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction|null); + } + + /** Represents a Button. */ + class Button implements IButton { + + /** + * Constructs a new Button. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton); + + /** Button title. */ + public title: string; + + /** Button openUriAction. */ + public openUriAction?: (google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction|null); + + /** + * Creates a new Button instance using the specified properties. + * @param [properties] Properties to set + * @returns Button instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button; + + /** + * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.verify|verify} messages. + * @param message Button message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.verify|verify} messages. + * @param message Button message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Button message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button; + + /** + * Decodes a Button message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button; + + /** + * Verifies a Button message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Button message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Button + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button; + + /** + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @param message Button + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Button to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace Button { + + /** Properties of an OpenUriAction. */ + interface IOpenUriAction { + + /** OpenUriAction uri */ + uri?: (string|null); + } + + /** Represents an OpenUriAction. */ + class OpenUriAction implements IOpenUriAction { + + /** + * Constructs a new OpenUriAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction); + + /** OpenUriAction uri. */ + public uri: string; + + /** + * Creates a new OpenUriAction instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenUriAction instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction; + + /** + * Encodes the specified OpenUriAction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. + * @param message OpenUriAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OpenUriAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. + * @param message OpenUriAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OpenUriAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenUriAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction; + + /** + * Decodes an OpenUriAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenUriAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction; + + /** + * Verifies an OpenUriAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OpenUriAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenUriAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction; + + /** + * Creates a plain object from an OpenUriAction message. Also converts values to other types if specified. + * @param message OpenUriAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OpenUriAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } + + /** Properties of a Suggestion. */ + interface ISuggestion { + + /** Suggestion title */ + title?: (string|null); + } + + /** Represents a Suggestion. */ + class Suggestion implements ISuggestion { + + /** + * Constructs a new Suggestion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion); + + /** Suggestion title. */ + public title: string; + + /** + * Creates a new Suggestion instance using the specified properties. + * @param [properties] Properties to set + * @returns Suggestion instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion; + + /** + * Encodes the specified Suggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.verify|verify} messages. + * @param message Suggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Suggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.verify|verify} messages. + * @param message Suggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Suggestion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion; + + /** + * Decodes a Suggestion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion; + + /** + * Verifies a Suggestion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Suggestion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Suggestion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion; + + /** + * Creates a plain object from a Suggestion message. Also converts values to other types if specified. + * @param message Suggestion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Suggestion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Suggestions. */ + interface ISuggestions { + + /** Suggestions suggestions */ + suggestions?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion[]|null); + } + + /** Represents a Suggestions. */ + class Suggestions implements ISuggestions { + + /** + * Constructs a new Suggestions. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions); + + /** Suggestions suggestions. */ + public suggestions: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion[]; + + /** + * Creates a new Suggestions instance using the specified properties. + * @param [properties] Properties to set + * @returns Suggestions instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions; + + /** + * Encodes the specified Suggestions message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.verify|verify} messages. + * @param message Suggestions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Suggestions message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.verify|verify} messages. + * @param message Suggestions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Suggestions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Suggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions; + + /** + * Decodes a Suggestions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Suggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions; + + /** + * Verifies a Suggestions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Suggestions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Suggestions + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions; + + /** + * Creates a plain object from a Suggestions message. Also converts values to other types if specified. + * @param message Suggestions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Suggestions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a LinkOutSuggestion. */ + interface ILinkOutSuggestion { + + /** LinkOutSuggestion destinationName */ + destinationName?: (string|null); + + /** LinkOutSuggestion uri */ + uri?: (string|null); + } + + /** Represents a LinkOutSuggestion. */ + class LinkOutSuggestion implements ILinkOutSuggestion { + + /** + * Constructs a new LinkOutSuggestion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion); + + /** LinkOutSuggestion destinationName. */ + public destinationName: string; + + /** LinkOutSuggestion uri. */ + public uri: string; + + /** + * Creates a new LinkOutSuggestion instance using the specified properties. + * @param [properties] Properties to set + * @returns LinkOutSuggestion instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion): google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion; + + /** + * Encodes the specified LinkOutSuggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.verify|verify} messages. + * @param message LinkOutSuggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LinkOutSuggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.verify|verify} messages. + * @param message LinkOutSuggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LinkOutSuggestion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LinkOutSuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion; + + /** + * Decodes a LinkOutSuggestion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LinkOutSuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion; + + /** + * Verifies a LinkOutSuggestion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LinkOutSuggestion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LinkOutSuggestion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion; + + /** + * Creates a plain object from a LinkOutSuggestion message. Also converts values to other types if specified. + * @param message LinkOutSuggestion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LinkOutSuggestion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ListSelect. */ + interface IListSelect { + + /** ListSelect title */ + title?: (string|null); + + /** ListSelect items */ + items?: (google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem[]|null); + + /** ListSelect subtitle */ + subtitle?: (string|null); + } + + /** Represents a ListSelect. */ + class ListSelect implements IListSelect { + + /** + * Constructs a new ListSelect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect); + + /** ListSelect title. */ + public title: string; + + /** ListSelect items. */ + public items: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem[]; + + /** ListSelect subtitle. */ + public subtitle: string; + + /** + * Creates a new ListSelect instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSelect instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect; + + /** + * Encodes the specified ListSelect message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.verify|verify} messages. + * @param message ListSelect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.verify|verify} messages. + * @param message ListSelect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListSelect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect; + + /** + * Decodes a ListSelect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect; + + /** + * Verifies a ListSelect message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListSelect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSelect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect; + + /** + * Creates a plain object from a ListSelect message. Also converts values to other types if specified. + * @param message ListSelect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListSelect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace ListSelect { + + /** Properties of an Item. */ + interface IItem { + + /** Item info */ + info?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null); + + /** Item title */ + title?: (string|null); + + /** Item description */ + description?: (string|null); + + /** Item image */ + image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + } + + /** Represents an Item. */ + class Item implements IItem { + + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem); + + /** Item info. */ + public info?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null); + + /** Item title. */ + public title: string; + + /** Item description. */ + public description: string; + + /** Item image. */ + public image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item; + + /** + * Verifies an Item message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a CarouselSelect. */ + interface ICarouselSelect { + + /** CarouselSelect items */ + items?: (google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem[]|null); + } + + /** Represents a CarouselSelect. */ + class CarouselSelect implements ICarouselSelect { + + /** + * Constructs a new CarouselSelect. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect); + + /** CarouselSelect items. */ + public items: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem[]; + + /** + * Creates a new CarouselSelect instance using the specified properties. + * @param [properties] Properties to set + * @returns CarouselSelect instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect; + + /** + * Encodes the specified CarouselSelect message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.verify|verify} messages. + * @param message CarouselSelect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CarouselSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.verify|verify} messages. + * @param message CarouselSelect message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CarouselSelect message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CarouselSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect; + + /** + * Decodes a CarouselSelect message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CarouselSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect; + + /** + * Verifies a CarouselSelect message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CarouselSelect message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CarouselSelect + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect; + + /** + * Creates a plain object from a CarouselSelect message. Also converts values to other types if specified. + * @param message CarouselSelect + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CarouselSelect to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace CarouselSelect { + + /** Properties of an Item. */ + interface IItem { + + /** Item info */ + info?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null); + + /** Item title */ + title?: (string|null); + + /** Item description */ + description?: (string|null); + + /** Item image */ + image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + } + + /** Represents an Item. */ + class Item implements IItem { + + /** + * Constructs a new Item. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem); + + /** Item info. */ + public info?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null); + + /** Item title. */ + public title: string; + + /** Item description. */ + public description: string; + + /** Item image. */ + public image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + + /** + * Creates a new Item instance using the specified properties. + * @param [properties] Properties to set + * @returns Item instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.verify|verify} messages. + * @param message Item message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Item message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item; + + /** + * Verifies an Item message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Item + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @param message Item + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Item to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SelectItemInfo. */ + interface ISelectItemInfo { + + /** SelectItemInfo key */ + key?: (string|null); + + /** SelectItemInfo synonyms */ + synonyms?: (string[]|null); + } + + /** Represents a SelectItemInfo. */ + class SelectItemInfo implements ISelectItemInfo { + + /** + * Constructs a new SelectItemInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo); + + /** SelectItemInfo key. */ + public key: string; + + /** SelectItemInfo synonyms. */ + public synonyms: string[]; + + /** + * Creates a new SelectItemInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SelectItemInfo instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo): google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo; + + /** + * Encodes the specified SelectItemInfo message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.verify|verify} messages. + * @param message SelectItemInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SelectItemInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.verify|verify} messages. + * @param message SelectItemInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SelectItemInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SelectItemInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo; + + /** + * Decodes a SelectItemInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SelectItemInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo; + + /** + * Verifies a SelectItemInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SelectItemInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SelectItemInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo; + + /** + * Creates a plain object from a SelectItemInfo message. Also converts values to other types if specified. + * @param message SelectItemInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SelectItemInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TelephonyPlayAudio. */ + interface ITelephonyPlayAudio { + + /** TelephonyPlayAudio audioUri */ + audioUri?: (string|null); + } + + /** Represents a TelephonyPlayAudio. */ + class TelephonyPlayAudio implements ITelephonyPlayAudio { + + /** + * Constructs a new TelephonyPlayAudio. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio); + + /** TelephonyPlayAudio audioUri. */ + public audioUri: string; + + /** + * Creates a new TelephonyPlayAudio instance using the specified properties. + * @param [properties] Properties to set + * @returns TelephonyPlayAudio instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio; + + /** + * Encodes the specified TelephonyPlayAudio message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.verify|verify} messages. + * @param message TelephonyPlayAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TelephonyPlayAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.verify|verify} messages. + * @param message TelephonyPlayAudio message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TelephonyPlayAudio message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TelephonyPlayAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio; + + /** + * Decodes a TelephonyPlayAudio message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TelephonyPlayAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio; + + /** + * Verifies a TelephonyPlayAudio message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TelephonyPlayAudio message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TelephonyPlayAudio + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio; + + /** + * Creates a plain object from a TelephonyPlayAudio message. Also converts values to other types if specified. + * @param message TelephonyPlayAudio + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TelephonyPlayAudio to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TelephonySynthesizeSpeech. */ + interface ITelephonySynthesizeSpeech { + + /** TelephonySynthesizeSpeech text */ + text?: (string|null); + + /** TelephonySynthesizeSpeech ssml */ + ssml?: (string|null); + } + + /** Represents a TelephonySynthesizeSpeech. */ + class TelephonySynthesizeSpeech implements ITelephonySynthesizeSpeech { + + /** + * Constructs a new TelephonySynthesizeSpeech. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech); + + /** TelephonySynthesizeSpeech text. */ + public text: string; + + /** TelephonySynthesizeSpeech ssml. */ + public ssml: string; + + /** TelephonySynthesizeSpeech source. */ + public source?: ("text"|"ssml"); + + /** + * Creates a new TelephonySynthesizeSpeech instance using the specified properties. + * @param [properties] Properties to set + * @returns TelephonySynthesizeSpeech instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech; + + /** + * Encodes the specified TelephonySynthesizeSpeech message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.verify|verify} messages. + * @param message TelephonySynthesizeSpeech message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TelephonySynthesizeSpeech message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.verify|verify} messages. + * @param message TelephonySynthesizeSpeech message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TelephonySynthesizeSpeech message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TelephonySynthesizeSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech; + + /** + * Decodes a TelephonySynthesizeSpeech message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TelephonySynthesizeSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech; + + /** + * Verifies a TelephonySynthesizeSpeech message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TelephonySynthesizeSpeech message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TelephonySynthesizeSpeech + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech; + + /** + * Creates a plain object from a TelephonySynthesizeSpeech message. Also converts values to other types if specified. + * @param message TelephonySynthesizeSpeech + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TelephonySynthesizeSpeech to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a TelephonyTransferCall. */ + interface ITelephonyTransferCall { + + /** TelephonyTransferCall phoneNumber */ + phoneNumber?: (string|null); + } + + /** Represents a TelephonyTransferCall. */ + class TelephonyTransferCall implements ITelephonyTransferCall { + + /** + * Constructs a new TelephonyTransferCall. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall); + + /** TelephonyTransferCall phoneNumber. */ + public phoneNumber: string; + + /** + * Creates a new TelephonyTransferCall instance using the specified properties. + * @param [properties] Properties to set + * @returns TelephonyTransferCall instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall; + + /** + * Encodes the specified TelephonyTransferCall message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.verify|verify} messages. + * @param message TelephonyTransferCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TelephonyTransferCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.verify|verify} messages. + * @param message TelephonyTransferCall message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TelephonyTransferCall message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TelephonyTransferCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall; + + /** + * Decodes a TelephonyTransferCall message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TelephonyTransferCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall; + + /** + * Verifies a TelephonyTransferCall message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TelephonyTransferCall message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TelephonyTransferCall + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall; + + /** + * Creates a plain object from a TelephonyTransferCall message. Also converts values to other types if specified. + * @param message TelephonyTransferCall + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TelephonyTransferCall to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a RbmText. */ + interface IRbmText { + + /** RbmText text */ + text?: (string|null); + + /** RbmText rbmSuggestion */ + rbmSuggestion?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion[]|null); + } + + /** Represents a RbmText. */ + class RbmText implements IRbmText { + + /** + * Constructs a new RbmText. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText); + + /** RbmText text. */ + public text: string; + + /** RbmText rbmSuggestion. */ + public rbmSuggestion: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion[]; + + /** + * Creates a new RbmText instance using the specified properties. + * @param [properties] Properties to set + * @returns RbmText instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText): google.cloud.dialogflow.v2beta1.Intent.Message.RbmText; - /** - * Calls DeleteDocument. - * @param request DeleteDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteDocument(request: google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest, callback: google.cloud.dialogflow.v2beta1.Documents.DeleteDocumentCallback): void; + /** + * Encodes the specified RbmText message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.verify|verify} messages. + * @param message RbmText message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls DeleteDocument. - * @param request DeleteDocumentRequest message or plain object - * @returns Promise - */ - public deleteDocument(request: google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest): Promise; + /** + * Encodes the specified RbmText message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.verify|verify} messages. + * @param message RbmText message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls UpdateDocument. - * @param request UpdateDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateDocument(request: google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest, callback: google.cloud.dialogflow.v2beta1.Documents.UpdateDocumentCallback): void; + /** + * Decodes a RbmText message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RbmText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmText; - /** - * Calls UpdateDocument. - * @param request UpdateDocumentRequest message or plain object - * @returns Promise - */ - public updateDocument(request: google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest): Promise; + /** + * Decodes a RbmText message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RbmText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmText; - /** - * Calls ReloadDocument. - * @param request ReloadDocumentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public reloadDocument(request: google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, callback: google.cloud.dialogflow.v2beta1.Documents.ReloadDocumentCallback): void; + /** + * Verifies a RbmText message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Calls ReloadDocument. - * @param request ReloadDocumentRequest message or plain object - * @returns Promise - */ - public reloadDocument(request: google.cloud.dialogflow.v2beta1.IReloadDocumentRequest): Promise; - } + /** + * Creates a RbmText message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RbmText + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmText; - namespace Documents { + /** + * Creates a plain object from a RbmText message. Also converts values to other types if specified. + * @param message RbmText + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmText, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#listDocuments}. - * @param error Error, if any - * @param [response] ListDocumentsResponse - */ - type ListDocumentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListDocumentsResponse) => void; + /** + * Converts this RbmText to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#getDocument}. - * @param error Error, if any - * @param [response] Document - */ - type GetDocumentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Document) => void; + /** Properties of a RbmCarouselCard. */ + interface IRbmCarouselCard { - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#createDocument}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** RbmCarouselCard cardWidth */ + cardWidth?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth|null); - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#deleteDocument}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** RbmCarouselCard cardContents */ + cardContents?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent[]|null); + } - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#updateDocument}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** Represents a RbmCarouselCard. */ + class RbmCarouselCard implements IRbmCarouselCard { - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#reloadDocument}. - * @param error Error, if any - * @param [response] Operation - */ - type ReloadDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } + /** + * Constructs a new RbmCarouselCard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard); - /** Properties of a Document. */ - interface IDocument { + /** RbmCarouselCard cardWidth. */ + public cardWidth: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth); - /** Document name */ - name?: (string|null); + /** RbmCarouselCard cardContents. */ + public cardContents: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent[]; - /** Document displayName */ - displayName?: (string|null); + /** + * Creates a new RbmCarouselCard instance using the specified properties. + * @param [properties] Properties to set + * @returns RbmCarouselCard instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard; - /** Document mimeType */ - mimeType?: (string|null); + /** + * Encodes the specified RbmCarouselCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.verify|verify} messages. + * @param message RbmCarouselCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** Document knowledgeTypes */ - knowledgeTypes?: (google.cloud.dialogflow.v2beta1.Document.KnowledgeType[]|null); + /** + * Encodes the specified RbmCarouselCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.verify|verify} messages. + * @param message RbmCarouselCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** Document contentUri */ - contentUri?: (string|null); + /** + * Decodes a RbmCarouselCard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RbmCarouselCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard; - /** Document content */ - content?: (string|null); + /** + * Decodes a RbmCarouselCard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RbmCarouselCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard; - /** Document rawContent */ - rawContent?: (Uint8Array|string|null); + /** + * Verifies a RbmCarouselCard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Document enableAutoReload */ - enableAutoReload?: (boolean|null); + /** + * Creates a RbmCarouselCard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RbmCarouselCard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard; - /** Document latestReloadStatus */ - latestReloadStatus?: (google.cloud.dialogflow.v2beta1.Document.IReloadStatus|null); - } + /** + * Creates a plain object from a RbmCarouselCard message. Also converts values to other types if specified. + * @param message RbmCarouselCard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Represents a Document. */ - class Document implements IDocument { + /** + * Converts this RbmCarouselCard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Constructs a new Document. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IDocument); + namespace RbmCarouselCard { - /** Document name. */ - public name: string; + /** CardWidth enum. */ + enum CardWidth { + CARD_WIDTH_UNSPECIFIED = 0, + SMALL = 1, + MEDIUM = 2 + } + } - /** Document displayName. */ - public displayName: string; + /** Properties of a RbmStandaloneCard. */ + interface IRbmStandaloneCard { - /** Document mimeType. */ - public mimeType: string; + /** RbmStandaloneCard cardOrientation */ + cardOrientation?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation|null); - /** Document knowledgeTypes. */ - public knowledgeTypes: google.cloud.dialogflow.v2beta1.Document.KnowledgeType[]; + /** RbmStandaloneCard thumbnailImageAlignment */ + thumbnailImageAlignment?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment|null); - /** Document contentUri. */ - public contentUri: string; + /** RbmStandaloneCard cardContent */ + cardContent?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent|null); + } - /** Document content. */ - public content: string; + /** Represents a RbmStandaloneCard. */ + class RbmStandaloneCard implements IRbmStandaloneCard { - /** Document rawContent. */ - public rawContent: (Uint8Array|string); + /** + * Constructs a new RbmStandaloneCard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard); - /** Document enableAutoReload. */ - public enableAutoReload: boolean; + /** RbmStandaloneCard cardOrientation. */ + public cardOrientation: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation); - /** Document latestReloadStatus. */ - public latestReloadStatus?: (google.cloud.dialogflow.v2beta1.Document.IReloadStatus|null); + /** RbmStandaloneCard thumbnailImageAlignment. */ + public thumbnailImageAlignment: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment); - /** Document source. */ - public source?: ("contentUri"|"content"|"rawContent"); + /** RbmStandaloneCard cardContent. */ + public cardContent?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent|null); - /** - * Creates a new Document instance using the specified properties. - * @param [properties] Properties to set - * @returns Document instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IDocument): google.cloud.dialogflow.v2beta1.Document; + /** + * Creates a new RbmStandaloneCard instance using the specified properties. + * @param [properties] Properties to set + * @returns RbmStandaloneCard instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard): google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard; - /** - * Encodes the specified Document message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.verify|verify} messages. - * @param message Document message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified RbmStandaloneCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.verify|verify} messages. + * @param message RbmStandaloneCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.verify|verify} messages. - * @param message Document message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified RbmStandaloneCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.verify|verify} messages. + * @param message RbmStandaloneCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Document message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Document - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Document; + /** + * Decodes a RbmStandaloneCard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RbmStandaloneCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard; - /** - * Decodes a Document message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Document - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Document; + /** + * Decodes a RbmStandaloneCard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RbmStandaloneCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard; - /** - * Verifies a Document message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a RbmStandaloneCard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a Document message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Document - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Document; + /** + * Creates a RbmStandaloneCard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RbmStandaloneCard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard; - /** - * Creates a plain object from a Document message. Also converts values to other types if specified. - * @param message Document - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a RbmStandaloneCard message. Also converts values to other types if specified. + * @param message RbmStandaloneCard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this Document to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this RbmStandaloneCard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - namespace Document { + namespace RbmStandaloneCard { - /** Properties of a ReloadStatus. */ - interface IReloadStatus { + /** CardOrientation enum. */ + enum CardOrientation { + CARD_ORIENTATION_UNSPECIFIED = 0, + HORIZONTAL = 1, + VERTICAL = 2 + } - /** ReloadStatus time */ - time?: (google.protobuf.ITimestamp|null); + /** ThumbnailImageAlignment enum. */ + enum ThumbnailImageAlignment { + THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED = 0, + LEFT = 1, + RIGHT = 2 + } + } - /** ReloadStatus status */ - status?: (google.rpc.IStatus|null); - } + /** Properties of a RbmCardContent. */ + interface IRbmCardContent { - /** Represents a ReloadStatus. */ - class ReloadStatus implements IReloadStatus { + /** RbmCardContent title */ + title?: (string|null); - /** - * Constructs a new ReloadStatus. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Document.IReloadStatus); + /** RbmCardContent description */ + description?: (string|null); - /** ReloadStatus time. */ - public time?: (google.protobuf.ITimestamp|null); + /** RbmCardContent media */ + media?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia|null); - /** ReloadStatus status. */ - public status?: (google.rpc.IStatus|null); + /** RbmCardContent suggestions */ + suggestions?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion[]|null); + } - /** - * Creates a new ReloadStatus instance using the specified properties. - * @param [properties] Properties to set - * @returns ReloadStatus instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Document.IReloadStatus): google.cloud.dialogflow.v2beta1.Document.ReloadStatus; + /** Represents a RbmCardContent. */ + class RbmCardContent implements IRbmCardContent { - /** - * Encodes the specified ReloadStatus message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.ReloadStatus.verify|verify} messages. - * @param message ReloadStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Document.IReloadStatus, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new RbmCardContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent); - /** - * Encodes the specified ReloadStatus message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.ReloadStatus.verify|verify} messages. - * @param message ReloadStatus message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Document.IReloadStatus, writer?: $protobuf.Writer): $protobuf.Writer; + /** RbmCardContent title. */ + public title: string; - /** - * Decodes a ReloadStatus message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReloadStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Document.ReloadStatus; + /** RbmCardContent description. */ + public description: string; - /** - * Decodes a ReloadStatus message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReloadStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Document.ReloadStatus; + /** RbmCardContent media. */ + public media?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia|null); - /** - * Verifies a ReloadStatus message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** RbmCardContent suggestions. */ + public suggestions: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion[]; - /** - * Creates a ReloadStatus message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReloadStatus - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Document.ReloadStatus; + /** + * Creates a new RbmCardContent instance using the specified properties. + * @param [properties] Properties to set + * @returns RbmCardContent instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent; - /** - * Creates a plain object from a ReloadStatus message. Also converts values to other types if specified. - * @param message ReloadStatus - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Document.ReloadStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified RbmCardContent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.verify|verify} messages. + * @param message RbmCardContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ReloadStatus to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified RbmCardContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.verify|verify} messages. + * @param message RbmCardContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent, writer?: $protobuf.Writer): $protobuf.Writer; - /** KnowledgeType enum. */ - enum KnowledgeType { - KNOWLEDGE_TYPE_UNSPECIFIED = 0, - FAQ = 1, - EXTRACTIVE_QA = 2 - } - } + /** + * Decodes a RbmCardContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RbmCardContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent; - /** Properties of a GetDocumentRequest. */ - interface IGetDocumentRequest { + /** + * Decodes a RbmCardContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RbmCardContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent; - /** GetDocumentRequest name */ - name?: (string|null); - } + /** + * Verifies a RbmCardContent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a GetDocumentRequest. */ - class GetDocumentRequest implements IGetDocumentRequest { + /** + * Creates a RbmCardContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RbmCardContent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent; - /** - * Constructs a new GetDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IGetDocumentRequest); + /** + * Creates a plain object from a RbmCardContent message. Also converts values to other types if specified. + * @param message RbmCardContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** GetDocumentRequest name. */ - public name: string; + /** + * Converts this RbmCardContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new GetDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDocumentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IGetDocumentRequest): google.cloud.dialogflow.v2beta1.GetDocumentRequest; + namespace RbmCardContent { - /** - * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetDocumentRequest.verify|verify} messages. - * @param message GetDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a RbmMedia. */ + interface IRbmMedia { - /** - * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetDocumentRequest.verify|verify} messages. - * @param message GetDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** RbmMedia fileUri */ + fileUri?: (string|null); - /** - * Decodes a GetDocumentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetDocumentRequest; + /** RbmMedia thumbnailUri */ + thumbnailUri?: (string|null); - /** - * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetDocumentRequest; + /** RbmMedia height */ + height?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height|null); + } - /** - * Verifies a GetDocumentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a RbmMedia. */ + class RbmMedia implements IRbmMedia { - /** - * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetDocumentRequest; + /** + * Constructs a new RbmMedia. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia); - /** - * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. - * @param message GetDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.GetDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** RbmMedia fileUri. */ + public fileUri: string; - /** - * Converts this GetDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** RbmMedia thumbnailUri. */ + public thumbnailUri: string; - /** Properties of a ListDocumentsRequest. */ - interface IListDocumentsRequest { + /** RbmMedia height. */ + public height: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height); - /** ListDocumentsRequest parent */ - parent?: (string|null); + /** + * Creates a new RbmMedia instance using the specified properties. + * @param [properties] Properties to set + * @returns RbmMedia instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia; - /** ListDocumentsRequest pageSize */ - pageSize?: (number|null); + /** + * Encodes the specified RbmMedia message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.verify|verify} messages. + * @param message RbmMedia message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListDocumentsRequest pageToken */ - pageToken?: (string|null); + /** + * Encodes the specified RbmMedia message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.verify|verify} messages. + * @param message RbmMedia message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListDocumentsRequest filter */ - filter?: (string|null); - } + /** + * Decodes a RbmMedia message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RbmMedia + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia; - /** Represents a ListDocumentsRequest. */ - class ListDocumentsRequest implements IListDocumentsRequest { + /** + * Decodes a RbmMedia message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RbmMedia + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia; - /** - * Constructs a new ListDocumentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListDocumentsRequest); + /** + * Verifies a RbmMedia message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ListDocumentsRequest parent. */ - public parent: string; + /** + * Creates a RbmMedia message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RbmMedia + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia; - /** ListDocumentsRequest pageSize. */ - public pageSize: number; + /** + * Creates a plain object from a RbmMedia message. Also converts values to other types if specified. + * @param message RbmMedia + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ListDocumentsRequest pageToken. */ - public pageToken: string; + /** + * Converts this RbmMedia to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ListDocumentsRequest filter. */ - public filter: string; + namespace RbmMedia { - /** - * Creates a new ListDocumentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDocumentsRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListDocumentsRequest): google.cloud.dialogflow.v2beta1.ListDocumentsRequest; + /** Height enum. */ + enum Height { + HEIGHT_UNSPECIFIED = 0, + SHORT = 1, + MEDIUM = 2, + TALL = 3 + } + } + } - /** - * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsRequest.verify|verify} messages. - * @param message ListDocumentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a RbmSuggestion. */ + interface IRbmSuggestion { - /** - * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsRequest.verify|verify} messages. - * @param message ListDocumentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** RbmSuggestion reply */ + reply?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply|null); - /** - * Decodes a ListDocumentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListDocumentsRequest; + /** RbmSuggestion action */ + action?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction|null); + } - /** - * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDocumentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListDocumentsRequest; + /** Represents a RbmSuggestion. */ + class RbmSuggestion implements IRbmSuggestion { - /** - * Verifies a ListDocumentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Constructs a new RbmSuggestion. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion); - /** - * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDocumentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListDocumentsRequest; + /** RbmSuggestion reply. */ + public reply?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply|null); - /** - * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. - * @param message ListDocumentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** RbmSuggestion action. */ + public action?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction|null); - /** - * Converts this ListDocumentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** RbmSuggestion suggestion. */ + public suggestion?: ("reply"|"action"); - /** Properties of a ListDocumentsResponse. */ - interface IListDocumentsResponse { + /** + * Creates a new RbmSuggestion instance using the specified properties. + * @param [properties] Properties to set + * @returns RbmSuggestion instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion; - /** ListDocumentsResponse documents */ - documents?: (google.cloud.dialogflow.v2beta1.IDocument[]|null); + /** + * Encodes the specified RbmSuggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.verify|verify} messages. + * @param message RbmSuggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListDocumentsResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** + * Encodes the specified RbmSuggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.verify|verify} messages. + * @param message RbmSuggestion message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a ListDocumentsResponse. */ - class ListDocumentsResponse implements IListDocumentsResponse { + /** + * Decodes a RbmSuggestion message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RbmSuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion; - /** - * Constructs a new ListDocumentsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListDocumentsResponse); + /** + * Decodes a RbmSuggestion message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RbmSuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion; - /** ListDocumentsResponse documents. */ - public documents: google.cloud.dialogflow.v2beta1.IDocument[]; + /** + * Verifies a RbmSuggestion message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ListDocumentsResponse nextPageToken. */ - public nextPageToken: string; + /** + * Creates a RbmSuggestion message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RbmSuggestion + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion; - /** - * Creates a new ListDocumentsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDocumentsResponse instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListDocumentsResponse): google.cloud.dialogflow.v2beta1.ListDocumentsResponse; + /** + * Creates a plain object from a RbmSuggestion message. Also converts values to other types if specified. + * @param message RbmSuggestion + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsResponse.verify|verify} messages. - * @param message ListDocumentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this RbmSuggestion to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsResponse.verify|verify} messages. - * @param message ListDocumentsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a RbmSuggestedReply. */ + interface IRbmSuggestedReply { - /** - * Decodes a ListDocumentsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListDocumentsResponse; + /** RbmSuggestedReply text */ + text?: (string|null); - /** - * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDocumentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListDocumentsResponse; + /** RbmSuggestedReply postbackData */ + postbackData?: (string|null); + } - /** - * Verifies a ListDocumentsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a RbmSuggestedReply. */ + class RbmSuggestedReply implements IRbmSuggestedReply { + + /** + * Constructs a new RbmSuggestedReply. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply); - /** - * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDocumentsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListDocumentsResponse; + /** RbmSuggestedReply text. */ + public text: string; - /** - * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. - * @param message ListDocumentsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** RbmSuggestedReply postbackData. */ + public postbackData: string; - /** - * Converts this ListDocumentsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new RbmSuggestedReply instance using the specified properties. + * @param [properties] Properties to set + * @returns RbmSuggestedReply instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply; - /** Properties of a CreateDocumentRequest. */ - interface ICreateDocumentRequest { + /** + * Encodes the specified RbmSuggestedReply message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.verify|verify} messages. + * @param message RbmSuggestedReply message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply, writer?: $protobuf.Writer): $protobuf.Writer; - /** CreateDocumentRequest parent */ - parent?: (string|null); + /** + * Encodes the specified RbmSuggestedReply message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.verify|verify} messages. + * @param message RbmSuggestedReply message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply, writer?: $protobuf.Writer): $protobuf.Writer; - /** CreateDocumentRequest document */ - document?: (google.cloud.dialogflow.v2beta1.IDocument|null); + /** + * Decodes a RbmSuggestedReply message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RbmSuggestedReply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply; - /** CreateDocumentRequest importGcsCustomMetadata */ - importGcsCustomMetadata?: (boolean|null); - } + /** + * Decodes a RbmSuggestedReply message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RbmSuggestedReply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply; - /** Represents a CreateDocumentRequest. */ - class CreateDocumentRequest implements ICreateDocumentRequest { + /** + * Verifies a RbmSuggestedReply message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new CreateDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateDocumentRequest); + /** + * Creates a RbmSuggestedReply message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RbmSuggestedReply + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply; - /** CreateDocumentRequest parent. */ - public parent: string; + /** + * Creates a plain object from a RbmSuggestedReply message. Also converts values to other types if specified. + * @param message RbmSuggestedReply + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** CreateDocumentRequest document. */ - public document?: (google.cloud.dialogflow.v2beta1.IDocument|null); + /** + * Converts this RbmSuggestedReply to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** CreateDocumentRequest importGcsCustomMetadata. */ - public importGcsCustomMetadata: boolean; + /** Properties of a RbmSuggestedAction. */ + interface IRbmSuggestedAction { - /** - * Creates a new CreateDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateDocumentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateDocumentRequest): google.cloud.dialogflow.v2beta1.CreateDocumentRequest; + /** RbmSuggestedAction text */ + text?: (string|null); - /** - * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateDocumentRequest.verify|verify} messages. - * @param message CreateDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** RbmSuggestedAction postbackData */ + postbackData?: (string|null); - /** - * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateDocumentRequest.verify|verify} messages. - * @param message CreateDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** RbmSuggestedAction dial */ + dial?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial|null); - /** - * Decodes a CreateDocumentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateDocumentRequest; + /** RbmSuggestedAction openUrl */ + openUrl?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri|null); - /** - * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateDocumentRequest; + /** RbmSuggestedAction shareLocation */ + shareLocation?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation|null); + } - /** - * Verifies a CreateDocumentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a RbmSuggestedAction. */ + class RbmSuggestedAction implements IRbmSuggestedAction { - /** - * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateDocumentRequest; + /** + * Constructs a new RbmSuggestedAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction); - /** - * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. - * @param message CreateDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.CreateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** RbmSuggestedAction text. */ + public text: string; - /** - * Converts this CreateDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** RbmSuggestedAction postbackData. */ + public postbackData: string; - /** Properties of a DeleteDocumentRequest. */ - interface IDeleteDocumentRequest { + /** RbmSuggestedAction dial. */ + public dial?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial|null); - /** DeleteDocumentRequest name */ - name?: (string|null); - } + /** RbmSuggestedAction openUrl. */ + public openUrl?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri|null); - /** Represents a DeleteDocumentRequest. */ - class DeleteDocumentRequest implements IDeleteDocumentRequest { + /** RbmSuggestedAction shareLocation. */ + public shareLocation?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation|null); - /** - * Constructs a new DeleteDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest); + /** RbmSuggestedAction action. */ + public action?: ("dial"|"openUrl"|"shareLocation"); - /** DeleteDocumentRequest name. */ - public name: string; + /** + * Creates a new RbmSuggestedAction instance using the specified properties. + * @param [properties] Properties to set + * @returns RbmSuggestedAction instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction; - /** - * Creates a new DeleteDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteDocumentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest): google.cloud.dialogflow.v2beta1.DeleteDocumentRequest; + /** + * Encodes the specified RbmSuggestedAction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.verify|verify} messages. + * @param message RbmSuggestedAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteDocumentRequest.verify|verify} messages. - * @param message DeleteDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified RbmSuggestedAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.verify|verify} messages. + * @param message RbmSuggestedAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteDocumentRequest.verify|verify} messages. - * @param message DeleteDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a RbmSuggestedAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RbmSuggestedAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction; - /** - * Decodes a DeleteDocumentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteDocumentRequest; + /** + * Decodes a RbmSuggestedAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RbmSuggestedAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction; - /** - * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteDocumentRequest; + /** + * Verifies a RbmSuggestedAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a DeleteDocumentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a RbmSuggestedAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RbmSuggestedAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction; - /** - * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteDocumentRequest; + /** + * Creates a plain object from a RbmSuggestedAction message. Also converts values to other types if specified. + * @param message RbmSuggestedAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. - * @param message DeleteDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this RbmSuggestedAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this DeleteDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + namespace RbmSuggestedAction { - /** Properties of an UpdateDocumentRequest. */ - interface IUpdateDocumentRequest { + /** Properties of a RbmSuggestedActionDial. */ + interface IRbmSuggestedActionDial { - /** UpdateDocumentRequest document */ - document?: (google.cloud.dialogflow.v2beta1.IDocument|null); + /** RbmSuggestedActionDial phoneNumber */ + phoneNumber?: (string|null); + } - /** UpdateDocumentRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** Represents a RbmSuggestedActionDial. */ + class RbmSuggestedActionDial implements IRbmSuggestedActionDial { - /** Represents an UpdateDocumentRequest. */ - class UpdateDocumentRequest implements IUpdateDocumentRequest { + /** + * Constructs a new RbmSuggestedActionDial. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial); - /** - * Constructs a new UpdateDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest); + /** RbmSuggestedActionDial phoneNumber. */ + public phoneNumber: string; - /** UpdateDocumentRequest document. */ - public document?: (google.cloud.dialogflow.v2beta1.IDocument|null); + /** + * Creates a new RbmSuggestedActionDial instance using the specified properties. + * @param [properties] Properties to set + * @returns RbmSuggestedActionDial instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial; - /** UpdateDocumentRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Encodes the specified RbmSuggestedActionDial message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.verify|verify} messages. + * @param message RbmSuggestedActionDial message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new UpdateDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDocumentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest): google.cloud.dialogflow.v2beta1.UpdateDocumentRequest; + /** + * Encodes the specified RbmSuggestedActionDial message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.verify|verify} messages. + * @param message RbmSuggestedActionDial message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateDocumentRequest.verify|verify} messages. - * @param message UpdateDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a RbmSuggestedActionDial message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RbmSuggestedActionDial + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial; - /** - * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateDocumentRequest.verify|verify} messages. - * @param message UpdateDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a RbmSuggestedActionDial message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RbmSuggestedActionDial + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial; - /** - * Decodes an UpdateDocumentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateDocumentRequest; + /** + * Verifies a RbmSuggestedActionDial message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateDocumentRequest; + /** + * Creates a RbmSuggestedActionDial message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RbmSuggestedActionDial + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial; - /** - * Verifies an UpdateDocumentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from a RbmSuggestedActionDial message. Also converts values to other types if specified. + * @param message RbmSuggestedActionDial + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateDocumentRequest; + /** + * Converts this RbmSuggestedActionDial to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. - * @param message UpdateDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a RbmSuggestedActionOpenUri. */ + interface IRbmSuggestedActionOpenUri { - /** - * Converts this UpdateDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** RbmSuggestedActionOpenUri uri */ + uri?: (string|null); + } - /** Properties of a KnowledgeOperationMetadata. */ - interface IKnowledgeOperationMetadata { + /** Represents a RbmSuggestedActionOpenUri. */ + class RbmSuggestedActionOpenUri implements IRbmSuggestedActionOpenUri { - /** KnowledgeOperationMetadata state */ - state?: (google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State|keyof typeof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State|null); - } + /** + * Constructs a new RbmSuggestedActionOpenUri. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri); - /** Represents a KnowledgeOperationMetadata. */ - class KnowledgeOperationMetadata implements IKnowledgeOperationMetadata { + /** RbmSuggestedActionOpenUri uri. */ + public uri: string; - /** - * Constructs a new KnowledgeOperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata); + /** + * Creates a new RbmSuggestedActionOpenUri instance using the specified properties. + * @param [properties] Properties to set + * @returns RbmSuggestedActionOpenUri instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri; - /** KnowledgeOperationMetadata state. */ - public state: (google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State|keyof typeof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State); + /** + * Encodes the specified RbmSuggestedActionOpenUri message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.verify|verify} messages. + * @param message RbmSuggestedActionOpenUri message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new KnowledgeOperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns KnowledgeOperationMetadata instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata): google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata; + /** + * Encodes the specified RbmSuggestedActionOpenUri message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.verify|verify} messages. + * @param message RbmSuggestedActionOpenUri message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified KnowledgeOperationMetadata message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.verify|verify} messages. - * @param message KnowledgeOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a RbmSuggestedActionOpenUri message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RbmSuggestedActionOpenUri + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri; - /** - * Encodes the specified KnowledgeOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.verify|verify} messages. - * @param message KnowledgeOperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a RbmSuggestedActionOpenUri message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RbmSuggestedActionOpenUri + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri; - /** - * Decodes a KnowledgeOperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns KnowledgeOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata; + /** + * Verifies a RbmSuggestedActionOpenUri message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a KnowledgeOperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns KnowledgeOperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata; + /** + * Creates a RbmSuggestedActionOpenUri message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RbmSuggestedActionOpenUri + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri; - /** - * Verifies a KnowledgeOperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from a RbmSuggestedActionOpenUri message. Also converts values to other types if specified. + * @param message RbmSuggestedActionOpenUri + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a KnowledgeOperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns KnowledgeOperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata; + /** + * Converts this RbmSuggestedActionOpenUri to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a KnowledgeOperationMetadata message. Also converts values to other types if specified. - * @param message KnowledgeOperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a RbmSuggestedActionShareLocation. */ + interface IRbmSuggestedActionShareLocation { + } - /** - * Converts this KnowledgeOperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a RbmSuggestedActionShareLocation. */ + class RbmSuggestedActionShareLocation implements IRbmSuggestedActionShareLocation { - namespace KnowledgeOperationMetadata { + /** + * Constructs a new RbmSuggestedActionShareLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation); - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - PENDING = 1, - RUNNING = 2, - DONE = 3 - } - } + /** + * Creates a new RbmSuggestedActionShareLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns RbmSuggestedActionShareLocation instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation; - /** Properties of a ReloadDocumentRequest. */ - interface IReloadDocumentRequest { + /** + * Encodes the specified RbmSuggestedActionShareLocation message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.verify|verify} messages. + * @param message RbmSuggestedActionShareLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation, writer?: $protobuf.Writer): $protobuf.Writer; - /** ReloadDocumentRequest name */ - name?: (string|null); + /** + * Encodes the specified RbmSuggestedActionShareLocation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.verify|verify} messages. + * @param message RbmSuggestedActionShareLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation, writer?: $protobuf.Writer): $protobuf.Writer; - /** ReloadDocumentRequest gcsSource */ - gcsSource?: (google.cloud.dialogflow.v2beta1.IGcsSource|null); + /** + * Decodes a RbmSuggestedActionShareLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RbmSuggestedActionShareLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation; - /** ReloadDocumentRequest importGcsCustomMetadata */ - importGcsCustomMetadata?: (boolean|null); - } + /** + * Decodes a RbmSuggestedActionShareLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RbmSuggestedActionShareLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation; - /** Represents a ReloadDocumentRequest. */ - class ReloadDocumentRequest implements IReloadDocumentRequest { + /** + * Verifies a RbmSuggestedActionShareLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new ReloadDocumentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IReloadDocumentRequest); + /** + * Creates a RbmSuggestedActionShareLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RbmSuggestedActionShareLocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation; - /** ReloadDocumentRequest name. */ - public name: string; + /** + * Creates a plain object from a RbmSuggestedActionShareLocation message. Also converts values to other types if specified. + * @param message RbmSuggestedActionShareLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ReloadDocumentRequest gcsSource. */ - public gcsSource?: (google.cloud.dialogflow.v2beta1.IGcsSource|null); + /** + * Converts this RbmSuggestedActionShareLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** ReloadDocumentRequest importGcsCustomMetadata. */ - public importGcsCustomMetadata: boolean; + /** Properties of a MediaContent. */ + interface IMediaContent { - /** ReloadDocumentRequest source. */ - public source?: "gcsSource"; + /** MediaContent mediaType */ + mediaType?: (google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType|null); - /** - * Creates a new ReloadDocumentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ReloadDocumentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IReloadDocumentRequest): google.cloud.dialogflow.v2beta1.ReloadDocumentRequest; + /** MediaContent mediaObjects */ + mediaObjects?: (google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject[]|null); + } - /** - * Encodes the specified ReloadDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ReloadDocumentRequest.verify|verify} messages. - * @param message ReloadDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a MediaContent. */ + class MediaContent implements IMediaContent { - /** - * Encodes the specified ReloadDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ReloadDocumentRequest.verify|verify} messages. - * @param message ReloadDocumentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new MediaContent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent); - /** - * Decodes a ReloadDocumentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReloadDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ReloadDocumentRequest; + /** MediaContent mediaType. */ + public mediaType: (google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType); - /** - * Decodes a ReloadDocumentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReloadDocumentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ReloadDocumentRequest; + /** MediaContent mediaObjects. */ + public mediaObjects: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject[]; - /** - * Verifies a ReloadDocumentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new MediaContent instance using the specified properties. + * @param [properties] Properties to set + * @returns MediaContent instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent; - /** - * Creates a ReloadDocumentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReloadDocumentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ReloadDocumentRequest; + /** + * Encodes the specified MediaContent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.verify|verify} messages. + * @param message MediaContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a ReloadDocumentRequest message. Also converts values to other types if specified. - * @param message ReloadDocumentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ReloadDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified MediaContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.verify|verify} messages. + * @param message MediaContent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ReloadDocumentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a MediaContent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MediaContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent; - /** Properties of a GcsSource. */ - interface IGcsSource { + /** + * Decodes a MediaContent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MediaContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent; - /** GcsSource uri */ - uri?: (string|null); - } + /** + * Verifies a MediaContent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a GcsSource. */ - class GcsSource implements IGcsSource { + /** + * Creates a MediaContent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MediaContent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent; - /** - * Constructs a new GcsSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IGcsSource); + /** + * Creates a plain object from a MediaContent message. Also converts values to other types if specified. + * @param message MediaContent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** GcsSource uri. */ - public uri: string; + /** + * Converts this MediaContent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new GcsSource instance using the specified properties. - * @param [properties] Properties to set - * @returns GcsSource instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IGcsSource): google.cloud.dialogflow.v2beta1.GcsSource; + namespace MediaContent { - /** - * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GcsSource.verify|verify} messages. - * @param message GcsSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a ResponseMediaObject. */ + interface IResponseMediaObject { - /** - * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GcsSource.verify|verify} messages. - * @param message GcsSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGcsSource, writer?: $protobuf.Writer): $protobuf.Writer; + /** ResponseMediaObject name */ + name?: (string|null); - /** - * Decodes a GcsSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcsSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GcsSource; + /** ResponseMediaObject description */ + description?: (string|null); - /** - * Decodes a GcsSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcsSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GcsSource; + /** ResponseMediaObject largeImage */ + largeImage?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); - /** - * Verifies a GcsSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ResponseMediaObject icon */ + icon?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); - /** - * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcsSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GcsSource; + /** ResponseMediaObject contentUrl */ + contentUrl?: (string|null); + } - /** - * Creates a plain object from a GcsSource message. Also converts values to other types if specified. - * @param message GcsSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.GcsSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a ResponseMediaObject. */ + class ResponseMediaObject implements IResponseMediaObject { - /** - * Converts this GcsSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new ResponseMediaObject. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject); - /** Represents an EntityTypes */ - class EntityTypes extends $protobuf.rpc.Service { + /** ResponseMediaObject name. */ + public name: string; - /** - * Constructs a new EntityTypes service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** ResponseMediaObject description. */ + public description: string; - /** - * Creates new EntityTypes service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): EntityTypes; + /** ResponseMediaObject largeImage. */ + public largeImage?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); - /** - * Calls ListEntityTypes. - * @param request ListEntityTypesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListEntityTypesResponse - */ - public listEntityTypes(request: google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.ListEntityTypesCallback): void; + /** ResponseMediaObject icon. */ + public icon?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); - /** - * Calls ListEntityTypes. - * @param request ListEntityTypesRequest message or plain object - * @returns Promise - */ - public listEntityTypes(request: google.cloud.dialogflow.v2beta1.IListEntityTypesRequest): Promise; + /** ResponseMediaObject contentUrl. */ + public contentUrl: string; - /** - * Calls GetEntityType. - * @param request GetEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EntityType - */ - public getEntityType(request: google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.GetEntityTypeCallback): void; + /** ResponseMediaObject image. */ + public image?: ("largeImage"|"icon"); - /** - * Calls GetEntityType. - * @param request GetEntityTypeRequest message or plain object - * @returns Promise - */ - public getEntityType(request: google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest): Promise; + /** + * Creates a new ResponseMediaObject instance using the specified properties. + * @param [properties] Properties to set + * @returns ResponseMediaObject instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject; - /** - * Calls CreateEntityType. - * @param request CreateEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EntityType - */ - public createEntityType(request: google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.CreateEntityTypeCallback): void; + /** + * Encodes the specified ResponseMediaObject message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. + * @param message ResponseMediaObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls CreateEntityType. - * @param request CreateEntityTypeRequest message or plain object - * @returns Promise - */ - public createEntityType(request: google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest): Promise; + /** + * Encodes the specified ResponseMediaObject message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. + * @param message ResponseMediaObject message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Calls UpdateEntityType. - * @param request UpdateEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and EntityType - */ - public updateEntityType(request: google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.UpdateEntityTypeCallback): void; + /** + * Decodes a ResponseMediaObject message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResponseMediaObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject; - /** - * Calls UpdateEntityType. - * @param request UpdateEntityTypeRequest message or plain object - * @returns Promise - */ - public updateEntityType(request: google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest): Promise; + /** + * Decodes a ResponseMediaObject message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResponseMediaObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject; - /** - * Calls DeleteEntityType. - * @param request DeleteEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteEntityType(request: google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.DeleteEntityTypeCallback): void; + /** + * Verifies a ResponseMediaObject message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Calls DeleteEntityType. - * @param request DeleteEntityTypeRequest message or plain object - * @returns Promise - */ - public deleteEntityType(request: google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest): Promise; + /** + * Creates a ResponseMediaObject message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResponseMediaObject + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject; - /** - * Calls BatchUpdateEntityTypes. - * @param request BatchUpdateEntityTypesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchUpdateEntityTypes(request: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.BatchUpdateEntityTypesCallback): void; + /** + * Creates a plain object from a ResponseMediaObject message. Also converts values to other types if specified. + * @param message ResponseMediaObject + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Calls BatchUpdateEntityTypes. - * @param request BatchUpdateEntityTypesRequest message or plain object - * @returns Promise - */ - public batchUpdateEntityTypes(request: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest): Promise; + /** + * Converts this ResponseMediaObject to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Calls BatchDeleteEntityTypes. - * @param request BatchDeleteEntityTypesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchDeleteEntityTypes(request: google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntityTypesCallback): void; + /** ResponseMediaType enum. */ + enum ResponseMediaType { + RESPONSE_MEDIA_TYPE_UNSPECIFIED = 0, + AUDIO = 1 + } + } - /** - * Calls BatchDeleteEntityTypes. - * @param request BatchDeleteEntityTypesRequest message or plain object - * @returns Promise - */ - public batchDeleteEntityTypes(request: google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest): Promise; + /** Properties of a BrowseCarouselCard. */ + interface IBrowseCarouselCard { - /** - * Calls BatchCreateEntities. - * @param request BatchCreateEntitiesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchCreateEntities(request: google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.BatchCreateEntitiesCallback): void; + /** BrowseCarouselCard items */ + items?: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem[]|null); - /** - * Calls BatchCreateEntities. - * @param request BatchCreateEntitiesRequest message or plain object - * @returns Promise - */ - public batchCreateEntities(request: google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest): Promise; + /** BrowseCarouselCard imageDisplayOptions */ + imageDisplayOptions?: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|null); + } - /** - * Calls BatchUpdateEntities. - * @param request BatchUpdateEntitiesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchUpdateEntities(request: google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.BatchUpdateEntitiesCallback): void; + /** Represents a BrowseCarouselCard. */ + class BrowseCarouselCard implements IBrowseCarouselCard { - /** - * Calls BatchUpdateEntities. - * @param request BatchUpdateEntitiesRequest message or plain object - * @returns Promise - */ - public batchUpdateEntities(request: google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest): Promise; + /** + * Constructs a new BrowseCarouselCard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard); - /** - * Calls BatchDeleteEntities. - * @param request BatchDeleteEntitiesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchDeleteEntities(request: google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntitiesCallback): void; + /** BrowseCarouselCard items. */ + public items: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem[]; - /** - * Calls BatchDeleteEntities. - * @param request BatchDeleteEntitiesRequest message or plain object - * @returns Promise - */ - public batchDeleteEntities(request: google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest): Promise; - } + /** BrowseCarouselCard imageDisplayOptions. */ + public imageDisplayOptions: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions); - namespace EntityTypes { + /** + * Creates a new BrowseCarouselCard instance using the specified properties. + * @param [properties] Properties to set + * @returns BrowseCarouselCard instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#listEntityTypes}. - * @param error Error, if any - * @param [response] ListEntityTypesResponse - */ - type ListEntityTypesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListEntityTypesResponse) => void; + /** + * Encodes the specified BrowseCarouselCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.verify|verify} messages. + * @param message BrowseCarouselCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#getEntityType}. - * @param error Error, if any - * @param [response] EntityType - */ - type GetEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.EntityType) => void; + /** + * Encodes the specified BrowseCarouselCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.verify|verify} messages. + * @param message BrowseCarouselCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#createEntityType}. - * @param error Error, if any - * @param [response] EntityType - */ - type CreateEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.EntityType) => void; + /** + * Decodes a BrowseCarouselCard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BrowseCarouselCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#updateEntityType}. - * @param error Error, if any - * @param [response] EntityType - */ - type UpdateEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.EntityType) => void; + /** + * Decodes a BrowseCarouselCard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BrowseCarouselCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#deleteEntityType}. - * @param error Error, if any - * @param [response] Empty - */ - type DeleteEntityTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + /** + * Verifies a BrowseCarouselCard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchUpdateEntityTypes}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchUpdateEntityTypesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Creates a BrowseCarouselCard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BrowseCarouselCard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchDeleteEntityTypes}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchDeleteEntityTypesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Creates a plain object from a BrowseCarouselCard message. Also converts values to other types if specified. + * @param message BrowseCarouselCard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchCreateEntities}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchCreateEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + /** + * Converts this BrowseCarouselCard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchUpdateEntities}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchUpdateEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + namespace BrowseCarouselCard { - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchDeleteEntities}. - * @param error Error, if any - * @param [response] Operation - */ - type BatchDeleteEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } + /** Properties of a BrowseCarouselCardItem. */ + interface IBrowseCarouselCardItem { - /** Properties of an EntityType. */ - interface IEntityType { + /** BrowseCarouselCardItem openUriAction */ + openUriAction?: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null); - /** EntityType name */ - name?: (string|null); + /** BrowseCarouselCardItem title */ + title?: (string|null); - /** EntityType displayName */ - displayName?: (string|null); + /** BrowseCarouselCardItem description */ + description?: (string|null); - /** EntityType kind */ - kind?: (google.cloud.dialogflow.v2beta1.EntityType.Kind|keyof typeof google.cloud.dialogflow.v2beta1.EntityType.Kind|null); + /** BrowseCarouselCardItem image */ + image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); - /** EntityType autoExpansionMode */ - autoExpansionMode?: (google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode|keyof typeof google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode|null); + /** BrowseCarouselCardItem footer */ + footer?: (string|null); + } - /** EntityType entities */ - entities?: (google.cloud.dialogflow.v2beta1.EntityType.IEntity[]|null); + /** Represents a BrowseCarouselCardItem. */ + class BrowseCarouselCardItem implements IBrowseCarouselCardItem { - /** EntityType enableFuzzyExtraction */ - enableFuzzyExtraction?: (boolean|null); - } + /** + * Constructs a new BrowseCarouselCardItem. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem); - /** Represents an EntityType. */ - class EntityType implements IEntityType { + /** BrowseCarouselCardItem openUriAction. */ + public openUriAction?: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null); - /** - * Constructs a new EntityType. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IEntityType); + /** BrowseCarouselCardItem title. */ + public title: string; - /** EntityType name. */ - public name: string; + /** BrowseCarouselCardItem description. */ + public description: string; - /** EntityType displayName. */ - public displayName: string; + /** BrowseCarouselCardItem image. */ + public image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); - /** EntityType kind. */ - public kind: (google.cloud.dialogflow.v2beta1.EntityType.Kind|keyof typeof google.cloud.dialogflow.v2beta1.EntityType.Kind); + /** BrowseCarouselCardItem footer. */ + public footer: string; - /** EntityType autoExpansionMode. */ - public autoExpansionMode: (google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode|keyof typeof google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode); + /** + * Creates a new BrowseCarouselCardItem instance using the specified properties. + * @param [properties] Properties to set + * @returns BrowseCarouselCardItem instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; - /** EntityType entities. */ - public entities: google.cloud.dialogflow.v2beta1.EntityType.IEntity[]; + /** + * Encodes the specified BrowseCarouselCardItem message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. + * @param message BrowseCarouselCardItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem, writer?: $protobuf.Writer): $protobuf.Writer; - /** EntityType enableFuzzyExtraction. */ - public enableFuzzyExtraction: boolean; + /** + * Encodes the specified BrowseCarouselCardItem message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. + * @param message BrowseCarouselCardItem message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new EntityType instance using the specified properties. - * @param [properties] Properties to set - * @returns EntityType instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IEntityType): google.cloud.dialogflow.v2beta1.EntityType; + /** + * Decodes a BrowseCarouselCardItem message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BrowseCarouselCardItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; - /** - * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.verify|verify} messages. - * @param message EntityType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a BrowseCarouselCardItem message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BrowseCarouselCardItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; - /** - * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.verify|verify} messages. - * @param message EntityType message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a BrowseCarouselCardItem message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes an EntityType message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EntityType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.EntityType; + /** + * Creates a BrowseCarouselCardItem message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BrowseCarouselCardItem + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; - /** - * Decodes an EntityType message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EntityType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.EntityType; + /** + * Creates a plain object from a BrowseCarouselCardItem message. Also converts values to other types if specified. + * @param message BrowseCarouselCardItem + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies an EntityType message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this BrowseCarouselCardItem to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates an EntityType message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EntityType - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.EntityType; + namespace BrowseCarouselCardItem { + + /** Properties of an OpenUrlAction. */ + interface IOpenUrlAction { + + /** OpenUrlAction url */ + url?: (string|null); - /** - * Creates a plain object from an EntityType message. Also converts values to other types if specified. - * @param message EntityType - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.EntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** OpenUrlAction urlTypeHint */ + urlTypeHint?: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|null); + } - /** - * Converts this EntityType to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents an OpenUrlAction. */ + class OpenUrlAction implements IOpenUrlAction { - namespace EntityType { + /** + * Constructs a new OpenUrlAction. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction); - /** Properties of an Entity. */ - interface IEntity { + /** OpenUrlAction url. */ + public url: string; - /** Entity value */ - value?: (string|null); + /** OpenUrlAction urlTypeHint. */ + public urlTypeHint: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint); - /** Entity synonyms */ - synonyms?: (string[]|null); - } + /** + * Creates a new OpenUrlAction instance using the specified properties. + * @param [properties] Properties to set + * @returns OpenUrlAction instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; - /** Represents an Entity. */ - class Entity implements IEntity { + /** + * Encodes the specified OpenUrlAction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. + * @param message OpenUrlAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new Entity. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.EntityType.IEntity); + /** + * Encodes the specified OpenUrlAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. + * @param message OpenUrlAction message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction, writer?: $protobuf.Writer): $protobuf.Writer; - /** Entity value. */ - public value: string; + /** + * Decodes an OpenUrlAction message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OpenUrlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; - /** Entity synonyms. */ - public synonyms: string[]; + /** + * Decodes an OpenUrlAction message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OpenUrlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; - /** - * Creates a new Entity instance using the specified properties. - * @param [properties] Properties to set - * @returns Entity instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.EntityType.IEntity): google.cloud.dialogflow.v2beta1.EntityType.Entity; + /** + * Verifies an OpenUrlAction message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.Entity.verify|verify} messages. - * @param message Entity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.EntityType.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates an OpenUrlAction message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OpenUrlAction + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; - /** - * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.Entity.verify|verify} messages. - * @param message Entity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.EntityType.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from an OpenUrlAction message. Also converts values to other types if specified. + * @param message OpenUrlAction + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes an Entity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Entity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.EntityType.Entity; + /** + * Converts this OpenUrlAction to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes an Entity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Entity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.EntityType.Entity; + namespace OpenUrlAction { - /** - * Verifies an Entity message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** UrlTypeHint enum. */ + enum UrlTypeHint { + URL_TYPE_HINT_UNSPECIFIED = 0, + AMP_ACTION = 1, + AMP_CONTENT = 2 + } + } + } - /** - * Creates an Entity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Entity - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.EntityType.Entity; + /** ImageDisplayOptions enum. */ + enum ImageDisplayOptions { + IMAGE_DISPLAY_OPTIONS_UNSPECIFIED = 0, + GRAY = 1, + WHITE = 2, + CROPPED = 3, + BLURRED_BACKGROUND = 4 + } + } - /** - * Creates a plain object from an Entity message. Also converts values to other types if specified. - * @param message Entity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.EntityType.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a TableCard. */ + interface ITableCard { - /** - * Converts this Entity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** TableCard title */ + title?: (string|null); - /** Kind enum. */ - enum Kind { - KIND_UNSPECIFIED = 0, - KIND_MAP = 1, - KIND_LIST = 2, - KIND_REGEXP = 3 - } + /** TableCard subtitle */ + subtitle?: (string|null); - /** AutoExpansionMode enum. */ - enum AutoExpansionMode { - AUTO_EXPANSION_MODE_UNSPECIFIED = 0, - AUTO_EXPANSION_MODE_DEFAULT = 1 - } - } + /** TableCard image */ + image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); - /** Properties of a ListEntityTypesRequest. */ - interface IListEntityTypesRequest { + /** TableCard columnProperties */ + columnProperties?: (google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties[]|null); - /** ListEntityTypesRequest parent */ - parent?: (string|null); + /** TableCard rows */ + rows?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow[]|null); - /** ListEntityTypesRequest languageCode */ - languageCode?: (string|null); + /** TableCard buttons */ + buttons?: (google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton[]|null); + } - /** ListEntityTypesRequest pageSize */ - pageSize?: (number|null); + /** Represents a TableCard. */ + class TableCard implements ITableCard { - /** ListEntityTypesRequest pageToken */ - pageToken?: (string|null); - } + /** + * Constructs a new TableCard. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard); - /** Represents a ListEntityTypesRequest. */ - class ListEntityTypesRequest implements IListEntityTypesRequest { + /** TableCard title. */ + public title: string; - /** - * Constructs a new ListEntityTypesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListEntityTypesRequest); + /** TableCard subtitle. */ + public subtitle: string; - /** ListEntityTypesRequest parent. */ - public parent: string; + /** TableCard image. */ + public image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); - /** ListEntityTypesRequest languageCode. */ - public languageCode: string; + /** TableCard columnProperties. */ + public columnProperties: google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties[]; - /** ListEntityTypesRequest pageSize. */ - public pageSize: number; + /** TableCard rows. */ + public rows: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow[]; - /** ListEntityTypesRequest pageToken. */ - public pageToken: string; + /** TableCard buttons. */ + public buttons: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton[]; - /** - * Creates a new ListEntityTypesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEntityTypesRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListEntityTypesRequest): google.cloud.dialogflow.v2beta1.ListEntityTypesRequest; + /** + * Creates a new TableCard instance using the specified properties. + * @param [properties] Properties to set + * @returns TableCard instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard): google.cloud.dialogflow.v2beta1.Intent.Message.TableCard; - /** - * Encodes the specified ListEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesRequest.verify|verify} messages. - * @param message ListEntityTypesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified TableCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.verify|verify} messages. + * @param message TableCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ListEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesRequest.verify|verify} messages. - * @param message ListEntityTypesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified TableCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.verify|verify} messages. + * @param message TableCard message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ListEntityTypesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEntityTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListEntityTypesRequest; + /** + * Decodes a TableCard message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.TableCard; - /** - * Decodes a ListEntityTypesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEntityTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListEntityTypesRequest; + /** + * Decodes a TableCard message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.TableCard; - /** - * Verifies a ListEntityTypesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a TableCard message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a ListEntityTypesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEntityTypesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListEntityTypesRequest; + /** + * Creates a TableCard message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableCard + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.TableCard; - /** - * Creates a plain object from a ListEntityTypesRequest message. Also converts values to other types if specified. - * @param message ListEntityTypesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a TableCard message. Also converts values to other types if specified. + * @param message TableCard + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.TableCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this ListEntityTypesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this TableCard to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a ListEntityTypesResponse. */ - interface IListEntityTypesResponse { + /** Properties of a ColumnProperties. */ + interface IColumnProperties { - /** ListEntityTypesResponse entityTypes */ - entityTypes?: (google.cloud.dialogflow.v2beta1.IEntityType[]|null); + /** ColumnProperties header */ + header?: (string|null); - /** ListEntityTypesResponse nextPageToken */ - nextPageToken?: (string|null); - } + /** ColumnProperties horizontalAlignment */ + horizontalAlignment?: (google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment|null); + } - /** Represents a ListEntityTypesResponse. */ - class ListEntityTypesResponse implements IListEntityTypesResponse { + /** Represents a ColumnProperties. */ + class ColumnProperties implements IColumnProperties { - /** - * Constructs a new ListEntityTypesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListEntityTypesResponse); + /** + * Constructs a new ColumnProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties); - /** ListEntityTypesResponse entityTypes. */ - public entityTypes: google.cloud.dialogflow.v2beta1.IEntityType[]; + /** ColumnProperties header. */ + public header: string; - /** ListEntityTypesResponse nextPageToken. */ - public nextPageToken: string; + /** ColumnProperties horizontalAlignment. */ + public horizontalAlignment: (google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment); - /** - * Creates a new ListEntityTypesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListEntityTypesResponse instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListEntityTypesResponse): google.cloud.dialogflow.v2beta1.ListEntityTypesResponse; + /** + * Creates a new ColumnProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ColumnProperties instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties): google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties; - /** - * Encodes the specified ListEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesResponse.verify|verify} messages. - * @param message ListEntityTypesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ColumnProperties message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.verify|verify} messages. + * @param message ColumnProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified ListEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesResponse.verify|verify} messages. - * @param message ListEntityTypesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified ColumnProperties message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.verify|verify} messages. + * @param message ColumnProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ListEntityTypesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListEntityTypesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListEntityTypesResponse; + /** + * Decodes a ColumnProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ColumnProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties; - /** - * Decodes a ListEntityTypesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListEntityTypesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListEntityTypesResponse; + /** + * Decodes a ColumnProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ColumnProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties; - /** - * Verifies a ListEntityTypesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a ColumnProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ColumnProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ColumnProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties; - /** - * Creates a ListEntityTypesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListEntityTypesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListEntityTypesResponse; + /** + * Creates a plain object from a ColumnProperties message. Also converts values to other types if specified. + * @param message ColumnProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a ListEntityTypesResponse message. Also converts values to other types if specified. - * @param message ListEntityTypesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this ColumnProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this ListEntityTypesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + namespace ColumnProperties { - /** Properties of a GetEntityTypeRequest. */ - interface IGetEntityTypeRequest { + /** HorizontalAlignment enum. */ + enum HorizontalAlignment { + HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0, + LEADING = 1, + CENTER = 2, + TRAILING = 3 + } + } - /** GetEntityTypeRequest name */ - name?: (string|null); + /** Properties of a TableCardRow. */ + interface ITableCardRow { - /** GetEntityTypeRequest languageCode */ - languageCode?: (string|null); - } + /** TableCardRow cells */ + cells?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell[]|null); - /** Represents a GetEntityTypeRequest. */ - class GetEntityTypeRequest implements IGetEntityTypeRequest { + /** TableCardRow dividerAfter */ + dividerAfter?: (boolean|null); + } - /** - * Constructs a new GetEntityTypeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest); + /** Represents a TableCardRow. */ + class TableCardRow implements ITableCardRow { - /** GetEntityTypeRequest name. */ - public name: string; + /** + * Constructs a new TableCardRow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow); - /** GetEntityTypeRequest languageCode. */ - public languageCode: string; + /** TableCardRow cells. */ + public cells: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell[]; - /** - * Creates a new GetEntityTypeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetEntityTypeRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest): google.cloud.dialogflow.v2beta1.GetEntityTypeRequest; + /** TableCardRow dividerAfter. */ + public dividerAfter: boolean; - /** - * Encodes the specified GetEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetEntityTypeRequest.verify|verify} messages. - * @param message GetEntityTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new TableCardRow instance using the specified properties. + * @param [properties] Properties to set + * @returns TableCardRow instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow; - /** - * Encodes the specified GetEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetEntityTypeRequest.verify|verify} messages. - * @param message GetEntityTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified TableCardRow message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.verify|verify} messages. + * @param message TableCardRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a GetEntityTypeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetEntityTypeRequest; + /** + * Encodes the specified TableCardRow message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.verify|verify} messages. + * @param message TableCardRow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a GetEntityTypeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetEntityTypeRequest; + /** + * Decodes a TableCardRow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableCardRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow; - /** - * Verifies a GetEntityTypeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a TableCardRow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableCardRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow; - /** - * Creates a GetEntityTypeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetEntityTypeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetEntityTypeRequest; + /** + * Verifies a TableCardRow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a GetEntityTypeRequest message. Also converts values to other types if specified. - * @param message GetEntityTypeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.GetEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a TableCardRow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableCardRow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow; - /** - * Converts this GetEntityTypeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a TableCardRow message. Also converts values to other types if specified. + * @param message TableCardRow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a CreateEntityTypeRequest. */ - interface ICreateEntityTypeRequest { + /** + * Converts this TableCardRow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** CreateEntityTypeRequest parent */ - parent?: (string|null); + /** Properties of a TableCardCell. */ + interface ITableCardCell { - /** CreateEntityTypeRequest entityType */ - entityType?: (google.cloud.dialogflow.v2beta1.IEntityType|null); + /** TableCardCell text */ + text?: (string|null); + } - /** CreateEntityTypeRequest languageCode */ - languageCode?: (string|null); - } + /** Represents a TableCardCell. */ + class TableCardCell implements ITableCardCell { - /** Represents a CreateEntityTypeRequest. */ - class CreateEntityTypeRequest implements ICreateEntityTypeRequest { + /** + * Constructs a new TableCardCell. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell); - /** - * Constructs a new CreateEntityTypeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest); + /** TableCardCell text. */ + public text: string; - /** CreateEntityTypeRequest parent. */ - public parent: string; + /** + * Creates a new TableCardCell instance using the specified properties. + * @param [properties] Properties to set + * @returns TableCardCell instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell; - /** CreateEntityTypeRequest entityType. */ - public entityType?: (google.cloud.dialogflow.v2beta1.IEntityType|null); + /** + * Encodes the specified TableCardCell message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.verify|verify} messages. + * @param message TableCardCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell, writer?: $protobuf.Writer): $protobuf.Writer; - /** CreateEntityTypeRequest languageCode. */ - public languageCode: string; + /** + * Encodes the specified TableCardCell message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.verify|verify} messages. + * @param message TableCardCell message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new CreateEntityTypeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateEntityTypeRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest): google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest; + /** + * Decodes a TableCardCell message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TableCardCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell; - /** - * Encodes the specified CreateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest.verify|verify} messages. - * @param message CreateEntityTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a TableCardCell message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TableCardCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell; - /** - * Encodes the specified CreateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest.verify|verify} messages. - * @param message CreateEntityTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a TableCardCell message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a CreateEntityTypeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest; + /** + * Creates a TableCardCell message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TableCardCell + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell; - /** - * Decodes a CreateEntityTypeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest; + /** + * Creates a plain object from a TableCardCell message. Also converts values to other types if specified. + * @param message TableCardCell + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a CreateEntityTypeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this TableCardCell to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a CreateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateEntityTypeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest; + /** Platform enum. */ + enum Platform { + PLATFORM_UNSPECIFIED = 0, + FACEBOOK = 1, + SLACK = 2, + TELEGRAM = 3, + KIK = 4, + SKYPE = 5, + LINE = 6, + VIBER = 7, + ACTIONS_ON_GOOGLE = 8, + TELEPHONY = 10, + GOOGLE_HANGOUTS = 11 + } + } - /** - * Creates a plain object from a CreateEntityTypeRequest message. Also converts values to other types if specified. - * @param message CreateEntityTypeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Properties of a FollowupIntentInfo. */ + interface IFollowupIntentInfo { - /** - * Converts this CreateEntityTypeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** FollowupIntentInfo followupIntentName */ + followupIntentName?: (string|null); - /** Properties of an UpdateEntityTypeRequest. */ - interface IUpdateEntityTypeRequest { + /** FollowupIntentInfo parentFollowupIntentName */ + parentFollowupIntentName?: (string|null); + } - /** UpdateEntityTypeRequest entityType */ - entityType?: (google.cloud.dialogflow.v2beta1.IEntityType|null); + /** Represents a FollowupIntentInfo. */ + class FollowupIntentInfo implements IFollowupIntentInfo { - /** UpdateEntityTypeRequest languageCode */ - languageCode?: (string|null); + /** + * Constructs a new FollowupIntentInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo); - /** UpdateEntityTypeRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - } + /** FollowupIntentInfo followupIntentName. */ + public followupIntentName: string; - /** Represents an UpdateEntityTypeRequest. */ - class UpdateEntityTypeRequest implements IUpdateEntityTypeRequest { + /** FollowupIntentInfo parentFollowupIntentName. */ + public parentFollowupIntentName: string; - /** - * Constructs a new UpdateEntityTypeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest); + /** + * Creates a new FollowupIntentInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FollowupIntentInfo instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo): google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo; - /** UpdateEntityTypeRequest entityType. */ - public entityType?: (google.cloud.dialogflow.v2beta1.IEntityType|null); + /** + * Encodes the specified FollowupIntentInfo message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.verify|verify} messages. + * @param message FollowupIntentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** UpdateEntityTypeRequest languageCode. */ - public languageCode: string; + /** + * Encodes the specified FollowupIntentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.verify|verify} messages. + * @param message FollowupIntentInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo, writer?: $protobuf.Writer): $protobuf.Writer; - /** UpdateEntityTypeRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Decodes a FollowupIntentInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FollowupIntentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo; - /** - * Creates a new UpdateEntityTypeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateEntityTypeRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest): google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest; + /** + * Decodes a FollowupIntentInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FollowupIntentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo; - /** - * Encodes the specified UpdateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest.verify|verify} messages. - * @param message UpdateEntityTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a FollowupIntentInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified UpdateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest.verify|verify} messages. - * @param message UpdateEntityTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a FollowupIntentInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FollowupIntentInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo; - /** - * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest; + /** + * Creates a plain object from a FollowupIntentInfo message. Also converts values to other types if specified. + * @param message FollowupIntentInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest; + /** + * Converts this FollowupIntentInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies an UpdateEntityTypeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** WebhookState enum. */ + enum WebhookState { + WEBHOOK_STATE_UNSPECIFIED = 0, + WEBHOOK_STATE_ENABLED = 1, + WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2 + } + } - /** - * Creates an UpdateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateEntityTypeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest; + /** Properties of a ListIntentsRequest. */ + interface IListIntentsRequest { - /** - * Creates a plain object from an UpdateEntityTypeRequest message. Also converts values to other types if specified. - * @param message UpdateEntityTypeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ListIntentsRequest parent */ + parent?: (string|null); - /** - * Converts this UpdateEntityTypeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ListIntentsRequest languageCode */ + languageCode?: (string|null); - /** Properties of a DeleteEntityTypeRequest. */ - interface IDeleteEntityTypeRequest { + /** ListIntentsRequest intentView */ + intentView?: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView|null); - /** DeleteEntityTypeRequest name */ - name?: (string|null); + /** ListIntentsRequest pageSize */ + pageSize?: (number|null); + + /** ListIntentsRequest pageToken */ + pageToken?: (string|null); } - /** Represents a DeleteEntityTypeRequest. */ - class DeleteEntityTypeRequest implements IDeleteEntityTypeRequest { + /** Represents a ListIntentsRequest. */ + class ListIntentsRequest implements IListIntentsRequest { /** - * Constructs a new DeleteEntityTypeRequest. + * Constructs a new ListIntentsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.IListIntentsRequest); - /** DeleteEntityTypeRequest name. */ - public name: string; + /** ListIntentsRequest parent. */ + public parent: string; + + /** ListIntentsRequest languageCode. */ + public languageCode: string; + + /** ListIntentsRequest intentView. */ + public intentView: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView); + + /** ListIntentsRequest pageSize. */ + public pageSize: number; + + /** ListIntentsRequest pageToken. */ + public pageToken: string; /** - * Creates a new DeleteEntityTypeRequest instance using the specified properties. + * Creates a new ListIntentsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteEntityTypeRequest instance + * @returns ListIntentsRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest): google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IListIntentsRequest): google.cloud.dialogflow.v2beta1.ListIntentsRequest; /** - * Encodes the specified DeleteEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest.verify|verify} messages. - * @param message DeleteEntityTypeRequest message or plain object to encode + * Encodes the specified ListIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsRequest.verify|verify} messages. + * @param message ListIntentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IListIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest.verify|verify} messages. - * @param message DeleteEntityTypeRequest message or plain object to encode + * Encodes the specified ListIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsRequest.verify|verify} messages. + * @param message ListIntentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer. + * Decodes a ListIntentsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteEntityTypeRequest + * @returns ListIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListIntentsRequest; /** - * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a ListIntentsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteEntityTypeRequest + * @returns ListIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListIntentsRequest; /** - * Verifies a DeleteEntityTypeRequest message. + * Verifies a ListIntentsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListIntentsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteEntityTypeRequest + * @returns ListIntentsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListIntentsRequest; /** - * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. - * @param message DeleteEntityTypeRequest + * Creates a plain object from a ListIntentsRequest message. Also converts values to other types if specified. + * @param message ListIntentsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ListIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteEntityTypeRequest to JSON. + * Converts this ListIntentsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchUpdateEntityTypesRequest. */ - interface IBatchUpdateEntityTypesRequest { - - /** BatchUpdateEntityTypesRequest parent */ - parent?: (string|null); - - /** BatchUpdateEntityTypesRequest entityTypeBatchUri */ - entityTypeBatchUri?: (string|null); - - /** BatchUpdateEntityTypesRequest entityTypeBatchInline */ - entityTypeBatchInline?: (google.cloud.dialogflow.v2beta1.IEntityTypeBatch|null); + /** Properties of a ListIntentsResponse. */ + interface IListIntentsResponse { - /** BatchUpdateEntityTypesRequest languageCode */ - languageCode?: (string|null); + /** ListIntentsResponse intents */ + intents?: (google.cloud.dialogflow.v2beta1.IIntent[]|null); - /** BatchUpdateEntityTypesRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** ListIntentsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a BatchUpdateEntityTypesRequest. */ - class BatchUpdateEntityTypesRequest implements IBatchUpdateEntityTypesRequest { + /** Represents a ListIntentsResponse. */ + class ListIntentsResponse implements IListIntentsResponse { /** - * Constructs a new BatchUpdateEntityTypesRequest. + * Constructs a new ListIntentsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest); - - /** BatchUpdateEntityTypesRequest parent. */ - public parent: string; - - /** BatchUpdateEntityTypesRequest entityTypeBatchUri. */ - public entityTypeBatchUri: string; - - /** BatchUpdateEntityTypesRequest entityTypeBatchInline. */ - public entityTypeBatchInline?: (google.cloud.dialogflow.v2beta1.IEntityTypeBatch|null); - - /** BatchUpdateEntityTypesRequest languageCode. */ - public languageCode: string; + constructor(properties?: google.cloud.dialogflow.v2beta1.IListIntentsResponse); - /** BatchUpdateEntityTypesRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** ListIntentsResponse intents. */ + public intents: google.cloud.dialogflow.v2beta1.IIntent[]; - /** BatchUpdateEntityTypesRequest entityTypeBatch. */ - public entityTypeBatch?: ("entityTypeBatchUri"|"entityTypeBatchInline"); + /** ListIntentsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new BatchUpdateEntityTypesRequest instance using the specified properties. + * Creates a new ListIntentsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns BatchUpdateEntityTypesRequest instance + * @returns ListIntentsResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IListIntentsResponse): google.cloud.dialogflow.v2beta1.ListIntentsResponse; /** - * Encodes the specified BatchUpdateEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.verify|verify} messages. - * @param message BatchUpdateEntityTypesRequest message or plain object to encode + * Encodes the specified ListIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsResponse.verify|verify} messages. + * @param message ListIntentsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IListIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchUpdateEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.verify|verify} messages. - * @param message BatchUpdateEntityTypesRequest message or plain object to encode + * Encodes the specified ListIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsResponse.verify|verify} messages. + * @param message ListIntentsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer. + * Decodes a ListIntentsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchUpdateEntityTypesRequest + * @returns ListIntentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListIntentsResponse; /** - * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListIntentsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchUpdateEntityTypesRequest + * @returns ListIntentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListIntentsResponse; /** - * Verifies a BatchUpdateEntityTypesRequest message. + * Verifies a ListIntentsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchUpdateEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListIntentsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchUpdateEntityTypesRequest + * @returns ListIntentsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListIntentsResponse; /** - * Creates a plain object from a BatchUpdateEntityTypesRequest message. Also converts values to other types if specified. - * @param message BatchUpdateEntityTypesRequest + * Creates a plain object from a ListIntentsResponse message. Also converts values to other types if specified. + * @param message ListIntentsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ListIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchUpdateEntityTypesRequest to JSON. + * Converts this ListIntentsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchUpdateEntityTypesResponse. */ - interface IBatchUpdateEntityTypesResponse { + /** Properties of a GetIntentRequest. */ + interface IGetIntentRequest { - /** BatchUpdateEntityTypesResponse entityTypes */ - entityTypes?: (google.cloud.dialogflow.v2beta1.IEntityType[]|null); + /** GetIntentRequest name */ + name?: (string|null); + + /** GetIntentRequest languageCode */ + languageCode?: (string|null); + + /** GetIntentRequest intentView */ + intentView?: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView|null); } - /** Represents a BatchUpdateEntityTypesResponse. */ - class BatchUpdateEntityTypesResponse implements IBatchUpdateEntityTypesResponse { + /** Represents a GetIntentRequest. */ + class GetIntentRequest implements IGetIntentRequest { /** - * Constructs a new BatchUpdateEntityTypesResponse. + * Constructs a new GetIntentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse); + constructor(properties?: google.cloud.dialogflow.v2beta1.IGetIntentRequest); - /** BatchUpdateEntityTypesResponse entityTypes. */ - public entityTypes: google.cloud.dialogflow.v2beta1.IEntityType[]; + /** GetIntentRequest name. */ + public name: string; + + /** GetIntentRequest languageCode. */ + public languageCode: string; + + /** GetIntentRequest intentView. */ + public intentView: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView); /** - * Creates a new BatchUpdateEntityTypesResponse instance using the specified properties. + * Creates a new GetIntentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchUpdateEntityTypesResponse instance + * @returns GetIntentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse; + public static create(properties?: google.cloud.dialogflow.v2beta1.IGetIntentRequest): google.cloud.dialogflow.v2beta1.GetIntentRequest; /** - * Encodes the specified BatchUpdateEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse.verify|verify} messages. - * @param message BatchUpdateEntityTypesResponse message or plain object to encode + * Encodes the specified GetIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetIntentRequest.verify|verify} messages. + * @param message GetIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IGetIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchUpdateEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse.verify|verify} messages. - * @param message BatchUpdateEntityTypesResponse message or plain object to encode + * Encodes the specified GetIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetIntentRequest.verify|verify} messages. + * @param message GetIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer. + * Decodes a GetIntentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchUpdateEntityTypesResponse + * @returns GetIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetIntentRequest; /** - * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer, length delimited. + * Decodes a GetIntentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchUpdateEntityTypesResponse + * @returns GetIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetIntentRequest; /** - * Verifies a BatchUpdateEntityTypesResponse message. + * Verifies a GetIntentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchUpdateEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetIntentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchUpdateEntityTypesResponse + * @returns GetIntentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetIntentRequest; /** - * Creates a plain object from a BatchUpdateEntityTypesResponse message. Also converts values to other types if specified. - * @param message BatchUpdateEntityTypesResponse + * Creates a plain object from a GetIntentRequest message. Also converts values to other types if specified. + * @param message GetIntentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.GetIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchUpdateEntityTypesResponse to JSON. + * Converts this GetIntentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchDeleteEntityTypesRequest. */ - interface IBatchDeleteEntityTypesRequest { + /** Properties of a CreateIntentRequest. */ + interface ICreateIntentRequest { - /** BatchDeleteEntityTypesRequest parent */ + /** CreateIntentRequest parent */ parent?: (string|null); - /** BatchDeleteEntityTypesRequest entityTypeNames */ - entityTypeNames?: (string[]|null); + /** CreateIntentRequest intent */ + intent?: (google.cloud.dialogflow.v2beta1.IIntent|null); + + /** CreateIntentRequest languageCode */ + languageCode?: (string|null); + + /** CreateIntentRequest intentView */ + intentView?: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView|null); } - /** Represents a BatchDeleteEntityTypesRequest. */ - class BatchDeleteEntityTypesRequest implements IBatchDeleteEntityTypesRequest { + /** Represents a CreateIntentRequest. */ + class CreateIntentRequest implements ICreateIntentRequest { /** - * Constructs a new BatchDeleteEntityTypesRequest. + * Constructs a new CreateIntentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateIntentRequest); - /** BatchDeleteEntityTypesRequest parent. */ + /** CreateIntentRequest parent. */ public parent: string; - /** BatchDeleteEntityTypesRequest entityTypeNames. */ - public entityTypeNames: string[]; + /** CreateIntentRequest intent. */ + public intent?: (google.cloud.dialogflow.v2beta1.IIntent|null); + + /** CreateIntentRequest languageCode. */ + public languageCode: string; + + /** CreateIntentRequest intentView. */ + public intentView: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView); /** - * Creates a new BatchDeleteEntityTypesRequest instance using the specified properties. + * Creates a new CreateIntentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchDeleteEntityTypesRequest instance + * @returns CreateIntentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest): google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateIntentRequest): google.cloud.dialogflow.v2beta1.CreateIntentRequest; /** - * Encodes the specified BatchDeleteEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest.verify|verify} messages. - * @param message BatchDeleteEntityTypesRequest message or plain object to encode + * Encodes the specified CreateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateIntentRequest.verify|verify} messages. + * @param message CreateIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.ICreateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchDeleteEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest.verify|verify} messages. - * @param message BatchDeleteEntityTypesRequest message or plain object to encode + * Encodes the specified CreateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateIntentRequest.verify|verify} messages. + * @param message CreateIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer. + * Decodes a CreateIntentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchDeleteEntityTypesRequest + * @returns CreateIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateIntentRequest; /** - * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateIntentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchDeleteEntityTypesRequest + * @returns CreateIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateIntentRequest; /** - * Verifies a BatchDeleteEntityTypesRequest message. + * Verifies a CreateIntentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchDeleteEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateIntentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchDeleteEntityTypesRequest + * @returns CreateIntentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateIntentRequest; /** - * Creates a plain object from a BatchDeleteEntityTypesRequest message. Also converts values to other types if specified. - * @param message BatchDeleteEntityTypesRequest + * Creates a plain object from a CreateIntentRequest message. Also converts values to other types if specified. + * @param message CreateIntentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.CreateIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchDeleteEntityTypesRequest to JSON. + * Converts this CreateIntentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchCreateEntitiesRequest. */ - interface IBatchCreateEntitiesRequest { - - /** BatchCreateEntitiesRequest parent */ - parent?: (string|null); + /** Properties of an UpdateIntentRequest. */ + interface IUpdateIntentRequest { - /** BatchCreateEntitiesRequest entities */ - entities?: (google.cloud.dialogflow.v2beta1.EntityType.IEntity[]|null); + /** UpdateIntentRequest intent */ + intent?: (google.cloud.dialogflow.v2beta1.IIntent|null); - /** BatchCreateEntitiesRequest languageCode */ + /** UpdateIntentRequest languageCode */ languageCode?: (string|null); + + /** UpdateIntentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateIntentRequest intentView */ + intentView?: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView|null); } - /** Represents a BatchCreateEntitiesRequest. */ - class BatchCreateEntitiesRequest implements IBatchCreateEntitiesRequest { + /** Represents an UpdateIntentRequest. */ + class UpdateIntentRequest implements IUpdateIntentRequest { /** - * Constructs a new BatchCreateEntitiesRequest. + * Constructs a new UpdateIntentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest); - - /** BatchCreateEntitiesRequest parent. */ - public parent: string; + constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateIntentRequest); - /** BatchCreateEntitiesRequest entities. */ - public entities: google.cloud.dialogflow.v2beta1.EntityType.IEntity[]; + /** UpdateIntentRequest intent. */ + public intent?: (google.cloud.dialogflow.v2beta1.IIntent|null); - /** BatchCreateEntitiesRequest languageCode. */ + /** UpdateIntentRequest languageCode. */ public languageCode: string; + /** UpdateIntentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateIntentRequest intentView. */ + public intentView: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView); + /** - * Creates a new BatchCreateEntitiesRequest instance using the specified properties. + * Creates a new UpdateIntentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchCreateEntitiesRequest instance + * @returns UpdateIntentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest): google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateIntentRequest): google.cloud.dialogflow.v2beta1.UpdateIntentRequest; /** - * Encodes the specified BatchCreateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest.verify|verify} messages. - * @param message BatchCreateEntitiesRequest message or plain object to encode + * Encodes the specified UpdateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateIntentRequest.verify|verify} messages. + * @param message UpdateIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchCreateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest.verify|verify} messages. - * @param message BatchCreateEntitiesRequest message or plain object to encode + * Encodes the specified UpdateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateIntentRequest.verify|verify} messages. + * @param message UpdateIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer. + * Decodes an UpdateIntentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchCreateEntitiesRequest + * @returns UpdateIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateIntentRequest; /** - * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateIntentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchCreateEntitiesRequest + * @returns UpdateIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateIntentRequest; /** - * Verifies a BatchCreateEntitiesRequest message. + * Verifies an UpdateIntentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchCreateEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateIntentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchCreateEntitiesRequest + * @returns UpdateIntentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateIntentRequest; /** - * Creates a plain object from a BatchCreateEntitiesRequest message. Also converts values to other types if specified. - * @param message BatchCreateEntitiesRequest + * Creates a plain object from an UpdateIntentRequest message. Also converts values to other types if specified. + * @param message UpdateIntentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchCreateEntitiesRequest to JSON. + * Converts this UpdateIntentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchUpdateEntitiesRequest. */ - interface IBatchUpdateEntitiesRequest { - - /** BatchUpdateEntitiesRequest parent */ - parent?: (string|null); - - /** BatchUpdateEntitiesRequest entities */ - entities?: (google.cloud.dialogflow.v2beta1.EntityType.IEntity[]|null); - - /** BatchUpdateEntitiesRequest languageCode */ - languageCode?: (string|null); + /** Properties of a DeleteIntentRequest. */ + interface IDeleteIntentRequest { - /** BatchUpdateEntitiesRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** DeleteIntentRequest name */ + name?: (string|null); } - /** Represents a BatchUpdateEntitiesRequest. */ - class BatchUpdateEntitiesRequest implements IBatchUpdateEntitiesRequest { + /** Represents a DeleteIntentRequest. */ + class DeleteIntentRequest implements IDeleteIntentRequest { /** - * Constructs a new BatchUpdateEntitiesRequest. + * Constructs a new DeleteIntentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest); - - /** BatchUpdateEntitiesRequest parent. */ - public parent: string; - - /** BatchUpdateEntitiesRequest entities. */ - public entities: google.cloud.dialogflow.v2beta1.EntityType.IEntity[]; - - /** BatchUpdateEntitiesRequest languageCode. */ - public languageCode: string; + constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteIntentRequest); - /** BatchUpdateEntitiesRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** DeleteIntentRequest name. */ + public name: string; /** - * Creates a new BatchUpdateEntitiesRequest instance using the specified properties. + * Creates a new DeleteIntentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchUpdateEntitiesRequest instance + * @returns DeleteIntentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest): google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteIntentRequest): google.cloud.dialogflow.v2beta1.DeleteIntentRequest; /** - * Encodes the specified BatchUpdateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.verify|verify} messages. - * @param message BatchUpdateEntitiesRequest message or plain object to encode + * Encodes the specified DeleteIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteIntentRequest.verify|verify} messages. + * @param message DeleteIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchUpdateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.verify|verify} messages. - * @param message BatchUpdateEntitiesRequest message or plain object to encode + * Encodes the specified DeleteIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteIntentRequest.verify|verify} messages. + * @param message DeleteIntentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer. + * Decodes a DeleteIntentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchUpdateEntitiesRequest + * @returns DeleteIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteIntentRequest; /** - * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteIntentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchUpdateEntitiesRequest + * @returns DeleteIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteIntentRequest; /** - * Verifies a BatchUpdateEntitiesRequest message. + * Verifies a DeleteIntentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchUpdateEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteIntentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchUpdateEntitiesRequest + * @returns DeleteIntentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteIntentRequest; /** - * Creates a plain object from a BatchUpdateEntitiesRequest message. Also converts values to other types if specified. - * @param message BatchUpdateEntitiesRequest + * Creates a plain object from a DeleteIntentRequest message. Also converts values to other types if specified. + * @param message DeleteIntentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchUpdateEntitiesRequest to JSON. + * Converts this DeleteIntentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchDeleteEntitiesRequest. */ - interface IBatchDeleteEntitiesRequest { + /** Properties of a BatchUpdateIntentsRequest. */ + interface IBatchUpdateIntentsRequest { - /** BatchDeleteEntitiesRequest parent */ + /** BatchUpdateIntentsRequest parent */ parent?: (string|null); - /** BatchDeleteEntitiesRequest entityValues */ - entityValues?: (string[]|null); + /** BatchUpdateIntentsRequest intentBatchUri */ + intentBatchUri?: (string|null); - /** BatchDeleteEntitiesRequest languageCode */ + /** BatchUpdateIntentsRequest intentBatchInline */ + intentBatchInline?: (google.cloud.dialogflow.v2beta1.IIntentBatch|null); + + /** BatchUpdateIntentsRequest languageCode */ languageCode?: (string|null); + + /** BatchUpdateIntentsRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** BatchUpdateIntentsRequest intentView */ + intentView?: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView|null); } - /** Represents a BatchDeleteEntitiesRequest. */ - class BatchDeleteEntitiesRequest implements IBatchDeleteEntitiesRequest { + /** Represents a BatchUpdateIntentsRequest. */ + class BatchUpdateIntentsRequest implements IBatchUpdateIntentsRequest { /** - * Constructs a new BatchDeleteEntitiesRequest. + * Constructs a new BatchUpdateIntentsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest); - /** BatchDeleteEntitiesRequest parent. */ + /** BatchUpdateIntentsRequest parent. */ public parent: string; - /** BatchDeleteEntitiesRequest entityValues. */ - public entityValues: string[]; + /** BatchUpdateIntentsRequest intentBatchUri. */ + public intentBatchUri: string; - /** BatchDeleteEntitiesRequest languageCode. */ + /** BatchUpdateIntentsRequest intentBatchInline. */ + public intentBatchInline?: (google.cloud.dialogflow.v2beta1.IIntentBatch|null); + + /** BatchUpdateIntentsRequest languageCode. */ public languageCode: string; + /** BatchUpdateIntentsRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** BatchUpdateIntentsRequest intentView. */ + public intentView: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView); + + /** BatchUpdateIntentsRequest intentBatch. */ + public intentBatch?: ("intentBatchUri"|"intentBatchInline"); + /** - * Creates a new BatchDeleteEntitiesRequest instance using the specified properties. + * Creates a new BatchUpdateIntentsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns BatchDeleteEntitiesRequest instance + * @returns BatchUpdateIntentsRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest): google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest; /** - * Encodes the specified BatchDeleteEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest.verify|verify} messages. - * @param message BatchDeleteEntitiesRequest message or plain object to encode + * Encodes the specified BatchUpdateIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.verify|verify} messages. + * @param message BatchUpdateIntentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchDeleteEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest.verify|verify} messages. - * @param message BatchDeleteEntitiesRequest message or plain object to encode + * Encodes the specified BatchUpdateIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.verify|verify} messages. + * @param message BatchUpdateIntentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer. + * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchDeleteEntitiesRequest + * @returns BatchUpdateIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest; /** - * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchDeleteEntitiesRequest + * @returns BatchUpdateIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest; /** - * Verifies a BatchDeleteEntitiesRequest message. + * Verifies a BatchUpdateIntentsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchDeleteEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchUpdateIntentsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchDeleteEntitiesRequest + * @returns BatchUpdateIntentsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest; /** - * Creates a plain object from a BatchDeleteEntitiesRequest message. Also converts values to other types if specified. - * @param message BatchDeleteEntitiesRequest + * Creates a plain object from a BatchUpdateIntentsRequest message. Also converts values to other types if specified. + * @param message BatchUpdateIntentsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchDeleteEntitiesRequest to JSON. + * Converts this BatchUpdateIntentsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an EntityTypeBatch. */ - interface IEntityTypeBatch { + /** Properties of a BatchUpdateIntentsResponse. */ + interface IBatchUpdateIntentsResponse { - /** EntityTypeBatch entityTypes */ - entityTypes?: (google.cloud.dialogflow.v2beta1.IEntityType[]|null); + /** BatchUpdateIntentsResponse intents */ + intents?: (google.cloud.dialogflow.v2beta1.IIntent[]|null); } - /** Represents an EntityTypeBatch. */ - class EntityTypeBatch implements IEntityTypeBatch { + /** Represents a BatchUpdateIntentsResponse. */ + class BatchUpdateIntentsResponse implements IBatchUpdateIntentsResponse { /** - * Constructs a new EntityTypeBatch. + * Constructs a new BatchUpdateIntentsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IEntityTypeBatch); + constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse); - /** EntityTypeBatch entityTypes. */ - public entityTypes: google.cloud.dialogflow.v2beta1.IEntityType[]; + /** BatchUpdateIntentsResponse intents. */ + public intents: google.cloud.dialogflow.v2beta1.IIntent[]; /** - * Creates a new EntityTypeBatch instance using the specified properties. + * Creates a new BatchUpdateIntentsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns EntityTypeBatch instance + * @returns BatchUpdateIntentsResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IEntityTypeBatch): google.cloud.dialogflow.v2beta1.EntityTypeBatch; + public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse; /** - * Encodes the specified EntityTypeBatch message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityTypeBatch.verify|verify} messages. - * @param message EntityTypeBatch message or plain object to encode + * Encodes the specified BatchUpdateIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.verify|verify} messages. + * @param message BatchUpdateIntentsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IEntityTypeBatch, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EntityTypeBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityTypeBatch.verify|verify} messages. - * @param message EntityTypeBatch message or plain object to encode + * Encodes the specified BatchUpdateIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.verify|verify} messages. + * @param message BatchUpdateIntentsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IEntityTypeBatch, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EntityTypeBatch message from the specified reader or buffer. + * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EntityTypeBatch + * @returns BatchUpdateIntentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.EntityTypeBatch; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse; /** - * Decodes an EntityTypeBatch message from the specified reader or buffer, length delimited. + * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EntityTypeBatch + * @returns BatchUpdateIntentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.EntityTypeBatch; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse; /** - * Verifies an EntityTypeBatch message. + * Verifies a BatchUpdateIntentsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an EntityTypeBatch message from a plain object. Also converts values to their respective internal types. + * Creates a BatchUpdateIntentsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EntityTypeBatch + * @returns BatchUpdateIntentsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.EntityTypeBatch; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse; /** - * Creates a plain object from an EntityTypeBatch message. Also converts values to other types if specified. - * @param message EntityTypeBatch + * Creates a plain object from a BatchUpdateIntentsResponse message. Also converts values to other types if specified. + * @param message BatchUpdateIntentsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.EntityTypeBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EntityTypeBatch to JSON. + * Converts this BatchUpdateIntentsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents an Intents */ - class Intents extends $protobuf.rpc.Service { - - /** - * Constructs a new Intents service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - - /** - * Creates new Intents service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Intents; - - /** - * Calls ListIntents. - * @param request ListIntentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListIntentsResponse - */ - public listIntents(request: google.cloud.dialogflow.v2beta1.IListIntentsRequest, callback: google.cloud.dialogflow.v2beta1.Intents.ListIntentsCallback): void; - - /** - * Calls ListIntents. - * @param request ListIntentsRequest message or plain object - * @returns Promise - */ - public listIntents(request: google.cloud.dialogflow.v2beta1.IListIntentsRequest): Promise; - - /** - * Calls GetIntent. - * @param request GetIntentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Intent - */ - public getIntent(request: google.cloud.dialogflow.v2beta1.IGetIntentRequest, callback: google.cloud.dialogflow.v2beta1.Intents.GetIntentCallback): void; - - /** - * Calls GetIntent. - * @param request GetIntentRequest message or plain object - * @returns Promise - */ - public getIntent(request: google.cloud.dialogflow.v2beta1.IGetIntentRequest): Promise; - - /** - * Calls CreateIntent. - * @param request CreateIntentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Intent - */ - public createIntent(request: google.cloud.dialogflow.v2beta1.ICreateIntentRequest, callback: google.cloud.dialogflow.v2beta1.Intents.CreateIntentCallback): void; - - /** - * Calls CreateIntent. - * @param request CreateIntentRequest message or plain object - * @returns Promise - */ - public createIntent(request: google.cloud.dialogflow.v2beta1.ICreateIntentRequest): Promise; - - /** - * Calls UpdateIntent. - * @param request UpdateIntentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Intent - */ - public updateIntent(request: google.cloud.dialogflow.v2beta1.IUpdateIntentRequest, callback: google.cloud.dialogflow.v2beta1.Intents.UpdateIntentCallback): void; + /** Properties of a BatchDeleteIntentsRequest. */ + interface IBatchDeleteIntentsRequest { - /** - * Calls UpdateIntent. - * @param request UpdateIntentRequest message or plain object - * @returns Promise - */ - public updateIntent(request: google.cloud.dialogflow.v2beta1.IUpdateIntentRequest): Promise; + /** BatchDeleteIntentsRequest parent */ + parent?: (string|null); - /** - * Calls DeleteIntent. - * @param request DeleteIntentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty - */ - public deleteIntent(request: google.cloud.dialogflow.v2beta1.IDeleteIntentRequest, callback: google.cloud.dialogflow.v2beta1.Intents.DeleteIntentCallback): void; + /** BatchDeleteIntentsRequest intents */ + intents?: (google.cloud.dialogflow.v2beta1.IIntent[]|null); + } - /** - * Calls DeleteIntent. - * @param request DeleteIntentRequest message or plain object - * @returns Promise - */ - public deleteIntent(request: google.cloud.dialogflow.v2beta1.IDeleteIntentRequest): Promise; + /** Represents a BatchDeleteIntentsRequest. */ + class BatchDeleteIntentsRequest implements IBatchDeleteIntentsRequest { /** - * Calls BatchUpdateIntents. - * @param request BatchUpdateIntentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation + * Constructs a new BatchDeleteIntentsRequest. + * @param [properties] Properties to set */ - public batchUpdateIntents(request: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, callback: google.cloud.dialogflow.v2beta1.Intents.BatchUpdateIntentsCallback): void; + constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest); - /** - * Calls BatchUpdateIntents. - * @param request BatchUpdateIntentsRequest message or plain object - * @returns Promise - */ - public batchUpdateIntents(request: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest): Promise; + /** BatchDeleteIntentsRequest parent. */ + public parent: string; - /** - * Calls BatchDeleteIntents. - * @param request BatchDeleteIntentsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public batchDeleteIntents(request: google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, callback: google.cloud.dialogflow.v2beta1.Intents.BatchDeleteIntentsCallback): void; + /** BatchDeleteIntentsRequest intents. */ + public intents: google.cloud.dialogflow.v2beta1.IIntent[]; /** - * Calls BatchDeleteIntents. - * @param request BatchDeleteIntentsRequest message or plain object - * @returns Promise + * Creates a new BatchDeleteIntentsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteIntentsRequest instance */ - public batchDeleteIntents(request: google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest): Promise; - } - - namespace Intents { + public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest): google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#listIntents}. - * @param error Error, if any - * @param [response] ListIntentsResponse + * Encodes the specified BatchDeleteIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.verify|verify} messages. + * @param message BatchDeleteIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type ListIntentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListIntentsResponse) => void; + public static encode(message: google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#getIntent}. - * @param error Error, if any - * @param [response] Intent + * Encodes the specified BatchDeleteIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.verify|verify} messages. + * @param message BatchDeleteIntentsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - type GetIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Intent) => void; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#createIntent}. - * @param error Error, if any - * @param [response] Intent + * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type CreateIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Intent) => void; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#updateIntent}. - * @param error Error, if any - * @param [response] Intent + * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type UpdateIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Intent) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#deleteIntent}. - * @param error Error, if any - * @param [response] Empty + * Verifies a BatchDeleteIntentsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type DeleteIntentCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#batchUpdateIntents}. - * @param error Error, if any - * @param [response] Operation + * Creates a BatchDeleteIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteIntentsRequest */ - type BatchUpdateIntentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#batchDeleteIntents}. - * @param error Error, if any - * @param [response] Operation + * Creates a plain object from a BatchDeleteIntentsRequest message. Also converts values to other types if specified. + * @param message BatchDeleteIntentsRequest + * @param [options] Conversion options + * @returns Plain object */ - type BatchDeleteIntentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of an Intent. */ - interface IIntent { - - /** Intent name */ - name?: (string|null); - - /** Intent displayName */ - displayName?: (string|null); - - /** Intent webhookState */ - webhookState?: (google.cloud.dialogflow.v2beta1.Intent.WebhookState|keyof typeof google.cloud.dialogflow.v2beta1.Intent.WebhookState|null); - - /** Intent priority */ - priority?: (number|null); - - /** Intent isFallback */ - isFallback?: (boolean|null); - - /** Intent mlEnabled */ - mlEnabled?: (boolean|null); - - /** Intent mlDisabled */ - mlDisabled?: (boolean|null); - - /** Intent endInteraction */ - endInteraction?: (boolean|null); - - /** Intent inputContextNames */ - inputContextNames?: (string[]|null); - - /** Intent events */ - events?: (string[]|null); - - /** Intent trainingPhrases */ - trainingPhrases?: (google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase[]|null); - - /** Intent action */ - action?: (string|null); - - /** Intent outputContexts */ - outputContexts?: (google.cloud.dialogflow.v2beta1.IContext[]|null); - - /** Intent resetContexts */ - resetContexts?: (boolean|null); - - /** Intent parameters */ - parameters?: (google.cloud.dialogflow.v2beta1.Intent.IParameter[]|null); - - /** Intent messages */ - messages?: (google.cloud.dialogflow.v2beta1.Intent.IMessage[]|null); - - /** Intent defaultResponsePlatforms */ - defaultResponsePlatforms?: (google.cloud.dialogflow.v2beta1.Intent.Message.Platform[]|null); - - /** Intent rootFollowupIntentName */ - rootFollowupIntentName?: (string|null); - - /** Intent parentFollowupIntentName */ - parentFollowupIntentName?: (string|null); - - /** Intent followupIntentInfo */ - followupIntentInfo?: (google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo[]|null); - } - - /** Represents an Intent. */ - class Intent implements IIntent { + public static toObject(message: google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Constructs a new Intent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IIntent); - - /** Intent name. */ - public name: string; - - /** Intent displayName. */ - public displayName: string; - - /** Intent webhookState. */ - public webhookState: (google.cloud.dialogflow.v2beta1.Intent.WebhookState|keyof typeof google.cloud.dialogflow.v2beta1.Intent.WebhookState); - - /** Intent priority. */ - public priority: number; - - /** Intent isFallback. */ - public isFallback: boolean; - - /** Intent mlEnabled. */ - public mlEnabled: boolean; - - /** Intent mlDisabled. */ - public mlDisabled: boolean; - - /** Intent endInteraction. */ - public endInteraction: boolean; - - /** Intent inputContextNames. */ - public inputContextNames: string[]; - - /** Intent events. */ - public events: string[]; - - /** Intent trainingPhrases. */ - public trainingPhrases: google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase[]; - - /** Intent action. */ - public action: string; - - /** Intent outputContexts. */ - public outputContexts: google.cloud.dialogflow.v2beta1.IContext[]; - - /** Intent resetContexts. */ - public resetContexts: boolean; - - /** Intent parameters. */ - public parameters: google.cloud.dialogflow.v2beta1.Intent.IParameter[]; + * Converts this BatchDeleteIntentsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Intent messages. */ - public messages: google.cloud.dialogflow.v2beta1.Intent.IMessage[]; + /** Properties of an IntentBatch. */ + interface IIntentBatch { - /** Intent defaultResponsePlatforms. */ - public defaultResponsePlatforms: google.cloud.dialogflow.v2beta1.Intent.Message.Platform[]; + /** IntentBatch intents */ + intents?: (google.cloud.dialogflow.v2beta1.IIntent[]|null); + } - /** Intent rootFollowupIntentName. */ - public rootFollowupIntentName: string; + /** Represents an IntentBatch. */ + class IntentBatch implements IIntentBatch { - /** Intent parentFollowupIntentName. */ - public parentFollowupIntentName: string; + /** + * Constructs a new IntentBatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IIntentBatch); - /** Intent followupIntentInfo. */ - public followupIntentInfo: google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo[]; + /** IntentBatch intents. */ + public intents: google.cloud.dialogflow.v2beta1.IIntent[]; /** - * Creates a new Intent instance using the specified properties. + * Creates a new IntentBatch instance using the specified properties. * @param [properties] Properties to set - * @returns Intent instance + * @returns IntentBatch instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IIntent): google.cloud.dialogflow.v2beta1.Intent; + public static create(properties?: google.cloud.dialogflow.v2beta1.IIntentBatch): google.cloud.dialogflow.v2beta1.IntentBatch; /** - * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.verify|verify} messages. - * @param message Intent message or plain object to encode + * Encodes the specified IntentBatch message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.IntentBatch.verify|verify} messages. + * @param message IntentBatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IIntentBatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.verify|verify} messages. - * @param message Intent message or plain object to encode + * Encodes the specified IntentBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.IntentBatch.verify|verify} messages. + * @param message IntentBatch message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IIntent, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IIntentBatch, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an Intent message from the specified reader or buffer. + * Decodes an IntentBatch message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Intent + * @returns IntentBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.IntentBatch; /** - * Decodes an Intent message from the specified reader or buffer, length delimited. + * Decodes an IntentBatch message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Intent + * @returns IntentBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.IntentBatch; /** - * Verifies an Intent message. + * Verifies an IntentBatch message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an Intent message from a plain object. Also converts values to their respective internal types. + * Creates an IntentBatch message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Intent + * @returns IntentBatch */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.IntentBatch; /** - * Creates a plain object from an Intent message. Also converts values to other types if specified. - * @param message Intent + * Creates a plain object from an IntentBatch message. Also converts values to other types if specified. + * @param message IntentBatch * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.IntentBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Intent to JSON. + * Converts this IntentBatch to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace Intent { - - /** Properties of a TrainingPhrase. */ - interface ITrainingPhrase { - - /** TrainingPhrase name */ - name?: (string|null); - - /** TrainingPhrase type */ - type?: (google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type|keyof typeof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type|null); - - /** TrainingPhrase parts */ - parts?: (google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart[]|null); - - /** TrainingPhrase timesAddedCount */ - timesAddedCount?: (number|null); - } - - /** Represents a TrainingPhrase. */ - class TrainingPhrase implements ITrainingPhrase { - - /** - * Constructs a new TrainingPhrase. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase); - - /** TrainingPhrase name. */ - public name: string; - - /** TrainingPhrase type. */ - public type: (google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type|keyof typeof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type); - - /** TrainingPhrase parts. */ - public parts: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart[]; - - /** TrainingPhrase timesAddedCount. */ - public timesAddedCount: number; - - /** - * Creates a new TrainingPhrase instance using the specified properties. - * @param [properties] Properties to set - * @returns TrainingPhrase instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase; - - /** - * Encodes the specified TrainingPhrase message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.verify|verify} messages. - * @param message TrainingPhrase message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TrainingPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.verify|verify} messages. - * @param message TrainingPhrase message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TrainingPhrase message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TrainingPhrase - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase; - - /** - * Decodes a TrainingPhrase message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TrainingPhrase - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase; - - /** - * Verifies a TrainingPhrase message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TrainingPhrase message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TrainingPhrase - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase; - - /** - * Creates a plain object from a TrainingPhrase message. Also converts values to other types if specified. - * @param message TrainingPhrase - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TrainingPhrase to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace TrainingPhrase { - - /** Properties of a Part. */ - interface IPart { - - /** Part text */ - text?: (string|null); - - /** Part entityType */ - entityType?: (string|null); - - /** Part alias */ - alias?: (string|null); - - /** Part userDefined */ - userDefined?: (boolean|null); - } - - /** Represents a Part. */ - class Part implements IPart { - - /** - * Constructs a new Part. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart); - - /** Part text. */ - public text: string; - - /** Part entityType. */ - public entityType: string; - - /** Part alias. */ - public alias: string; - - /** Part userDefined. */ - public userDefined: boolean; - - /** - * Creates a new Part instance using the specified properties. - * @param [properties] Properties to set - * @returns Part instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part; - - /** - * Encodes the specified Part message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.verify|verify} messages. - * @param message Part message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.verify|verify} messages. - * @param message Part message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Part message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part; - - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part; - - /** - * Verifies a Part message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Part - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part; + /** IntentView enum. */ + enum IntentView { + INTENT_VIEW_UNSPECIFIED = 0, + INTENT_VIEW_FULL = 1 + } - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @param message Part - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a SessionEntityTypes */ + class SessionEntityTypes extends $protobuf.rpc.Service { - /** - * Converts this Part to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new SessionEntityTypes service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - EXAMPLE = 1, - TEMPLATE = 2 - } - } + /** + * Creates new SessionEntityTypes service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SessionEntityTypes; - /** Properties of a Parameter. */ - interface IParameter { + /** + * Calls ListSessionEntityTypes. + * @param request ListSessionEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListSessionEntityTypesResponse + */ + public listSessionEntityTypes(request: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, callback: google.cloud.dialogflow.v2beta1.SessionEntityTypes.ListSessionEntityTypesCallback): void; - /** Parameter name */ - name?: (string|null); + /** + * Calls ListSessionEntityTypes. + * @param request ListSessionEntityTypesRequest message or plain object + * @returns Promise + */ + public listSessionEntityTypes(request: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest): Promise; - /** Parameter displayName */ - displayName?: (string|null); + /** + * Calls GetSessionEntityType. + * @param request GetSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionEntityType + */ + public getSessionEntityType(request: google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.SessionEntityTypes.GetSessionEntityTypeCallback): void; - /** Parameter value */ - value?: (string|null); + /** + * Calls GetSessionEntityType. + * @param request GetSessionEntityTypeRequest message or plain object + * @returns Promise + */ + public getSessionEntityType(request: google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest): Promise; - /** Parameter defaultValue */ - defaultValue?: (string|null); + /** + * Calls CreateSessionEntityType. + * @param request CreateSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionEntityType + */ + public createSessionEntityType(request: google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.SessionEntityTypes.CreateSessionEntityTypeCallback): void; - /** Parameter entityTypeDisplayName */ - entityTypeDisplayName?: (string|null); + /** + * Calls CreateSessionEntityType. + * @param request CreateSessionEntityTypeRequest message or plain object + * @returns Promise + */ + public createSessionEntityType(request: google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest): Promise; - /** Parameter mandatory */ - mandatory?: (boolean|null); + /** + * Calls UpdateSessionEntityType. + * @param request UpdateSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and SessionEntityType + */ + public updateSessionEntityType(request: google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.SessionEntityTypes.UpdateSessionEntityTypeCallback): void; - /** Parameter prompts */ - prompts?: (string[]|null); + /** + * Calls UpdateSessionEntityType. + * @param request UpdateSessionEntityTypeRequest message or plain object + * @returns Promise + */ + public updateSessionEntityType(request: google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest): Promise; - /** Parameter isList */ - isList?: (boolean|null); - } + /** + * Calls DeleteSessionEntityType. + * @param request DeleteSessionEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteSessionEntityType(request: google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.SessionEntityTypes.DeleteSessionEntityTypeCallback): void; - /** Represents a Parameter. */ - class Parameter implements IParameter { + /** + * Calls DeleteSessionEntityType. + * @param request DeleteSessionEntityTypeRequest message or plain object + * @returns Promise + */ + public deleteSessionEntityType(request: google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest): Promise; + } - /** - * Constructs a new Parameter. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.IParameter); + namespace SessionEntityTypes { - /** Parameter name. */ - public name: string; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#listSessionEntityTypes}. + * @param error Error, if any + * @param [response] ListSessionEntityTypesResponse + */ + type ListSessionEntityTypesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse) => void; - /** Parameter displayName. */ - public displayName: string; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#getSessionEntityType}. + * @param error Error, if any + * @param [response] SessionEntityType + */ + type GetSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.SessionEntityType) => void; - /** Parameter value. */ - public value: string; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#createSessionEntityType}. + * @param error Error, if any + * @param [response] SessionEntityType + */ + type CreateSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.SessionEntityType) => void; - /** Parameter defaultValue. */ - public defaultValue: string; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#updateSessionEntityType}. + * @param error Error, if any + * @param [response] SessionEntityType + */ + type UpdateSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.SessionEntityType) => void; - /** Parameter entityTypeDisplayName. */ - public entityTypeDisplayName: string; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#deleteSessionEntityType}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteSessionEntityTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } - /** Parameter mandatory. */ - public mandatory: boolean; + /** Properties of a SessionEntityType. */ + interface ISessionEntityType { - /** Parameter prompts. */ - public prompts: string[]; + /** SessionEntityType name */ + name?: (string|null); - /** Parameter isList. */ - public isList: boolean; + /** SessionEntityType entityOverrideMode */ + entityOverrideMode?: (google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode|keyof typeof google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode|null); - /** - * Creates a new Parameter instance using the specified properties. - * @param [properties] Properties to set - * @returns Parameter instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.IParameter): google.cloud.dialogflow.v2beta1.Intent.Parameter; + /** SessionEntityType entities */ + entities?: (google.cloud.dialogflow.v2beta1.EntityType.IEntity[]|null); + } - /** - * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Parameter.verify|verify} messages. - * @param message Parameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a SessionEntityType. */ + class SessionEntityType implements ISessionEntityType { - /** - * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Parameter.verify|verify} messages. - * @param message Parameter message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.IParameter, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new SessionEntityType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ISessionEntityType); - /** - * Decodes a Parameter message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Parameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Parameter; + /** SessionEntityType name. */ + public name: string; - /** - * Decodes a Parameter message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Parameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Parameter; + /** SessionEntityType entityOverrideMode. */ + public entityOverrideMode: (google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode|keyof typeof google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode); - /** - * Verifies a Parameter message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** SessionEntityType entities. */ + public entities: google.cloud.dialogflow.v2beta1.EntityType.IEntity[]; - /** - * Creates a Parameter message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Parameter - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Parameter; + /** + * Creates a new SessionEntityType instance using the specified properties. + * @param [properties] Properties to set + * @returns SessionEntityType instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ISessionEntityType): google.cloud.dialogflow.v2beta1.SessionEntityType; - /** - * Creates a plain object from a Parameter message. Also converts values to other types if specified. - * @param message Parameter - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Parameter, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified SessionEntityType message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SessionEntityType.verify|verify} messages. + * @param message SessionEntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ISessionEntityType, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this Parameter to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified SessionEntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SessionEntityType.verify|verify} messages. + * @param message SessionEntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISessionEntityType, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a Message. */ - interface IMessage { + /** + * Decodes a SessionEntityType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SessionEntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SessionEntityType; - /** Message text */ - text?: (google.cloud.dialogflow.v2beta1.Intent.Message.IText|null); + /** + * Decodes a SessionEntityType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SessionEntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SessionEntityType; - /** Message image */ - image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** + * Verifies a SessionEntityType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Message quickReplies */ - quickReplies?: (google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies|null); + /** + * Creates a SessionEntityType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SessionEntityType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SessionEntityType; - /** Message card */ - card?: (google.cloud.dialogflow.v2beta1.Intent.Message.ICard|null); + /** + * Creates a plain object from a SessionEntityType message. Also converts values to other types if specified. + * @param message SessionEntityType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.SessionEntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Message payload */ - payload?: (google.protobuf.IStruct|null); + /** + * Converts this SessionEntityType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Message simpleResponses */ - simpleResponses?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses|null); + namespace SessionEntityType { - /** Message basicCard */ - basicCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard|null); + /** EntityOverrideMode enum. */ + enum EntityOverrideMode { + ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0, + ENTITY_OVERRIDE_MODE_OVERRIDE = 1, + ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2 + } + } - /** Message suggestions */ - suggestions?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions|null); + /** Properties of a ListSessionEntityTypesRequest. */ + interface IListSessionEntityTypesRequest { - /** Message linkOutSuggestion */ - linkOutSuggestion?: (google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion|null); + /** ListSessionEntityTypesRequest parent */ + parent?: (string|null); - /** Message listSelect */ - listSelect?: (google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect|null); + /** ListSessionEntityTypesRequest pageSize */ + pageSize?: (number|null); - /** Message carouselSelect */ - carouselSelect?: (google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect|null); + /** ListSessionEntityTypesRequest pageToken */ + pageToken?: (string|null); + } - /** Message telephonyPlayAudio */ - telephonyPlayAudio?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio|null); + /** Represents a ListSessionEntityTypesRequest. */ + class ListSessionEntityTypesRequest implements IListSessionEntityTypesRequest { - /** Message telephonySynthesizeSpeech */ - telephonySynthesizeSpeech?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech|null); + /** + * Constructs a new ListSessionEntityTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest); - /** Message telephonyTransferCall */ - telephonyTransferCall?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall|null); + /** ListSessionEntityTypesRequest parent. */ + public parent: string; - /** Message rbmText */ - rbmText?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText|null); + /** ListSessionEntityTypesRequest pageSize. */ + public pageSize: number; - /** Message rbmStandaloneRichCard */ - rbmStandaloneRichCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard|null); + /** ListSessionEntityTypesRequest pageToken. */ + public pageToken: string; - /** Message rbmCarouselRichCard */ - rbmCarouselRichCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard|null); + /** + * Creates a new ListSessionEntityTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionEntityTypesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest; - /** Message browseCarouselCard */ - browseCarouselCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard|null); + /** + * Encodes the specified ListSessionEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest.verify|verify} messages. + * @param message ListSessionEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Message tableCard */ - tableCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard|null); + /** + * Encodes the specified ListSessionEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest.verify|verify} messages. + * @param message ListSessionEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Message mediaContent */ - mediaContent?: (google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent|null); + /** + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest; - /** Message platform */ - platform?: (google.cloud.dialogflow.v2beta1.Intent.Message.Platform|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.Platform|null); - } + /** + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest; - /** Represents a Message. */ - class Message implements IMessage { + /** + * Verifies a ListSessionEntityTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new Message. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.IMessage); + /** + * Creates a ListSessionEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionEntityTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest; - /** Message text. */ - public text?: (google.cloud.dialogflow.v2beta1.Intent.Message.IText|null); + /** + * Creates a plain object from a ListSessionEntityTypesRequest message. Also converts values to other types if specified. + * @param message ListSessionEntityTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Message image. */ - public image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** + * Converts this ListSessionEntityTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Message quickReplies. */ - public quickReplies?: (google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies|null); + /** Properties of a ListSessionEntityTypesResponse. */ + interface IListSessionEntityTypesResponse { - /** Message card. */ - public card?: (google.cloud.dialogflow.v2beta1.Intent.Message.ICard|null); + /** ListSessionEntityTypesResponse sessionEntityTypes */ + sessionEntityTypes?: (google.cloud.dialogflow.v2beta1.ISessionEntityType[]|null); - /** Message payload. */ - public payload?: (google.protobuf.IStruct|null); + /** ListSessionEntityTypesResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** Message simpleResponses. */ - public simpleResponses?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses|null); + /** Represents a ListSessionEntityTypesResponse. */ + class ListSessionEntityTypesResponse implements IListSessionEntityTypesResponse { - /** Message basicCard. */ - public basicCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard|null); + /** + * Constructs a new ListSessionEntityTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse); - /** Message suggestions. */ - public suggestions?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions|null); + /** ListSessionEntityTypesResponse sessionEntityTypes. */ + public sessionEntityTypes: google.cloud.dialogflow.v2beta1.ISessionEntityType[]; - /** Message linkOutSuggestion. */ - public linkOutSuggestion?: (google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion|null); + /** ListSessionEntityTypesResponse nextPageToken. */ + public nextPageToken: string; - /** Message listSelect. */ - public listSelect?: (google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect|null); + /** + * Creates a new ListSessionEntityTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListSessionEntityTypesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse; - /** Message carouselSelect. */ - public carouselSelect?: (google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect|null); + /** + * Encodes the specified ListSessionEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse.verify|verify} messages. + * @param message ListSessionEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Message telephonyPlayAudio. */ - public telephonyPlayAudio?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio|null); + /** + * Encodes the specified ListSessionEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse.verify|verify} messages. + * @param message ListSessionEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Message telephonySynthesizeSpeech. */ - public telephonySynthesizeSpeech?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech|null); + /** + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListSessionEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse; - /** Message telephonyTransferCall. */ - public telephonyTransferCall?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall|null); + /** + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListSessionEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse; - /** Message rbmText. */ - public rbmText?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText|null); + /** + * Verifies a ListSessionEntityTypesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Message rbmStandaloneRichCard. */ - public rbmStandaloneRichCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard|null); + /** + * Creates a ListSessionEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListSessionEntityTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse; - /** Message rbmCarouselRichCard. */ - public rbmCarouselRichCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard|null); + /** + * Creates a plain object from a ListSessionEntityTypesResponse message. Also converts values to other types if specified. + * @param message ListSessionEntityTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Message browseCarouselCard. */ - public browseCarouselCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard|null); + /** + * Converts this ListSessionEntityTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Message tableCard. */ - public tableCard?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard|null); + /** Properties of a GetSessionEntityTypeRequest. */ + interface IGetSessionEntityTypeRequest { - /** Message mediaContent. */ - public mediaContent?: (google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent|null); + /** GetSessionEntityTypeRequest name */ + name?: (string|null); + } - /** Message platform. */ - public platform: (google.cloud.dialogflow.v2beta1.Intent.Message.Platform|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.Platform); + /** Represents a GetSessionEntityTypeRequest. */ + class GetSessionEntityTypeRequest implements IGetSessionEntityTypeRequest { - /** Message message. */ - public message?: ("text"|"image"|"quickReplies"|"card"|"payload"|"simpleResponses"|"basicCard"|"suggestions"|"linkOutSuggestion"|"listSelect"|"carouselSelect"|"telephonyPlayAudio"|"telephonySynthesizeSpeech"|"telephonyTransferCall"|"rbmText"|"rbmStandaloneRichCard"|"rbmCarouselRichCard"|"browseCarouselCard"|"tableCard"|"mediaContent"); + /** + * Constructs a new GetSessionEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest); - /** - * Creates a new Message instance using the specified properties. - * @param [properties] Properties to set - * @returns Message instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.IMessage): google.cloud.dialogflow.v2beta1.Intent.Message; + /** GetSessionEntityTypeRequest name. */ + public name: string; - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new GetSessionEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetSessionEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest): google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest; - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.verify|verify} messages. - * @param message Message message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.IMessage, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified GetSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest.verify|verify} messages. + * @param message GetSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Message message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message; + /** + * Encodes the specified GetSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest.verify|verify} messages. + * @param message GetSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message; + /** + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest; - /** - * Verifies a Message message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest; - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Message - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message; + /** + * Verifies a GetSessionEntityTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @param message Message - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a GetSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetSessionEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest; - /** - * Converts this Message to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a GetSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message GetSessionEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - namespace Message { + /** + * Converts this GetSessionEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a Text. */ - interface IText { + /** Properties of a CreateSessionEntityTypeRequest. */ + interface ICreateSessionEntityTypeRequest { - /** Text text */ - text?: (string[]|null); - } + /** CreateSessionEntityTypeRequest parent */ + parent?: (string|null); + + /** CreateSessionEntityTypeRequest sessionEntityType */ + sessionEntityType?: (google.cloud.dialogflow.v2beta1.ISessionEntityType|null); + } + + /** Represents a CreateSessionEntityTypeRequest. */ + class CreateSessionEntityTypeRequest implements ICreateSessionEntityTypeRequest { - /** Represents a Text. */ - class Text implements IText { + /** + * Constructs a new CreateSessionEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest); - /** - * Constructs a new Text. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IText); + /** CreateSessionEntityTypeRequest parent. */ + public parent: string; - /** Text text. */ - public text: string[]; + /** CreateSessionEntityTypeRequest sessionEntityType. */ + public sessionEntityType?: (google.cloud.dialogflow.v2beta1.ISessionEntityType|null); - /** - * Creates a new Text instance using the specified properties. - * @param [properties] Properties to set - * @returns Text instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IText): google.cloud.dialogflow.v2beta1.Intent.Message.Text; + /** + * Creates a new CreateSessionEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateSessionEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest): google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest; - /** - * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Text.verify|verify} messages. - * @param message Text message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IText, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified CreateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest.verify|verify} messages. + * @param message CreateSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Text.verify|verify} messages. - * @param message Text message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IText, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified CreateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest.verify|verify} messages. + * @param message CreateSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a Text message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Text - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.Text; + /** + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest; - /** - * Decodes a Text message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Text - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.Text; + /** + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest; - /** - * Verifies a Text message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies a CreateSessionEntityTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a Text message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Text - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.Text; + /** + * Creates a CreateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateSessionEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest; - /** - * Creates a plain object from a Text message. Also converts values to other types if specified. - * @param message Text - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.Text, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from a CreateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message CreateSessionEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this Text to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this CreateSessionEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of an Image. */ - interface IImage { + /** Properties of an UpdateSessionEntityTypeRequest. */ + interface IUpdateSessionEntityTypeRequest { - /** Image imageUri */ - imageUri?: (string|null); + /** UpdateSessionEntityTypeRequest sessionEntityType */ + sessionEntityType?: (google.cloud.dialogflow.v2beta1.ISessionEntityType|null); - /** Image accessibilityText */ - accessibilityText?: (string|null); - } + /** UpdateSessionEntityTypeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** Represents an Image. */ - class Image implements IImage { + /** Represents an UpdateSessionEntityTypeRequest. */ + class UpdateSessionEntityTypeRequest implements IUpdateSessionEntityTypeRequest { - /** - * Constructs a new Image. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IImage); + /** + * Constructs a new UpdateSessionEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest); - /** Image imageUri. */ - public imageUri: string; + /** UpdateSessionEntityTypeRequest sessionEntityType. */ + public sessionEntityType?: (google.cloud.dialogflow.v2beta1.ISessionEntityType|null); - /** Image accessibilityText. */ - public accessibilityText: string; + /** UpdateSessionEntityTypeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** - * Creates a new Image instance using the specified properties. - * @param [properties] Properties to set - * @returns Image instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IImage): google.cloud.dialogflow.v2beta1.Intent.Message.Image; + /** + * Creates a new UpdateSessionEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateSessionEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest): google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest; - /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify|verify} messages. - * @param message Image message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified UpdateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @param message UpdateSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify|verify} messages. - * @param message Image message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IImage, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified UpdateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @param message UpdateSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an Image message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.Image; + /** + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest; - /** - * Decodes an Image message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.Image; + /** + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest; - /** - * Verifies an Image message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Verifies an UpdateSessionEntityTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates an Image message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Image - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.Image; + /** + * Creates an UpdateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateSessionEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest; - /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @param message Image - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.Image, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a plain object from an UpdateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message UpdateSessionEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Converts this Image to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Converts this UpdateSessionEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a QuickReplies. */ - interface IQuickReplies { + /** Properties of a DeleteSessionEntityTypeRequest. */ + interface IDeleteSessionEntityTypeRequest { - /** QuickReplies title */ - title?: (string|null); + /** DeleteSessionEntityTypeRequest name */ + name?: (string|null); + } - /** QuickReplies quickReplies */ - quickReplies?: (string[]|null); - } + /** Represents a DeleteSessionEntityTypeRequest. */ + class DeleteSessionEntityTypeRequest implements IDeleteSessionEntityTypeRequest { - /** Represents a QuickReplies. */ - class QuickReplies implements IQuickReplies { + /** + * Constructs a new DeleteSessionEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest); - /** - * Constructs a new QuickReplies. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies); + /** DeleteSessionEntityTypeRequest name. */ + public name: string; - /** QuickReplies title. */ - public title: string; + /** + * Creates a new DeleteSessionEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteSessionEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest): google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest; - /** QuickReplies quickReplies. */ - public quickReplies: string[]; + /** + * Encodes the specified DeleteSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @param message DeleteSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new QuickReplies instance using the specified properties. - * @param [properties] Properties to set - * @returns QuickReplies instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies): google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies; + /** + * Encodes the specified DeleteSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @param message DeleteSessionEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified QuickReplies message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.verify|verify} messages. - * @param message QuickReplies message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest; - /** - * Encodes the specified QuickReplies message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.verify|verify} messages. - * @param message QuickReplies message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest; - /** - * Decodes a QuickReplies message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuickReplies - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies; + /** + * Verifies a DeleteSessionEntityTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a QuickReplies message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuickReplies - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies; + /** + * Creates a DeleteSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteSessionEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest; - /** - * Verifies a QuickReplies message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from a DeleteSessionEntityTypeRequest message. Also converts values to other types if specified. + * @param message DeleteSessionEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a QuickReplies message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuickReplies - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies; + /** + * Converts this DeleteSessionEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a QuickReplies message. Also converts values to other types if specified. - * @param message QuickReplies - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents an EntityTypes */ + class EntityTypes extends $protobuf.rpc.Service { - /** - * Converts this QuickReplies to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new EntityTypes service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** Properties of a Card. */ - interface ICard { + /** + * Creates new EntityTypes service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): EntityTypes; - /** Card title */ - title?: (string|null); + /** + * Calls ListEntityTypes. + * @param request ListEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListEntityTypesResponse + */ + public listEntityTypes(request: google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.ListEntityTypesCallback): void; - /** Card subtitle */ - subtitle?: (string|null); + /** + * Calls ListEntityTypes. + * @param request ListEntityTypesRequest message or plain object + * @returns Promise + */ + public listEntityTypes(request: google.cloud.dialogflow.v2beta1.IListEntityTypesRequest): Promise; - /** Card imageUri */ - imageUri?: (string|null); + /** + * Calls GetEntityType. + * @param request GetEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EntityType + */ + public getEntityType(request: google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.GetEntityTypeCallback): void; - /** Card buttons */ - buttons?: (google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton[]|null); - } + /** + * Calls GetEntityType. + * @param request GetEntityTypeRequest message or plain object + * @returns Promise + */ + public getEntityType(request: google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest): Promise; - /** Represents a Card. */ - class Card implements ICard { + /** + * Calls CreateEntityType. + * @param request CreateEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EntityType + */ + public createEntityType(request: google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.CreateEntityTypeCallback): void; - /** - * Constructs a new Card. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ICard); + /** + * Calls CreateEntityType. + * @param request CreateEntityTypeRequest message or plain object + * @returns Promise + */ + public createEntityType(request: google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest): Promise; - /** Card title. */ - public title: string; + /** + * Calls UpdateEntityType. + * @param request UpdateEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and EntityType + */ + public updateEntityType(request: google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.UpdateEntityTypeCallback): void; - /** Card subtitle. */ - public subtitle: string; + /** + * Calls UpdateEntityType. + * @param request UpdateEntityTypeRequest message or plain object + * @returns Promise + */ + public updateEntityType(request: google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest): Promise; - /** Card imageUri. */ - public imageUri: string; + /** + * Calls DeleteEntityType. + * @param request DeleteEntityTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteEntityType(request: google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.DeleteEntityTypeCallback): void; - /** Card buttons. */ - public buttons: google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton[]; + /** + * Calls DeleteEntityType. + * @param request DeleteEntityTypeRequest message or plain object + * @returns Promise + */ + public deleteEntityType(request: google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest): Promise; - /** - * Creates a new Card instance using the specified properties. - * @param [properties] Properties to set - * @returns Card instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ICard): google.cloud.dialogflow.v2beta1.Intent.Message.Card; + /** + * Calls BatchUpdateEntityTypes. + * @param request BatchUpdateEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchUpdateEntityTypes(request: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.BatchUpdateEntityTypesCallback): void; - /** - * Encodes the specified Card message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.verify|verify} messages. - * @param message Card message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ICard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls BatchUpdateEntityTypes. + * @param request BatchUpdateEntityTypesRequest message or plain object + * @returns Promise + */ + public batchUpdateEntityTypes(request: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest): Promise; - /** - * Encodes the specified Card message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.verify|verify} messages. - * @param message Card message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ICard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls BatchDeleteEntityTypes. + * @param request BatchDeleteEntityTypesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchDeleteEntityTypes(request: google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntityTypesCallback): void; - /** - * Decodes a Card message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Card - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.Card; + /** + * Calls BatchDeleteEntityTypes. + * @param request BatchDeleteEntityTypesRequest message or plain object + * @returns Promise + */ + public batchDeleteEntityTypes(request: google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest): Promise; - /** - * Decodes a Card message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Card - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.Card; + /** + * Calls BatchCreateEntities. + * @param request BatchCreateEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchCreateEntities(request: google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.BatchCreateEntitiesCallback): void; - /** - * Verifies a Card message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Calls BatchCreateEntities. + * @param request BatchCreateEntitiesRequest message or plain object + * @returns Promise + */ + public batchCreateEntities(request: google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest): Promise; - /** - * Creates a Card message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Card - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.Card; + /** + * Calls BatchUpdateEntities. + * @param request BatchUpdateEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchUpdateEntities(request: google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.BatchUpdateEntitiesCallback): void; - /** - * Creates a plain object from a Card message. Also converts values to other types if specified. - * @param message Card - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.Card, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Calls BatchUpdateEntities. + * @param request BatchUpdateEntitiesRequest message or plain object + * @returns Promise + */ + public batchUpdateEntities(request: google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest): Promise; - /** - * Converts this Card to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Calls BatchDeleteEntities. + * @param request BatchDeleteEntitiesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public batchDeleteEntities(request: google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, callback: google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntitiesCallback): void; - namespace Card { + /** + * Calls BatchDeleteEntities. + * @param request BatchDeleteEntitiesRequest message or plain object + * @returns Promise + */ + public batchDeleteEntities(request: google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest): Promise; + } - /** Properties of a Button. */ - interface IButton { + namespace EntityTypes { - /** Button text */ - text?: (string|null); + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#listEntityTypes}. + * @param error Error, if any + * @param [response] ListEntityTypesResponse + */ + type ListEntityTypesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListEntityTypesResponse) => void; - /** Button postback */ - postback?: (string|null); - } + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#getEntityType}. + * @param error Error, if any + * @param [response] EntityType + */ + type GetEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.EntityType) => void; - /** Represents a Button. */ - class Button implements IButton { + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#createEntityType}. + * @param error Error, if any + * @param [response] EntityType + */ + type CreateEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.EntityType) => void; - /** - * Constructs a new Button. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton); + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#updateEntityType}. + * @param error Error, if any + * @param [response] EntityType + */ + type UpdateEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.EntityType) => void; - /** Button text. */ - public text: string; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#deleteEntityType}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteEntityTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** Button postback. */ - public postback: string; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchUpdateEntityTypes}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchUpdateEntityTypesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** - * Creates a new Button instance using the specified properties. - * @param [properties] Properties to set - * @returns Button instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton): google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchDeleteEntityTypes}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchDeleteEntityTypesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** - * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.verify|verify} messages. - * @param message Button message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchCreateEntities}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchCreateEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** - * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.verify|verify} messages. - * @param message Button message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchUpdateEntities}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchUpdateEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - /** - * Decodes a Button message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchDeleteEntities}. + * @param error Error, if any + * @param [response] Operation + */ + type BatchDeleteEntitiesCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } - /** - * Decodes a Button message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button; + /** Properties of an EntityType. */ + interface IEntityType { - /** - * Verifies a Button message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** EntityType name */ + name?: (string|null); - /** - * Creates a Button message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Button - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button; + /** EntityType displayName */ + displayName?: (string|null); - /** - * Creates a plain object from a Button message. Also converts values to other types if specified. - * @param message Button - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** EntityType kind */ + kind?: (google.cloud.dialogflow.v2beta1.EntityType.Kind|keyof typeof google.cloud.dialogflow.v2beta1.EntityType.Kind|null); - /** - * Converts this Button to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** EntityType autoExpansionMode */ + autoExpansionMode?: (google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode|keyof typeof google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode|null); - /** Properties of a SimpleResponse. */ - interface ISimpleResponse { + /** EntityType entities */ + entities?: (google.cloud.dialogflow.v2beta1.EntityType.IEntity[]|null); - /** SimpleResponse textToSpeech */ - textToSpeech?: (string|null); + /** EntityType enableFuzzyExtraction */ + enableFuzzyExtraction?: (boolean|null); + } - /** SimpleResponse ssml */ - ssml?: (string|null); + /** Represents an EntityType. */ + class EntityType implements IEntityType { - /** SimpleResponse displayText */ - displayText?: (string|null); - } + /** + * Constructs a new EntityType. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IEntityType); - /** Represents a SimpleResponse. */ - class SimpleResponse implements ISimpleResponse { + /** EntityType name. */ + public name: string; - /** - * Constructs a new SimpleResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse); + /** EntityType displayName. */ + public displayName: string; - /** SimpleResponse textToSpeech. */ - public textToSpeech: string; + /** EntityType kind. */ + public kind: (google.cloud.dialogflow.v2beta1.EntityType.Kind|keyof typeof google.cloud.dialogflow.v2beta1.EntityType.Kind); - /** SimpleResponse ssml. */ - public ssml: string; + /** EntityType autoExpansionMode. */ + public autoExpansionMode: (google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode|keyof typeof google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode); - /** SimpleResponse displayText. */ - public displayText: string; + /** EntityType entities. */ + public entities: google.cloud.dialogflow.v2beta1.EntityType.IEntity[]; - /** - * Creates a new SimpleResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns SimpleResponse instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse; + /** EntityType enableFuzzyExtraction. */ + public enableFuzzyExtraction: boolean; - /** - * Encodes the specified SimpleResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.verify|verify} messages. - * @param message SimpleResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new EntityType instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityType instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IEntityType): google.cloud.dialogflow.v2beta1.EntityType; - /** - * Encodes the specified SimpleResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.verify|verify} messages. - * @param message SimpleResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.verify|verify} messages. + * @param message EntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a SimpleResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SimpleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse; + /** + * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.verify|verify} messages. + * @param message EntityType message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IEntityType, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a SimpleResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SimpleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse; + /** + * Decodes an EntityType message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.EntityType; - /** - * Verifies a SimpleResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes an EntityType message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.EntityType; - /** - * Creates a SimpleResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SimpleResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse; + /** + * Verifies an EntityType message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a SimpleResponse message. Also converts values to other types if specified. - * @param message SimpleResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates an EntityType message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityType + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.EntityType; - /** - * Converts this SimpleResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * @param message EntityType + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.EntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Properties of a SimpleResponses. */ - interface ISimpleResponses { + /** + * Converts this EntityType to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** SimpleResponses simpleResponses */ - simpleResponses?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse[]|null); - } + namespace EntityType { - /** Represents a SimpleResponses. */ - class SimpleResponses implements ISimpleResponses { + /** Properties of an Entity. */ + interface IEntity { - /** - * Constructs a new SimpleResponses. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses); + /** Entity value */ + value?: (string|null); - /** SimpleResponses simpleResponses. */ - public simpleResponses: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse[]; + /** Entity synonyms */ + synonyms?: (string[]|null); + } - /** - * Creates a new SimpleResponses instance using the specified properties. - * @param [properties] Properties to set - * @returns SimpleResponses instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses; + /** Represents an Entity. */ + class Entity implements IEntity { - /** - * Encodes the specified SimpleResponses message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.verify|verify} messages. - * @param message SimpleResponses message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new Entity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.EntityType.IEntity); - /** - * Encodes the specified SimpleResponses message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.verify|verify} messages. - * @param message SimpleResponses message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses, writer?: $protobuf.Writer): $protobuf.Writer; + /** Entity value. */ + public value: string; - /** - * Decodes a SimpleResponses message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SimpleResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses; + /** Entity synonyms. */ + public synonyms: string[]; - /** - * Decodes a SimpleResponses message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SimpleResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses; + /** + * Creates a new Entity instance using the specified properties. + * @param [properties] Properties to set + * @returns Entity instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.EntityType.IEntity): google.cloud.dialogflow.v2beta1.EntityType.Entity; - /** - * Verifies a SimpleResponses message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.EntityType.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a SimpleResponses message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SimpleResponses - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses; + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.Entity.verify|verify} messages. + * @param message Entity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.EntityType.IEntity, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a SimpleResponses message. Also converts values to other types if specified. - * @param message SimpleResponses - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes an Entity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.EntityType.Entity; - /** - * Converts this SimpleResponses to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.EntityType.Entity; - /** Properties of a BasicCard. */ - interface IBasicCard { + /** + * Verifies an Entity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** BasicCard title */ - title?: (string|null); + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.EntityType.Entity; - /** BasicCard subtitle */ - subtitle?: (string|null); + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @param message Entity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.EntityType.Entity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** BasicCard formattedText */ - formattedText?: (string|null); + /** + * Converts this Entity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** BasicCard image */ - image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** Kind enum. */ + enum Kind { + KIND_UNSPECIFIED = 0, + KIND_MAP = 1, + KIND_LIST = 2, + KIND_REGEXP = 3 + } - /** BasicCard buttons */ - buttons?: (google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton[]|null); - } + /** AutoExpansionMode enum. */ + enum AutoExpansionMode { + AUTO_EXPANSION_MODE_UNSPECIFIED = 0, + AUTO_EXPANSION_MODE_DEFAULT = 1 + } + } - /** Represents a BasicCard. */ - class BasicCard implements IBasicCard { + /** Properties of a ListEntityTypesRequest. */ + interface IListEntityTypesRequest { - /** - * Constructs a new BasicCard. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard); + /** ListEntityTypesRequest parent */ + parent?: (string|null); - /** BasicCard title. */ - public title: string; + /** ListEntityTypesRequest languageCode */ + languageCode?: (string|null); - /** BasicCard subtitle. */ - public subtitle: string; + /** ListEntityTypesRequest pageSize */ + pageSize?: (number|null); - /** BasicCard formattedText. */ - public formattedText: string; + /** ListEntityTypesRequest pageToken */ + pageToken?: (string|null); + } - /** BasicCard image. */ - public image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** Represents a ListEntityTypesRequest. */ + class ListEntityTypesRequest implements IListEntityTypesRequest { - /** BasicCard buttons. */ - public buttons: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton[]; + /** + * Constructs a new ListEntityTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListEntityTypesRequest); - /** - * Creates a new BasicCard instance using the specified properties. - * @param [properties] Properties to set - * @returns BasicCard instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard; + /** ListEntityTypesRequest parent. */ + public parent: string; - /** - * Encodes the specified BasicCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.verify|verify} messages. - * @param message BasicCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListEntityTypesRequest languageCode. */ + public languageCode: string; - /** - * Encodes the specified BasicCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.verify|verify} messages. - * @param message BasicCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListEntityTypesRequest pageSize. */ + public pageSize: number; - /** - * Decodes a BasicCard message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BasicCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard; + /** ListEntityTypesRequest pageToken. */ + public pageToken: string; - /** - * Decodes a BasicCard message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BasicCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard; + /** + * Creates a new ListEntityTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEntityTypesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListEntityTypesRequest): google.cloud.dialogflow.v2beta1.ListEntityTypesRequest; - /** - * Verifies a BasicCard message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified ListEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesRequest.verify|verify} messages. + * @param message ListEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a BasicCard message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BasicCard - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard; + /** + * Encodes the specified ListEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesRequest.verify|verify} messages. + * @param message ListEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a BasicCard message. Also converts values to other types if specified. - * @param message BasicCard - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ListEntityTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListEntityTypesRequest; - /** - * Converts this BasicCard to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a ListEntityTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListEntityTypesRequest; - namespace BasicCard { + /** + * Verifies a ListEntityTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Properties of a Button. */ - interface IButton { + /** + * Creates a ListEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEntityTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListEntityTypesRequest; - /** Button title */ - title?: (string|null); + /** + * Creates a plain object from a ListEntityTypesRequest message. Also converts values to other types if specified. + * @param message ListEntityTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Button openUriAction */ - openUriAction?: (google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction|null); - } + /** + * Converts this ListEntityTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a Button. */ - class Button implements IButton { + /** Properties of a ListEntityTypesResponse. */ + interface IListEntityTypesResponse { - /** - * Constructs a new Button. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton); + /** ListEntityTypesResponse entityTypes */ + entityTypes?: (google.cloud.dialogflow.v2beta1.IEntityType[]|null); - /** Button title. */ - public title: string; + /** ListEntityTypesResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** Button openUriAction. */ - public openUriAction?: (google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction|null); + /** Represents a ListEntityTypesResponse. */ + class ListEntityTypesResponse implements IListEntityTypesResponse { - /** - * Creates a new Button instance using the specified properties. - * @param [properties] Properties to set - * @returns Button instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button; + /** + * Constructs a new ListEntityTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListEntityTypesResponse); - /** - * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.verify|verify} messages. - * @param message Button message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListEntityTypesResponse entityTypes. */ + public entityTypes: google.cloud.dialogflow.v2beta1.IEntityType[]; - /** - * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.verify|verify} messages. - * @param message Button message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListEntityTypesResponse nextPageToken. */ + public nextPageToken: string; - /** - * Decodes a Button message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button; + /** + * Creates a new ListEntityTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListEntityTypesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListEntityTypesResponse): google.cloud.dialogflow.v2beta1.ListEntityTypesResponse; - /** - * Decodes a Button message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button; + /** + * Encodes the specified ListEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesResponse.verify|verify} messages. + * @param message ListEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a Button message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified ListEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesResponse.verify|verify} messages. + * @param message ListEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a Button message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Button - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button; + /** + * Decodes a ListEntityTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListEntityTypesResponse; - /** - * Creates a plain object from a Button message. Also converts values to other types if specified. - * @param message Button - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a ListEntityTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListEntityTypesResponse; - /** - * Converts this Button to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a ListEntityTypesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - namespace Button { + /** + * Creates a ListEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListEntityTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListEntityTypesResponse; - /** Properties of an OpenUriAction. */ - interface IOpenUriAction { + /** + * Creates a plain object from a ListEntityTypesResponse message. Also converts values to other types if specified. + * @param message ListEntityTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** OpenUriAction uri */ - uri?: (string|null); - } + /** + * Converts this ListEntityTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents an OpenUriAction. */ - class OpenUriAction implements IOpenUriAction { + /** Properties of a GetEntityTypeRequest. */ + interface IGetEntityTypeRequest { - /** - * Constructs a new OpenUriAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction); + /** GetEntityTypeRequest name */ + name?: (string|null); - /** OpenUriAction uri. */ - public uri: string; + /** GetEntityTypeRequest languageCode */ + languageCode?: (string|null); + } - /** - * Creates a new OpenUriAction instance using the specified properties. - * @param [properties] Properties to set - * @returns OpenUriAction instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction; + /** Represents a GetEntityTypeRequest. */ + class GetEntityTypeRequest implements IGetEntityTypeRequest { - /** - * Encodes the specified OpenUriAction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. - * @param message OpenUriAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new GetEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest); - /** - * Encodes the specified OpenUriAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. - * @param message OpenUriAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** GetEntityTypeRequest name. */ + public name: string; - /** - * Decodes an OpenUriAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OpenUriAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction; + /** GetEntityTypeRequest languageCode. */ + public languageCode: string; - /** - * Decodes an OpenUriAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OpenUriAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction; + /** + * Creates a new GetEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest): google.cloud.dialogflow.v2beta1.GetEntityTypeRequest; - /** - * Verifies an OpenUriAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified GetEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetEntityTypeRequest.verify|verify} messages. + * @param message GetEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates an OpenUriAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OpenUriAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction; + /** + * Encodes the specified GetEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetEntityTypeRequest.verify|verify} messages. + * @param message GetEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an OpenUriAction message. Also converts values to other types if specified. - * @param message OpenUriAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a GetEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetEntityTypeRequest; - /** - * Converts this OpenUriAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } + /** + * Decodes a GetEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetEntityTypeRequest; - /** Properties of a Suggestion. */ - interface ISuggestion { + /** + * Verifies a GetEntityTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Suggestion title */ - title?: (string|null); - } + /** + * Creates a GetEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetEntityTypeRequest; - /** Represents a Suggestion. */ - class Suggestion implements ISuggestion { + /** + * Creates a plain object from a GetEntityTypeRequest message. Also converts values to other types if specified. + * @param message GetEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.GetEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new Suggestion. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion); + /** + * Converts this GetEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Suggestion title. */ - public title: string; + /** Properties of a CreateEntityTypeRequest. */ + interface ICreateEntityTypeRequest { - /** - * Creates a new Suggestion instance using the specified properties. - * @param [properties] Properties to set - * @returns Suggestion instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion; + /** CreateEntityTypeRequest parent */ + parent?: (string|null); - /** - * Encodes the specified Suggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.verify|verify} messages. - * @param message Suggestion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + /** CreateEntityTypeRequest entityType */ + entityType?: (google.cloud.dialogflow.v2beta1.IEntityType|null); - /** - * Encodes the specified Suggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.verify|verify} messages. - * @param message Suggestion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + /** CreateEntityTypeRequest languageCode */ + languageCode?: (string|null); + } - /** - * Decodes a Suggestion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Suggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion; + /** Represents a CreateEntityTypeRequest. */ + class CreateEntityTypeRequest implements ICreateEntityTypeRequest { - /** - * Decodes a Suggestion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Suggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion; + /** + * Constructs a new CreateEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest); - /** - * Verifies a Suggestion message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** CreateEntityTypeRequest parent. */ + public parent: string; - /** - * Creates a Suggestion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Suggestion - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion; + /** CreateEntityTypeRequest entityType. */ + public entityType?: (google.cloud.dialogflow.v2beta1.IEntityType|null); - /** - * Creates a plain object from a Suggestion message. Also converts values to other types if specified. - * @param message Suggestion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CreateEntityTypeRequest languageCode. */ + public languageCode: string; - /** - * Converts this Suggestion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new CreateEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest): google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest; - /** Properties of a Suggestions. */ - interface ISuggestions { + /** + * Encodes the specified CreateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest.verify|verify} messages. + * @param message CreateEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Suggestions suggestions */ - suggestions?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion[]|null); - } + /** + * Encodes the specified CreateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest.verify|verify} messages. + * @param message CreateEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a Suggestions. */ - class Suggestions implements ISuggestions { + /** + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest; - /** - * Constructs a new Suggestions. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions); + /** + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest; - /** Suggestions suggestions. */ - public suggestions: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion[]; + /** + * Verifies a CreateEntityTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new Suggestions instance using the specified properties. - * @param [properties] Properties to set - * @returns Suggestions instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions; + /** + * Creates a CreateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest; - /** - * Encodes the specified Suggestions message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.verify|verify} messages. - * @param message Suggestions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a CreateEntityTypeRequest message. Also converts values to other types if specified. + * @param message CreateEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified Suggestions message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.verify|verify} messages. - * @param message Suggestions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this CreateEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a Suggestions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Suggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions; + /** Properties of an UpdateEntityTypeRequest. */ + interface IUpdateEntityTypeRequest { - /** - * Decodes a Suggestions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Suggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions; + /** UpdateEntityTypeRequest entityType */ + entityType?: (google.cloud.dialogflow.v2beta1.IEntityType|null); - /** - * Verifies a Suggestions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** UpdateEntityTypeRequest languageCode */ + languageCode?: (string|null); - /** - * Creates a Suggestions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Suggestions - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions; + /** UpdateEntityTypeRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** - * Creates a plain object from a Suggestions message. Also converts values to other types if specified. - * @param message Suggestions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents an UpdateEntityTypeRequest. */ + class UpdateEntityTypeRequest implements IUpdateEntityTypeRequest { - /** - * Converts this Suggestions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new UpdateEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest); - /** Properties of a LinkOutSuggestion. */ - interface ILinkOutSuggestion { + /** UpdateEntityTypeRequest entityType. */ + public entityType?: (google.cloud.dialogflow.v2beta1.IEntityType|null); - /** LinkOutSuggestion destinationName */ - destinationName?: (string|null); + /** UpdateEntityTypeRequest languageCode. */ + public languageCode: string; - /** LinkOutSuggestion uri */ - uri?: (string|null); - } + /** UpdateEntityTypeRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** Represents a LinkOutSuggestion. */ - class LinkOutSuggestion implements ILinkOutSuggestion { + /** + * Creates a new UpdateEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest): google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest; - /** - * Constructs a new LinkOutSuggestion. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion); + /** + * Encodes the specified UpdateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest.verify|verify} messages. + * @param message UpdateEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** LinkOutSuggestion destinationName. */ - public destinationName: string; + /** + * Encodes the specified UpdateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest.verify|verify} messages. + * @param message UpdateEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** LinkOutSuggestion uri. */ - public uri: string; + /** + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest; - /** - * Creates a new LinkOutSuggestion instance using the specified properties. - * @param [properties] Properties to set - * @returns LinkOutSuggestion instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion): google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion; + /** + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest; - /** - * Encodes the specified LinkOutSuggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.verify|verify} messages. - * @param message LinkOutSuggestion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies an UpdateEntityTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified LinkOutSuggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.verify|verify} messages. - * @param message LinkOutSuggestion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates an UpdateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest; - /** - * Decodes a LinkOutSuggestion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LinkOutSuggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion; + /** + * Creates a plain object from an UpdateEntityTypeRequest message. Also converts values to other types if specified. + * @param message UpdateEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a LinkOutSuggestion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LinkOutSuggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion; + /** + * Converts this UpdateEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a LinkOutSuggestion message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of a DeleteEntityTypeRequest. */ + interface IDeleteEntityTypeRequest { - /** - * Creates a LinkOutSuggestion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LinkOutSuggestion - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion; + /** DeleteEntityTypeRequest name */ + name?: (string|null); + } - /** - * Creates a plain object from a LinkOutSuggestion message. Also converts values to other types if specified. - * @param message LinkOutSuggestion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a DeleteEntityTypeRequest. */ + class DeleteEntityTypeRequest implements IDeleteEntityTypeRequest { - /** - * Converts this LinkOutSuggestion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new DeleteEntityTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest); - /** Properties of a ListSelect. */ - interface IListSelect { + /** DeleteEntityTypeRequest name. */ + public name: string; - /** ListSelect title */ - title?: (string|null); + /** + * Creates a new DeleteEntityTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteEntityTypeRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest): google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest; - /** ListSelect items */ - items?: (google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem[]|null); + /** + * Encodes the specified DeleteEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest.verify|verify} messages. + * @param message DeleteEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** ListSelect subtitle */ - subtitle?: (string|null); - } + /** + * Encodes the specified DeleteEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest.verify|verify} messages. + * @param message DeleteEntityTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a ListSelect. */ - class ListSelect implements IListSelect { + /** + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest; - /** - * Constructs a new ListSelect. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect); + /** + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest; - /** ListSelect title. */ - public title: string; + /** + * Verifies a DeleteEntityTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ListSelect items. */ - public items: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem[]; + /** + * Creates a DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteEntityTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest; - /** ListSelect subtitle. */ - public subtitle: string; + /** + * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. + * @param message DeleteEntityTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a new ListSelect instance using the specified properties. - * @param [properties] Properties to set - * @returns ListSelect instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect; + /** + * Converts this DeleteEntityTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified ListSelect message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.verify|verify} messages. - * @param message ListSelect message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a BatchUpdateEntityTypesRequest. */ + interface IBatchUpdateEntityTypesRequest { - /** - * Encodes the specified ListSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.verify|verify} messages. - * @param message ListSelect message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect, writer?: $protobuf.Writer): $protobuf.Writer; + /** BatchUpdateEntityTypesRequest parent */ + parent?: (string|null); - /** - * Decodes a ListSelect message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect; + /** BatchUpdateEntityTypesRequest entityTypeBatchUri */ + entityTypeBatchUri?: (string|null); - /** - * Decodes a ListSelect message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect; + /** BatchUpdateEntityTypesRequest entityTypeBatchInline */ + entityTypeBatchInline?: (google.cloud.dialogflow.v2beta1.IEntityTypeBatch|null); - /** - * Verifies a ListSelect message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** BatchUpdateEntityTypesRequest languageCode */ + languageCode?: (string|null); - /** - * Creates a ListSelect message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListSelect - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect; + /** BatchUpdateEntityTypesRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** - * Creates a plain object from a ListSelect message. Also converts values to other types if specified. - * @param message ListSelect - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a BatchUpdateEntityTypesRequest. */ + class BatchUpdateEntityTypesRequest implements IBatchUpdateEntityTypesRequest { - /** - * Converts this ListSelect to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new BatchUpdateEntityTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest); - namespace ListSelect { + /** BatchUpdateEntityTypesRequest parent. */ + public parent: string; - /** Properties of an Item. */ - interface IItem { + /** BatchUpdateEntityTypesRequest entityTypeBatchUri. */ + public entityTypeBatchUri: string; - /** Item info */ - info?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null); + /** BatchUpdateEntityTypesRequest entityTypeBatchInline. */ + public entityTypeBatchInline?: (google.cloud.dialogflow.v2beta1.IEntityTypeBatch|null); - /** Item title */ - title?: (string|null); + /** BatchUpdateEntityTypesRequest languageCode. */ + public languageCode: string; - /** Item description */ - description?: (string|null); + /** BatchUpdateEntityTypesRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** Item image */ - image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); - } + /** BatchUpdateEntityTypesRequest entityTypeBatch. */ + public entityTypeBatch?: ("entityTypeBatchUri"|"entityTypeBatchInline"); - /** Represents an Item. */ - class Item implements IItem { + /** + * Creates a new BatchUpdateEntityTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchUpdateEntityTypesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest; - /** - * Constructs a new Item. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem); + /** + * Encodes the specified BatchUpdateEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.verify|verify} messages. + * @param message BatchUpdateEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Item info. */ - public info?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null); + /** + * Encodes the specified BatchUpdateEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.verify|verify} messages. + * @param message BatchUpdateEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Item title. */ - public title: string; + /** + * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchUpdateEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest; - /** Item description. */ - public description: string; + /** + * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchUpdateEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest; - /** Item image. */ - public image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** + * Verifies a BatchUpdateEntityTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new Item instance using the specified properties. - * @param [properties] Properties to set - * @returns Item instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item; + /** + * Creates a BatchUpdateEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchUpdateEntityTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest; - /** - * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.verify|verify} messages. - * @param message Item message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a BatchUpdateEntityTypesRequest message. Also converts values to other types if specified. + * @param message BatchUpdateEntityTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.verify|verify} messages. - * @param message Item message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this BatchUpdateEntityTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes an Item message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item; + /** Properties of a BatchUpdateEntityTypesResponse. */ + interface IBatchUpdateEntityTypesResponse { - /** - * Decodes an Item message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item; + /** BatchUpdateEntityTypesResponse entityTypes */ + entityTypes?: (google.cloud.dialogflow.v2beta1.IEntityType[]|null); + } - /** - * Verifies an Item message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a BatchUpdateEntityTypesResponse. */ + class BatchUpdateEntityTypesResponse implements IBatchUpdateEntityTypesResponse { - /** - * Creates an Item message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Item - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item; + /** + * Constructs a new BatchUpdateEntityTypesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse); - /** - * Creates a plain object from an Item message. Also converts values to other types if specified. - * @param message Item - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** BatchUpdateEntityTypesResponse entityTypes. */ + public entityTypes: google.cloud.dialogflow.v2beta1.IEntityType[]; - /** - * Converts this Item to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Creates a new BatchUpdateEntityTypesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchUpdateEntityTypesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse; - /** Properties of a CarouselSelect. */ - interface ICarouselSelect { + /** + * Encodes the specified BatchUpdateEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse.verify|verify} messages. + * @param message BatchUpdateEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** CarouselSelect items */ - items?: (google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem[]|null); - } + /** + * Encodes the specified BatchUpdateEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse.verify|verify} messages. + * @param message BatchUpdateEntityTypesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a CarouselSelect. */ - class CarouselSelect implements ICarouselSelect { + /** + * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchUpdateEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse; - /** - * Constructs a new CarouselSelect. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect); + /** + * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchUpdateEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse; - /** CarouselSelect items. */ - public items: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem[]; + /** + * Verifies a BatchUpdateEntityTypesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new CarouselSelect instance using the specified properties. - * @param [properties] Properties to set - * @returns CarouselSelect instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect; + /** + * Creates a BatchUpdateEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchUpdateEntityTypesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse; - /** - * Encodes the specified CarouselSelect message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.verify|verify} messages. - * @param message CarouselSelect message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a BatchUpdateEntityTypesResponse message. Also converts values to other types if specified. + * @param message BatchUpdateEntityTypesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified CarouselSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.verify|verify} messages. - * @param message CarouselSelect message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this BatchUpdateEntityTypesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a CarouselSelect message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CarouselSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect; + /** Properties of a BatchDeleteEntityTypesRequest. */ + interface IBatchDeleteEntityTypesRequest { - /** - * Decodes a CarouselSelect message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CarouselSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect; + /** BatchDeleteEntityTypesRequest parent */ + parent?: (string|null); - /** - * Verifies a CarouselSelect message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** BatchDeleteEntityTypesRequest entityTypeNames */ + entityTypeNames?: (string[]|null); + } - /** - * Creates a CarouselSelect message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CarouselSelect - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect; + /** Represents a BatchDeleteEntityTypesRequest. */ + class BatchDeleteEntityTypesRequest implements IBatchDeleteEntityTypesRequest { - /** - * Creates a plain object from a CarouselSelect message. Also converts values to other types if specified. - * @param message CarouselSelect - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new BatchDeleteEntityTypesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest); - /** - * Converts this CarouselSelect to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** BatchDeleteEntityTypesRequest parent. */ + public parent: string; - namespace CarouselSelect { + /** BatchDeleteEntityTypesRequest entityTypeNames. */ + public entityTypeNames: string[]; - /** Properties of an Item. */ - interface IItem { + /** + * Creates a new BatchDeleteEntityTypesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteEntityTypesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest): google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest; - /** Item info */ - info?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null); + /** + * Encodes the specified BatchDeleteEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest.verify|verify} messages. + * @param message BatchDeleteEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Item title */ - title?: (string|null); + /** + * Encodes the specified BatchDeleteEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest.verify|verify} messages. + * @param message BatchDeleteEntityTypesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Item description */ - description?: (string|null); + /** + * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest; - /** Item image */ - image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); - } + /** + * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest; - /** Represents an Item. */ - class Item implements IItem { + /** + * Verifies a BatchDeleteEntityTypesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new Item. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem); + /** + * Creates a BatchDeleteEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteEntityTypesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest; - /** Item info. */ - public info?: (google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null); + /** + * Creates a plain object from a BatchDeleteEntityTypesRequest message. Also converts values to other types if specified. + * @param message BatchDeleteEntityTypesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** Item title. */ - public title: string; + /** + * Converts this BatchDeleteEntityTypesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Item description. */ - public description: string; + /** Properties of a BatchCreateEntitiesRequest. */ + interface IBatchCreateEntitiesRequest { - /** Item image. */ - public image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** BatchCreateEntitiesRequest parent */ + parent?: (string|null); - /** - * Creates a new Item instance using the specified properties. - * @param [properties] Properties to set - * @returns Item instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item; + /** BatchCreateEntitiesRequest entities */ + entities?: (google.cloud.dialogflow.v2beta1.EntityType.IEntity[]|null); - /** - * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.verify|verify} messages. - * @param message Item message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + /** BatchCreateEntitiesRequest languageCode */ + languageCode?: (string|null); + } - /** - * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.verify|verify} messages. - * @param message Item message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a BatchCreateEntitiesRequest. */ + class BatchCreateEntitiesRequest implements IBatchCreateEntitiesRequest { - /** - * Decodes an Item message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item; + /** + * Constructs a new BatchCreateEntitiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest); - /** - * Decodes an Item message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item; + /** BatchCreateEntitiesRequest parent. */ + public parent: string; - /** - * Verifies an Item message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** BatchCreateEntitiesRequest entities. */ + public entities: google.cloud.dialogflow.v2beta1.EntityType.IEntity[]; - /** - * Creates an Item message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Item - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item; + /** BatchCreateEntitiesRequest languageCode. */ + public languageCode: string; - /** - * Creates a plain object from an Item message. Also converts values to other types if specified. - * @param message Item - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a new BatchCreateEntitiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateEntitiesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest): google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest; - /** - * Converts this Item to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** + * Encodes the specified BatchCreateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest.verify|verify} messages. + * @param message BatchCreateEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a SelectItemInfo. */ - interface ISelectItemInfo { + /** + * Encodes the specified BatchCreateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest.verify|verify} messages. + * @param message BatchCreateEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** SelectItemInfo key */ - key?: (string|null); + /** + * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest; - /** SelectItemInfo synonyms */ - synonyms?: (string[]|null); - } + /** + * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest; - /** Represents a SelectItemInfo. */ - class SelectItemInfo implements ISelectItemInfo { + /** + * Verifies a BatchCreateEntitiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new SelectItemInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo); + /** + * Creates a BatchCreateEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateEntitiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest; - /** SelectItemInfo key. */ - public key: string; + /** + * Creates a plain object from a BatchCreateEntitiesRequest message. Also converts values to other types if specified. + * @param message BatchCreateEntitiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** SelectItemInfo synonyms. */ - public synonyms: string[]; + /** + * Converts this BatchCreateEntitiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new SelectItemInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SelectItemInfo instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo): google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo; + /** Properties of a BatchUpdateEntitiesRequest. */ + interface IBatchUpdateEntitiesRequest { - /** - * Encodes the specified SelectItemInfo message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.verify|verify} messages. - * @param message SelectItemInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** BatchUpdateEntitiesRequest parent */ + parent?: (string|null); - /** - * Encodes the specified SelectItemInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.verify|verify} messages. - * @param message SelectItemInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** BatchUpdateEntitiesRequest entities */ + entities?: (google.cloud.dialogflow.v2beta1.EntityType.IEntity[]|null); - /** - * Decodes a SelectItemInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SelectItemInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo; + /** BatchUpdateEntitiesRequest languageCode */ + languageCode?: (string|null); - /** - * Decodes a SelectItemInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SelectItemInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo; + /** BatchUpdateEntitiesRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + } - /** - * Verifies a SelectItemInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a BatchUpdateEntitiesRequest. */ + class BatchUpdateEntitiesRequest implements IBatchUpdateEntitiesRequest { - /** - * Creates a SelectItemInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SelectItemInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo; + /** + * Constructs a new BatchUpdateEntitiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest); - /** - * Creates a plain object from a SelectItemInfo message. Also converts values to other types if specified. - * @param message SelectItemInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** BatchUpdateEntitiesRequest parent. */ + public parent: string; - /** - * Converts this SelectItemInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** BatchUpdateEntitiesRequest entities. */ + public entities: google.cloud.dialogflow.v2beta1.EntityType.IEntity[]; - /** Properties of a TelephonyPlayAudio. */ - interface ITelephonyPlayAudio { + /** BatchUpdateEntitiesRequest languageCode. */ + public languageCode: string; - /** TelephonyPlayAudio audioUri */ - audioUri?: (string|null); - } + /** BatchUpdateEntitiesRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); - /** Represents a TelephonyPlayAudio. */ - class TelephonyPlayAudio implements ITelephonyPlayAudio { + /** + * Creates a new BatchUpdateEntitiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchUpdateEntitiesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest): google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest; - /** - * Constructs a new TelephonyPlayAudio. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio); + /** + * Encodes the specified BatchUpdateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.verify|verify} messages. + * @param message BatchUpdateEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** TelephonyPlayAudio audioUri. */ - public audioUri: string; + /** + * Encodes the specified BatchUpdateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.verify|verify} messages. + * @param message BatchUpdateEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new TelephonyPlayAudio instance using the specified properties. - * @param [properties] Properties to set - * @returns TelephonyPlayAudio instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio; + /** + * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchUpdateEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest; - /** - * Encodes the specified TelephonyPlayAudio message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.verify|verify} messages. - * @param message TelephonyPlayAudio message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchUpdateEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest; - /** - * Encodes the specified TelephonyPlayAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.verify|verify} messages. - * @param message TelephonyPlayAudio message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a BatchUpdateEntitiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a TelephonyPlayAudio message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TelephonyPlayAudio - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio; + /** + * Creates a BatchUpdateEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchUpdateEntitiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest; - /** - * Decodes a TelephonyPlayAudio message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TelephonyPlayAudio - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio; + /** + * Creates a plain object from a BatchUpdateEntitiesRequest message. Also converts values to other types if specified. + * @param message BatchUpdateEntitiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a TelephonyPlayAudio message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this BatchUpdateEntitiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a TelephonyPlayAudio message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TelephonyPlayAudio - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio; + /** Properties of a BatchDeleteEntitiesRequest. */ + interface IBatchDeleteEntitiesRequest { - /** - * Creates a plain object from a TelephonyPlayAudio message. Also converts values to other types if specified. - * @param message TelephonyPlayAudio - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** BatchDeleteEntitiesRequest parent */ + parent?: (string|null); + + /** BatchDeleteEntitiesRequest entityValues */ + entityValues?: (string[]|null); - /** - * Converts this TelephonyPlayAudio to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** BatchDeleteEntitiesRequest languageCode */ + languageCode?: (string|null); + } - /** Properties of a TelephonySynthesizeSpeech. */ - interface ITelephonySynthesizeSpeech { + /** Represents a BatchDeleteEntitiesRequest. */ + class BatchDeleteEntitiesRequest implements IBatchDeleteEntitiesRequest { - /** TelephonySynthesizeSpeech text */ - text?: (string|null); + /** + * Constructs a new BatchDeleteEntitiesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest); - /** TelephonySynthesizeSpeech ssml */ - ssml?: (string|null); - } + /** BatchDeleteEntitiesRequest parent. */ + public parent: string; - /** Represents a TelephonySynthesizeSpeech. */ - class TelephonySynthesizeSpeech implements ITelephonySynthesizeSpeech { + /** BatchDeleteEntitiesRequest entityValues. */ + public entityValues: string[]; - /** - * Constructs a new TelephonySynthesizeSpeech. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech); + /** BatchDeleteEntitiesRequest languageCode. */ + public languageCode: string; - /** TelephonySynthesizeSpeech text. */ - public text: string; + /** + * Creates a new BatchDeleteEntitiesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchDeleteEntitiesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest): google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest; - /** TelephonySynthesizeSpeech ssml. */ - public ssml: string; + /** + * Encodes the specified BatchDeleteEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest.verify|verify} messages. + * @param message BatchDeleteEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** TelephonySynthesizeSpeech source. */ - public source?: ("text"|"ssml"); + /** + * Encodes the specified BatchDeleteEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest.verify|verify} messages. + * @param message BatchDeleteEntitiesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new TelephonySynthesizeSpeech instance using the specified properties. - * @param [properties] Properties to set - * @returns TelephonySynthesizeSpeech instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech; + /** + * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchDeleteEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest; - /** - * Encodes the specified TelephonySynthesizeSpeech message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.verify|verify} messages. - * @param message TelephonySynthesizeSpeech message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchDeleteEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest; - /** - * Encodes the specified TelephonySynthesizeSpeech message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.verify|verify} messages. - * @param message TelephonySynthesizeSpeech message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a BatchDeleteEntitiesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a TelephonySynthesizeSpeech message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TelephonySynthesizeSpeech - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech; + /** + * Creates a BatchDeleteEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchDeleteEntitiesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest; - /** - * Decodes a TelephonySynthesizeSpeech message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TelephonySynthesizeSpeech - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech; + /** + * Creates a plain object from a BatchDeleteEntitiesRequest message. Also converts values to other types if specified. + * @param message BatchDeleteEntitiesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a TelephonySynthesizeSpeech message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this BatchDeleteEntitiesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a TelephonySynthesizeSpeech message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TelephonySynthesizeSpeech - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech; + /** Properties of an EntityTypeBatch. */ + interface IEntityTypeBatch { - /** - * Creates a plain object from a TelephonySynthesizeSpeech message. Also converts values to other types if specified. - * @param message TelephonySynthesizeSpeech - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** EntityTypeBatch entityTypes */ + entityTypes?: (google.cloud.dialogflow.v2beta1.IEntityType[]|null); + } - /** - * Converts this TelephonySynthesizeSpeech to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents an EntityTypeBatch. */ + class EntityTypeBatch implements IEntityTypeBatch { - /** Properties of a TelephonyTransferCall. */ - interface ITelephonyTransferCall { + /** + * Constructs a new EntityTypeBatch. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IEntityTypeBatch); - /** TelephonyTransferCall phoneNumber */ - phoneNumber?: (string|null); - } + /** EntityTypeBatch entityTypes. */ + public entityTypes: google.cloud.dialogflow.v2beta1.IEntityType[]; - /** Represents a TelephonyTransferCall. */ - class TelephonyTransferCall implements ITelephonyTransferCall { + /** + * Creates a new EntityTypeBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns EntityTypeBatch instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IEntityTypeBatch): google.cloud.dialogflow.v2beta1.EntityTypeBatch; - /** - * Constructs a new TelephonyTransferCall. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall); + /** + * Encodes the specified EntityTypeBatch message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityTypeBatch.verify|verify} messages. + * @param message EntityTypeBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IEntityTypeBatch, writer?: $protobuf.Writer): $protobuf.Writer; - /** TelephonyTransferCall phoneNumber. */ - public phoneNumber: string; + /** + * Encodes the specified EntityTypeBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityTypeBatch.verify|verify} messages. + * @param message EntityTypeBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IEntityTypeBatch, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new TelephonyTransferCall instance using the specified properties. - * @param [properties] Properties to set - * @returns TelephonyTransferCall instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall; + /** + * Decodes an EntityTypeBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EntityTypeBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.EntityTypeBatch; - /** - * Encodes the specified TelephonyTransferCall message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.verify|verify} messages. - * @param message TelephonyTransferCall message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes an EntityTypeBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EntityTypeBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.EntityTypeBatch; - /** - * Encodes the specified TelephonyTransferCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.verify|verify} messages. - * @param message TelephonyTransferCall message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies an EntityTypeBatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a TelephonyTransferCall message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TelephonyTransferCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall; + /** + * Creates an EntityTypeBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EntityTypeBatch + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.EntityTypeBatch; - /** - * Decodes a TelephonyTransferCall message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TelephonyTransferCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall; + /** + * Creates a plain object from an EntityTypeBatch message. Also converts values to other types if specified. + * @param message EntityTypeBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.EntityTypeBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a TelephonyTransferCall message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this EntityTypeBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a TelephonyTransferCall message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TelephonyTransferCall - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall; + /** Represents a Conversations */ + class Conversations extends $protobuf.rpc.Service { - /** - * Creates a plain object from a TelephonyTransferCall message. Also converts values to other types if specified. - * @param message TelephonyTransferCall - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new Conversations service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** - * Converts this TelephonyTransferCall to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates new Conversations service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Conversations; - /** Properties of a RbmText. */ - interface IRbmText { + /** + * Calls CreateConversation. + * @param request CreateConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Conversation + */ + public createConversation(request: google.cloud.dialogflow.v2beta1.ICreateConversationRequest, callback: google.cloud.dialogflow.v2beta1.Conversations.CreateConversationCallback): void; - /** RbmText text */ - text?: (string|null); + /** + * Calls CreateConversation. + * @param request CreateConversationRequest message or plain object + * @returns Promise + */ + public createConversation(request: google.cloud.dialogflow.v2beta1.ICreateConversationRequest): Promise; - /** RbmText rbmSuggestion */ - rbmSuggestion?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion[]|null); - } + /** + * Calls ListConversations. + * @param request ListConversationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConversationsResponse + */ + public listConversations(request: google.cloud.dialogflow.v2beta1.IListConversationsRequest, callback: google.cloud.dialogflow.v2beta1.Conversations.ListConversationsCallback): void; - /** Represents a RbmText. */ - class RbmText implements IRbmText { + /** + * Calls ListConversations. + * @param request ListConversationsRequest message or plain object + * @returns Promise + */ + public listConversations(request: google.cloud.dialogflow.v2beta1.IListConversationsRequest): Promise; - /** - * Constructs a new RbmText. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText); + /** + * Calls GetConversation. + * @param request GetConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Conversation + */ + public getConversation(request: google.cloud.dialogflow.v2beta1.IGetConversationRequest, callback: google.cloud.dialogflow.v2beta1.Conversations.GetConversationCallback): void; - /** RbmText text. */ - public text: string; + /** + * Calls GetConversation. + * @param request GetConversationRequest message or plain object + * @returns Promise + */ + public getConversation(request: google.cloud.dialogflow.v2beta1.IGetConversationRequest): Promise; - /** RbmText rbmSuggestion. */ - public rbmSuggestion: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion[]; + /** + * Calls CompleteConversation. + * @param request CompleteConversationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Conversation + */ + public completeConversation(request: google.cloud.dialogflow.v2beta1.ICompleteConversationRequest, callback: google.cloud.dialogflow.v2beta1.Conversations.CompleteConversationCallback): void; - /** - * Creates a new RbmText instance using the specified properties. - * @param [properties] Properties to set - * @returns RbmText instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText): google.cloud.dialogflow.v2beta1.Intent.Message.RbmText; + /** + * Calls CompleteConversation. + * @param request CompleteConversationRequest message or plain object + * @returns Promise + */ + public completeConversation(request: google.cloud.dialogflow.v2beta1.ICompleteConversationRequest): Promise; - /** - * Encodes the specified RbmText message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.verify|verify} messages. - * @param message RbmText message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls CreateCallMatcher. + * @param request CreateCallMatcherRequest message or plain object + * @param callback Node-style callback called with the error, if any, and CallMatcher + */ + public createCallMatcher(request: google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest, callback: google.cloud.dialogflow.v2beta1.Conversations.CreateCallMatcherCallback): void; - /** - * Encodes the specified RbmText message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.verify|verify} messages. - * @param message RbmText message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Calls CreateCallMatcher. + * @param request CreateCallMatcherRequest message or plain object + * @returns Promise + */ + public createCallMatcher(request: google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest): Promise; - /** - * Decodes a RbmText message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RbmText - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmText; + /** + * Calls ListCallMatchers. + * @param request ListCallMatchersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListCallMatchersResponse + */ + public listCallMatchers(request: google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, callback: google.cloud.dialogflow.v2beta1.Conversations.ListCallMatchersCallback): void; - /** - * Decodes a RbmText message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RbmText - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmText; + /** + * Calls ListCallMatchers. + * @param request ListCallMatchersRequest message or plain object + * @returns Promise + */ + public listCallMatchers(request: google.cloud.dialogflow.v2beta1.IListCallMatchersRequest): Promise; - /** - * Verifies a RbmText message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Calls DeleteCallMatcher. + * @param request DeleteCallMatcherRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteCallMatcher(request: google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest, callback: google.cloud.dialogflow.v2beta1.Conversations.DeleteCallMatcherCallback): void; - /** - * Creates a RbmText message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RbmText - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmText; + /** + * Calls DeleteCallMatcher. + * @param request DeleteCallMatcherRequest message or plain object + * @returns Promise + */ + public deleteCallMatcher(request: google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest): Promise; - /** - * Creates a plain object from a RbmText message. Also converts values to other types if specified. - * @param message RbmText - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmText, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Calls BatchCreateMessages. + * @param request BatchCreateMessagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BatchCreateMessagesResponse + */ + public batchCreateMessages(request: google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest, callback: google.cloud.dialogflow.v2beta1.Conversations.BatchCreateMessagesCallback): void; - /** - * Converts this RbmText to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Calls BatchCreateMessages. + * @param request BatchCreateMessagesRequest message or plain object + * @returns Promise + */ + public batchCreateMessages(request: google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest): Promise; - /** Properties of a RbmCarouselCard. */ - interface IRbmCarouselCard { + /** + * Calls ListMessages. + * @param request ListMessagesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListMessagesResponse + */ + public listMessages(request: google.cloud.dialogflow.v2beta1.IListMessagesRequest, callback: google.cloud.dialogflow.v2beta1.Conversations.ListMessagesCallback): void; - /** RbmCarouselCard cardWidth */ - cardWidth?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth|null); + /** + * Calls ListMessages. + * @param request ListMessagesRequest message or plain object + * @returns Promise + */ + public listMessages(request: google.cloud.dialogflow.v2beta1.IListMessagesRequest): Promise; + } - /** RbmCarouselCard cardContents */ - cardContents?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent[]|null); - } + namespace Conversations { - /** Represents a RbmCarouselCard. */ - class RbmCarouselCard implements IRbmCarouselCard { + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#createConversation}. + * @param error Error, if any + * @param [response] Conversation + */ + type CreateConversationCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Conversation) => void; - /** - * Constructs a new RbmCarouselCard. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard); + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#listConversations}. + * @param error Error, if any + * @param [response] ListConversationsResponse + */ + type ListConversationsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListConversationsResponse) => void; - /** RbmCarouselCard cardWidth. */ - public cardWidth: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth); + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#getConversation}. + * @param error Error, if any + * @param [response] Conversation + */ + type GetConversationCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Conversation) => void; - /** RbmCarouselCard cardContents. */ - public cardContents: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent[]; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#completeConversation}. + * @param error Error, if any + * @param [response] Conversation + */ + type CompleteConversationCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Conversation) => void; - /** - * Creates a new RbmCarouselCard instance using the specified properties. - * @param [properties] Properties to set - * @returns RbmCarouselCard instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#createCallMatcher}. + * @param error Error, if any + * @param [response] CallMatcher + */ + type CreateCallMatcherCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.CallMatcher) => void; - /** - * Encodes the specified RbmCarouselCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.verify|verify} messages. - * @param message RbmCarouselCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#listCallMatchers}. + * @param error Error, if any + * @param [response] ListCallMatchersResponse + */ + type ListCallMatchersCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListCallMatchersResponse) => void; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#deleteCallMatcher}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteCallMatcherCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; - /** - * Encodes the specified RbmCarouselCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.verify|verify} messages. - * @param message RbmCarouselCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#batchCreateMessages}. + * @param error Error, if any + * @param [response] BatchCreateMessagesResponse + */ + type BatchCreateMessagesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse) => void; - /** - * Decodes a RbmCarouselCard message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RbmCarouselCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#listMessages}. + * @param error Error, if any + * @param [response] ListMessagesResponse + */ + type ListMessagesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListMessagesResponse) => void; + } - /** - * Decodes a RbmCarouselCard message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RbmCarouselCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard; + /** Properties of a Conversation. */ + interface IConversation { - /** - * Verifies a RbmCarouselCard message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Conversation name */ + name?: (string|null); - /** - * Creates a RbmCarouselCard message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RbmCarouselCard - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard; + /** Conversation lifecycleState */ + lifecycleState?: (google.cloud.dialogflow.v2beta1.Conversation.LifecycleState|keyof typeof google.cloud.dialogflow.v2beta1.Conversation.LifecycleState|null); - /** - * Creates a plain object from a RbmCarouselCard message. Also converts values to other types if specified. - * @param message RbmCarouselCard - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Conversation conversationProfile */ + conversationProfile?: (string|null); - /** - * Converts this RbmCarouselCard to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Conversation phoneNumber */ + phoneNumber?: (google.cloud.dialogflow.v2beta1.IConversationPhoneNumber|null); - namespace RbmCarouselCard { + /** Conversation conversationStage */ + conversationStage?: (google.cloud.dialogflow.v2beta1.Conversation.ConversationStage|keyof typeof google.cloud.dialogflow.v2beta1.Conversation.ConversationStage|null); - /** CardWidth enum. */ - enum CardWidth { - CARD_WIDTH_UNSPECIFIED = 0, - SMALL = 1, - MEDIUM = 2 - } - } + /** Conversation startTime */ + startTime?: (google.protobuf.ITimestamp|null); - /** Properties of a RbmStandaloneCard. */ - interface IRbmStandaloneCard { + /** Conversation endTime */ + endTime?: (google.protobuf.ITimestamp|null); + } - /** RbmStandaloneCard cardOrientation */ - cardOrientation?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation|null); + /** Represents a Conversation. */ + class Conversation implements IConversation { - /** RbmStandaloneCard thumbnailImageAlignment */ - thumbnailImageAlignment?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment|null); + /** + * Constructs a new Conversation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IConversation); - /** RbmStandaloneCard cardContent */ - cardContent?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent|null); - } + /** Conversation name. */ + public name: string; - /** Represents a RbmStandaloneCard. */ - class RbmStandaloneCard implements IRbmStandaloneCard { + /** Conversation lifecycleState. */ + public lifecycleState: (google.cloud.dialogflow.v2beta1.Conversation.LifecycleState|keyof typeof google.cloud.dialogflow.v2beta1.Conversation.LifecycleState); - /** - * Constructs a new RbmStandaloneCard. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard); + /** Conversation conversationProfile. */ + public conversationProfile: string; - /** RbmStandaloneCard cardOrientation. */ - public cardOrientation: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation); + /** Conversation phoneNumber. */ + public phoneNumber?: (google.cloud.dialogflow.v2beta1.IConversationPhoneNumber|null); - /** RbmStandaloneCard thumbnailImageAlignment. */ - public thumbnailImageAlignment: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment); + /** Conversation conversationStage. */ + public conversationStage: (google.cloud.dialogflow.v2beta1.Conversation.ConversationStage|keyof typeof google.cloud.dialogflow.v2beta1.Conversation.ConversationStage); - /** RbmStandaloneCard cardContent. */ - public cardContent?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent|null); + /** Conversation startTime. */ + public startTime?: (google.protobuf.ITimestamp|null); - /** - * Creates a new RbmStandaloneCard instance using the specified properties. - * @param [properties] Properties to set - * @returns RbmStandaloneCard instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard): google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard; + /** Conversation endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); - /** - * Encodes the specified RbmStandaloneCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.verify|verify} messages. - * @param message RbmStandaloneCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new Conversation instance using the specified properties. + * @param [properties] Properties to set + * @returns Conversation instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IConversation): google.cloud.dialogflow.v2beta1.Conversation; - /** - * Encodes the specified RbmStandaloneCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.verify|verify} messages. - * @param message RbmStandaloneCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a RbmStandaloneCard message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RbmStandaloneCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard; + /** + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Conversation.verify|verify} messages. + * @param message Conversation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IConversation, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a RbmStandaloneCard message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RbmStandaloneCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard; + /** + * Decodes a Conversation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Conversation; - /** - * Verifies a RbmStandaloneCard message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a Conversation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Conversation; - /** - * Creates a RbmStandaloneCard message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RbmStandaloneCard - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard; + /** + * Verifies a Conversation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a RbmStandaloneCard message. Also converts values to other types if specified. - * @param message RbmStandaloneCard - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Conversation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Conversation; - /** - * Converts this RbmStandaloneCard to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * @param message Conversation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Conversation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - namespace RbmStandaloneCard { + /** + * Converts this Conversation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** CardOrientation enum. */ - enum CardOrientation { - CARD_ORIENTATION_UNSPECIFIED = 0, - HORIZONTAL = 1, - VERTICAL = 2 - } + namespace Conversation { - /** ThumbnailImageAlignment enum. */ - enum ThumbnailImageAlignment { - THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED = 0, - LEFT = 1, - RIGHT = 2 - } - } + /** LifecycleState enum. */ + enum LifecycleState { + LIFECYCLE_STATE_UNSPECIFIED = 0, + IN_PROGRESS = 1, + COMPLETED = 2 + } - /** Properties of a RbmCardContent. */ - interface IRbmCardContent { + /** ConversationStage enum. */ + enum ConversationStage { + CONVERSATION_STAGE_UNSPECIFIED = 0, + VIRTUAL_AGENT_STAGE = 1, + HUMAN_ASSIST_STAGE = 2 + } + } - /** RbmCardContent title */ - title?: (string|null); + /** Properties of a ConversationPhoneNumber. */ + interface IConversationPhoneNumber { - /** RbmCardContent description */ - description?: (string|null); + /** ConversationPhoneNumber phoneNumber */ + phoneNumber?: (string|null); + } - /** RbmCardContent media */ - media?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia|null); + /** Represents a ConversationPhoneNumber. */ + class ConversationPhoneNumber implements IConversationPhoneNumber { - /** RbmCardContent suggestions */ - suggestions?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion[]|null); - } + /** + * Constructs a new ConversationPhoneNumber. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IConversationPhoneNumber); - /** Represents a RbmCardContent. */ - class RbmCardContent implements IRbmCardContent { + /** ConversationPhoneNumber phoneNumber. */ + public phoneNumber: string; - /** - * Constructs a new RbmCardContent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent); + /** + * Creates a new ConversationPhoneNumber instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationPhoneNumber instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IConversationPhoneNumber): google.cloud.dialogflow.v2beta1.ConversationPhoneNumber; - /** RbmCardContent title. */ - public title: string; + /** + * Encodes the specified ConversationPhoneNumber message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ConversationPhoneNumber.verify|verify} messages. + * @param message ConversationPhoneNumber message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IConversationPhoneNumber, writer?: $protobuf.Writer): $protobuf.Writer; - /** RbmCardContent description. */ - public description: string; + /** + * Encodes the specified ConversationPhoneNumber message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ConversationPhoneNumber.verify|verify} messages. + * @param message ConversationPhoneNumber message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IConversationPhoneNumber, writer?: $protobuf.Writer): $protobuf.Writer; - /** RbmCardContent media. */ - public media?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia|null); + /** + * Decodes a ConversationPhoneNumber message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationPhoneNumber + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ConversationPhoneNumber; - /** RbmCardContent suggestions. */ - public suggestions: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion[]; + /** + * Decodes a ConversationPhoneNumber message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationPhoneNumber + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ConversationPhoneNumber; - /** - * Creates a new RbmCardContent instance using the specified properties. - * @param [properties] Properties to set - * @returns RbmCardContent instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent; + /** + * Verifies a ConversationPhoneNumber message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified RbmCardContent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.verify|verify} messages. - * @param message RbmCardContent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a ConversationPhoneNumber message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationPhoneNumber + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ConversationPhoneNumber; - /** - * Encodes the specified RbmCardContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.verify|verify} messages. - * @param message RbmCardContent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a ConversationPhoneNumber message. Also converts values to other types if specified. + * @param message ConversationPhoneNumber + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ConversationPhoneNumber, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a RbmCardContent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RbmCardContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent; + /** + * Converts this ConversationPhoneNumber to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a RbmCardContent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RbmCardContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent; + /** Properties of a CallMatcher. */ + interface ICallMatcher { - /** - * Verifies a RbmCardContent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** CallMatcher name */ + name?: (string|null); - /** - * Creates a RbmCardContent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RbmCardContent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent; + /** CallMatcher toHeader */ + toHeader?: (string|null); - /** - * Creates a plain object from a RbmCardContent message. Also converts values to other types if specified. - * @param message RbmCardContent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CallMatcher fromHeader */ + fromHeader?: (string|null); - /** - * Converts this RbmCardContent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** CallMatcher callIdHeader */ + callIdHeader?: (string|null); - namespace RbmCardContent { + /** CallMatcher customHeaders */ + customHeaders?: (google.cloud.dialogflow.v2beta1.CallMatcher.ICustomHeaders|null); + } - /** Properties of a RbmMedia. */ - interface IRbmMedia { + /** Represents a CallMatcher. */ + class CallMatcher implements ICallMatcher { - /** RbmMedia fileUri */ - fileUri?: (string|null); + /** + * Constructs a new CallMatcher. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ICallMatcher); - /** RbmMedia thumbnailUri */ - thumbnailUri?: (string|null); + /** CallMatcher name. */ + public name: string; - /** RbmMedia height */ - height?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height|null); - } + /** CallMatcher toHeader. */ + public toHeader: string; - /** Represents a RbmMedia. */ - class RbmMedia implements IRbmMedia { + /** CallMatcher fromHeader. */ + public fromHeader: string; - /** - * Constructs a new RbmMedia. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia); + /** CallMatcher callIdHeader. */ + public callIdHeader: string; - /** RbmMedia fileUri. */ - public fileUri: string; + /** CallMatcher customHeaders. */ + public customHeaders?: (google.cloud.dialogflow.v2beta1.CallMatcher.ICustomHeaders|null); - /** RbmMedia thumbnailUri. */ - public thumbnailUri: string; + /** + * Creates a new CallMatcher instance using the specified properties. + * @param [properties] Properties to set + * @returns CallMatcher instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ICallMatcher): google.cloud.dialogflow.v2beta1.CallMatcher; - /** RbmMedia height. */ - public height: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height); + /** + * Encodes the specified CallMatcher message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CallMatcher.verify|verify} messages. + * @param message CallMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ICallMatcher, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new RbmMedia instance using the specified properties. - * @param [properties] Properties to set - * @returns RbmMedia instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia; + /** + * Encodes the specified CallMatcher message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CallMatcher.verify|verify} messages. + * @param message CallMatcher message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICallMatcher, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified RbmMedia message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.verify|verify} messages. - * @param message RbmMedia message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a CallMatcher message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CallMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CallMatcher; - /** - * Encodes the specified RbmMedia message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.verify|verify} messages. - * @param message RbmMedia message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a CallMatcher message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CallMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CallMatcher; - /** - * Decodes a RbmMedia message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RbmMedia - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia; + /** + * Verifies a CallMatcher message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a RbmMedia message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RbmMedia - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia; + /** + * Creates a CallMatcher message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CallMatcher + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CallMatcher; - /** - * Verifies a RbmMedia message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a plain object from a CallMatcher message. Also converts values to other types if specified. + * @param message CallMatcher + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CallMatcher, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a RbmMedia message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RbmMedia - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia; + /** + * Converts this CallMatcher to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a plain object from a RbmMedia message. Also converts values to other types if specified. - * @param message RbmMedia - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia, options?: $protobuf.IConversionOptions): { [k: string]: any }; + namespace CallMatcher { - /** - * Converts this RbmMedia to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a CustomHeaders. */ + interface ICustomHeaders { - namespace RbmMedia { + /** CustomHeaders ciscoGuid */ + ciscoGuid?: (string|null); + } - /** Height enum. */ - enum Height { - HEIGHT_UNSPECIFIED = 0, - SHORT = 1, - MEDIUM = 2, - TALL = 3 - } - } - } + /** Represents a CustomHeaders. */ + class CustomHeaders implements ICustomHeaders { - /** Properties of a RbmSuggestion. */ - interface IRbmSuggestion { + /** + * Constructs a new CustomHeaders. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.CallMatcher.ICustomHeaders); - /** RbmSuggestion reply */ - reply?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply|null); + /** CustomHeaders ciscoGuid. */ + public ciscoGuid: string; - /** RbmSuggestion action */ - action?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction|null); - } + /** + * Creates a new CustomHeaders instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHeaders instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.CallMatcher.ICustomHeaders): google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders; - /** Represents a RbmSuggestion. */ - class RbmSuggestion implements IRbmSuggestion { + /** + * Encodes the specified CustomHeaders message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders.verify|verify} messages. + * @param message CustomHeaders message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.CallMatcher.ICustomHeaders, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new RbmSuggestion. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion); + /** + * Encodes the specified CustomHeaders message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders.verify|verify} messages. + * @param message CustomHeaders message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.CallMatcher.ICustomHeaders, writer?: $protobuf.Writer): $protobuf.Writer; - /** RbmSuggestion reply. */ - public reply?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply|null); + /** + * Decodes a CustomHeaders message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders; - /** RbmSuggestion action. */ - public action?: (google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction|null); + /** + * Decodes a CustomHeaders message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders; - /** RbmSuggestion suggestion. */ - public suggestion?: ("reply"|"action"); + /** + * Verifies a CustomHeaders message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new RbmSuggestion instance using the specified properties. - * @param [properties] Properties to set - * @returns RbmSuggestion instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion; + /** + * Creates a CustomHeaders message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHeaders + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders; - /** - * Encodes the specified RbmSuggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.verify|verify} messages. - * @param message RbmSuggestion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a CustomHeaders message. Also converts values to other types if specified. + * @param message CustomHeaders + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified RbmSuggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.verify|verify} messages. - * @param message RbmSuggestion message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this CustomHeaders to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Decodes a RbmSuggestion message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RbmSuggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion; + /** Properties of a CreateConversationRequest. */ + interface ICreateConversationRequest { - /** - * Decodes a RbmSuggestion message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RbmSuggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion; + /** CreateConversationRequest parent */ + parent?: (string|null); - /** - * Verifies a RbmSuggestion message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** CreateConversationRequest conversation */ + conversation?: (google.cloud.dialogflow.v2beta1.IConversation|null); - /** - * Creates a RbmSuggestion message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RbmSuggestion - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion; + /** CreateConversationRequest conversationId */ + conversationId?: (string|null); + } - /** - * Creates a plain object from a RbmSuggestion message. Also converts values to other types if specified. - * @param message RbmSuggestion - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** Represents a CreateConversationRequest. */ + class CreateConversationRequest implements ICreateConversationRequest { - /** - * Converts this RbmSuggestion to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Constructs a new CreateConversationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateConversationRequest); - /** Properties of a RbmSuggestedReply. */ - interface IRbmSuggestedReply { + /** CreateConversationRequest parent. */ + public parent: string; - /** RbmSuggestedReply text */ - text?: (string|null); + /** CreateConversationRequest conversation. */ + public conversation?: (google.cloud.dialogflow.v2beta1.IConversation|null); - /** RbmSuggestedReply postbackData */ - postbackData?: (string|null); - } + /** CreateConversationRequest conversationId. */ + public conversationId: string; - /** Represents a RbmSuggestedReply. */ - class RbmSuggestedReply implements IRbmSuggestedReply { + /** + * Creates a new CreateConversationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateConversationRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateConversationRequest): google.cloud.dialogflow.v2beta1.CreateConversationRequest; - /** - * Constructs a new RbmSuggestedReply. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply); + /** + * Encodes the specified CreateConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateConversationRequest.verify|verify} messages. + * @param message CreateConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ICreateConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** RbmSuggestedReply text. */ - public text: string; + /** + * Encodes the specified CreateConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateConversationRequest.verify|verify} messages. + * @param message CreateConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** RbmSuggestedReply postbackData. */ - public postbackData: string; + /** + * Decodes a CreateConversationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateConversationRequest; - /** - * Creates a new RbmSuggestedReply instance using the specified properties. - * @param [properties] Properties to set - * @returns RbmSuggestedReply instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply; + /** + * Decodes a CreateConversationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateConversationRequest; - /** - * Encodes the specified RbmSuggestedReply message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.verify|verify} messages. - * @param message RbmSuggestedReply message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a CreateConversationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified RbmSuggestedReply message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.verify|verify} messages. - * @param message RbmSuggestedReply message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a CreateConversationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateConversationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateConversationRequest; - /** - * Decodes a RbmSuggestedReply message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RbmSuggestedReply - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply; + /** + * Creates a plain object from a CreateConversationRequest message. Also converts values to other types if specified. + * @param message CreateConversationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CreateConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a RbmSuggestedReply message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RbmSuggestedReply - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply; + /** + * Converts this CreateConversationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a RbmSuggestedReply message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of a ListConversationsRequest. */ + interface IListConversationsRequest { - /** - * Creates a RbmSuggestedReply message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RbmSuggestedReply - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply; + /** ListConversationsRequest parent */ + parent?: (string|null); - /** - * Creates a plain object from a RbmSuggestedReply message. Also converts values to other types if specified. - * @param message RbmSuggestedReply - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ListConversationsRequest pageSize */ + pageSize?: (number|null); - /** - * Converts this RbmSuggestedReply to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ListConversationsRequest pageToken */ + pageToken?: (string|null); - /** Properties of a RbmSuggestedAction. */ - interface IRbmSuggestedAction { + /** ListConversationsRequest filter */ + filter?: (string|null); + } - /** RbmSuggestedAction text */ - text?: (string|null); + /** Represents a ListConversationsRequest. */ + class ListConversationsRequest implements IListConversationsRequest { - /** RbmSuggestedAction postbackData */ - postbackData?: (string|null); + /** + * Constructs a new ListConversationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListConversationsRequest); - /** RbmSuggestedAction dial */ - dial?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial|null); + /** ListConversationsRequest parent. */ + public parent: string; - /** RbmSuggestedAction openUrl */ - openUrl?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri|null); + /** ListConversationsRequest pageSize. */ + public pageSize: number; - /** RbmSuggestedAction shareLocation */ - shareLocation?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation|null); - } + /** ListConversationsRequest pageToken. */ + public pageToken: string; - /** Represents a RbmSuggestedAction. */ - class RbmSuggestedAction implements IRbmSuggestedAction { + /** ListConversationsRequest filter. */ + public filter: string; - /** - * Constructs a new RbmSuggestedAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction); + /** + * Creates a new ListConversationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversationsRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListConversationsRequest): google.cloud.dialogflow.v2beta1.ListConversationsRequest; - /** RbmSuggestedAction text. */ - public text: string; + /** + * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationsRequest.verify|verify} messages. + * @param message ListConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** RbmSuggestedAction postbackData. */ - public postbackData: string; + /** + * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationsRequest.verify|verify} messages. + * @param message ListConversationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListConversationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** RbmSuggestedAction dial. */ - public dial?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial|null); + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListConversationsRequest; - /** RbmSuggestedAction openUrl. */ - public openUrl?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri|null); + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListConversationsRequest; - /** RbmSuggestedAction shareLocation. */ - public shareLocation?: (google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation|null); + /** + * Verifies a ListConversationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** RbmSuggestedAction action. */ - public action?: ("dial"|"openUrl"|"shareLocation"); + /** + * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConversationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListConversationsRequest; - /** - * Creates a new RbmSuggestedAction instance using the specified properties. - * @param [properties] Properties to set - * @returns RbmSuggestedAction instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction; + /** + * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. + * @param message ListConversationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListConversationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified RbmSuggestedAction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.verify|verify} messages. - * @param message RbmSuggestedAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this ListConversationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified RbmSuggestedAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.verify|verify} messages. - * @param message RbmSuggestedAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a ListConversationsResponse. */ + interface IListConversationsResponse { - /** - * Decodes a RbmSuggestedAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RbmSuggestedAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction; + /** ListConversationsResponse conversations */ + conversations?: (google.cloud.dialogflow.v2beta1.IConversation[]|null); - /** - * Decodes a RbmSuggestedAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RbmSuggestedAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction; + /** ListConversationsResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * Verifies a RbmSuggestedAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a ListConversationsResponse. */ + class ListConversationsResponse implements IListConversationsResponse { - /** - * Creates a RbmSuggestedAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RbmSuggestedAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction; + /** + * Constructs a new ListConversationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListConversationsResponse); - /** - * Creates a plain object from a RbmSuggestedAction message. Also converts values to other types if specified. - * @param message RbmSuggestedAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ListConversationsResponse conversations. */ + public conversations: google.cloud.dialogflow.v2beta1.IConversation[]; - /** - * Converts this RbmSuggestedAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ListConversationsResponse nextPageToken. */ + public nextPageToken: string; - namespace RbmSuggestedAction { + /** + * Creates a new ListConversationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListConversationsResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListConversationsResponse): google.cloud.dialogflow.v2beta1.ListConversationsResponse; - /** Properties of a RbmSuggestedActionDial. */ - interface IRbmSuggestedActionDial { + /** + * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationsResponse.verify|verify} messages. + * @param message ListConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** RbmSuggestedActionDial phoneNumber */ - phoneNumber?: (string|null); - } + /** + * Encodes the specified ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationsResponse.verify|verify} messages. + * @param message ListConversationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListConversationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a RbmSuggestedActionDial. */ - class RbmSuggestedActionDial implements IRbmSuggestedActionDial { + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListConversationsResponse; - /** - * Constructs a new RbmSuggestedActionDial. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial); + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListConversationsResponse; - /** RbmSuggestedActionDial phoneNumber. */ - public phoneNumber: string; + /** + * Verifies a ListConversationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new RbmSuggestedActionDial instance using the specified properties. - * @param [properties] Properties to set - * @returns RbmSuggestedActionDial instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial; + /** + * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListConversationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListConversationsResponse; - /** - * Encodes the specified RbmSuggestedActionDial message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.verify|verify} messages. - * @param message RbmSuggestedActionDial message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. + * @param message ListConversationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListConversationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified RbmSuggestedActionDial message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.verify|verify} messages. - * @param message RbmSuggestedActionDial message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this ListConversationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a RbmSuggestedActionDial message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RbmSuggestedActionDial - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial; + /** Properties of a GetConversationRequest. */ + interface IGetConversationRequest { - /** - * Decodes a RbmSuggestedActionDial message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RbmSuggestedActionDial - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial; + /** GetConversationRequest name */ + name?: (string|null); + } - /** - * Verifies a RbmSuggestedActionDial message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a GetConversationRequest. */ + class GetConversationRequest implements IGetConversationRequest { - /** - * Creates a RbmSuggestedActionDial message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RbmSuggestedActionDial - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial; + /** + * Constructs a new GetConversationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IGetConversationRequest); - /** - * Creates a plain object from a RbmSuggestedActionDial message. Also converts values to other types if specified. - * @param message RbmSuggestedActionDial - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** GetConversationRequest name. */ + public name: string; - /** - * Converts this RbmSuggestedActionDial to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new GetConversationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetConversationRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IGetConversationRequest): google.cloud.dialogflow.v2beta1.GetConversationRequest; - /** Properties of a RbmSuggestedActionOpenUri. */ - interface IRbmSuggestedActionOpenUri { + /** + * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetConversationRequest.verify|verify} messages. + * @param message GetConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** RbmSuggestedActionOpenUri uri */ - uri?: (string|null); - } + /** + * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetConversationRequest.verify|verify} messages. + * @param message GetConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a RbmSuggestedActionOpenUri. */ - class RbmSuggestedActionOpenUri implements IRbmSuggestedActionOpenUri { + /** + * Decodes a GetConversationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetConversationRequest; - /** - * Constructs a new RbmSuggestedActionOpenUri. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri); + /** + * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetConversationRequest; - /** RbmSuggestedActionOpenUri uri. */ - public uri: string; + /** + * Verifies a GetConversationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a new RbmSuggestedActionOpenUri instance using the specified properties. - * @param [properties] Properties to set - * @returns RbmSuggestedActionOpenUri instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri; + /** + * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetConversationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetConversationRequest; - /** - * Encodes the specified RbmSuggestedActionOpenUri message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.verify|verify} messages. - * @param message RbmSuggestedActionOpenUri message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. + * @param message GetConversationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.GetConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified RbmSuggestedActionOpenUri message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.verify|verify} messages. - * @param message RbmSuggestedActionOpenUri message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this GetConversationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes a RbmSuggestedActionOpenUri message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RbmSuggestedActionOpenUri - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri; + /** Properties of a CompleteConversationRequest. */ + interface ICompleteConversationRequest { - /** - * Decodes a RbmSuggestedActionOpenUri message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RbmSuggestedActionOpenUri - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri; + /** CompleteConversationRequest name */ + name?: (string|null); + } - /** - * Verifies a RbmSuggestedActionOpenUri message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Represents a CompleteConversationRequest. */ + class CompleteConversationRequest implements ICompleteConversationRequest { - /** - * Creates a RbmSuggestedActionOpenUri message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RbmSuggestedActionOpenUri - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri; + /** + * Constructs a new CompleteConversationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ICompleteConversationRequest); - /** - * Creates a plain object from a RbmSuggestedActionOpenUri message. Also converts values to other types if specified. - * @param message RbmSuggestedActionOpenUri - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CompleteConversationRequest name. */ + public name: string; - /** - * Converts this RbmSuggestedActionOpenUri to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a new CompleteConversationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CompleteConversationRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ICompleteConversationRequest): google.cloud.dialogflow.v2beta1.CompleteConversationRequest; - /** Properties of a RbmSuggestedActionShareLocation. */ - interface IRbmSuggestedActionShareLocation { - } + /** + * Encodes the specified CompleteConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CompleteConversationRequest.verify|verify} messages. + * @param message CompleteConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ICompleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a RbmSuggestedActionShareLocation. */ - class RbmSuggestedActionShareLocation implements IRbmSuggestedActionShareLocation { + /** + * Encodes the specified CompleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CompleteConversationRequest.verify|verify} messages. + * @param message CompleteConversationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICompleteConversationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new RbmSuggestedActionShareLocation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation); + /** + * Decodes a CompleteConversationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CompleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CompleteConversationRequest; - /** - * Creates a new RbmSuggestedActionShareLocation instance using the specified properties. - * @param [properties] Properties to set - * @returns RbmSuggestedActionShareLocation instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation; + /** + * Decodes a CompleteConversationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CompleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CompleteConversationRequest; - /** - * Encodes the specified RbmSuggestedActionShareLocation message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.verify|verify} messages. - * @param message RbmSuggestedActionShareLocation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a CompleteConversationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified RbmSuggestedActionShareLocation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.verify|verify} messages. - * @param message RbmSuggestedActionShareLocation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a CompleteConversationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CompleteConversationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CompleteConversationRequest; - /** - * Decodes a RbmSuggestedActionShareLocation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RbmSuggestedActionShareLocation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation; + /** + * Creates a plain object from a CompleteConversationRequest message. Also converts values to other types if specified. + * @param message CompleteConversationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CompleteConversationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a RbmSuggestedActionShareLocation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RbmSuggestedActionShareLocation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation; + /** + * Converts this CompleteConversationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a RbmSuggestedActionShareLocation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of a CreateCallMatcherRequest. */ + interface ICreateCallMatcherRequest { - /** - * Creates a RbmSuggestedActionShareLocation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RbmSuggestedActionShareLocation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation; + /** CreateCallMatcherRequest parent */ + parent?: (string|null); - /** - * Creates a plain object from a RbmSuggestedActionShareLocation message. Also converts values to other types if specified. - * @param message RbmSuggestedActionShareLocation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** CreateCallMatcherRequest callMatcher */ + callMatcher?: (google.cloud.dialogflow.v2beta1.ICallMatcher|null); + } - /** - * Converts this RbmSuggestedActionShareLocation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } + /** Represents a CreateCallMatcherRequest. */ + class CreateCallMatcherRequest implements ICreateCallMatcherRequest { - /** Properties of a MediaContent. */ - interface IMediaContent { + /** + * Constructs a new CreateCallMatcherRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest); - /** MediaContent mediaType */ - mediaType?: (google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType|null); + /** CreateCallMatcherRequest parent. */ + public parent: string; - /** MediaContent mediaObjects */ - mediaObjects?: (google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject[]|null); - } + /** CreateCallMatcherRequest callMatcher. */ + public callMatcher?: (google.cloud.dialogflow.v2beta1.ICallMatcher|null); - /** Represents a MediaContent. */ - class MediaContent implements IMediaContent { + /** + * Creates a new CreateCallMatcherRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateCallMatcherRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest): google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest; - /** - * Constructs a new MediaContent. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent); + /** + * Encodes the specified CreateCallMatcherRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest.verify|verify} messages. + * @param message CreateCallMatcherRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** MediaContent mediaType. */ - public mediaType: (google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType); + /** + * Encodes the specified CreateCallMatcherRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest.verify|verify} messages. + * @param message CreateCallMatcherRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** MediaContent mediaObjects. */ - public mediaObjects: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject[]; + /** + * Decodes a CreateCallMatcherRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateCallMatcherRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest; - /** - * Creates a new MediaContent instance using the specified properties. - * @param [properties] Properties to set - * @returns MediaContent instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent; + /** + * Decodes a CreateCallMatcherRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateCallMatcherRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest; - /** - * Encodes the specified MediaContent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.verify|verify} messages. - * @param message MediaContent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a CreateCallMatcherRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified MediaContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.verify|verify} messages. - * @param message MediaContent message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a CreateCallMatcherRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateCallMatcherRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest; - /** - * Decodes a MediaContent message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MediaContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent; + /** + * Creates a plain object from a CreateCallMatcherRequest message. Also converts values to other types if specified. + * @param message CreateCallMatcherRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a MediaContent message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MediaContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent; + /** + * Converts this CreateCallMatcherRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a MediaContent message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of a ListCallMatchersRequest. */ + interface IListCallMatchersRequest { - /** - * Creates a MediaContent message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MediaContent - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent; + /** ListCallMatchersRequest parent */ + parent?: (string|null); - /** - * Creates a plain object from a MediaContent message. Also converts values to other types if specified. - * @param message MediaContent - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ListCallMatchersRequest pageSize */ + pageSize?: (number|null); - /** - * Converts this MediaContent to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ListCallMatchersRequest pageToken */ + pageToken?: (string|null); + } - namespace MediaContent { + /** Represents a ListCallMatchersRequest. */ + class ListCallMatchersRequest implements IListCallMatchersRequest { - /** Properties of a ResponseMediaObject. */ - interface IResponseMediaObject { + /** + * Constructs a new ListCallMatchersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListCallMatchersRequest); - /** ResponseMediaObject name */ - name?: (string|null); + /** ListCallMatchersRequest parent. */ + public parent: string; - /** ResponseMediaObject description */ - description?: (string|null); + /** ListCallMatchersRequest pageSize. */ + public pageSize: number; - /** ResponseMediaObject largeImage */ - largeImage?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** ListCallMatchersRequest pageToken. */ + public pageToken: string; - /** ResponseMediaObject icon */ - icon?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** + * Creates a new ListCallMatchersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCallMatchersRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListCallMatchersRequest): google.cloud.dialogflow.v2beta1.ListCallMatchersRequest; - /** ResponseMediaObject contentUrl */ - contentUrl?: (string|null); - } + /** + * Encodes the specified ListCallMatchersRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListCallMatchersRequest.verify|verify} messages. + * @param message ListCallMatchersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** Represents a ResponseMediaObject. */ - class ResponseMediaObject implements IResponseMediaObject { + /** + * Encodes the specified ListCallMatchersRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListCallMatchersRequest.verify|verify} messages. + * @param message ListCallMatchersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new ResponseMediaObject. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject); + /** + * Decodes a ListCallMatchersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCallMatchersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListCallMatchersRequest; - /** ResponseMediaObject name. */ - public name: string; + /** + * Decodes a ListCallMatchersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCallMatchersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListCallMatchersRequest; - /** ResponseMediaObject description. */ - public description: string; + /** + * Verifies a ListCallMatchersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** ResponseMediaObject largeImage. */ - public largeImage?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** + * Creates a ListCallMatchersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCallMatchersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListCallMatchersRequest; - /** ResponseMediaObject icon. */ - public icon?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** + * Creates a plain object from a ListCallMatchersRequest message. Also converts values to other types if specified. + * @param message ListCallMatchersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListCallMatchersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ResponseMediaObject contentUrl. */ - public contentUrl: string; + /** + * Converts this ListCallMatchersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ResponseMediaObject image. */ - public image?: ("largeImage"|"icon"); + /** Properties of a ListCallMatchersResponse. */ + interface IListCallMatchersResponse { - /** - * Creates a new ResponseMediaObject instance using the specified properties. - * @param [properties] Properties to set - * @returns ResponseMediaObject instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject; + /** ListCallMatchersResponse callMatchers */ + callMatchers?: (google.cloud.dialogflow.v2beta1.ICallMatcher[]|null); - /** - * Encodes the specified ResponseMediaObject message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. - * @param message ResponseMediaObject message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListCallMatchersResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** - * Encodes the specified ResponseMediaObject message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. - * @param message ResponseMediaObject message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a ListCallMatchersResponse. */ + class ListCallMatchersResponse implements IListCallMatchersResponse { - /** - * Decodes a ResponseMediaObject message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResponseMediaObject - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject; + /** + * Constructs a new ListCallMatchersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListCallMatchersResponse); - /** - * Decodes a ResponseMediaObject message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResponseMediaObject - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject; + /** ListCallMatchersResponse callMatchers. */ + public callMatchers: google.cloud.dialogflow.v2beta1.ICallMatcher[]; - /** - * Verifies a ResponseMediaObject message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ListCallMatchersResponse nextPageToken. */ + public nextPageToken: string; - /** - * Creates a ResponseMediaObject message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResponseMediaObject - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject; + /** + * Creates a new ListCallMatchersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListCallMatchersResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListCallMatchersResponse): google.cloud.dialogflow.v2beta1.ListCallMatchersResponse; - /** - * Creates a plain object from a ResponseMediaObject message. Also converts values to other types if specified. - * @param message ResponseMediaObject - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified ListCallMatchersResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListCallMatchersResponse.verify|verify} messages. + * @param message ListCallMatchersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListCallMatchersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this ResponseMediaObject to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Encodes the specified ListCallMatchersResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListCallMatchersResponse.verify|verify} messages. + * @param message ListCallMatchersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListCallMatchersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** ResponseMediaType enum. */ - enum ResponseMediaType { - RESPONSE_MEDIA_TYPE_UNSPECIFIED = 0, - AUDIO = 1 - } - } + /** + * Decodes a ListCallMatchersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListCallMatchersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListCallMatchersResponse; - /** Properties of a BrowseCarouselCard. */ - interface IBrowseCarouselCard { + /** + * Decodes a ListCallMatchersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListCallMatchersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListCallMatchersResponse; - /** BrowseCarouselCard items */ - items?: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem[]|null); + /** + * Verifies a ListCallMatchersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** BrowseCarouselCard imageDisplayOptions */ - imageDisplayOptions?: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|null); - } + /** + * Creates a ListCallMatchersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListCallMatchersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListCallMatchersResponse; - /** Represents a BrowseCarouselCard. */ - class BrowseCarouselCard implements IBrowseCarouselCard { + /** + * Creates a plain object from a ListCallMatchersResponse message. Also converts values to other types if specified. + * @param message ListCallMatchersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListCallMatchersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Constructs a new BrowseCarouselCard. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard); + /** + * Converts this ListCallMatchersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** BrowseCarouselCard items. */ - public items: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem[]; + /** Properties of a DeleteCallMatcherRequest. */ + interface IDeleteCallMatcherRequest { - /** BrowseCarouselCard imageDisplayOptions. */ - public imageDisplayOptions: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions); + /** DeleteCallMatcherRequest name */ + name?: (string|null); + } - /** - * Creates a new BrowseCarouselCard instance using the specified properties. - * @param [properties] Properties to set - * @returns BrowseCarouselCard instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard; + /** Represents a DeleteCallMatcherRequest. */ + class DeleteCallMatcherRequest implements IDeleteCallMatcherRequest { - /** - * Encodes the specified BrowseCarouselCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.verify|verify} messages. - * @param message BrowseCarouselCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Constructs a new DeleteCallMatcherRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest); - /** - * Encodes the specified BrowseCarouselCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.verify|verify} messages. - * @param message BrowseCarouselCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** DeleteCallMatcherRequest name. */ + public name: string; - /** - * Decodes a BrowseCarouselCard message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BrowseCarouselCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard; + /** + * Creates a new DeleteCallMatcherRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteCallMatcherRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest): google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest; - /** - * Decodes a BrowseCarouselCard message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BrowseCarouselCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard; + /** + * Encodes the specified DeleteCallMatcherRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest.verify|verify} messages. + * @param message DeleteCallMatcherRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a BrowseCarouselCard message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Encodes the specified DeleteCallMatcherRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest.verify|verify} messages. + * @param message DeleteCallMatcherRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a BrowseCarouselCard message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BrowseCarouselCard - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard; + /** + * Decodes a DeleteCallMatcherRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteCallMatcherRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest; - /** - * Creates a plain object from a BrowseCarouselCard message. Also converts values to other types if specified. - * @param message BrowseCarouselCard - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Decodes a DeleteCallMatcherRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteCallMatcherRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest; - /** - * Converts this BrowseCarouselCard to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Verifies a DeleteCallMatcherRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - namespace BrowseCarouselCard { + /** + * Creates a DeleteCallMatcherRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteCallMatcherRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest; - /** Properties of a BrowseCarouselCardItem. */ - interface IBrowseCarouselCardItem { + /** + * Creates a plain object from a DeleteCallMatcherRequest message. Also converts values to other types if specified. + * @param message DeleteCallMatcherRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** BrowseCarouselCardItem openUriAction */ - openUriAction?: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null); + /** + * Converts this DeleteCallMatcherRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** BrowseCarouselCardItem title */ - title?: (string|null); + /** Properties of a CreateMessageRequest. */ + interface ICreateMessageRequest { - /** BrowseCarouselCardItem description */ - description?: (string|null); + /** CreateMessageRequest parent */ + parent?: (string|null); - /** BrowseCarouselCardItem image */ - image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** CreateMessageRequest message */ + message?: (google.cloud.dialogflow.v2beta1.IMessage|null); + } - /** BrowseCarouselCardItem footer */ - footer?: (string|null); - } + /** Represents a CreateMessageRequest. */ + class CreateMessageRequest implements ICreateMessageRequest { - /** Represents a BrowseCarouselCardItem. */ - class BrowseCarouselCardItem implements IBrowseCarouselCardItem { + /** + * Constructs a new CreateMessageRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateMessageRequest); - /** - * Constructs a new BrowseCarouselCardItem. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem); + /** CreateMessageRequest parent. */ + public parent: string; - /** BrowseCarouselCardItem openUriAction. */ - public openUriAction?: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null); + /** CreateMessageRequest message. */ + public message?: (google.cloud.dialogflow.v2beta1.IMessage|null); - /** BrowseCarouselCardItem title. */ - public title: string; + /** + * Creates a new CreateMessageRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateMessageRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateMessageRequest): google.cloud.dialogflow.v2beta1.CreateMessageRequest; - /** BrowseCarouselCardItem description. */ - public description: string; + /** + * Encodes the specified CreateMessageRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateMessageRequest.verify|verify} messages. + * @param message CreateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ICreateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** BrowseCarouselCardItem image. */ - public image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** + * Encodes the specified CreateMessageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateMessageRequest.verify|verify} messages. + * @param message CreateMessageRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateMessageRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** BrowseCarouselCardItem footer. */ - public footer: string; + /** + * Decodes a CreateMessageRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateMessageRequest; - /** - * Creates a new BrowseCarouselCardItem instance using the specified properties. - * @param [properties] Properties to set - * @returns BrowseCarouselCardItem instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; + /** + * Decodes a CreateMessageRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateMessageRequest; - /** - * Encodes the specified BrowseCarouselCardItem message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. - * @param message BrowseCarouselCardItem message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a CreateMessageRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified BrowseCarouselCardItem message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. - * @param message BrowseCarouselCardItem message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a CreateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateMessageRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateMessageRequest; - /** - * Decodes a BrowseCarouselCardItem message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BrowseCarouselCardItem - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; + /** + * Creates a plain object from a CreateMessageRequest message. Also converts values to other types if specified. + * @param message CreateMessageRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CreateMessageRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes a BrowseCarouselCardItem message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BrowseCarouselCardItem - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; + /** + * Converts this CreateMessageRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Verifies a BrowseCarouselCardItem message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** Properties of a BatchCreateMessagesRequest. */ + interface IBatchCreateMessagesRequest { - /** - * Creates a BrowseCarouselCardItem message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BrowseCarouselCardItem - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem; + /** BatchCreateMessagesRequest parent */ + parent?: (string|null); - /** - * Creates a plain object from a BrowseCarouselCardItem message. Also converts values to other types if specified. - * @param message BrowseCarouselCardItem - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** BatchCreateMessagesRequest requests */ + requests?: (google.cloud.dialogflow.v2beta1.ICreateMessageRequest[]|null); + } - /** - * Converts this BrowseCarouselCardItem to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a BatchCreateMessagesRequest. */ + class BatchCreateMessagesRequest implements IBatchCreateMessagesRequest { - namespace BrowseCarouselCardItem { + /** + * Constructs a new BatchCreateMessagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest); - /** Properties of an OpenUrlAction. */ - interface IOpenUrlAction { + /** BatchCreateMessagesRequest parent. */ + public parent: string; - /** OpenUrlAction url */ - url?: (string|null); + /** BatchCreateMessagesRequest requests. */ + public requests: google.cloud.dialogflow.v2beta1.ICreateMessageRequest[]; - /** OpenUrlAction urlTypeHint */ - urlTypeHint?: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|null); - } + /** + * Creates a new BatchCreateMessagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateMessagesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest): google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest; - /** Represents an OpenUrlAction. */ - class OpenUrlAction implements IOpenUrlAction { + /** + * Encodes the specified BatchCreateMessagesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest.verify|verify} messages. + * @param message BatchCreateMessagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new OpenUrlAction. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction); + /** + * Encodes the specified BatchCreateMessagesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest.verify|verify} messages. + * @param message BatchCreateMessagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** OpenUrlAction url. */ - public url: string; + /** + * Decodes a BatchCreateMessagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest; - /** OpenUrlAction urlTypeHint. */ - public urlTypeHint: (google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint); + /** + * Decodes a BatchCreateMessagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest; - /** - * Creates a new OpenUrlAction instance using the specified properties. - * @param [properties] Properties to set - * @returns OpenUrlAction instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; + /** + * Verifies a BatchCreateMessagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Encodes the specified OpenUrlAction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. - * @param message OpenUrlAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a BatchCreateMessagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateMessagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest; - /** - * Encodes the specified OpenUrlAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. - * @param message OpenUrlAction message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a plain object from a BatchCreateMessagesRequest message. Also converts values to other types if specified. + * @param message BatchCreateMessagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Decodes an OpenUrlAction message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OpenUrlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; + /** + * Converts this BatchCreateMessagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Decodes an OpenUrlAction message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OpenUrlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; + /** Properties of a BatchCreateMessagesResponse. */ + interface IBatchCreateMessagesResponse { - /** - * Verifies an OpenUrlAction message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** BatchCreateMessagesResponse messages */ + messages?: (google.cloud.dialogflow.v2beta1.IMessage[]|null); + } - /** - * Creates an OpenUrlAction message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OpenUrlAction - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction; + /** Represents a BatchCreateMessagesResponse. */ + class BatchCreateMessagesResponse implements IBatchCreateMessagesResponse { - /** - * Creates a plain object from an OpenUrlAction message. Also converts values to other types if specified. - * @param message OpenUrlAction - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new BatchCreateMessagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse); - /** - * Converts this OpenUrlAction to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** BatchCreateMessagesResponse messages. */ + public messages: google.cloud.dialogflow.v2beta1.IMessage[]; - namespace OpenUrlAction { + /** + * Creates a new BatchCreateMessagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns BatchCreateMessagesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse): google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse; - /** UrlTypeHint enum. */ - enum UrlTypeHint { - URL_TYPE_HINT_UNSPECIFIED = 0, - AMP_ACTION = 1, - AMP_CONTENT = 2 - } - } - } + /** + * Encodes the specified BatchCreateMessagesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse.verify|verify} messages. + * @param message BatchCreateMessagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** ImageDisplayOptions enum. */ - enum ImageDisplayOptions { - IMAGE_DISPLAY_OPTIONS_UNSPECIFIED = 0, - GRAY = 1, - WHITE = 2, - CROPPED = 3, - BLURRED_BACKGROUND = 4 - } - } + /** + * Encodes the specified BatchCreateMessagesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse.verify|verify} messages. + * @param message BatchCreateMessagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** Properties of a TableCard. */ - interface ITableCard { + /** + * Decodes a BatchCreateMessagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BatchCreateMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse; - /** TableCard title */ - title?: (string|null); + /** + * Decodes a BatchCreateMessagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BatchCreateMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse; - /** TableCard subtitle */ - subtitle?: (string|null); + /** + * Verifies a BatchCreateMessagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** TableCard image */ - image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** + * Creates a BatchCreateMessagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BatchCreateMessagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse; - /** TableCard columnProperties */ - columnProperties?: (google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties[]|null); + /** + * Creates a plain object from a BatchCreateMessagesResponse message. Also converts values to other types if specified. + * @param message BatchCreateMessagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** TableCard rows */ - rows?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow[]|null); + /** + * Converts this BatchCreateMessagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** TableCard buttons */ - buttons?: (google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton[]|null); - } + /** Properties of a ListMessagesRequest. */ + interface IListMessagesRequest { - /** Represents a TableCard. */ - class TableCard implements ITableCard { + /** ListMessagesRequest parent */ + parent?: (string|null); - /** - * Constructs a new TableCard. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard); + /** ListMessagesRequest filter */ + filter?: (string|null); - /** TableCard title. */ - public title: string; + /** ListMessagesRequest pageSize */ + pageSize?: (number|null); - /** TableCard subtitle. */ - public subtitle: string; + /** ListMessagesRequest pageToken */ + pageToken?: (string|null); + } - /** TableCard image. */ - public image?: (google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null); + /** Represents a ListMessagesRequest. */ + class ListMessagesRequest implements IListMessagesRequest { - /** TableCard columnProperties. */ - public columnProperties: google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties[]; + /** + * Constructs a new ListMessagesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListMessagesRequest); - /** TableCard rows. */ - public rows: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow[]; + /** ListMessagesRequest parent. */ + public parent: string; - /** TableCard buttons. */ - public buttons: google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton[]; + /** ListMessagesRequest filter. */ + public filter: string; - /** - * Creates a new TableCard instance using the specified properties. - * @param [properties] Properties to set - * @returns TableCard instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard): google.cloud.dialogflow.v2beta1.Intent.Message.TableCard; + /** ListMessagesRequest pageSize. */ + public pageSize: number; - /** - * Encodes the specified TableCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.verify|verify} messages. - * @param message TableCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListMessagesRequest pageToken. */ + public pageToken: string; - /** - * Encodes the specified TableCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.verify|verify} messages. - * @param message TableCard message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ListMessagesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMessagesRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListMessagesRequest): google.cloud.dialogflow.v2beta1.ListMessagesRequest; - /** - * Decodes a TableCard message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TableCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.TableCard; + /** + * Encodes the specified ListMessagesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListMessagesRequest.verify|verify} messages. + * @param message ListMessagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a TableCard message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TableCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.TableCard; + /** + * Encodes the specified ListMessagesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListMessagesRequest.verify|verify} messages. + * @param message ListMessagesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListMessagesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a TableCard message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListMessagesRequest; - /** - * Creates a TableCard message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TableCard - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.TableCard; + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListMessagesRequest; - /** - * Creates a plain object from a TableCard message. Also converts values to other types if specified. - * @param message TableCard - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.TableCard, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a ListMessagesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this TableCard to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a ListMessagesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMessagesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListMessagesRequest; - /** Properties of a ColumnProperties. */ - interface IColumnProperties { + /** + * Creates a plain object from a ListMessagesRequest message. Also converts values to other types if specified. + * @param message ListMessagesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListMessagesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** ColumnProperties header */ - header?: (string|null); + /** + * Converts this ListMessagesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** ColumnProperties horizontalAlignment */ - horizontalAlignment?: (google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment|null); - } + /** Properties of a ListMessagesResponse. */ + interface IListMessagesResponse { - /** Represents a ColumnProperties. */ - class ColumnProperties implements IColumnProperties { + /** ListMessagesResponse messages */ + messages?: (google.cloud.dialogflow.v2beta1.IMessage[]|null); - /** - * Constructs a new ColumnProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties); + /** ListMessagesResponse nextPageToken */ + nextPageToken?: (string|null); + } - /** ColumnProperties header. */ - public header: string; + /** Represents a ListMessagesResponse. */ + class ListMessagesResponse implements IListMessagesResponse { - /** ColumnProperties horizontalAlignment. */ - public horizontalAlignment: (google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment|keyof typeof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment); + /** + * Constructs a new ListMessagesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListMessagesResponse); - /** - * Creates a new ColumnProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns ColumnProperties instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties): google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties; + /** ListMessagesResponse messages. */ + public messages: google.cloud.dialogflow.v2beta1.IMessage[]; - /** - * Encodes the specified ColumnProperties message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.verify|verify} messages. - * @param message ColumnProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties, writer?: $protobuf.Writer): $protobuf.Writer; + /** ListMessagesResponse nextPageToken. */ + public nextPageToken: string; - /** - * Encodes the specified ColumnProperties message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.verify|verify} messages. - * @param message ColumnProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new ListMessagesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListMessagesResponse instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IListMessagesResponse): google.cloud.dialogflow.v2beta1.ListMessagesResponse; - /** - * Decodes a ColumnProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ColumnProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties; + /** + * Encodes the specified ListMessagesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListMessagesResponse.verify|verify} messages. + * @param message ListMessagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IListMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a ColumnProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ColumnProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties; + /** + * Encodes the specified ListMessagesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListMessagesResponse.verify|verify} messages. + * @param message ListMessagesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListMessagesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies a ColumnProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListMessagesResponse; - /** - * Creates a ColumnProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ColumnProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties; + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListMessagesResponse; - /** - * Creates a plain object from a ColumnProperties message. Also converts values to other types if specified. - * @param message ColumnProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a ListMessagesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this ColumnProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a ListMessagesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListMessagesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListMessagesResponse; - namespace ColumnProperties { + /** + * Creates a plain object from a ListMessagesResponse message. Also converts values to other types if specified. + * @param message ListMessagesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ListMessagesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** HorizontalAlignment enum. */ - enum HorizontalAlignment { - HORIZONTAL_ALIGNMENT_UNSPECIFIED = 0, - LEADING = 1, - CENTER = 2, - TRAILING = 3 - } - } + /** + * Converts this ListMessagesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Properties of a TableCardRow. */ - interface ITableCardRow { + /** Properties of a ConversationEvent. */ + interface IConversationEvent { - /** TableCardRow cells */ - cells?: (google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell[]|null); + /** ConversationEvent conversation */ + conversation?: (string|null); - /** TableCardRow dividerAfter */ - dividerAfter?: (boolean|null); - } + /** ConversationEvent type */ + type?: (google.cloud.dialogflow.v2beta1.ConversationEvent.Type|keyof typeof google.cloud.dialogflow.v2beta1.ConversationEvent.Type|null); - /** Represents a TableCardRow. */ - class TableCardRow implements ITableCardRow { + /** ConversationEvent errorStatus */ + errorStatus?: (google.rpc.IStatus|null); - /** - * Constructs a new TableCardRow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow); + /** ConversationEvent newMessagePayload */ + newMessagePayload?: (google.cloud.dialogflow.v2beta1.IMessage|null); + } - /** TableCardRow cells. */ - public cells: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell[]; + /** Represents a ConversationEvent. */ + class ConversationEvent implements IConversationEvent { - /** TableCardRow dividerAfter. */ - public dividerAfter: boolean; + /** + * Constructs a new ConversationEvent. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IConversationEvent); - /** - * Creates a new TableCardRow instance using the specified properties. - * @param [properties] Properties to set - * @returns TableCardRow instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow; + /** ConversationEvent conversation. */ + public conversation: string; - /** - * Encodes the specified TableCardRow message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.verify|verify} messages. - * @param message TableCardRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow, writer?: $protobuf.Writer): $protobuf.Writer; + /** ConversationEvent type. */ + public type: (google.cloud.dialogflow.v2beta1.ConversationEvent.Type|keyof typeof google.cloud.dialogflow.v2beta1.ConversationEvent.Type); - /** - * Encodes the specified TableCardRow message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.verify|verify} messages. - * @param message TableCardRow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow, writer?: $protobuf.Writer): $protobuf.Writer; + /** ConversationEvent errorStatus. */ + public errorStatus?: (google.rpc.IStatus|null); - /** - * Decodes a TableCardRow message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TableCardRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow; + /** ConversationEvent newMessagePayload. */ + public newMessagePayload?: (google.cloud.dialogflow.v2beta1.IMessage|null); - /** - * Decodes a TableCardRow message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TableCardRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow; + /** ConversationEvent payload. */ + public payload?: "newMessagePayload"; - /** - * Verifies a TableCardRow message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new ConversationEvent instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationEvent instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.IConversationEvent): google.cloud.dialogflow.v2beta1.ConversationEvent; - /** - * Creates a TableCardRow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TableCardRow - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow; + /** + * Encodes the specified ConversationEvent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ConversationEvent.verify|verify} messages. + * @param message ConversationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.IConversationEvent, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a TableCardRow message. Also converts values to other types if specified. - * @param message TableCardRow - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified ConversationEvent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ConversationEvent.verify|verify} messages. + * @param message ConversationEvent message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IConversationEvent, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this TableCardRow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a ConversationEvent message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ConversationEvent; - /** Properties of a TableCardCell. */ - interface ITableCardCell { + /** + * Decodes a ConversationEvent message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ConversationEvent; - /** TableCardCell text */ - text?: (string|null); - } + /** + * Verifies a ConversationEvent message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a TableCardCell. */ - class TableCardCell implements ITableCardCell { + /** + * Creates a ConversationEvent message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationEvent + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ConversationEvent; - /** - * Constructs a new TableCardCell. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell); + /** + * Creates a plain object from a ConversationEvent message. Also converts values to other types if specified. + * @param message ConversationEvent + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.ConversationEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** TableCardCell text. */ - public text: string; + /** + * Converts this ConversationEvent to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Creates a new TableCardCell instance using the specified properties. - * @param [properties] Properties to set - * @returns TableCardCell instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell; + namespace ConversationEvent { - /** - * Encodes the specified TableCardCell message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.verify|verify} messages. - * @param message TableCardCell message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell, writer?: $protobuf.Writer): $protobuf.Writer; + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + CONVERSATION_STARTED = 1, + CONVERSATION_FINISHED = 2, + NEW_MESSAGE = 5, + UNRECOVERABLE_ERROR = 4 + } + } - /** - * Encodes the specified TableCardCell message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.verify|verify} messages. - * @param message TableCardCell message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell, writer?: $protobuf.Writer): $protobuf.Writer; + /** Represents a ConversationProfiles */ + class ConversationProfiles extends $protobuf.rpc.Service { - /** - * Decodes a TableCardCell message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TableCardCell - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell; + /** + * Constructs a new ConversationProfiles service. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + */ + constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); - /** - * Decodes a TableCardCell message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TableCardCell - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell; + /** + * Creates new ConversationProfiles service using the specified rpc implementation. + * @param rpcImpl RPC implementation + * @param [requestDelimited=false] Whether requests are length-delimited + * @param [responseDelimited=false] Whether responses are length-delimited + * @returns RPC service. Useful where requests and/or responses are streamed. + */ + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): ConversationProfiles; - /** - * Verifies a TableCardCell message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Calls ListConversationProfiles. + * @param request ListConversationProfilesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListConversationProfilesResponse + */ + public listConversationProfiles(request: google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, callback: google.cloud.dialogflow.v2beta1.ConversationProfiles.ListConversationProfilesCallback): void; - /** - * Creates a TableCardCell message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TableCardCell - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell; + /** + * Calls ListConversationProfiles. + * @param request ListConversationProfilesRequest message or plain object + * @returns Promise + */ + public listConversationProfiles(request: google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest): Promise; - /** - * Creates a plain object from a TableCardCell message. Also converts values to other types if specified. - * @param message TableCardCell - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Calls GetConversationProfile. + * @param request GetConversationProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConversationProfile + */ + public getConversationProfile(request: google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest, callback: google.cloud.dialogflow.v2beta1.ConversationProfiles.GetConversationProfileCallback): void; - /** - * Converts this TableCardCell to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Calls GetConversationProfile. + * @param request GetConversationProfileRequest message or plain object + * @returns Promise + */ + public getConversationProfile(request: google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest): Promise; - /** Platform enum. */ - enum Platform { - PLATFORM_UNSPECIFIED = 0, - FACEBOOK = 1, - SLACK = 2, - TELEGRAM = 3, - KIK = 4, - SKYPE = 5, - LINE = 6, - VIBER = 7, - ACTIONS_ON_GOOGLE = 8, - TELEPHONY = 10, - GOOGLE_HANGOUTS = 11 - } - } + /** + * Calls CreateConversationProfile. + * @param request CreateConversationProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConversationProfile + */ + public createConversationProfile(request: google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest, callback: google.cloud.dialogflow.v2beta1.ConversationProfiles.CreateConversationProfileCallback): void; - /** Properties of a FollowupIntentInfo. */ - interface IFollowupIntentInfo { + /** + * Calls CreateConversationProfile. + * @param request CreateConversationProfileRequest message or plain object + * @returns Promise + */ + public createConversationProfile(request: google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest): Promise; - /** FollowupIntentInfo followupIntentName */ - followupIntentName?: (string|null); + /** + * Calls UpdateConversationProfile. + * @param request UpdateConversationProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ConversationProfile + */ + public updateConversationProfile(request: google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest, callback: google.cloud.dialogflow.v2beta1.ConversationProfiles.UpdateConversationProfileCallback): void; - /** FollowupIntentInfo parentFollowupIntentName */ - parentFollowupIntentName?: (string|null); - } + /** + * Calls UpdateConversationProfile. + * @param request UpdateConversationProfileRequest message or plain object + * @returns Promise + */ + public updateConversationProfile(request: google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest): Promise; - /** Represents a FollowupIntentInfo. */ - class FollowupIntentInfo implements IFollowupIntentInfo { + /** + * Calls DeleteConversationProfile. + * @param request DeleteConversationProfileRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty + */ + public deleteConversationProfile(request: google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest, callback: google.cloud.dialogflow.v2beta1.ConversationProfiles.DeleteConversationProfileCallback): void; - /** - * Constructs a new FollowupIntentInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo); + /** + * Calls DeleteConversationProfile. + * @param request DeleteConversationProfileRequest message or plain object + * @returns Promise + */ + public deleteConversationProfile(request: google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest): Promise; + } - /** FollowupIntentInfo followupIntentName. */ - public followupIntentName: string; + namespace ConversationProfiles { - /** FollowupIntentInfo parentFollowupIntentName. */ - public parentFollowupIntentName: string; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.ConversationProfiles#listConversationProfiles}. + * @param error Error, if any + * @param [response] ListConversationProfilesResponse + */ + type ListConversationProfilesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse) => void; - /** - * Creates a new FollowupIntentInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FollowupIntentInfo instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo): google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.ConversationProfiles#getConversationProfile}. + * @param error Error, if any + * @param [response] ConversationProfile + */ + type GetConversationProfileCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ConversationProfile) => void; - /** - * Encodes the specified FollowupIntentInfo message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.verify|verify} messages. - * @param message FollowupIntentInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.ConversationProfiles#createConversationProfile}. + * @param error Error, if any + * @param [response] ConversationProfile + */ + type CreateConversationProfileCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ConversationProfile) => void; - /** - * Encodes the specified FollowupIntentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.verify|verify} messages. - * @param message FollowupIntentInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.ConversationProfiles#updateConversationProfile}. + * @param error Error, if any + * @param [response] ConversationProfile + */ + type UpdateConversationProfileCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ConversationProfile) => void; - /** - * Decodes a FollowupIntentInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FollowupIntentInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.ConversationProfiles#deleteConversationProfile}. + * @param error Error, if any + * @param [response] Empty + */ + type DeleteConversationProfileCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + } - /** - * Decodes a FollowupIntentInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FollowupIntentInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo; + /** Properties of a ConversationProfile. */ + interface IConversationProfile { - /** - * Verifies a FollowupIntentInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ConversationProfile name */ + name?: (string|null); - /** - * Creates a FollowupIntentInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FollowupIntentInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo; + /** ConversationProfile displayName */ + displayName?: (string|null); - /** - * Creates a plain object from a FollowupIntentInfo message. Also converts values to other types if specified. - * @param message FollowupIntentInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ConversationProfile createTime */ + createTime?: (google.protobuf.ITimestamp|null); - /** - * Converts this FollowupIntentInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ConversationProfile updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); - /** WebhookState enum. */ - enum WebhookState { - WEBHOOK_STATE_UNSPECIFIED = 0, - WEBHOOK_STATE_ENABLED = 1, - WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING = 2 - } - } + /** ConversationProfile automatedAgentConfig */ + automatedAgentConfig?: (google.cloud.dialogflow.v2beta1.IAutomatedAgentConfig|null); - /** Properties of a ListIntentsRequest. */ - interface IListIntentsRequest { + /** ConversationProfile humanAgentAssistantConfig */ + humanAgentAssistantConfig?: (google.cloud.dialogflow.v2beta1.IHumanAgentAssistantConfig|null); - /** ListIntentsRequest parent */ - parent?: (string|null); + /** ConversationProfile humanAgentHandoffConfig */ + humanAgentHandoffConfig?: (google.cloud.dialogflow.v2beta1.IHumanAgentHandoffConfig|null); - /** ListIntentsRequest languageCode */ - languageCode?: (string|null); + /** ConversationProfile notificationConfig */ + notificationConfig?: (google.cloud.dialogflow.v2beta1.INotificationConfig|null); - /** ListIntentsRequest intentView */ - intentView?: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView|null); + /** ConversationProfile loggingConfig */ + loggingConfig?: (google.cloud.dialogflow.v2beta1.ILoggingConfig|null); - /** ListIntentsRequest pageSize */ - pageSize?: (number|null); + /** ConversationProfile newMessageEventNotificationConfig */ + newMessageEventNotificationConfig?: (google.cloud.dialogflow.v2beta1.INotificationConfig|null); - /** ListIntentsRequest pageToken */ - pageToken?: (string|null); + /** ConversationProfile sttConfig */ + sttConfig?: (google.cloud.dialogflow.v2beta1.ISpeechToTextConfig|null); + + /** ConversationProfile languageCode */ + languageCode?: (string|null); } - /** Represents a ListIntentsRequest. */ - class ListIntentsRequest implements IListIntentsRequest { + /** Represents a ConversationProfile. */ + class ConversationProfile implements IConversationProfile { /** - * Constructs a new ListIntentsRequest. + * Constructs a new ConversationProfile. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListIntentsRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.IConversationProfile); - /** ListIntentsRequest parent. */ - public parent: string; + /** ConversationProfile name. */ + public name: string; - /** ListIntentsRequest languageCode. */ - public languageCode: string; + /** ConversationProfile displayName. */ + public displayName: string; - /** ListIntentsRequest intentView. */ - public intentView: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView); + /** ConversationProfile createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); - /** ListIntentsRequest pageSize. */ - public pageSize: number; + /** ConversationProfile updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); - /** ListIntentsRequest pageToken. */ - public pageToken: string; + /** ConversationProfile automatedAgentConfig. */ + public automatedAgentConfig?: (google.cloud.dialogflow.v2beta1.IAutomatedAgentConfig|null); + + /** ConversationProfile humanAgentAssistantConfig. */ + public humanAgentAssistantConfig?: (google.cloud.dialogflow.v2beta1.IHumanAgentAssistantConfig|null); + + /** ConversationProfile humanAgentHandoffConfig. */ + public humanAgentHandoffConfig?: (google.cloud.dialogflow.v2beta1.IHumanAgentHandoffConfig|null); + + /** ConversationProfile notificationConfig. */ + public notificationConfig?: (google.cloud.dialogflow.v2beta1.INotificationConfig|null); + + /** ConversationProfile loggingConfig. */ + public loggingConfig?: (google.cloud.dialogflow.v2beta1.ILoggingConfig|null); + + /** ConversationProfile newMessageEventNotificationConfig. */ + public newMessageEventNotificationConfig?: (google.cloud.dialogflow.v2beta1.INotificationConfig|null); + + /** ConversationProfile sttConfig. */ + public sttConfig?: (google.cloud.dialogflow.v2beta1.ISpeechToTextConfig|null); + + /** ConversationProfile languageCode. */ + public languageCode: string; /** - * Creates a new ListIntentsRequest instance using the specified properties. + * Creates a new ConversationProfile instance using the specified properties. * @param [properties] Properties to set - * @returns ListIntentsRequest instance + * @returns ConversationProfile instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListIntentsRequest): google.cloud.dialogflow.v2beta1.ListIntentsRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IConversationProfile): google.cloud.dialogflow.v2beta1.ConversationProfile; /** - * Encodes the specified ListIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsRequest.verify|verify} messages. - * @param message ListIntentsRequest message or plain object to encode + * Encodes the specified ConversationProfile message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ConversationProfile.verify|verify} messages. + * @param message ConversationProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IConversationProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsRequest.verify|verify} messages. - * @param message ListIntentsRequest message or plain object to encode + * Encodes the specified ConversationProfile message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ConversationProfile.verify|verify} messages. + * @param message ConversationProfile message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IConversationProfile, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListIntentsRequest message from the specified reader or buffer. + * Decodes a ConversationProfile message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListIntentsRequest + * @returns ConversationProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListIntentsRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ConversationProfile; /** - * Decodes a ListIntentsRequest message from the specified reader or buffer, length delimited. + * Decodes a ConversationProfile message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListIntentsRequest + * @returns ConversationProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListIntentsRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ConversationProfile; /** - * Verifies a ListIntentsRequest message. + * Verifies a ConversationProfile message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListIntentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ConversationProfile message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListIntentsRequest + * @returns ConversationProfile */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListIntentsRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ConversationProfile; /** - * Creates a plain object from a ListIntentsRequest message. Also converts values to other types if specified. - * @param message ListIntentsRequest + * Creates a plain object from a ConversationProfile message. Also converts values to other types if specified. + * @param message ConversationProfile * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ConversationProfile, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListIntentsRequest to JSON. + * Converts this ConversationProfile to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListIntentsResponse. */ - interface IListIntentsResponse { - - /** ListIntentsResponse intents */ - intents?: (google.cloud.dialogflow.v2beta1.IIntent[]|null); + /** Properties of an AutomatedAgentConfig. */ + interface IAutomatedAgentConfig { - /** ListIntentsResponse nextPageToken */ - nextPageToken?: (string|null); + /** AutomatedAgentConfig agent */ + agent?: (string|null); } - /** Represents a ListIntentsResponse. */ - class ListIntentsResponse implements IListIntentsResponse { + /** Represents an AutomatedAgentConfig. */ + class AutomatedAgentConfig implements IAutomatedAgentConfig { /** - * Constructs a new ListIntentsResponse. + * Constructs a new AutomatedAgentConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListIntentsResponse); + constructor(properties?: google.cloud.dialogflow.v2beta1.IAutomatedAgentConfig); - /** ListIntentsResponse intents. */ - public intents: google.cloud.dialogflow.v2beta1.IIntent[]; - - /** ListIntentsResponse nextPageToken. */ - public nextPageToken: string; + /** AutomatedAgentConfig agent. */ + public agent: string; /** - * Creates a new ListIntentsResponse instance using the specified properties. + * Creates a new AutomatedAgentConfig instance using the specified properties. * @param [properties] Properties to set - * @returns ListIntentsResponse instance + * @returns AutomatedAgentConfig instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListIntentsResponse): google.cloud.dialogflow.v2beta1.ListIntentsResponse; + public static create(properties?: google.cloud.dialogflow.v2beta1.IAutomatedAgentConfig): google.cloud.dialogflow.v2beta1.AutomatedAgentConfig; /** - * Encodes the specified ListIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsResponse.verify|verify} messages. - * @param message ListIntentsResponse message or plain object to encode + * Encodes the specified AutomatedAgentConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AutomatedAgentConfig.verify|verify} messages. + * @param message AutomatedAgentConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IAutomatedAgentConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsResponse.verify|verify} messages. - * @param message ListIntentsResponse message or plain object to encode + * Encodes the specified AutomatedAgentConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AutomatedAgentConfig.verify|verify} messages. + * @param message AutomatedAgentConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IAutomatedAgentConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListIntentsResponse message from the specified reader or buffer. + * Decodes an AutomatedAgentConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListIntentsResponse + * @returns AutomatedAgentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListIntentsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.AutomatedAgentConfig; /** - * Decodes a ListIntentsResponse message from the specified reader or buffer, length delimited. + * Decodes an AutomatedAgentConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListIntentsResponse + * @returns AutomatedAgentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListIntentsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.AutomatedAgentConfig; /** - * Verifies a ListIntentsResponse message. + * Verifies an AutomatedAgentConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListIntentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AutomatedAgentConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListIntentsResponse + * @returns AutomatedAgentConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListIntentsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.AutomatedAgentConfig; /** - * Creates a plain object from a ListIntentsResponse message. Also converts values to other types if specified. - * @param message ListIntentsResponse + * Creates a plain object from an AutomatedAgentConfig message. Also converts values to other types if specified. + * @param message AutomatedAgentConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.AutomatedAgentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListIntentsResponse to JSON. + * Converts this AutomatedAgentConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetIntentRequest. */ - interface IGetIntentRequest { + /** Properties of a HumanAgentAssistantConfig. */ + interface IHumanAgentAssistantConfig { - /** GetIntentRequest name */ - name?: (string|null); + /** HumanAgentAssistantConfig notificationConfig */ + notificationConfig?: (google.cloud.dialogflow.v2beta1.INotificationConfig|null); - /** GetIntentRequest languageCode */ - languageCode?: (string|null); + /** HumanAgentAssistantConfig humanAgentSuggestionConfig */ + humanAgentSuggestionConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig|null); - /** GetIntentRequest intentView */ - intentView?: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView|null); + /** HumanAgentAssistantConfig endUserSuggestionConfig */ + endUserSuggestionConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig|null); + + /** HumanAgentAssistantConfig messageAnalysisConfig */ + messageAnalysisConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IMessageAnalysisConfig|null); } - /** Represents a GetIntentRequest. */ - class GetIntentRequest implements IGetIntentRequest { + /** Represents a HumanAgentAssistantConfig. */ + class HumanAgentAssistantConfig implements IHumanAgentAssistantConfig { /** - * Constructs a new GetIntentRequest. + * Constructs a new HumanAgentAssistantConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IGetIntentRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.IHumanAgentAssistantConfig); - /** GetIntentRequest name. */ - public name: string; + /** HumanAgentAssistantConfig notificationConfig. */ + public notificationConfig?: (google.cloud.dialogflow.v2beta1.INotificationConfig|null); - /** GetIntentRequest languageCode. */ - public languageCode: string; + /** HumanAgentAssistantConfig humanAgentSuggestionConfig. */ + public humanAgentSuggestionConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig|null); - /** GetIntentRequest intentView. */ - public intentView: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView); + /** HumanAgentAssistantConfig endUserSuggestionConfig. */ + public endUserSuggestionConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig|null); + + /** HumanAgentAssistantConfig messageAnalysisConfig. */ + public messageAnalysisConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IMessageAnalysisConfig|null); /** - * Creates a new GetIntentRequest instance using the specified properties. + * Creates a new HumanAgentAssistantConfig instance using the specified properties. * @param [properties] Properties to set - * @returns GetIntentRequest instance + * @returns HumanAgentAssistantConfig instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IGetIntentRequest): google.cloud.dialogflow.v2beta1.GetIntentRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IHumanAgentAssistantConfig): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig; /** - * Encodes the specified GetIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetIntentRequest.verify|verify} messages. - * @param message GetIntentRequest message or plain object to encode + * Encodes the specified HumanAgentAssistantConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.verify|verify} messages. + * @param message HumanAgentAssistantConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IGetIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IHumanAgentAssistantConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetIntentRequest.verify|verify} messages. - * @param message GetIntentRequest message or plain object to encode + * Encodes the specified HumanAgentAssistantConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.verify|verify} messages. + * @param message HumanAgentAssistantConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IHumanAgentAssistantConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HumanAgentAssistantConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HumanAgentAssistantConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig; + + /** + * Decodes a HumanAgentAssistantConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HumanAgentAssistantConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig; + + /** + * Verifies a HumanAgentAssistantConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HumanAgentAssistantConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HumanAgentAssistantConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig; + + /** + * Creates a plain object from a HumanAgentAssistantConfig message. Also converts values to other types if specified. + * @param message HumanAgentAssistantConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HumanAgentAssistantConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace HumanAgentAssistantConfig { + + /** Properties of a SuggestionTriggerSettings. */ + interface ISuggestionTriggerSettings { + + /** SuggestionTriggerSettings noSmallTalk */ + noSmallTalk?: (boolean|null); + + /** SuggestionTriggerSettings onlyEndUser */ + onlyEndUser?: (boolean|null); + } + + /** Represents a SuggestionTriggerSettings. */ + class SuggestionTriggerSettings implements ISuggestionTriggerSettings { + + /** + * Constructs a new SuggestionTriggerSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionTriggerSettings); + + /** SuggestionTriggerSettings noSmallTalk. */ + public noSmallTalk: boolean; + + /** SuggestionTriggerSettings onlyEndUser. */ + public onlyEndUser: boolean; + + /** + * Creates a new SuggestionTriggerSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionTriggerSettings instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionTriggerSettings): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings; + + /** + * Encodes the specified SuggestionTriggerSettings message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings.verify|verify} messages. + * @param message SuggestionTriggerSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionTriggerSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionTriggerSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings.verify|verify} messages. + * @param message SuggestionTriggerSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionTriggerSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionTriggerSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionTriggerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings; + + /** + * Decodes a SuggestionTriggerSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionTriggerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings; + + /** + * Verifies a SuggestionTriggerSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionTriggerSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionTriggerSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings; + + /** + * Creates a plain object from a SuggestionTriggerSettings message. Also converts values to other types if specified. + * @param message SuggestionTriggerSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionTriggerSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestionFeatureConfig. */ + interface ISuggestionFeatureConfig { + + /** SuggestionFeatureConfig suggestionFeature */ + suggestionFeature?: (google.cloud.dialogflow.v2beta1.ISuggestionFeature|null); + + /** SuggestionFeatureConfig enableEventBasedSuggestion */ + enableEventBasedSuggestion?: (boolean|null); + + /** SuggestionFeatureConfig suggestionTriggerSettings */ + suggestionTriggerSettings?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionTriggerSettings|null); + + /** SuggestionFeatureConfig queryConfig */ + queryConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionQueryConfig|null); + + /** SuggestionFeatureConfig conversationModelConfig */ + conversationModelConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IConversationModelConfig|null); + } + + /** Represents a SuggestionFeatureConfig. */ + class SuggestionFeatureConfig implements ISuggestionFeatureConfig { + + /** + * Constructs a new SuggestionFeatureConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionFeatureConfig); + + /** SuggestionFeatureConfig suggestionFeature. */ + public suggestionFeature?: (google.cloud.dialogflow.v2beta1.ISuggestionFeature|null); + + /** SuggestionFeatureConfig enableEventBasedSuggestion. */ + public enableEventBasedSuggestion: boolean; + + /** SuggestionFeatureConfig suggestionTriggerSettings. */ + public suggestionTriggerSettings?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionTriggerSettings|null); + + /** SuggestionFeatureConfig queryConfig. */ + public queryConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionQueryConfig|null); + + /** SuggestionFeatureConfig conversationModelConfig. */ + public conversationModelConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IConversationModelConfig|null); + + /** + * Creates a new SuggestionFeatureConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionFeatureConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionFeatureConfig): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig; + + /** + * Encodes the specified SuggestionFeatureConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.verify|verify} messages. + * @param message SuggestionFeatureConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionFeatureConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionFeatureConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.verify|verify} messages. + * @param message SuggestionFeatureConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionFeatureConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionFeatureConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionFeatureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig; + + /** + * Decodes a SuggestionFeatureConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionFeatureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig; + + /** + * Verifies a SuggestionFeatureConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionFeatureConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionFeatureConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig; + + /** + * Creates a plain object from a SuggestionFeatureConfig message. Also converts values to other types if specified. + * @param message SuggestionFeatureConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionFeatureConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestionConfig. */ + interface ISuggestionConfig { + + /** SuggestionConfig featureConfigs */ + featureConfigs?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionFeatureConfig[]|null); + + /** SuggestionConfig groupSuggestionResponses */ + groupSuggestionResponses?: (boolean|null); + } + + /** Represents a SuggestionConfig. */ + class SuggestionConfig implements ISuggestionConfig { + + /** + * Constructs a new SuggestionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig); + + /** SuggestionConfig featureConfigs. */ + public featureConfigs: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionFeatureConfig[]; + + /** SuggestionConfig groupSuggestionResponses. */ + public groupSuggestionResponses: boolean; + + /** + * Creates a new SuggestionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig; + + /** + * Encodes the specified SuggestionConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.verify|verify} messages. + * @param message SuggestionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.verify|verify} messages. + * @param message SuggestionConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig; + + /** + * Decodes a SuggestionConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig; + + /** + * Verifies a SuggestionConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig; + + /** + * Creates a plain object from a SuggestionConfig message. Also converts values to other types if specified. + * @param message SuggestionConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a SuggestionQueryConfig. */ + interface ISuggestionQueryConfig { + + /** SuggestionQueryConfig knowledgeBaseQuerySource */ + knowledgeBaseQuerySource?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource|null); + + /** SuggestionQueryConfig documentQuerySource */ + documentQuerySource?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource|null); + + /** SuggestionQueryConfig dialogflowQuerySource */ + dialogflowQuerySource?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource|null); + + /** SuggestionQueryConfig maxResults */ + maxResults?: (number|null); + + /** SuggestionQueryConfig confidenceThreshold */ + confidenceThreshold?: (number|null); + + /** SuggestionQueryConfig contextFilterSettings */ + contextFilterSettings?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings|null); + } + + /** Represents a SuggestionQueryConfig. */ + class SuggestionQueryConfig implements ISuggestionQueryConfig { + + /** + * Constructs a new SuggestionQueryConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionQueryConfig); + + /** SuggestionQueryConfig knowledgeBaseQuerySource. */ + public knowledgeBaseQuerySource?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource|null); + + /** SuggestionQueryConfig documentQuerySource. */ + public documentQuerySource?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource|null); + + /** SuggestionQueryConfig dialogflowQuerySource. */ + public dialogflowQuerySource?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource|null); + + /** SuggestionQueryConfig maxResults. */ + public maxResults: number; + + /** SuggestionQueryConfig confidenceThreshold. */ + public confidenceThreshold: number; + + /** SuggestionQueryConfig contextFilterSettings. */ + public contextFilterSettings?: (google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings|null); + + /** SuggestionQueryConfig querySource. */ + public querySource?: ("knowledgeBaseQuerySource"|"documentQuerySource"|"dialogflowQuerySource"); + + /** + * Creates a new SuggestionQueryConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SuggestionQueryConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionQueryConfig): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig; + + /** + * Encodes the specified SuggestionQueryConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.verify|verify} messages. + * @param message SuggestionQueryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionQueryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SuggestionQueryConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.verify|verify} messages. + * @param message SuggestionQueryConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionQueryConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SuggestionQueryConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SuggestionQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig; + + /** + * Decodes a SuggestionQueryConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SuggestionQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig; + + /** + * Verifies a SuggestionQueryConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SuggestionQueryConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SuggestionQueryConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig; + + /** + * Creates a plain object from a SuggestionQueryConfig message. Also converts values to other types if specified. + * @param message SuggestionQueryConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SuggestionQueryConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SuggestionQueryConfig { + + /** Properties of a KnowledgeBaseQuerySource. */ + interface IKnowledgeBaseQuerySource { + + /** KnowledgeBaseQuerySource knowledgeBases */ + knowledgeBases?: (string[]|null); + } + + /** Represents a KnowledgeBaseQuerySource. */ + class KnowledgeBaseQuerySource implements IKnowledgeBaseQuerySource { - /** - * Decodes a GetIntentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetIntentRequest; + /** + * Constructs a new KnowledgeBaseQuerySource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource); - /** - * Decodes a GetIntentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetIntentRequest; + /** KnowledgeBaseQuerySource knowledgeBases. */ + public knowledgeBases: string[]; - /** - * Verifies a GetIntentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new KnowledgeBaseQuerySource instance using the specified properties. + * @param [properties] Properties to set + * @returns KnowledgeBaseQuerySource instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource; - /** - * Creates a GetIntentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetIntentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetIntentRequest; + /** + * Encodes the specified KnowledgeBaseQuerySource message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.verify|verify} messages. + * @param message KnowledgeBaseQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from a GetIntentRequest message. Also converts values to other types if specified. - * @param message GetIntentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.GetIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified KnowledgeBaseQuerySource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.verify|verify} messages. + * @param message KnowledgeBaseQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this GetIntentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a KnowledgeBaseQuerySource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns KnowledgeBaseQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource; - /** Properties of a CreateIntentRequest. */ - interface ICreateIntentRequest { + /** + * Decodes a KnowledgeBaseQuerySource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns KnowledgeBaseQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource; - /** CreateIntentRequest parent */ - parent?: (string|null); + /** + * Verifies a KnowledgeBaseQuerySource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** CreateIntentRequest intent */ - intent?: (google.cloud.dialogflow.v2beta1.IIntent|null); + /** + * Creates a KnowledgeBaseQuerySource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns KnowledgeBaseQuerySource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource; - /** CreateIntentRequest languageCode */ - languageCode?: (string|null); + /** + * Creates a plain object from a KnowledgeBaseQuerySource message. Also converts values to other types if specified. + * @param message KnowledgeBaseQuerySource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** CreateIntentRequest intentView */ - intentView?: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView|null); - } + /** + * Converts this KnowledgeBaseQuerySource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a CreateIntentRequest. */ - class CreateIntentRequest implements ICreateIntentRequest { + /** Properties of a DocumentQuerySource. */ + interface IDocumentQuerySource { - /** - * Constructs a new CreateIntentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateIntentRequest); + /** DocumentQuerySource documents */ + documents?: (string[]|null); + } - /** CreateIntentRequest parent. */ - public parent: string; + /** Represents a DocumentQuerySource. */ + class DocumentQuerySource implements IDocumentQuerySource { - /** CreateIntentRequest intent. */ - public intent?: (google.cloud.dialogflow.v2beta1.IIntent|null); + /** + * Constructs a new DocumentQuerySource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource); - /** CreateIntentRequest languageCode. */ - public languageCode: string; + /** DocumentQuerySource documents. */ + public documents: string[]; - /** CreateIntentRequest intentView. */ - public intentView: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView); + /** + * Creates a new DocumentQuerySource instance using the specified properties. + * @param [properties] Properties to set + * @returns DocumentQuerySource instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource; - /** - * Creates a new CreateIntentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateIntentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateIntentRequest): google.cloud.dialogflow.v2beta1.CreateIntentRequest; + /** + * Encodes the specified DocumentQuerySource message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.verify|verify} messages. + * @param message DocumentQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified CreateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateIntentRequest.verify|verify} messages. - * @param message CreateIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.ICreateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified DocumentQuerySource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.verify|verify} messages. + * @param message DocumentQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified CreateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateIntentRequest.verify|verify} messages. - * @param message CreateIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a DocumentQuerySource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DocumentQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource; - /** - * Decodes a CreateIntentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateIntentRequest; + /** + * Decodes a DocumentQuerySource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DocumentQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource; - /** - * Decodes a CreateIntentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateIntentRequest; + /** + * Verifies a DocumentQuerySource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a CreateIntentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a DocumentQuerySource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DocumentQuerySource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource; - /** - * Creates a CreateIntentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateIntentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateIntentRequest; + /** + * Creates a plain object from a DocumentQuerySource message. Also converts values to other types if specified. + * @param message DocumentQuerySource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a CreateIntentRequest message. Also converts values to other types if specified. - * @param message CreateIntentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.CreateIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this DocumentQuerySource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this CreateIntentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a DialogflowQuerySource. */ + interface IDialogflowQuerySource { - /** Properties of an UpdateIntentRequest. */ - interface IUpdateIntentRequest { + /** DialogflowQuerySource agent */ + agent?: (string|null); + } - /** UpdateIntentRequest intent */ - intent?: (google.cloud.dialogflow.v2beta1.IIntent|null); + /** Represents a DialogflowQuerySource. */ + class DialogflowQuerySource implements IDialogflowQuerySource { - /** UpdateIntentRequest languageCode */ - languageCode?: (string|null); + /** + * Constructs a new DialogflowQuerySource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource); - /** UpdateIntentRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** DialogflowQuerySource agent. */ + public agent: string; - /** UpdateIntentRequest intentView */ - intentView?: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView|null); - } + /** + * Creates a new DialogflowQuerySource instance using the specified properties. + * @param [properties] Properties to set + * @returns DialogflowQuerySource instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource; - /** Represents an UpdateIntentRequest. */ - class UpdateIntentRequest implements IUpdateIntentRequest { + /** + * Encodes the specified DialogflowQuerySource message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.verify|verify} messages. + * @param message DialogflowQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Constructs a new UpdateIntentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateIntentRequest); + /** + * Encodes the specified DialogflowQuerySource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.verify|verify} messages. + * @param message DialogflowQuerySource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource, writer?: $protobuf.Writer): $protobuf.Writer; - /** UpdateIntentRequest intent. */ - public intent?: (google.cloud.dialogflow.v2beta1.IIntent|null); + /** + * Decodes a DialogflowQuerySource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DialogflowQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource; - /** UpdateIntentRequest languageCode. */ - public languageCode: string; + /** + * Decodes a DialogflowQuerySource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DialogflowQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource; - /** UpdateIntentRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** + * Verifies a DialogflowQuerySource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** UpdateIntentRequest intentView. */ - public intentView: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView); + /** + * Creates a DialogflowQuerySource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DialogflowQuerySource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource; - /** - * Creates a new UpdateIntentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateIntentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateIntentRequest): google.cloud.dialogflow.v2beta1.UpdateIntentRequest; + /** + * Creates a plain object from a DialogflowQuerySource message. Also converts values to other types if specified. + * @param message DialogflowQuerySource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Encodes the specified UpdateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateIntentRequest.verify|verify} messages. - * @param message UpdateIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Converts this DialogflowQuerySource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Encodes the specified UpdateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateIntentRequest.verify|verify} messages. - * @param message UpdateIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** Properties of a ContextFilterSettings. */ + interface IContextFilterSettings { - /** - * Decodes an UpdateIntentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateIntentRequest; + /** ContextFilterSettings dropHandoffMessages */ + dropHandoffMessages?: (boolean|null); - /** - * Decodes an UpdateIntentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateIntentRequest; + /** ContextFilterSettings dropVirtualAgentMessages */ + dropVirtualAgentMessages?: (boolean|null); - /** - * Verifies an UpdateIntentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** ContextFilterSettings dropIvrMessages */ + dropIvrMessages?: (boolean|null); + } - /** - * Creates an UpdateIntentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateIntentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateIntentRequest; + /** Represents a ContextFilterSettings. */ + class ContextFilterSettings implements IContextFilterSettings { - /** - * Creates a plain object from an UpdateIntentRequest message. Also converts values to other types if specified. - * @param message UpdateIntentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Constructs a new ContextFilterSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings); - /** - * Converts this UpdateIntentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** ContextFilterSettings dropHandoffMessages. */ + public dropHandoffMessages: boolean; - /** Properties of a DeleteIntentRequest. */ - interface IDeleteIntentRequest { + /** ContextFilterSettings dropVirtualAgentMessages. */ + public dropVirtualAgentMessages: boolean; - /** DeleteIntentRequest name */ - name?: (string|null); - } + /** ContextFilterSettings dropIvrMessages. */ + public dropIvrMessages: boolean; - /** Represents a DeleteIntentRequest. */ - class DeleteIntentRequest implements IDeleteIntentRequest { + /** + * Creates a new ContextFilterSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ContextFilterSettings instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings; - /** - * Constructs a new DeleteIntentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteIntentRequest); + /** + * Encodes the specified ContextFilterSettings message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.verify|verify} messages. + * @param message ContextFilterSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings, writer?: $protobuf.Writer): $protobuf.Writer; - /** DeleteIntentRequest name. */ - public name: string; + /** + * Encodes the specified ContextFilterSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.verify|verify} messages. + * @param message ContextFilterSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a new DeleteIntentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteIntentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteIntentRequest): google.cloud.dialogflow.v2beta1.DeleteIntentRequest; + /** + * Decodes a ContextFilterSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ContextFilterSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings; - /** - * Encodes the specified DeleteIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteIntentRequest.verify|verify} messages. - * @param message DeleteIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a ContextFilterSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ContextFilterSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings; - /** - * Encodes the specified DeleteIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteIntentRequest.verify|verify} messages. - * @param message DeleteIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Verifies a ContextFilterSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Decodes a DeleteIntentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteIntentRequest; + /** + * Creates a ContextFilterSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ContextFilterSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings; - /** - * Decodes a DeleteIntentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteIntentRequest; + /** + * Creates a plain object from a ContextFilterSettings message. Also converts values to other types if specified. + * @param message ContextFilterSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Verifies a DeleteIntentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Converts this ContextFilterSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Creates a DeleteIntentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteIntentRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteIntentRequest; + /** Properties of a ConversationModelConfig. */ + interface IConversationModelConfig { - /** - * Creates a plain object from a DeleteIntentRequest message. Also converts values to other types if specified. - * @param message DeleteIntentRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** ConversationModelConfig model */ + model?: (string|null); + } - /** - * Converts this DeleteIntentRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Represents a ConversationModelConfig. */ + class ConversationModelConfig implements IConversationModelConfig { - /** Properties of a BatchUpdateIntentsRequest. */ - interface IBatchUpdateIntentsRequest { + /** + * Constructs a new ConversationModelConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IConversationModelConfig); - /** BatchUpdateIntentsRequest parent */ - parent?: (string|null); + /** ConversationModelConfig model. */ + public model: string; - /** BatchUpdateIntentsRequest intentBatchUri */ - intentBatchUri?: (string|null); + /** + * Creates a new ConversationModelConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConversationModelConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IConversationModelConfig): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig; - /** BatchUpdateIntentsRequest intentBatchInline */ - intentBatchInline?: (google.cloud.dialogflow.v2beta1.IIntentBatch|null); + /** + * Encodes the specified ConversationModelConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig.verify|verify} messages. + * @param message ConversationModelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IConversationModelConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** BatchUpdateIntentsRequest languageCode */ - languageCode?: (string|null); + /** + * Encodes the specified ConversationModelConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig.verify|verify} messages. + * @param message ConversationModelConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IConversationModelConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** BatchUpdateIntentsRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** + * Decodes a ConversationModelConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ConversationModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig; - /** BatchUpdateIntentsRequest intentView */ - intentView?: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView|null); - } + /** + * Decodes a ConversationModelConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ConversationModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig; + + /** + * Verifies a ConversationModelConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** Represents a BatchUpdateIntentsRequest. */ - class BatchUpdateIntentsRequest implements IBatchUpdateIntentsRequest { + /** + * Creates a ConversationModelConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ConversationModelConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig; - /** - * Constructs a new BatchUpdateIntentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest); + /** + * Creates a plain object from a ConversationModelConfig message. Also converts values to other types if specified. + * @param message ConversationModelConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** BatchUpdateIntentsRequest parent. */ - public parent: string; + /** + * Converts this ConversationModelConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** BatchUpdateIntentsRequest intentBatchUri. */ - public intentBatchUri: string; + /** Properties of a MessageAnalysisConfig. */ + interface IMessageAnalysisConfig { - /** BatchUpdateIntentsRequest intentBatchInline. */ - public intentBatchInline?: (google.cloud.dialogflow.v2beta1.IIntentBatch|null); + /** MessageAnalysisConfig enableEntityExtraction */ + enableEntityExtraction?: (boolean|null); - /** BatchUpdateIntentsRequest languageCode. */ - public languageCode: string; + /** MessageAnalysisConfig enableSentimentAnalysis */ + enableSentimentAnalysis?: (boolean|null); + } - /** BatchUpdateIntentsRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** Represents a MessageAnalysisConfig. */ + class MessageAnalysisConfig implements IMessageAnalysisConfig { - /** BatchUpdateIntentsRequest intentView. */ - public intentView: (google.cloud.dialogflow.v2beta1.IntentView|keyof typeof google.cloud.dialogflow.v2beta1.IntentView); + /** + * Constructs a new MessageAnalysisConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IMessageAnalysisConfig); - /** BatchUpdateIntentsRequest intentBatch. */ - public intentBatch?: ("intentBatchUri"|"intentBatchInline"); + /** MessageAnalysisConfig enableEntityExtraction. */ + public enableEntityExtraction: boolean; - /** - * Creates a new BatchUpdateIntentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchUpdateIntentsRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest; + /** MessageAnalysisConfig enableSentimentAnalysis. */ + public enableSentimentAnalysis: boolean; - /** - * Encodes the specified BatchUpdateIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.verify|verify} messages. - * @param message BatchUpdateIntentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new MessageAnalysisConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageAnalysisConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IMessageAnalysisConfig): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig; - /** - * Encodes the specified BatchUpdateIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.verify|verify} messages. - * @param message BatchUpdateIntentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified MessageAnalysisConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig.verify|verify} messages. + * @param message MessageAnalysisConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IMessageAnalysisConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchUpdateIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest; + /** + * Encodes the specified MessageAnalysisConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig.verify|verify} messages. + * @param message MessageAnalysisConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IMessageAnalysisConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchUpdateIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest; + /** + * Decodes a MessageAnalysisConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageAnalysisConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig; - /** - * Verifies a BatchUpdateIntentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a MessageAnalysisConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageAnalysisConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig; - /** - * Creates a BatchUpdateIntentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchUpdateIntentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest; + /** + * Verifies a MessageAnalysisConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Creates a plain object from a BatchUpdateIntentsRequest message. Also converts values to other types if specified. - * @param message BatchUpdateIntentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Creates a MessageAnalysisConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageAnalysisConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig; - /** - * Converts this BatchUpdateIntentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** + * Creates a plain object from a MessageAnalysisConfig message. Also converts values to other types if specified. + * @param message MessageAnalysisConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageAnalysisConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } - /** Properties of a BatchUpdateIntentsResponse. */ - interface IBatchUpdateIntentsResponse { + /** Properties of a HumanAgentHandoffConfig. */ + interface IHumanAgentHandoffConfig { - /** BatchUpdateIntentsResponse intents */ - intents?: (google.cloud.dialogflow.v2beta1.IIntent[]|null); + /** HumanAgentHandoffConfig livePersonConfig */ + livePersonConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ILivePersonConfig|null); + + /** HumanAgentHandoffConfig salesforceLiveAgentConfig */ + salesforceLiveAgentConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig|null); } - /** Represents a BatchUpdateIntentsResponse. */ - class BatchUpdateIntentsResponse implements IBatchUpdateIntentsResponse { + /** Represents a HumanAgentHandoffConfig. */ + class HumanAgentHandoffConfig implements IHumanAgentHandoffConfig { /** - * Constructs a new BatchUpdateIntentsResponse. + * Constructs a new HumanAgentHandoffConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse); + constructor(properties?: google.cloud.dialogflow.v2beta1.IHumanAgentHandoffConfig); - /** BatchUpdateIntentsResponse intents. */ - public intents: google.cloud.dialogflow.v2beta1.IIntent[]; + /** HumanAgentHandoffConfig livePersonConfig. */ + public livePersonConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ILivePersonConfig|null); + + /** HumanAgentHandoffConfig salesforceLiveAgentConfig. */ + public salesforceLiveAgentConfig?: (google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig|null); + + /** HumanAgentHandoffConfig agentService. */ + public agentService?: ("livePersonConfig"|"salesforceLiveAgentConfig"); /** - * Creates a new BatchUpdateIntentsResponse instance using the specified properties. + * Creates a new HumanAgentHandoffConfig instance using the specified properties. * @param [properties] Properties to set - * @returns BatchUpdateIntentsResponse instance + * @returns HumanAgentHandoffConfig instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse; + public static create(properties?: google.cloud.dialogflow.v2beta1.IHumanAgentHandoffConfig): google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig; /** - * Encodes the specified BatchUpdateIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.verify|verify} messages. - * @param message BatchUpdateIntentsResponse message or plain object to encode + * Encodes the specified HumanAgentHandoffConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.verify|verify} messages. + * @param message HumanAgentHandoffConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IHumanAgentHandoffConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified BatchUpdateIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.verify|verify} messages. - * @param message BatchUpdateIntentsResponse message or plain object to encode + * Encodes the specified HumanAgentHandoffConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.verify|verify} messages. + * @param message HumanAgentHandoffConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IHumanAgentHandoffConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer. + * Decodes a HumanAgentHandoffConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns BatchUpdateIntentsResponse + * @returns HumanAgentHandoffConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig; /** - * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer, length delimited. + * Decodes a HumanAgentHandoffConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns BatchUpdateIntentsResponse + * @returns HumanAgentHandoffConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig; /** - * Verifies a BatchUpdateIntentsResponse message. + * Verifies a HumanAgentHandoffConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a BatchUpdateIntentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a HumanAgentHandoffConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns BatchUpdateIntentsResponse + * @returns HumanAgentHandoffConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig; /** - * Creates a plain object from a BatchUpdateIntentsResponse message. Also converts values to other types if specified. - * @param message BatchUpdateIntentsResponse + * Creates a plain object from a HumanAgentHandoffConfig message. Also converts values to other types if specified. + * @param message HumanAgentHandoffConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this BatchUpdateIntentsResponse to JSON. + * Converts this HumanAgentHandoffConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a BatchDeleteIntentsRequest. */ - interface IBatchDeleteIntentsRequest { + namespace HumanAgentHandoffConfig { - /** BatchDeleteIntentsRequest parent */ - parent?: (string|null); + /** Properties of a LivePersonConfig. */ + interface ILivePersonConfig { - /** BatchDeleteIntentsRequest intents */ - intents?: (google.cloud.dialogflow.v2beta1.IIntent[]|null); - } + /** LivePersonConfig accountNumber */ + accountNumber?: (string|null); + } - /** Represents a BatchDeleteIntentsRequest. */ - class BatchDeleteIntentsRequest implements IBatchDeleteIntentsRequest { + /** Represents a LivePersonConfig. */ + class LivePersonConfig implements ILivePersonConfig { - /** - * Constructs a new BatchDeleteIntentsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest); + /** + * Constructs a new LivePersonConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ILivePersonConfig); - /** BatchDeleteIntentsRequest parent. */ - public parent: string; + /** LivePersonConfig accountNumber. */ + public accountNumber: string; - /** BatchDeleteIntentsRequest intents. */ - public intents: google.cloud.dialogflow.v2beta1.IIntent[]; + /** + * Creates a new LivePersonConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns LivePersonConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ILivePersonConfig): google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig; - /** - * Creates a new BatchDeleteIntentsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns BatchDeleteIntentsRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest): google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest; + /** + * Encodes the specified LivePersonConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig.verify|verify} messages. + * @param message LivePersonConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ILivePersonConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified BatchDeleteIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.verify|verify} messages. - * @param message BatchDeleteIntentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Encodes the specified LivePersonConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig.verify|verify} messages. + * @param message LivePersonConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ILivePersonConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Encodes the specified BatchDeleteIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.verify|verify} messages. - * @param message BatchDeleteIntentsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Decodes a LivePersonConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LivePersonConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig; - /** - * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BatchDeleteIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest; + /** + * Decodes a LivePersonConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LivePersonConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig; - /** - * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BatchDeleteIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest; + /** + * Verifies a LivePersonConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Verifies a BatchDeleteIntentsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a LivePersonConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LivePersonConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig; - /** - * Creates a BatchDeleteIntentsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BatchDeleteIntentsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest; + /** + * Creates a plain object from a LivePersonConfig message. Also converts values to other types if specified. + * @param message LivePersonConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Creates a plain object from a BatchDeleteIntentsRequest message. Also converts values to other types if specified. - * @param message BatchDeleteIntentsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Converts this LivePersonConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** - * Converts this BatchDeleteIntentsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a SalesforceLiveAgentConfig. */ + interface ISalesforceLiveAgentConfig { - /** Properties of an IntentBatch. */ - interface IIntentBatch { + /** SalesforceLiveAgentConfig organizationId */ + organizationId?: (string|null); - /** IntentBatch intents */ - intents?: (google.cloud.dialogflow.v2beta1.IIntent[]|null); - } + /** SalesforceLiveAgentConfig deploymentId */ + deploymentId?: (string|null); - /** Represents an IntentBatch. */ - class IntentBatch implements IIntentBatch { + /** SalesforceLiveAgentConfig buttonId */ + buttonId?: (string|null); - /** - * Constructs a new IntentBatch. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IIntentBatch); + /** SalesforceLiveAgentConfig endpointDomain */ + endpointDomain?: (string|null); + } - /** IntentBatch intents. */ - public intents: google.cloud.dialogflow.v2beta1.IIntent[]; + /** Represents a SalesforceLiveAgentConfig. */ + class SalesforceLiveAgentConfig implements ISalesforceLiveAgentConfig { - /** - * Creates a new IntentBatch instance using the specified properties. - * @param [properties] Properties to set - * @returns IntentBatch instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IIntentBatch): google.cloud.dialogflow.v2beta1.IntentBatch; + /** + * Constructs a new SalesforceLiveAgentConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig); - /** - * Encodes the specified IntentBatch message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.IntentBatch.verify|verify} messages. - * @param message IntentBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IIntentBatch, writer?: $protobuf.Writer): $protobuf.Writer; + /** SalesforceLiveAgentConfig organizationId. */ + public organizationId: string; - /** - * Encodes the specified IntentBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.IntentBatch.verify|verify} messages. - * @param message IntentBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IIntentBatch, writer?: $protobuf.Writer): $protobuf.Writer; + /** SalesforceLiveAgentConfig deploymentId. */ + public deploymentId: string; - /** - * Decodes an IntentBatch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntentBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.IntentBatch; + /** SalesforceLiveAgentConfig buttonId. */ + public buttonId: string; - /** - * Decodes an IntentBatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntentBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.IntentBatch; + /** SalesforceLiveAgentConfig endpointDomain. */ + public endpointDomain: string; - /** - * Verifies an IntentBatch message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Creates a new SalesforceLiveAgentConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns SalesforceLiveAgentConfig instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig): google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig; - /** - * Creates an IntentBatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntentBatch - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.IntentBatch; + /** + * Encodes the specified SalesforceLiveAgentConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.verify|verify} messages. + * @param message SalesforceLiveAgentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Creates a plain object from an IntentBatch message. Also converts values to other types if specified. - * @param message IntentBatch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.IntentBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Encodes the specified SalesforceLiveAgentConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.verify|verify} messages. + * @param message SalesforceLiveAgentConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Converts this IntentBatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Decodes a SalesforceLiveAgentConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SalesforceLiveAgentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig; - /** IntentView enum. */ - enum IntentView { - INTENT_VIEW_UNSPECIFIED = 0, - INTENT_VIEW_FULL = 1 - } + /** + * Decodes a SalesforceLiveAgentConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SalesforceLiveAgentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig; - /** Represents a KnowledgeBases */ - class KnowledgeBases extends $protobuf.rpc.Service { + /** + * Verifies a SalesforceLiveAgentConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Constructs a new KnowledgeBases service. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - */ - constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); + /** + * Creates a SalesforceLiveAgentConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SalesforceLiveAgentConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig; - /** - * Creates new KnowledgeBases service using the specified rpc implementation. - * @param rpcImpl RPC implementation - * @param [requestDelimited=false] Whether requests are length-delimited - * @param [responseDelimited=false] Whether responses are length-delimited - * @returns RPC service. Useful where requests and/or responses are streamed. - */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): KnowledgeBases; + /** + * Creates a plain object from a SalesforceLiveAgentConfig message. Also converts values to other types if specified. + * @param message SalesforceLiveAgentConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** - * Calls ListKnowledgeBases. - * @param request ListKnowledgeBasesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListKnowledgeBasesResponse - */ - public listKnowledgeBases(request: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, callback: google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBasesCallback): void; + /** + * Converts this SalesforceLiveAgentConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** - * Calls ListKnowledgeBases. - * @param request ListKnowledgeBasesRequest message or plain object - * @returns Promise - */ - public listKnowledgeBases(request: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest): Promise; + /** Properties of a NotificationConfig. */ + interface INotificationConfig { - /** - * Calls GetKnowledgeBase. - * @param request GetKnowledgeBaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and KnowledgeBase - */ - public getKnowledgeBase(request: google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest, callback: google.cloud.dialogflow.v2beta1.KnowledgeBases.GetKnowledgeBaseCallback): void; + /** NotificationConfig topic */ + topic?: (string|null); - /** - * Calls GetKnowledgeBase. - * @param request GetKnowledgeBaseRequest message or plain object - * @returns Promise - */ - public getKnowledgeBase(request: google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest): Promise; + /** NotificationConfig messageFormat */ + messageFormat?: (google.cloud.dialogflow.v2beta1.NotificationConfig.MessageFormat|keyof typeof google.cloud.dialogflow.v2beta1.NotificationConfig.MessageFormat|null); + } - /** - * Calls CreateKnowledgeBase. - * @param request CreateKnowledgeBaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and KnowledgeBase - */ - public createKnowledgeBase(request: google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest, callback: google.cloud.dialogflow.v2beta1.KnowledgeBases.CreateKnowledgeBaseCallback): void; + /** Represents a NotificationConfig. */ + class NotificationConfig implements INotificationConfig { /** - * Calls CreateKnowledgeBase. - * @param request CreateKnowledgeBaseRequest message or plain object - * @returns Promise + * Constructs a new NotificationConfig. + * @param [properties] Properties to set */ - public createKnowledgeBase(request: google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest): Promise; + constructor(properties?: google.cloud.dialogflow.v2beta1.INotificationConfig); + + /** NotificationConfig topic. */ + public topic: string; + + /** NotificationConfig messageFormat. */ + public messageFormat: (google.cloud.dialogflow.v2beta1.NotificationConfig.MessageFormat|keyof typeof google.cloud.dialogflow.v2beta1.NotificationConfig.MessageFormat); /** - * Calls DeleteKnowledgeBase. - * @param request DeleteKnowledgeBaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Creates a new NotificationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NotificationConfig instance */ - public deleteKnowledgeBase(request: google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest, callback: google.cloud.dialogflow.v2beta1.KnowledgeBases.DeleteKnowledgeBaseCallback): void; + public static create(properties?: google.cloud.dialogflow.v2beta1.INotificationConfig): google.cloud.dialogflow.v2beta1.NotificationConfig; /** - * Calls DeleteKnowledgeBase. - * @param request DeleteKnowledgeBaseRequest message or plain object - * @returns Promise + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public deleteKnowledgeBase(request: google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest): Promise; + public static encode(message: google.cloud.dialogflow.v2beta1.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateKnowledgeBase. - * @param request UpdateKnowledgeBaseRequest message or plain object - * @param callback Node-style callback called with the error, if any, and KnowledgeBase + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.NotificationConfig.verify|verify} messages. + * @param message NotificationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer */ - public updateKnowledgeBase(request: google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest, callback: google.cloud.dialogflow.v2beta1.KnowledgeBases.UpdateKnowledgeBaseCallback): void; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.INotificationConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Calls UpdateKnowledgeBase. - * @param request UpdateKnowledgeBaseRequest message or plain object - * @returns Promise + * Decodes a NotificationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public updateKnowledgeBase(request: google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest): Promise; - } - - namespace KnowledgeBases { + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.NotificationConfig; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#listKnowledgeBases}. - * @param error Error, if any - * @param [response] ListKnowledgeBasesResponse + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - type ListKnowledgeBasesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse) => void; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.NotificationConfig; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#getKnowledgeBase}. - * @param error Error, if any - * @param [response] KnowledgeBase + * Verifies a NotificationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not */ - type GetKnowledgeBaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.KnowledgeBase) => void; + public static verify(message: { [k: string]: any }): (string|null); /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#createKnowledgeBase}. - * @param error Error, if any - * @param [response] KnowledgeBase + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NotificationConfig */ - type CreateKnowledgeBaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.KnowledgeBase) => void; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.NotificationConfig; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#deleteKnowledgeBase}. - * @param error Error, if any - * @param [response] Empty + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @param message NotificationConfig + * @param [options] Conversion options + * @returns Plain object */ - type DeleteKnowledgeBaseCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + public static toObject(message: google.cloud.dialogflow.v2beta1.NotificationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#updateKnowledgeBase}. - * @param error Error, if any - * @param [response] KnowledgeBase + * Converts this NotificationConfig to JSON. + * @returns JSON object */ - type UpdateKnowledgeBaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.KnowledgeBase) => void; + public toJSON(): { [k: string]: any }; } - /** Properties of a KnowledgeBase. */ - interface IKnowledgeBase { + namespace NotificationConfig { - /** KnowledgeBase name */ - name?: (string|null); + /** MessageFormat enum. */ + enum MessageFormat { + MESSAGE_FORMAT_UNSPECIFIED = 0, + PROTO = 1, + JSON = 2 + } + } - /** KnowledgeBase displayName */ - displayName?: (string|null); + /** Properties of a LoggingConfig. */ + interface ILoggingConfig { - /** KnowledgeBase languageCode */ - languageCode?: (string|null); + /** LoggingConfig enableStackdriverLogging */ + enableStackdriverLogging?: (boolean|null); } - /** Represents a KnowledgeBase. */ - class KnowledgeBase implements IKnowledgeBase { + /** Represents a LoggingConfig. */ + class LoggingConfig implements ILoggingConfig { /** - * Constructs a new KnowledgeBase. + * Constructs a new LoggingConfig. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IKnowledgeBase); - - /** KnowledgeBase name. */ - public name: string; - - /** KnowledgeBase displayName. */ - public displayName: string; + constructor(properties?: google.cloud.dialogflow.v2beta1.ILoggingConfig); - /** KnowledgeBase languageCode. */ - public languageCode: string; + /** LoggingConfig enableStackdriverLogging. */ + public enableStackdriverLogging: boolean; /** - * Creates a new KnowledgeBase instance using the specified properties. + * Creates a new LoggingConfig instance using the specified properties. * @param [properties] Properties to set - * @returns KnowledgeBase instance + * @returns LoggingConfig instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IKnowledgeBase): google.cloud.dialogflow.v2beta1.KnowledgeBase; + public static create(properties?: google.cloud.dialogflow.v2beta1.ILoggingConfig): google.cloud.dialogflow.v2beta1.LoggingConfig; /** - * Encodes the specified KnowledgeBase message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeBase.verify|verify} messages. - * @param message KnowledgeBase message or plain object to encode + * Encodes the specified LoggingConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.LoggingConfig.verify|verify} messages. + * @param message LoggingConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IKnowledgeBase, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified KnowledgeBase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeBase.verify|verify} messages. - * @param message KnowledgeBase message or plain object to encode + * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.LoggingConfig.verify|verify} messages. + * @param message LoggingConfig message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IKnowledgeBase, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ILoggingConfig, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a KnowledgeBase message from the specified reader or buffer. + * Decodes a LoggingConfig message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns KnowledgeBase + * @returns LoggingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.KnowledgeBase; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.LoggingConfig; /** - * Decodes a KnowledgeBase message from the specified reader or buffer, length delimited. + * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns KnowledgeBase + * @returns LoggingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.KnowledgeBase; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.LoggingConfig; /** - * Verifies a KnowledgeBase message. + * Verifies a LoggingConfig message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a KnowledgeBase message from a plain object. Also converts values to their respective internal types. + * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns KnowledgeBase + * @returns LoggingConfig */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.KnowledgeBase; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.LoggingConfig; /** - * Creates a plain object from a KnowledgeBase message. Also converts values to other types if specified. - * @param message KnowledgeBase + * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. + * @param message LoggingConfig * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.KnowledgeBase, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.LoggingConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this KnowledgeBase to JSON. + * Converts this LoggingConfig to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListKnowledgeBasesRequest. */ - interface IListKnowledgeBasesRequest { + /** Properties of a ListConversationProfilesRequest. */ + interface IListConversationProfilesRequest { - /** ListKnowledgeBasesRequest parent */ + /** ListConversationProfilesRequest parent */ parent?: (string|null); - /** ListKnowledgeBasesRequest pageSize */ + /** ListConversationProfilesRequest pageSize */ pageSize?: (number|null); - /** ListKnowledgeBasesRequest pageToken */ + /** ListConversationProfilesRequest pageToken */ pageToken?: (string|null); - - /** ListKnowledgeBasesRequest filter */ - filter?: (string|null); } - /** Represents a ListKnowledgeBasesRequest. */ - class ListKnowledgeBasesRequest implements IListKnowledgeBasesRequest { + /** Represents a ListConversationProfilesRequest. */ + class ListConversationProfilesRequest implements IListConversationProfilesRequest { /** - * Constructs a new ListKnowledgeBasesRequest. + * Constructs a new ListConversationProfilesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest); - /** ListKnowledgeBasesRequest parent. */ + /** ListConversationProfilesRequest parent. */ public parent: string; - /** ListKnowledgeBasesRequest pageSize. */ + /** ListConversationProfilesRequest pageSize. */ public pageSize: number; - /** ListKnowledgeBasesRequest pageToken. */ + /** ListConversationProfilesRequest pageToken. */ public pageToken: string; - /** ListKnowledgeBasesRequest filter. */ - public filter: string; - /** - * Creates a new ListKnowledgeBasesRequest instance using the specified properties. + * Creates a new ListConversationProfilesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListKnowledgeBasesRequest instance + * @returns ListConversationProfilesRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest): google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest; /** - * Encodes the specified ListKnowledgeBasesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest.verify|verify} messages. - * @param message ListKnowledgeBasesRequest message or plain object to encode + * Encodes the specified ListConversationProfilesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest.verify|verify} messages. + * @param message ListConversationProfilesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListKnowledgeBasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest.verify|verify} messages. - * @param message ListKnowledgeBasesRequest message or plain object to encode + * Encodes the specified ListConversationProfilesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest.verify|verify} messages. + * @param message ListConversationProfilesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListKnowledgeBasesRequest message from the specified reader or buffer. + * Decodes a ListConversationProfilesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListKnowledgeBasesRequest + * @returns ListConversationProfilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest; /** - * Decodes a ListKnowledgeBasesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListConversationProfilesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListKnowledgeBasesRequest + * @returns ListConversationProfilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest; /** - * Verifies a ListKnowledgeBasesRequest message. + * Verifies a ListConversationProfilesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListKnowledgeBasesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListConversationProfilesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListKnowledgeBasesRequest + * @returns ListConversationProfilesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest; /** - * Creates a plain object from a ListKnowledgeBasesRequest message. Also converts values to other types if specified. - * @param message ListKnowledgeBasesRequest + * Creates a plain object from a ListConversationProfilesRequest message. Also converts values to other types if specified. + * @param message ListConversationProfilesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListKnowledgeBasesRequest to JSON. + * Converts this ListConversationProfilesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListKnowledgeBasesResponse. */ - interface IListKnowledgeBasesResponse { + /** Properties of a ListConversationProfilesResponse. */ + interface IListConversationProfilesResponse { - /** ListKnowledgeBasesResponse knowledgeBases */ - knowledgeBases?: (google.cloud.dialogflow.v2beta1.IKnowledgeBase[]|null); + /** ListConversationProfilesResponse conversationProfiles */ + conversationProfiles?: (google.cloud.dialogflow.v2beta1.IConversationProfile[]|null); - /** ListKnowledgeBasesResponse nextPageToken */ + /** ListConversationProfilesResponse nextPageToken */ nextPageToken?: (string|null); } - /** Represents a ListKnowledgeBasesResponse. */ - class ListKnowledgeBasesResponse implements IListKnowledgeBasesResponse { + /** Represents a ListConversationProfilesResponse. */ + class ListConversationProfilesResponse implements IListConversationProfilesResponse { /** - * Constructs a new ListKnowledgeBasesResponse. + * Constructs a new ListConversationProfilesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse); + constructor(properties?: google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse); - /** ListKnowledgeBasesResponse knowledgeBases. */ - public knowledgeBases: google.cloud.dialogflow.v2beta1.IKnowledgeBase[]; + /** ListConversationProfilesResponse conversationProfiles. */ + public conversationProfiles: google.cloud.dialogflow.v2beta1.IConversationProfile[]; - /** ListKnowledgeBasesResponse nextPageToken. */ + /** ListConversationProfilesResponse nextPageToken. */ public nextPageToken: string; /** - * Creates a new ListKnowledgeBasesResponse instance using the specified properties. + * Creates a new ListConversationProfilesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListKnowledgeBasesResponse instance + * @returns ListConversationProfilesResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse; + public static create(properties?: google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse): google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse; /** - * Encodes the specified ListKnowledgeBasesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse.verify|verify} messages. - * @param message ListKnowledgeBasesResponse message or plain object to encode + * Encodes the specified ListConversationProfilesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse.verify|verify} messages. + * @param message ListConversationProfilesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListKnowledgeBasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse.verify|verify} messages. - * @param message ListKnowledgeBasesResponse message or plain object to encode + * Encodes the specified ListConversationProfilesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse.verify|verify} messages. + * @param message ListConversationProfilesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListKnowledgeBasesResponse message from the specified reader or buffer. + * Decodes a ListConversationProfilesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListKnowledgeBasesResponse + * @returns ListConversationProfilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse; /** - * Decodes a ListKnowledgeBasesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListConversationProfilesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListKnowledgeBasesResponse + * @returns ListConversationProfilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse; /** - * Verifies a ListKnowledgeBasesResponse message. + * Verifies a ListConversationProfilesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListKnowledgeBasesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListConversationProfilesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListKnowledgeBasesResponse + * @returns ListConversationProfilesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse; /** - * Creates a plain object from a ListKnowledgeBasesResponse message. Also converts values to other types if specified. - * @param message ListKnowledgeBasesResponse + * Creates a plain object from a ListConversationProfilesResponse message. Also converts values to other types if specified. + * @param message ListConversationProfilesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListKnowledgeBasesResponse to JSON. + * Converts this ListConversationProfilesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetKnowledgeBaseRequest. */ - interface IGetKnowledgeBaseRequest { + /** Properties of a GetConversationProfileRequest. */ + interface IGetConversationProfileRequest { - /** GetKnowledgeBaseRequest name */ + /** GetConversationProfileRequest name */ name?: (string|null); } - /** Represents a GetKnowledgeBaseRequest. */ - class GetKnowledgeBaseRequest implements IGetKnowledgeBaseRequest { + /** Represents a GetConversationProfileRequest. */ + class GetConversationProfileRequest implements IGetConversationProfileRequest { /** - * Constructs a new GetKnowledgeBaseRequest. + * Constructs a new GetConversationProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest); - /** GetKnowledgeBaseRequest name. */ + /** GetConversationProfileRequest name. */ public name: string; /** - * Creates a new GetKnowledgeBaseRequest instance using the specified properties. + * Creates a new GetConversationProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetKnowledgeBaseRequest instance + * @returns GetConversationProfileRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest): google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest): google.cloud.dialogflow.v2beta1.GetConversationProfileRequest; /** - * Encodes the specified GetKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest.verify|verify} messages. - * @param message GetKnowledgeBaseRequest message or plain object to encode + * Encodes the specified GetConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetConversationProfileRequest.verify|verify} messages. + * @param message GetConversationProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest.verify|verify} messages. - * @param message GetKnowledgeBaseRequest message or plain object to encode + * Encodes the specified GetConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetConversationProfileRequest.verify|verify} messages. + * @param message GetConversationProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetKnowledgeBaseRequest message from the specified reader or buffer. + * Decodes a GetConversationProfileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetKnowledgeBaseRequest + * @returns GetConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetConversationProfileRequest; /** - * Decodes a GetKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * Decodes a GetConversationProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetKnowledgeBaseRequest + * @returns GetConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetConversationProfileRequest; /** - * Verifies a GetKnowledgeBaseRequest message. + * Verifies a GetConversationProfileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetConversationProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetKnowledgeBaseRequest + * @returns GetConversationProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetConversationProfileRequest; /** - * Creates a plain object from a GetKnowledgeBaseRequest message. Also converts values to other types if specified. - * @param message GetKnowledgeBaseRequest + * Creates a plain object from a GetConversationProfileRequest message. Also converts values to other types if specified. + * @param message GetConversationProfileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.GetConversationProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetKnowledgeBaseRequest to JSON. + * Converts this GetConversationProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateKnowledgeBaseRequest. */ - interface ICreateKnowledgeBaseRequest { + /** Properties of a CreateConversationProfileRequest. */ + interface ICreateConversationProfileRequest { - /** CreateKnowledgeBaseRequest parent */ + /** CreateConversationProfileRequest parent */ parent?: (string|null); - /** CreateKnowledgeBaseRequest knowledgeBase */ - knowledgeBase?: (google.cloud.dialogflow.v2beta1.IKnowledgeBase|null); + /** CreateConversationProfileRequest conversationProfile */ + conversationProfile?: (google.cloud.dialogflow.v2beta1.IConversationProfile|null); } - /** Represents a CreateKnowledgeBaseRequest. */ - class CreateKnowledgeBaseRequest implements ICreateKnowledgeBaseRequest { + /** Represents a CreateConversationProfileRequest. */ + class CreateConversationProfileRequest implements ICreateConversationProfileRequest { /** - * Constructs a new CreateKnowledgeBaseRequest. + * Constructs a new CreateConversationProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest); - /** CreateKnowledgeBaseRequest parent. */ + /** CreateConversationProfileRequest parent. */ public parent: string; - /** CreateKnowledgeBaseRequest knowledgeBase. */ - public knowledgeBase?: (google.cloud.dialogflow.v2beta1.IKnowledgeBase|null); + /** CreateConversationProfileRequest conversationProfile. */ + public conversationProfile?: (google.cloud.dialogflow.v2beta1.IConversationProfile|null); /** - * Creates a new CreateKnowledgeBaseRequest instance using the specified properties. + * Creates a new CreateConversationProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateKnowledgeBaseRequest instance + * @returns CreateConversationProfileRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest): google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest): google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest; /** - * Encodes the specified CreateKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest.verify|verify} messages. - * @param message CreateKnowledgeBaseRequest message or plain object to encode + * Encodes the specified CreateConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest.verify|verify} messages. + * @param message CreateConversationProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest.verify|verify} messages. - * @param message CreateKnowledgeBaseRequest message or plain object to encode + * Encodes the specified CreateConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest.verify|verify} messages. + * @param message CreateConversationProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateKnowledgeBaseRequest message from the specified reader or buffer. + * Decodes a CreateConversationProfileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateKnowledgeBaseRequest + * @returns CreateConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest; /** - * Decodes a CreateKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateConversationProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateKnowledgeBaseRequest + * @returns CreateConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest; /** - * Verifies a CreateKnowledgeBaseRequest message. + * Verifies a CreateConversationProfileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateConversationProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateKnowledgeBaseRequest + * @returns CreateConversationProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest; /** - * Creates a plain object from a CreateKnowledgeBaseRequest message. Also converts values to other types if specified. - * @param message CreateKnowledgeBaseRequest + * Creates a plain object from a CreateConversationProfileRequest message. Also converts values to other types if specified. + * @param message CreateConversationProfileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateKnowledgeBaseRequest to JSON. + * Converts this CreateConversationProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteKnowledgeBaseRequest. */ - interface IDeleteKnowledgeBaseRequest { + /** Properties of an UpdateConversationProfileRequest. */ + interface IUpdateConversationProfileRequest { - /** DeleteKnowledgeBaseRequest name */ - name?: (string|null); + /** UpdateConversationProfileRequest conversationProfile */ + conversationProfile?: (google.cloud.dialogflow.v2beta1.IConversationProfile|null); - /** DeleteKnowledgeBaseRequest force */ - force?: (boolean|null); + /** UpdateConversationProfileRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a DeleteKnowledgeBaseRequest. */ - class DeleteKnowledgeBaseRequest implements IDeleteKnowledgeBaseRequest { + /** Represents an UpdateConversationProfileRequest. */ + class UpdateConversationProfileRequest implements IUpdateConversationProfileRequest { /** - * Constructs a new DeleteKnowledgeBaseRequest. + * Constructs a new UpdateConversationProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest); - /** DeleteKnowledgeBaseRequest name. */ - public name: string; + /** UpdateConversationProfileRequest conversationProfile. */ + public conversationProfile?: (google.cloud.dialogflow.v2beta1.IConversationProfile|null); - /** DeleteKnowledgeBaseRequest force. */ - public force: boolean; + /** UpdateConversationProfileRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new DeleteKnowledgeBaseRequest instance using the specified properties. + * Creates a new UpdateConversationProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteKnowledgeBaseRequest instance + * @returns UpdateConversationProfileRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest): google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest): google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest; /** - * Encodes the specified DeleteKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.verify|verify} messages. - * @param message DeleteKnowledgeBaseRequest message or plain object to encode + * Encodes the specified UpdateConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest.verify|verify} messages. + * @param message UpdateConversationProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.verify|verify} messages. - * @param message DeleteKnowledgeBaseRequest message or plain object to encode + * Encodes the specified UpdateConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest.verify|verify} messages. + * @param message UpdateConversationProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteKnowledgeBaseRequest message from the specified reader or buffer. + * Decodes an UpdateConversationProfileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteKnowledgeBaseRequest + * @returns UpdateConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest; /** - * Decodes a DeleteKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateConversationProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteKnowledgeBaseRequest + * @returns UpdateConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest; /** - * Verifies a DeleteKnowledgeBaseRequest message. + * Verifies an UpdateConversationProfileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateConversationProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteKnowledgeBaseRequest + * @returns UpdateConversationProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest; /** - * Creates a plain object from a DeleteKnowledgeBaseRequest message. Also converts values to other types if specified. - * @param message DeleteKnowledgeBaseRequest + * Creates a plain object from an UpdateConversationProfileRequest message. Also converts values to other types if specified. + * @param message UpdateConversationProfileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteKnowledgeBaseRequest to JSON. + * Converts this UpdateConversationProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateKnowledgeBaseRequest. */ - interface IUpdateKnowledgeBaseRequest { - - /** UpdateKnowledgeBaseRequest knowledgeBase */ - knowledgeBase?: (google.cloud.dialogflow.v2beta1.IKnowledgeBase|null); + /** Properties of a DeleteConversationProfileRequest. */ + interface IDeleteConversationProfileRequest { - /** UpdateKnowledgeBaseRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** DeleteConversationProfileRequest name */ + name?: (string|null); } - /** Represents an UpdateKnowledgeBaseRequest. */ - class UpdateKnowledgeBaseRequest implements IUpdateKnowledgeBaseRequest { + /** Represents a DeleteConversationProfileRequest. */ + class DeleteConversationProfileRequest implements IDeleteConversationProfileRequest { /** - * Constructs a new UpdateKnowledgeBaseRequest. + * Constructs a new DeleteConversationProfileRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest); - - /** UpdateKnowledgeBaseRequest knowledgeBase. */ - public knowledgeBase?: (google.cloud.dialogflow.v2beta1.IKnowledgeBase|null); + constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest); - /** UpdateKnowledgeBaseRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** DeleteConversationProfileRequest name. */ + public name: string; /** - * Creates a new UpdateKnowledgeBaseRequest instance using the specified properties. + * Creates a new DeleteConversationProfileRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateKnowledgeBaseRequest instance + * @returns DeleteConversationProfileRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest): google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest): google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest; /** - * Encodes the specified UpdateKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest.verify|verify} messages. - * @param message UpdateKnowledgeBaseRequest message or plain object to encode + * Encodes the specified DeleteConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest.verify|verify} messages. + * @param message DeleteConversationProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest.verify|verify} messages. - * @param message UpdateKnowledgeBaseRequest message or plain object to encode + * Encodes the specified DeleteConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest.verify|verify} messages. + * @param message DeleteConversationProfileRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateKnowledgeBaseRequest message from the specified reader or buffer. + * Decodes a DeleteConversationProfileRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateKnowledgeBaseRequest + * @returns DeleteConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest; /** - * Decodes an UpdateKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteConversationProfileRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateKnowledgeBaseRequest + * @returns DeleteConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest; /** - * Verifies an UpdateKnowledgeBaseRequest message. + * Verifies a DeleteConversationProfileRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteConversationProfileRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateKnowledgeBaseRequest + * @returns DeleteConversationProfileRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest; /** - * Creates a plain object from an UpdateKnowledgeBaseRequest message. Also converts values to other types if specified. - * @param message UpdateKnowledgeBaseRequest + * Creates a plain object from a DeleteConversationProfileRequest message. Also converts values to other types if specified. + * @param message DeleteConversationProfileRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateKnowledgeBaseRequest to JSON. + * Converts this DeleteConversationProfileRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a Sessions */ - class Sessions extends $protobuf.rpc.Service { + /** Represents a Documents */ + class Documents extends $protobuf.rpc.Service { /** - * Constructs a new Sessions service. + * Constructs a new Documents service. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited @@ -26863,1820 +48573,1618 @@ export namespace google { constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates new Sessions service using the specified rpc implementation. + * Creates new Documents service using the specified rpc implementation. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited * @returns RPC service. Useful where requests and/or responses are streamed. */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Sessions; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): Documents; /** - * Calls DetectIntent. - * @param request DetectIntentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DetectIntentResponse + * Calls ListDocuments. + * @param request ListDocumentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDocumentsResponse */ - public detectIntent(request: google.cloud.dialogflow.v2beta1.IDetectIntentRequest, callback: google.cloud.dialogflow.v2beta1.Sessions.DetectIntentCallback): void; + public listDocuments(request: google.cloud.dialogflow.v2beta1.IListDocumentsRequest, callback: google.cloud.dialogflow.v2beta1.Documents.ListDocumentsCallback): void; /** - * Calls DetectIntent. - * @param request DetectIntentRequest message or plain object + * Calls ListDocuments. + * @param request ListDocumentsRequest message or plain object * @returns Promise */ - public detectIntent(request: google.cloud.dialogflow.v2beta1.IDetectIntentRequest): Promise; + public listDocuments(request: google.cloud.dialogflow.v2beta1.IListDocumentsRequest): Promise; /** - * Calls StreamingDetectIntent. - * @param request StreamingDetectIntentRequest message or plain object - * @param callback Node-style callback called with the error, if any, and StreamingDetectIntentResponse + * Calls GetDocument. + * @param request GetDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Document */ - public streamingDetectIntent(request: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest, callback: google.cloud.dialogflow.v2beta1.Sessions.StreamingDetectIntentCallback): void; + public getDocument(request: google.cloud.dialogflow.v2beta1.IGetDocumentRequest, callback: google.cloud.dialogflow.v2beta1.Documents.GetDocumentCallback): void; /** - * Calls StreamingDetectIntent. - * @param request StreamingDetectIntentRequest message or plain object + * Calls GetDocument. + * @param request GetDocumentRequest message or plain object * @returns Promise */ - public streamingDetectIntent(request: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest): Promise; - } - - namespace Sessions { - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Sessions#detectIntent}. - * @param error Error, if any - * @param [response] DetectIntentResponse - */ - type DetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.DetectIntentResponse) => void; - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Sessions#streamingDetectIntent}. - * @param error Error, if any - * @param [response] StreamingDetectIntentResponse - */ - type StreamingDetectIntentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse) => void; - } - - /** Properties of a DetectIntentRequest. */ - interface IDetectIntentRequest { - - /** DetectIntentRequest session */ - session?: (string|null); - - /** DetectIntentRequest queryParams */ - queryParams?: (google.cloud.dialogflow.v2beta1.IQueryParameters|null); - - /** DetectIntentRequest queryInput */ - queryInput?: (google.cloud.dialogflow.v2beta1.IQueryInput|null); - - /** DetectIntentRequest outputAudioConfig */ - outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); - - /** DetectIntentRequest outputAudioConfigMask */ - outputAudioConfigMask?: (google.protobuf.IFieldMask|null); - - /** DetectIntentRequest inputAudio */ - inputAudio?: (Uint8Array|string|null); - } - - /** Represents a DetectIntentRequest. */ - class DetectIntentRequest implements IDetectIntentRequest { - - /** - * Constructs a new DetectIntentRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IDetectIntentRequest); - - /** DetectIntentRequest session. */ - public session: string; - - /** DetectIntentRequest queryParams. */ - public queryParams?: (google.cloud.dialogflow.v2beta1.IQueryParameters|null); - - /** DetectIntentRequest queryInput. */ - public queryInput?: (google.cloud.dialogflow.v2beta1.IQueryInput|null); - - /** DetectIntentRequest outputAudioConfig. */ - public outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); - - /** DetectIntentRequest outputAudioConfigMask. */ - public outputAudioConfigMask?: (google.protobuf.IFieldMask|null); - - /** DetectIntentRequest inputAudio. */ - public inputAudio: (Uint8Array|string); - - /** - * Creates a new DetectIntentRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DetectIntentRequest instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IDetectIntentRequest): google.cloud.dialogflow.v2beta1.DetectIntentRequest; - - /** - * Encodes the specified DetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentRequest.verify|verify} messages. - * @param message DetectIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.IDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentRequest.verify|verify} messages. - * @param message DetectIntentRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public getDocument(request: google.cloud.dialogflow.v2beta1.IGetDocumentRequest): Promise; /** - * Decodes a DetectIntentRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DetectIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateDocument. + * @param request CreateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DetectIntentRequest; + public createDocument(request: google.cloud.dialogflow.v2beta1.ICreateDocumentRequest, callback: google.cloud.dialogflow.v2beta1.Documents.CreateDocumentCallback): void; /** - * Decodes a DetectIntentRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DetectIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls CreateDocument. + * @param request CreateDocumentRequest message or plain object + * @returns Promise */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DetectIntentRequest; + public createDocument(request: google.cloud.dialogflow.v2beta1.ICreateDocumentRequest): Promise; /** - * Verifies a DetectIntentRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Calls ImportDocuments. + * @param request ImportDocumentsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static verify(message: { [k: string]: any }): (string|null); + public importDocuments(request: google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, callback: google.cloud.dialogflow.v2beta1.Documents.ImportDocumentsCallback): void; /** - * Creates a DetectIntentRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DetectIntentRequest + * Calls ImportDocuments. + * @param request ImportDocumentsRequest message or plain object + * @returns Promise */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DetectIntentRequest; + public importDocuments(request: google.cloud.dialogflow.v2beta1.IImportDocumentsRequest): Promise; /** - * Creates a plain object from a DetectIntentRequest message. Also converts values to other types if specified. - * @param message DetectIntentRequest - * @param [options] Conversion options - * @returns Plain object + * Calls DeleteDocument. + * @param request DeleteDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static toObject(message: google.cloud.dialogflow.v2beta1.DetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public deleteDocument(request: google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest, callback: google.cloud.dialogflow.v2beta1.Documents.DeleteDocumentCallback): void; /** - * Converts this DetectIntentRequest to JSON. - * @returns JSON object + * Calls DeleteDocument. + * @param request DeleteDocumentRequest message or plain object + * @returns Promise */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DetectIntentResponse. */ - interface IDetectIntentResponse { - - /** DetectIntentResponse responseId */ - responseId?: (string|null); - - /** DetectIntentResponse queryResult */ - queryResult?: (google.cloud.dialogflow.v2beta1.IQueryResult|null); - - /** DetectIntentResponse alternativeQueryResults */ - alternativeQueryResults?: (google.cloud.dialogflow.v2beta1.IQueryResult[]|null); - - /** DetectIntentResponse webhookStatus */ - webhookStatus?: (google.rpc.IStatus|null); - - /** DetectIntentResponse outputAudio */ - outputAudio?: (Uint8Array|string|null); - - /** DetectIntentResponse outputAudioConfig */ - outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); - } - - /** Represents a DetectIntentResponse. */ - class DetectIntentResponse implements IDetectIntentResponse { + public deleteDocument(request: google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest): Promise; /** - * Constructs a new DetectIntentResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IDetectIntentResponse); - - /** DetectIntentResponse responseId. */ - public responseId: string; - - /** DetectIntentResponse queryResult. */ - public queryResult?: (google.cloud.dialogflow.v2beta1.IQueryResult|null); - - /** DetectIntentResponse alternativeQueryResults. */ - public alternativeQueryResults: google.cloud.dialogflow.v2beta1.IQueryResult[]; - - /** DetectIntentResponse webhookStatus. */ - public webhookStatus?: (google.rpc.IStatus|null); - - /** DetectIntentResponse outputAudio. */ - public outputAudio: (Uint8Array|string); + * Calls UpdateDocument. + * @param request UpdateDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDocument(request: google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest, callback: google.cloud.dialogflow.v2beta1.Documents.UpdateDocumentCallback): void; - /** DetectIntentResponse outputAudioConfig. */ - public outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + /** + * Calls UpdateDocument. + * @param request UpdateDocumentRequest message or plain object + * @returns Promise + */ + public updateDocument(request: google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest): Promise; /** - * Creates a new DetectIntentResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns DetectIntentResponse instance + * Calls ReloadDocument. + * @param request ReloadDocumentRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IDetectIntentResponse): google.cloud.dialogflow.v2beta1.DetectIntentResponse; + public reloadDocument(request: google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, callback: google.cloud.dialogflow.v2beta1.Documents.ReloadDocumentCallback): void; /** - * Encodes the specified DetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentResponse.verify|verify} messages. - * @param message DetectIntentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Calls ReloadDocument. + * @param request ReloadDocumentRequest message or plain object + * @returns Promise */ - public static encode(message: google.cloud.dialogflow.v2beta1.IDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public reloadDocument(request: google.cloud.dialogflow.v2beta1.IReloadDocumentRequest): Promise; + } + + namespace Documents { /** - * Encodes the specified DetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentResponse.verify|verify} messages. - * @param message DetectIntentResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#listDocuments}. + * @param error Error, if any + * @param [response] ListDocumentsResponse */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + type ListDocumentsCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListDocumentsResponse) => void; /** - * Decodes a DetectIntentResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#getDocument}. + * @param error Error, if any + * @param [response] Document */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DetectIntentResponse; + type GetDocumentCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.Document) => void; /** - * Decodes a DetectIntentResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#createDocument}. + * @param error Error, if any + * @param [response] Operation */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DetectIntentResponse; + type CreateDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Verifies a DetectIntentResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#importDocuments}. + * @param error Error, if any + * @param [response] Operation */ - public static verify(message: { [k: string]: any }): (string|null); + type ImportDocumentsCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a DetectIntentResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DetectIntentResponse + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#deleteDocument}. + * @param error Error, if any + * @param [response] Operation */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DetectIntentResponse; + type DeleteDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Creates a plain object from a DetectIntentResponse message. Also converts values to other types if specified. - * @param message DetectIntentResponse - * @param [options] Conversion options - * @returns Plain object + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#updateDocument}. + * @param error Error, if any + * @param [response] Operation */ - public static toObject(message: google.cloud.dialogflow.v2beta1.DetectIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + type UpdateDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; /** - * Converts this DetectIntentResponse to JSON. - * @returns JSON object + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#reloadDocument}. + * @param error Error, if any + * @param [response] Operation */ - public toJSON(): { [k: string]: any }; + type ReloadDocumentCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; } - /** Properties of a QueryParameters. */ - interface IQueryParameters { + /** Properties of a Document. */ + interface IDocument { - /** QueryParameters timeZone */ - timeZone?: (string|null); + /** Document name */ + name?: (string|null); - /** QueryParameters geoLocation */ - geoLocation?: (google.type.ILatLng|null); + /** Document displayName */ + displayName?: (string|null); - /** QueryParameters contexts */ - contexts?: (google.cloud.dialogflow.v2beta1.IContext[]|null); + /** Document mimeType */ + mimeType?: (string|null); - /** QueryParameters resetContexts */ - resetContexts?: (boolean|null); + /** Document knowledgeTypes */ + knowledgeTypes?: (google.cloud.dialogflow.v2beta1.Document.KnowledgeType[]|null); - /** QueryParameters sessionEntityTypes */ - sessionEntityTypes?: (google.cloud.dialogflow.v2beta1.ISessionEntityType[]|null); + /** Document contentUri */ + contentUri?: (string|null); - /** QueryParameters payload */ - payload?: (google.protobuf.IStruct|null); + /** Document content */ + content?: (string|null); - /** QueryParameters knowledgeBaseNames */ - knowledgeBaseNames?: (string[]|null); + /** Document rawContent */ + rawContent?: (Uint8Array|string|null); - /** QueryParameters sentimentAnalysisRequestConfig */ - sentimentAnalysisRequestConfig?: (google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig|null); + /** Document enableAutoReload */ + enableAutoReload?: (boolean|null); - /** QueryParameters subAgents */ - subAgents?: (google.cloud.dialogflow.v2beta1.ISubAgent[]|null); + /** Document latestReloadStatus */ + latestReloadStatus?: (google.cloud.dialogflow.v2beta1.Document.IReloadStatus|null); - /** QueryParameters webhookHeaders */ - webhookHeaders?: ({ [k: string]: string }|null); + /** Document metadata */ + metadata?: ({ [k: string]: string }|null); } - /** Represents a QueryParameters. */ - class QueryParameters implements IQueryParameters { + /** Represents a Document. */ + class Document implements IDocument { /** - * Constructs a new QueryParameters. + * Constructs a new Document. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IQueryParameters); + constructor(properties?: google.cloud.dialogflow.v2beta1.IDocument); - /** QueryParameters timeZone. */ - public timeZone: string; + /** Document name. */ + public name: string; - /** QueryParameters geoLocation. */ - public geoLocation?: (google.type.ILatLng|null); + /** Document displayName. */ + public displayName: string; - /** QueryParameters contexts. */ - public contexts: google.cloud.dialogflow.v2beta1.IContext[]; + /** Document mimeType. */ + public mimeType: string; - /** QueryParameters resetContexts. */ - public resetContexts: boolean; + /** Document knowledgeTypes. */ + public knowledgeTypes: google.cloud.dialogflow.v2beta1.Document.KnowledgeType[]; - /** QueryParameters sessionEntityTypes. */ - public sessionEntityTypes: google.cloud.dialogflow.v2beta1.ISessionEntityType[]; + /** Document contentUri. */ + public contentUri: string; - /** QueryParameters payload. */ - public payload?: (google.protobuf.IStruct|null); + /** Document content. */ + public content: string; - /** QueryParameters knowledgeBaseNames. */ - public knowledgeBaseNames: string[]; + /** Document rawContent. */ + public rawContent: (Uint8Array|string); - /** QueryParameters sentimentAnalysisRequestConfig. */ - public sentimentAnalysisRequestConfig?: (google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig|null); + /** Document enableAutoReload. */ + public enableAutoReload: boolean; - /** QueryParameters subAgents. */ - public subAgents: google.cloud.dialogflow.v2beta1.ISubAgent[]; + /** Document latestReloadStatus. */ + public latestReloadStatus?: (google.cloud.dialogflow.v2beta1.Document.IReloadStatus|null); - /** QueryParameters webhookHeaders. */ - public webhookHeaders: { [k: string]: string }; + /** Document metadata. */ + public metadata: { [k: string]: string }; + + /** Document source. */ + public source?: ("contentUri"|"content"|"rawContent"); /** - * Creates a new QueryParameters instance using the specified properties. + * Creates a new Document instance using the specified properties. * @param [properties] Properties to set - * @returns QueryParameters instance + * @returns Document instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IQueryParameters): google.cloud.dialogflow.v2beta1.QueryParameters; + public static create(properties?: google.cloud.dialogflow.v2beta1.IDocument): google.cloud.dialogflow.v2beta1.Document; /** - * Encodes the specified QueryParameters message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryParameters.verify|verify} messages. - * @param message QueryParameters message or plain object to encode + * Encodes the specified Document message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.verify|verify} messages. + * @param message Document message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified QueryParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryParameters.verify|verify} messages. - * @param message QueryParameters message or plain object to encode + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.verify|verify} messages. + * @param message Document message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IQueryParameters, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDocument, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a QueryParameters message from the specified reader or buffer. + * Decodes a Document message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns QueryParameters + * @returns Document * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.QueryParameters; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Document; /** - * Decodes a QueryParameters message from the specified reader or buffer, length delimited. + * Decodes a Document message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns QueryParameters + * @returns Document * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.QueryParameters; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Document; /** - * Verifies a QueryParameters message. + * Verifies a Document message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a QueryParameters message from a plain object. Also converts values to their respective internal types. + * Creates a Document message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns QueryParameters + * @returns Document */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.QueryParameters; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Document; /** - * Creates a plain object from a QueryParameters message. Also converts values to other types if specified. - * @param message QueryParameters + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @param message Document * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.QueryParameters, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.Document, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this QueryParameters to JSON. + * Converts this Document to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a QueryInput. */ - interface IQueryInput { + namespace Document { - /** QueryInput audioConfig */ - audioConfig?: (google.cloud.dialogflow.v2beta1.IInputAudioConfig|null); + /** Properties of a ReloadStatus. */ + interface IReloadStatus { - /** QueryInput text */ - text?: (google.cloud.dialogflow.v2beta1.ITextInput|null); + /** ReloadStatus time */ + time?: (google.protobuf.ITimestamp|null); - /** QueryInput event */ - event?: (google.cloud.dialogflow.v2beta1.IEventInput|null); + /** ReloadStatus status */ + status?: (google.rpc.IStatus|null); + } + + /** Represents a ReloadStatus. */ + class ReloadStatus implements IReloadStatus { + + /** + * Constructs a new ReloadStatus. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.Document.IReloadStatus); + + /** ReloadStatus time. */ + public time?: (google.protobuf.ITimestamp|null); + + /** ReloadStatus status. */ + public status?: (google.rpc.IStatus|null); + + /** + * Creates a new ReloadStatus instance using the specified properties. + * @param [properties] Properties to set + * @returns ReloadStatus instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.Document.IReloadStatus): google.cloud.dialogflow.v2beta1.Document.ReloadStatus; + + /** + * Encodes the specified ReloadStatus message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.ReloadStatus.verify|verify} messages. + * @param message ReloadStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.Document.IReloadStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReloadStatus message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.ReloadStatus.verify|verify} messages. + * @param message ReloadStatus message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.Document.IReloadStatus, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReloadStatus message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReloadStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Document.ReloadStatus; + + /** + * Decodes a ReloadStatus message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReloadStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Document.ReloadStatus; + + /** + * Verifies a ReloadStatus message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReloadStatus message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReloadStatus + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Document.ReloadStatus; + + /** + * Creates a plain object from a ReloadStatus message. Also converts values to other types if specified. + * @param message ReloadStatus + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.Document.ReloadStatus, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReloadStatus to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** KnowledgeType enum. */ + enum KnowledgeType { + KNOWLEDGE_TYPE_UNSPECIFIED = 0, + FAQ = 1, + EXTRACTIVE_QA = 2, + ARTICLE_SUGGESTION = 3, + SMART_REPLY = 4 + } } - /** Represents a QueryInput. */ - class QueryInput implements IQueryInput { + /** Properties of a GetDocumentRequest. */ + interface IGetDocumentRequest { + + /** GetDocumentRequest name */ + name?: (string|null); + } + + /** Represents a GetDocumentRequest. */ + class GetDocumentRequest implements IGetDocumentRequest { /** - * Constructs a new QueryInput. + * Constructs a new GetDocumentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IQueryInput); - - /** QueryInput audioConfig. */ - public audioConfig?: (google.cloud.dialogflow.v2beta1.IInputAudioConfig|null); - - /** QueryInput text. */ - public text?: (google.cloud.dialogflow.v2beta1.ITextInput|null); - - /** QueryInput event. */ - public event?: (google.cloud.dialogflow.v2beta1.IEventInput|null); + constructor(properties?: google.cloud.dialogflow.v2beta1.IGetDocumentRequest); - /** QueryInput input. */ - public input?: ("audioConfig"|"text"|"event"); + /** GetDocumentRequest name. */ + public name: string; /** - * Creates a new QueryInput instance using the specified properties. + * Creates a new GetDocumentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns QueryInput instance + * @returns GetDocumentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IQueryInput): google.cloud.dialogflow.v2beta1.QueryInput; + public static create(properties?: google.cloud.dialogflow.v2beta1.IGetDocumentRequest): google.cloud.dialogflow.v2beta1.GetDocumentRequest; /** - * Encodes the specified QueryInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryInput.verify|verify} messages. - * @param message QueryInput message or plain object to encode + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetDocumentRequest.verify|verify} messages. + * @param message GetDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IQueryInput, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified QueryInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryInput.verify|verify} messages. - * @param message QueryInput message or plain object to encode + * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetDocumentRequest.verify|verify} messages. + * @param message GetDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IQueryInput, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a QueryInput message from the specified reader or buffer. + * Decodes a GetDocumentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns QueryInput + * @returns GetDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.QueryInput; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetDocumentRequest; /** - * Decodes a QueryInput message from the specified reader or buffer, length delimited. + * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns QueryInput + * @returns GetDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.QueryInput; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetDocumentRequest; /** - * Verifies a QueryInput message. + * Verifies a GetDocumentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a QueryInput message from a plain object. Also converts values to their respective internal types. + * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns QueryInput + * @returns GetDocumentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.QueryInput; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetDocumentRequest; /** - * Creates a plain object from a QueryInput message. Also converts values to other types if specified. - * @param message QueryInput + * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. + * @param message GetDocumentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.QueryInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.GetDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this QueryInput to JSON. + * Converts this GetDocumentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a QueryResult. */ - interface IQueryResult { - - /** QueryResult queryText */ - queryText?: (string|null); - - /** QueryResult languageCode */ - languageCode?: (string|null); - - /** QueryResult speechRecognitionConfidence */ - speechRecognitionConfidence?: (number|null); - - /** QueryResult action */ - action?: (string|null); - - /** QueryResult parameters */ - parameters?: (google.protobuf.IStruct|null); - - /** QueryResult allRequiredParamsPresent */ - allRequiredParamsPresent?: (boolean|null); - - /** QueryResult fulfillmentText */ - fulfillmentText?: (string|null); - - /** QueryResult fulfillmentMessages */ - fulfillmentMessages?: (google.cloud.dialogflow.v2beta1.Intent.IMessage[]|null); - - /** QueryResult webhookSource */ - webhookSource?: (string|null); - - /** QueryResult webhookPayload */ - webhookPayload?: (google.protobuf.IStruct|null); - - /** QueryResult outputContexts */ - outputContexts?: (google.cloud.dialogflow.v2beta1.IContext[]|null); - - /** QueryResult intent */ - intent?: (google.cloud.dialogflow.v2beta1.IIntent|null); + /** Properties of a ListDocumentsRequest. */ + interface IListDocumentsRequest { - /** QueryResult intentDetectionConfidence */ - intentDetectionConfidence?: (number|null); + /** ListDocumentsRequest parent */ + parent?: (string|null); - /** QueryResult diagnosticInfo */ - diagnosticInfo?: (google.protobuf.IStruct|null); + /** ListDocumentsRequest pageSize */ + pageSize?: (number|null); - /** QueryResult sentimentAnalysisResult */ - sentimentAnalysisResult?: (google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult|null); + /** ListDocumentsRequest pageToken */ + pageToken?: (string|null); - /** QueryResult knowledgeAnswers */ - knowledgeAnswers?: (google.cloud.dialogflow.v2beta1.IKnowledgeAnswers|null); + /** ListDocumentsRequest filter */ + filter?: (string|null); } - /** Represents a QueryResult. */ - class QueryResult implements IQueryResult { + /** Represents a ListDocumentsRequest. */ + class ListDocumentsRequest implements IListDocumentsRequest { /** - * Constructs a new QueryResult. + * Constructs a new ListDocumentsRequest. * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IQueryResult); - - /** QueryResult queryText. */ - public queryText: string; - - /** QueryResult languageCode. */ - public languageCode: string; - - /** QueryResult speechRecognitionConfidence. */ - public speechRecognitionConfidence: number; - - /** QueryResult action. */ - public action: string; - - /** QueryResult parameters. */ - public parameters?: (google.protobuf.IStruct|null); - - /** QueryResult allRequiredParamsPresent. */ - public allRequiredParamsPresent: boolean; - - /** QueryResult fulfillmentText. */ - public fulfillmentText: string; - - /** QueryResult fulfillmentMessages. */ - public fulfillmentMessages: google.cloud.dialogflow.v2beta1.Intent.IMessage[]; - - /** QueryResult webhookSource. */ - public webhookSource: string; - - /** QueryResult webhookPayload. */ - public webhookPayload?: (google.protobuf.IStruct|null); - - /** QueryResult outputContexts. */ - public outputContexts: google.cloud.dialogflow.v2beta1.IContext[]; - - /** QueryResult intent. */ - public intent?: (google.cloud.dialogflow.v2beta1.IIntent|null); + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IListDocumentsRequest); - /** QueryResult intentDetectionConfidence. */ - public intentDetectionConfidence: number; + /** ListDocumentsRequest parent. */ + public parent: string; - /** QueryResult diagnosticInfo. */ - public diagnosticInfo?: (google.protobuf.IStruct|null); + /** ListDocumentsRequest pageSize. */ + public pageSize: number; - /** QueryResult sentimentAnalysisResult. */ - public sentimentAnalysisResult?: (google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult|null); + /** ListDocumentsRequest pageToken. */ + public pageToken: string; - /** QueryResult knowledgeAnswers. */ - public knowledgeAnswers?: (google.cloud.dialogflow.v2beta1.IKnowledgeAnswers|null); + /** ListDocumentsRequest filter. */ + public filter: string; /** - * Creates a new QueryResult instance using the specified properties. + * Creates a new ListDocumentsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns QueryResult instance + * @returns ListDocumentsRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IQueryResult): google.cloud.dialogflow.v2beta1.QueryResult; + public static create(properties?: google.cloud.dialogflow.v2beta1.IListDocumentsRequest): google.cloud.dialogflow.v2beta1.ListDocumentsRequest; /** - * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryResult.verify|verify} messages. - * @param message QueryResult message or plain object to encode + * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsRequest.verify|verify} messages. + * @param message ListDocumentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryResult.verify|verify} messages. - * @param message QueryResult message or plain object to encode + * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsRequest.verify|verify} messages. + * @param message ListDocumentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IQueryResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a QueryResult message from the specified reader or buffer. + * Decodes a ListDocumentsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns QueryResult + * @returns ListDocumentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.QueryResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListDocumentsRequest; /** - * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns QueryResult + * @returns ListDocumentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.QueryResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListDocumentsRequest; /** - * Verifies a QueryResult message. + * Verifies a ListDocumentsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. + * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns QueryResult + * @returns ListDocumentsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.QueryResult; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListDocumentsRequest; /** - * Creates a plain object from a QueryResult message. Also converts values to other types if specified. - * @param message QueryResult + * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. + * @param message ListDocumentsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.QueryResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ListDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this QueryResult to JSON. + * Converts this ListDocumentsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a KnowledgeAnswers. */ - interface IKnowledgeAnswers { + /** Properties of a ListDocumentsResponse. */ + interface IListDocumentsResponse { - /** KnowledgeAnswers answers */ - answers?: (google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer[]|null); + /** ListDocumentsResponse documents */ + documents?: (google.cloud.dialogflow.v2beta1.IDocument[]|null); + + /** ListDocumentsResponse nextPageToken */ + nextPageToken?: (string|null); } - /** Represents a KnowledgeAnswers. */ - class KnowledgeAnswers implements IKnowledgeAnswers { + /** Represents a ListDocumentsResponse. */ + class ListDocumentsResponse implements IListDocumentsResponse { /** - * Constructs a new KnowledgeAnswers. + * Constructs a new ListDocumentsResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IKnowledgeAnswers); + constructor(properties?: google.cloud.dialogflow.v2beta1.IListDocumentsResponse); - /** KnowledgeAnswers answers. */ - public answers: google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer[]; + /** ListDocumentsResponse documents. */ + public documents: google.cloud.dialogflow.v2beta1.IDocument[]; + + /** ListDocumentsResponse nextPageToken. */ + public nextPageToken: string; /** - * Creates a new KnowledgeAnswers instance using the specified properties. + * Creates a new ListDocumentsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns KnowledgeAnswers instance + * @returns ListDocumentsResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IKnowledgeAnswers): google.cloud.dialogflow.v2beta1.KnowledgeAnswers; + public static create(properties?: google.cloud.dialogflow.v2beta1.IListDocumentsResponse): google.cloud.dialogflow.v2beta1.ListDocumentsResponse; /** - * Encodes the specified KnowledgeAnswers message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.verify|verify} messages. - * @param message KnowledgeAnswers message or plain object to encode + * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsResponse.verify|verify} messages. + * @param message ListDocumentsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IKnowledgeAnswers, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified KnowledgeAnswers message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.verify|verify} messages. - * @param message KnowledgeAnswers message or plain object to encode + * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsResponse.verify|verify} messages. + * @param message ListDocumentsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IKnowledgeAnswers, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a KnowledgeAnswers message from the specified reader or buffer. + * Decodes a ListDocumentsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns KnowledgeAnswers + * @returns ListDocumentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.KnowledgeAnswers; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListDocumentsResponse; /** - * Decodes a KnowledgeAnswers message from the specified reader or buffer, length delimited. + * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns KnowledgeAnswers + * @returns ListDocumentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.KnowledgeAnswers; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListDocumentsResponse; /** - * Verifies a KnowledgeAnswers message. + * Verifies a ListDocumentsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a KnowledgeAnswers message from a plain object. Also converts values to their respective internal types. + * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns KnowledgeAnswers + * @returns ListDocumentsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.KnowledgeAnswers; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListDocumentsResponse; /** - * Creates a plain object from a KnowledgeAnswers message. Also converts values to other types if specified. - * @param message KnowledgeAnswers + * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. + * @param message ListDocumentsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.KnowledgeAnswers, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ListDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this KnowledgeAnswers to JSON. + * Converts this ListDocumentsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace KnowledgeAnswers { - - /** Properties of an Answer. */ - interface IAnswer { - - /** Answer source */ - source?: (string|null); - - /** Answer faqQuestion */ - faqQuestion?: (string|null); - - /** Answer answer */ - answer?: (string|null); - - /** Answer matchConfidenceLevel */ - matchConfidenceLevel?: (google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel|keyof typeof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel|null); - - /** Answer matchConfidence */ - matchConfidence?: (number|null); - } - - /** Represents an Answer. */ - class Answer implements IAnswer { + /** Properties of a CreateDocumentRequest. */ + interface ICreateDocumentRequest { - /** - * Constructs a new Answer. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer); + /** CreateDocumentRequest parent */ + parent?: (string|null); - /** Answer source. */ - public source: string; + /** CreateDocumentRequest document */ + document?: (google.cloud.dialogflow.v2beta1.IDocument|null); - /** Answer faqQuestion. */ - public faqQuestion: string; + /** CreateDocumentRequest importGcsCustomMetadata */ + importGcsCustomMetadata?: (boolean|null); + } - /** Answer answer. */ - public answer: string; + /** Represents a CreateDocumentRequest. */ + class CreateDocumentRequest implements ICreateDocumentRequest { - /** Answer matchConfidenceLevel. */ - public matchConfidenceLevel: (google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel|keyof typeof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel); + /** + * Constructs a new CreateDocumentRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateDocumentRequest); - /** Answer matchConfidence. */ - public matchConfidence: number; + /** CreateDocumentRequest parent. */ + public parent: string; - /** - * Creates a new Answer instance using the specified properties. - * @param [properties] Properties to set - * @returns Answer instance - */ - public static create(properties?: google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer): google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer; + /** CreateDocumentRequest document. */ + public document?: (google.cloud.dialogflow.v2beta1.IDocument|null); - /** - * Encodes the specified Answer message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.verify|verify} messages. - * @param message Answer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + /** CreateDocumentRequest importGcsCustomMetadata. */ + public importGcsCustomMetadata: boolean; - /** - * Encodes the specified Answer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.verify|verify} messages. - * @param message Answer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer, writer?: $protobuf.Writer): $protobuf.Writer; + /** + * Creates a new CreateDocumentRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateDocumentRequest instance + */ + public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateDocumentRequest): google.cloud.dialogflow.v2beta1.CreateDocumentRequest; - /** - * Decodes an Answer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Answer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer; + /** + * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateDocumentRequest.verify|verify} messages. + * @param message CreateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.dialogflow.v2beta1.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Decodes an Answer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Answer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer; + /** + * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateDocumentRequest.verify|verify} messages. + * @param message CreateDocumentRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; - /** - * Verifies an Answer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateDocumentRequest; - /** - * Creates an Answer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Answer - */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer; + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateDocumentRequest; - /** - * Creates a plain object from an Answer message. Also converts values to other types if specified. - * @param message Answer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + /** + * Verifies a CreateDocumentRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); - /** - * Converts this Answer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** + * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateDocumentRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateDocumentRequest; - namespace Answer { + /** + * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. + * @param message CreateDocumentRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.dialogflow.v2beta1.CreateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - /** MatchConfidenceLevel enum. */ - enum MatchConfidenceLevel { - MATCH_CONFIDENCE_LEVEL_UNSPECIFIED = 0, - LOW = 1, - MEDIUM = 2, - HIGH = 3 - } - } + /** + * Converts this CreateDocumentRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; } - /** Properties of a StreamingDetectIntentRequest. */ - interface IStreamingDetectIntentRequest { - - /** StreamingDetectIntentRequest session */ - session?: (string|null); - - /** StreamingDetectIntentRequest queryParams */ - queryParams?: (google.cloud.dialogflow.v2beta1.IQueryParameters|null); - - /** StreamingDetectIntentRequest queryInput */ - queryInput?: (google.cloud.dialogflow.v2beta1.IQueryInput|null); + /** Properties of an ImportDocumentsRequest. */ + interface IImportDocumentsRequest { - /** StreamingDetectIntentRequest singleUtterance */ - singleUtterance?: (boolean|null); + /** ImportDocumentsRequest parent */ + parent?: (string|null); - /** StreamingDetectIntentRequest outputAudioConfig */ - outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + /** ImportDocumentsRequest gcsSource */ + gcsSource?: (google.cloud.dialogflow.v2beta1.IGcsSources|null); - /** StreamingDetectIntentRequest outputAudioConfigMask */ - outputAudioConfigMask?: (google.protobuf.IFieldMask|null); + /** ImportDocumentsRequest documentTemplate */ + documentTemplate?: (google.cloud.dialogflow.v2beta1.IImportDocumentTemplate|null); - /** StreamingDetectIntentRequest inputAudio */ - inputAudio?: (Uint8Array|string|null); + /** ImportDocumentsRequest importGcsCustomMetadata */ + importGcsCustomMetadata?: (boolean|null); } - /** Represents a StreamingDetectIntentRequest. */ - class StreamingDetectIntentRequest implements IStreamingDetectIntentRequest { + /** Represents an ImportDocumentsRequest. */ + class ImportDocumentsRequest implements IImportDocumentsRequest { /** - * Constructs a new StreamingDetectIntentRequest. + * Constructs a new ImportDocumentsRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest); - - /** StreamingDetectIntentRequest session. */ - public session: string; + constructor(properties?: google.cloud.dialogflow.v2beta1.IImportDocumentsRequest); - /** StreamingDetectIntentRequest queryParams. */ - public queryParams?: (google.cloud.dialogflow.v2beta1.IQueryParameters|null); - - /** StreamingDetectIntentRequest queryInput. */ - public queryInput?: (google.cloud.dialogflow.v2beta1.IQueryInput|null); + /** ImportDocumentsRequest parent. */ + public parent: string; - /** StreamingDetectIntentRequest singleUtterance. */ - public singleUtterance: boolean; + /** ImportDocumentsRequest gcsSource. */ + public gcsSource?: (google.cloud.dialogflow.v2beta1.IGcsSources|null); - /** StreamingDetectIntentRequest outputAudioConfig. */ - public outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + /** ImportDocumentsRequest documentTemplate. */ + public documentTemplate?: (google.cloud.dialogflow.v2beta1.IImportDocumentTemplate|null); - /** StreamingDetectIntentRequest outputAudioConfigMask. */ - public outputAudioConfigMask?: (google.protobuf.IFieldMask|null); + /** ImportDocumentsRequest importGcsCustomMetadata. */ + public importGcsCustomMetadata: boolean; - /** StreamingDetectIntentRequest inputAudio. */ - public inputAudio: (Uint8Array|string); + /** ImportDocumentsRequest source. */ + public source?: "gcsSource"; /** - * Creates a new StreamingDetectIntentRequest instance using the specified properties. + * Creates a new ImportDocumentsRequest instance using the specified properties. * @param [properties] Properties to set - * @returns StreamingDetectIntentRequest instance + * @returns ImportDocumentsRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest): google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IImportDocumentsRequest): google.cloud.dialogflow.v2beta1.ImportDocumentsRequest; /** - * Encodes the specified StreamingDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.verify|verify} messages. - * @param message StreamingDetectIntentRequest message or plain object to encode + * Encodes the specified ImportDocumentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportDocumentsRequest.verify|verify} messages. + * @param message ImportDocumentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StreamingDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.verify|verify} messages. - * @param message StreamingDetectIntentRequest message or plain object to encode + * Encodes the specified ImportDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportDocumentsRequest.verify|verify} messages. + * @param message ImportDocumentsRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer. + * Decodes an ImportDocumentsRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StreamingDetectIntentRequest + * @returns ImportDocumentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ImportDocumentsRequest; /** - * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportDocumentsRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StreamingDetectIntentRequest + * @returns ImportDocumentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ImportDocumentsRequest; /** - * Verifies a StreamingDetectIntentRequest message. + * Verifies an ImportDocumentsRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a StreamingDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StreamingDetectIntentRequest + * @returns ImportDocumentsRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ImportDocumentsRequest; /** - * Creates a plain object from a StreamingDetectIntentRequest message. Also converts values to other types if specified. - * @param message StreamingDetectIntentRequest + * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. + * @param message ImportDocumentsRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ImportDocumentsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StreamingDetectIntentRequest to JSON. + * Converts this ImportDocumentsRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a StreamingDetectIntentResponse. */ - interface IStreamingDetectIntentResponse { - - /** StreamingDetectIntentResponse responseId */ - responseId?: (string|null); - - /** StreamingDetectIntentResponse recognitionResult */ - recognitionResult?: (google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null); - - /** StreamingDetectIntentResponse queryResult */ - queryResult?: (google.cloud.dialogflow.v2beta1.IQueryResult|null); - - /** StreamingDetectIntentResponse alternativeQueryResults */ - alternativeQueryResults?: (google.cloud.dialogflow.v2beta1.IQueryResult[]|null); + /** Properties of an ImportDocumentTemplate. */ + interface IImportDocumentTemplate { - /** StreamingDetectIntentResponse webhookStatus */ - webhookStatus?: (google.rpc.IStatus|null); + /** ImportDocumentTemplate mimeType */ + mimeType?: (string|null); - /** StreamingDetectIntentResponse outputAudio */ - outputAudio?: (Uint8Array|string|null); + /** ImportDocumentTemplate knowledgeTypes */ + knowledgeTypes?: (google.cloud.dialogflow.v2beta1.Document.KnowledgeType[]|null); - /** StreamingDetectIntentResponse outputAudioConfig */ - outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + /** ImportDocumentTemplate metadata */ + metadata?: ({ [k: string]: string }|null); } - /** Represents a StreamingDetectIntentResponse. */ - class StreamingDetectIntentResponse implements IStreamingDetectIntentResponse { + /** Represents an ImportDocumentTemplate. */ + class ImportDocumentTemplate implements IImportDocumentTemplate { /** - * Constructs a new StreamingDetectIntentResponse. + * Constructs a new ImportDocumentTemplate. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse); - - /** StreamingDetectIntentResponse responseId. */ - public responseId: string; - - /** StreamingDetectIntentResponse recognitionResult. */ - public recognitionResult?: (google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null); - - /** StreamingDetectIntentResponse queryResult. */ - public queryResult?: (google.cloud.dialogflow.v2beta1.IQueryResult|null); - - /** StreamingDetectIntentResponse alternativeQueryResults. */ - public alternativeQueryResults: google.cloud.dialogflow.v2beta1.IQueryResult[]; + constructor(properties?: google.cloud.dialogflow.v2beta1.IImportDocumentTemplate); - /** StreamingDetectIntentResponse webhookStatus. */ - public webhookStatus?: (google.rpc.IStatus|null); + /** ImportDocumentTemplate mimeType. */ + public mimeType: string; - /** StreamingDetectIntentResponse outputAudio. */ - public outputAudio: (Uint8Array|string); + /** ImportDocumentTemplate knowledgeTypes. */ + public knowledgeTypes: google.cloud.dialogflow.v2beta1.Document.KnowledgeType[]; - /** StreamingDetectIntentResponse outputAudioConfig. */ - public outputAudioConfig?: (google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null); + /** ImportDocumentTemplate metadata. */ + public metadata: { [k: string]: string }; /** - * Creates a new StreamingDetectIntentResponse instance using the specified properties. + * Creates a new ImportDocumentTemplate instance using the specified properties. * @param [properties] Properties to set - * @returns StreamingDetectIntentResponse instance + * @returns ImportDocumentTemplate instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse): google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse; + public static create(properties?: google.cloud.dialogflow.v2beta1.IImportDocumentTemplate): google.cloud.dialogflow.v2beta1.ImportDocumentTemplate; /** - * Encodes the specified StreamingDetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.verify|verify} messages. - * @param message StreamingDetectIntentResponse message or plain object to encode + * Encodes the specified ImportDocumentTemplate message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportDocumentTemplate.verify|verify} messages. + * @param message ImportDocumentTemplate message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IImportDocumentTemplate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StreamingDetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.verify|verify} messages. - * @param message StreamingDetectIntentResponse message or plain object to encode + * Encodes the specified ImportDocumentTemplate message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportDocumentTemplate.verify|verify} messages. + * @param message ImportDocumentTemplate message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IImportDocumentTemplate, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer. + * Decodes an ImportDocumentTemplate message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StreamingDetectIntentResponse + * @returns ImportDocumentTemplate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ImportDocumentTemplate; /** - * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer, length delimited. + * Decodes an ImportDocumentTemplate message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StreamingDetectIntentResponse + * @returns ImportDocumentTemplate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ImportDocumentTemplate; /** - * Verifies a StreamingDetectIntentResponse message. + * Verifies an ImportDocumentTemplate message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a StreamingDetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ImportDocumentTemplate message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StreamingDetectIntentResponse + * @returns ImportDocumentTemplate */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ImportDocumentTemplate; /** - * Creates a plain object from a StreamingDetectIntentResponse message. Also converts values to other types if specified. - * @param message StreamingDetectIntentResponse + * Creates a plain object from an ImportDocumentTemplate message. Also converts values to other types if specified. + * @param message ImportDocumentTemplate * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ImportDocumentTemplate, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StreamingDetectIntentResponse to JSON. + * Converts this ImportDocumentTemplate to JSON. * @returns JSON object */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a StreamingRecognitionResult. */ - interface IStreamingRecognitionResult { - - /** StreamingRecognitionResult messageType */ - messageType?: (google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType|keyof typeof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType|null); - - /** StreamingRecognitionResult transcript */ - transcript?: (string|null); - - /** StreamingRecognitionResult isFinal */ - isFinal?: (boolean|null); - - /** StreamingRecognitionResult confidence */ - confidence?: (number|null); - - /** StreamingRecognitionResult stability */ - stability?: (number|null); - - /** StreamingRecognitionResult speechWordInfo */ - speechWordInfo?: (google.cloud.dialogflow.v2beta1.ISpeechWordInfo[]|null); - - /** StreamingRecognitionResult speechEndOffset */ - speechEndOffset?: (google.protobuf.IDuration|null); - - /** StreamingRecognitionResult dtmfDigits */ - dtmfDigits?: (google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents|null); - } - - /** Represents a StreamingRecognitionResult. */ - class StreamingRecognitionResult implements IStreamingRecognitionResult { - - /** - * Constructs a new StreamingRecognitionResult. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult); - - /** StreamingRecognitionResult messageType. */ - public messageType: (google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType|keyof typeof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType); - - /** StreamingRecognitionResult transcript. */ - public transcript: string; - - /** StreamingRecognitionResult isFinal. */ - public isFinal: boolean; + public toJSON(): { [k: string]: any }; + } - /** StreamingRecognitionResult confidence. */ - public confidence: number; + /** Properties of an ImportDocumentsResponse. */ + interface IImportDocumentsResponse { - /** StreamingRecognitionResult stability. */ - public stability: number; + /** ImportDocumentsResponse warnings */ + warnings?: (google.rpc.IStatus[]|null); + } - /** StreamingRecognitionResult speechWordInfo. */ - public speechWordInfo: google.cloud.dialogflow.v2beta1.ISpeechWordInfo[]; + /** Represents an ImportDocumentsResponse. */ + class ImportDocumentsResponse implements IImportDocumentsResponse { - /** StreamingRecognitionResult speechEndOffset. */ - public speechEndOffset?: (google.protobuf.IDuration|null); + /** + * Constructs a new ImportDocumentsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.dialogflow.v2beta1.IImportDocumentsResponse); - /** StreamingRecognitionResult dtmfDigits. */ - public dtmfDigits?: (google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents|null); + /** ImportDocumentsResponse warnings. */ + public warnings: google.rpc.IStatus[]; /** - * Creates a new StreamingRecognitionResult instance using the specified properties. + * Creates a new ImportDocumentsResponse instance using the specified properties. * @param [properties] Properties to set - * @returns StreamingRecognitionResult instance + * @returns ImportDocumentsResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult): google.cloud.dialogflow.v2beta1.StreamingRecognitionResult; + public static create(properties?: google.cloud.dialogflow.v2beta1.IImportDocumentsResponse): google.cloud.dialogflow.v2beta1.ImportDocumentsResponse; /** - * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.verify|verify} messages. - * @param message StreamingRecognitionResult message or plain object to encode + * Encodes the specified ImportDocumentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportDocumentsResponse.verify|verify} messages. + * @param message ImportDocumentsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.verify|verify} messages. - * @param message StreamingRecognitionResult message or plain object to encode + * Encodes the specified ImportDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportDocumentsResponse.verify|verify} messages. + * @param message ImportDocumentsResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * Decodes an ImportDocumentsResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns StreamingRecognitionResult + * @returns ImportDocumentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.StreamingRecognitionResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ImportDocumentsResponse; /** - * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * Decodes an ImportDocumentsResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns StreamingRecognitionResult + * @returns ImportDocumentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.StreamingRecognitionResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ImportDocumentsResponse; /** - * Verifies a StreamingRecognitionResult message. + * Verifies an ImportDocumentsResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * Creates an ImportDocumentsResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns StreamingRecognitionResult + * @returns ImportDocumentsResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.StreamingRecognitionResult; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ImportDocumentsResponse; /** - * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. - * @param message StreamingRecognitionResult + * Creates a plain object from an ImportDocumentsResponse message. Also converts values to other types if specified. + * @param message ImportDocumentsResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.StreamingRecognitionResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ImportDocumentsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this StreamingRecognitionResult to JSON. + * Converts this ImportDocumentsResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace StreamingRecognitionResult { - - /** MessageType enum. */ - enum MessageType { - MESSAGE_TYPE_UNSPECIFIED = 0, - TRANSCRIPT = 1, - END_OF_SINGLE_UTTERANCE = 2 - } - } - - /** Properties of a TextInput. */ - interface ITextInput { - - /** TextInput text */ - text?: (string|null); + /** Properties of a DeleteDocumentRequest. */ + interface IDeleteDocumentRequest { - /** TextInput languageCode */ - languageCode?: (string|null); + /** DeleteDocumentRequest name */ + name?: (string|null); } - /** Represents a TextInput. */ - class TextInput implements ITextInput { + /** Represents a DeleteDocumentRequest. */ + class DeleteDocumentRequest implements IDeleteDocumentRequest { /** - * Constructs a new TextInput. + * Constructs a new DeleteDocumentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ITextInput); - - /** TextInput text. */ - public text: string; + constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest); - /** TextInput languageCode. */ - public languageCode: string; + /** DeleteDocumentRequest name. */ + public name: string; /** - * Creates a new TextInput instance using the specified properties. + * Creates a new DeleteDocumentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns TextInput instance + * @returns DeleteDocumentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ITextInput): google.cloud.dialogflow.v2beta1.TextInput; + public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest): google.cloud.dialogflow.v2beta1.DeleteDocumentRequest; /** - * Encodes the specified TextInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TextInput.verify|verify} messages. - * @param message TextInput message or plain object to encode + * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteDocumentRequest.verify|verify} messages. + * @param message DeleteDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TextInput.verify|verify} messages. - * @param message TextInput message or plain object to encode + * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteDocumentRequest.verify|verify} messages. + * @param message DeleteDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ITextInput, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a TextInput message from the specified reader or buffer. + * Decodes a DeleteDocumentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns TextInput + * @returns DeleteDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.TextInput; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteDocumentRequest; /** - * Decodes a TextInput message from the specified reader or buffer, length delimited. + * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns TextInput + * @returns DeleteDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.TextInput; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteDocumentRequest; /** - * Verifies a TextInput message. + * Verifies a DeleteDocumentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a TextInput message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns TextInput + * @returns DeleteDocumentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.TextInput; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteDocumentRequest; /** - * Creates a plain object from a TextInput message. Also converts values to other types if specified. - * @param message TextInput + * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. + * @param message DeleteDocumentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.TextInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this TextInput to JSON. + * Converts this DeleteDocumentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an EventInput. */ - interface IEventInput { - - /** EventInput name */ - name?: (string|null); + /** Properties of an UpdateDocumentRequest. */ + interface IUpdateDocumentRequest { - /** EventInput parameters */ - parameters?: (google.protobuf.IStruct|null); + /** UpdateDocumentRequest document */ + document?: (google.cloud.dialogflow.v2beta1.IDocument|null); - /** EventInput languageCode */ - languageCode?: (string|null); + /** UpdateDocumentRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents an EventInput. */ - class EventInput implements IEventInput { + /** Represents an UpdateDocumentRequest. */ + class UpdateDocumentRequest implements IUpdateDocumentRequest { /** - * Constructs a new EventInput. + * Constructs a new UpdateDocumentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IEventInput); - - /** EventInput name. */ - public name: string; + constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest); - /** EventInput parameters. */ - public parameters?: (google.protobuf.IStruct|null); + /** UpdateDocumentRequest document. */ + public document?: (google.cloud.dialogflow.v2beta1.IDocument|null); - /** EventInput languageCode. */ - public languageCode: string; + /** UpdateDocumentRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new EventInput instance using the specified properties. + * Creates a new UpdateDocumentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns EventInput instance + * @returns UpdateDocumentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IEventInput): google.cloud.dialogflow.v2beta1.EventInput; + public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest): google.cloud.dialogflow.v2beta1.UpdateDocumentRequest; /** - * Encodes the specified EventInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EventInput.verify|verify} messages. - * @param message EventInput message or plain object to encode + * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateDocumentRequest.verify|verify} messages. + * @param message UpdateDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IEventInput, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified EventInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EventInput.verify|verify} messages. - * @param message EventInput message or plain object to encode + * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateDocumentRequest.verify|verify} messages. + * @param message UpdateDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IEventInput, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an EventInput message from the specified reader or buffer. + * Decodes an UpdateDocumentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns EventInput + * @returns UpdateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.EventInput; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateDocumentRequest; /** - * Decodes an EventInput message from the specified reader or buffer, length delimited. + * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns EventInput + * @returns UpdateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.EventInput; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateDocumentRequest; /** - * Verifies an EventInput message. + * Verifies an UpdateDocumentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an EventInput message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns EventInput + * @returns UpdateDocumentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.EventInput; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateDocumentRequest; /** - * Creates a plain object from an EventInput message. Also converts values to other types if specified. - * @param message EventInput + * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. + * @param message UpdateDocumentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.EventInput, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this EventInput to JSON. + * Converts this UpdateDocumentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SentimentAnalysisRequestConfig. */ - interface ISentimentAnalysisRequestConfig { + /** Properties of a KnowledgeOperationMetadata. */ + interface IKnowledgeOperationMetadata { - /** SentimentAnalysisRequestConfig analyzeQueryTextSentiment */ - analyzeQueryTextSentiment?: (boolean|null); + /** KnowledgeOperationMetadata state */ + state?: (google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State|keyof typeof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State|null); } - /** Represents a SentimentAnalysisRequestConfig. */ - class SentimentAnalysisRequestConfig implements ISentimentAnalysisRequestConfig { + /** Represents a KnowledgeOperationMetadata. */ + class KnowledgeOperationMetadata implements IKnowledgeOperationMetadata { /** - * Constructs a new SentimentAnalysisRequestConfig. + * Constructs a new KnowledgeOperationMetadata. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig); + constructor(properties?: google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata); - /** SentimentAnalysisRequestConfig analyzeQueryTextSentiment. */ - public analyzeQueryTextSentiment: boolean; + /** KnowledgeOperationMetadata state. */ + public state: (google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State|keyof typeof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State); /** - * Creates a new SentimentAnalysisRequestConfig instance using the specified properties. + * Creates a new KnowledgeOperationMetadata instance using the specified properties. * @param [properties] Properties to set - * @returns SentimentAnalysisRequestConfig instance + * @returns KnowledgeOperationMetadata instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig): google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig; + public static create(properties?: google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata): google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata; /** - * Encodes the specified SentimentAnalysisRequestConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.verify|verify} messages. - * @param message SentimentAnalysisRequestConfig message or plain object to encode + * Encodes the specified KnowledgeOperationMetadata message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.verify|verify} messages. + * @param message KnowledgeOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SentimentAnalysisRequestConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.verify|verify} messages. - * @param message SentimentAnalysisRequestConfig message or plain object to encode + * Encodes the specified KnowledgeOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.verify|verify} messages. + * @param message KnowledgeOperationMetadata message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer. + * Decodes a KnowledgeOperationMetadata message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SentimentAnalysisRequestConfig + * @returns KnowledgeOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata; /** - * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer, length delimited. + * Decodes a KnowledgeOperationMetadata message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SentimentAnalysisRequestConfig + * @returns KnowledgeOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata; /** - * Verifies a SentimentAnalysisRequestConfig message. + * Verifies a KnowledgeOperationMetadata message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SentimentAnalysisRequestConfig message from a plain object. Also converts values to their respective internal types. + * Creates a KnowledgeOperationMetadata message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SentimentAnalysisRequestConfig + * @returns KnowledgeOperationMetadata */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata; /** - * Creates a plain object from a SentimentAnalysisRequestConfig message. Also converts values to other types if specified. - * @param message SentimentAnalysisRequestConfig + * Creates a plain object from a KnowledgeOperationMetadata message. Also converts values to other types if specified. + * @param message KnowledgeOperationMetadata * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SentimentAnalysisRequestConfig to JSON. + * Converts this KnowledgeOperationMetadata to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a SentimentAnalysisResult. */ - interface ISentimentAnalysisResult { + namespace KnowledgeOperationMetadata { - /** SentimentAnalysisResult queryTextSentiment */ - queryTextSentiment?: (google.cloud.dialogflow.v2beta1.ISentiment|null); + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + PENDING = 1, + RUNNING = 2, + DONE = 3 + } } - /** Represents a SentimentAnalysisResult. */ - class SentimentAnalysisResult implements ISentimentAnalysisResult { + /** Properties of a ReloadDocumentRequest. */ + interface IReloadDocumentRequest { + + /** ReloadDocumentRequest name */ + name?: (string|null); + + /** ReloadDocumentRequest gcsSource */ + gcsSource?: (google.cloud.dialogflow.v2beta1.IGcsSource|null); + + /** ReloadDocumentRequest importGcsCustomMetadata */ + importGcsCustomMetadata?: (boolean|null); + } + + /** Represents a ReloadDocumentRequest. */ + class ReloadDocumentRequest implements IReloadDocumentRequest { /** - * Constructs a new SentimentAnalysisResult. + * Constructs a new ReloadDocumentRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult); + constructor(properties?: google.cloud.dialogflow.v2beta1.IReloadDocumentRequest); - /** SentimentAnalysisResult queryTextSentiment. */ - public queryTextSentiment?: (google.cloud.dialogflow.v2beta1.ISentiment|null); + /** ReloadDocumentRequest name. */ + public name: string; + + /** ReloadDocumentRequest gcsSource. */ + public gcsSource?: (google.cloud.dialogflow.v2beta1.IGcsSource|null); + + /** ReloadDocumentRequest importGcsCustomMetadata. */ + public importGcsCustomMetadata: boolean; + + /** ReloadDocumentRequest source. */ + public source?: "gcsSource"; /** - * Creates a new SentimentAnalysisResult instance using the specified properties. + * Creates a new ReloadDocumentRequest instance using the specified properties. * @param [properties] Properties to set - * @returns SentimentAnalysisResult instance + * @returns ReloadDocumentRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult): google.cloud.dialogflow.v2beta1.SentimentAnalysisResult; + public static create(properties?: google.cloud.dialogflow.v2beta1.IReloadDocumentRequest): google.cloud.dialogflow.v2beta1.ReloadDocumentRequest; /** - * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.verify|verify} messages. - * @param message SentimentAnalysisResult message or plain object to encode + * Encodes the specified ReloadDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ReloadDocumentRequest.verify|verify} messages. + * @param message ReloadDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.verify|verify} messages. - * @param message SentimentAnalysisResult message or plain object to encode + * Encodes the specified ReloadDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ReloadDocumentRequest.verify|verify} messages. + * @param message ReloadDocumentRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IReloadDocumentRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * Decodes a ReloadDocumentRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SentimentAnalysisResult + * @returns ReloadDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SentimentAnalysisResult; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ReloadDocumentRequest; /** - * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * Decodes a ReloadDocumentRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SentimentAnalysisResult + * @returns ReloadDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SentimentAnalysisResult; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ReloadDocumentRequest; /** - * Verifies a SentimentAnalysisResult message. + * Verifies a ReloadDocumentRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * Creates a ReloadDocumentRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SentimentAnalysisResult + * @returns ReloadDocumentRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SentimentAnalysisResult; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ReloadDocumentRequest; /** - * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. - * @param message SentimentAnalysisResult + * Creates a plain object from a ReloadDocumentRequest message. Also converts values to other types if specified. + * @param message ReloadDocumentRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.SentimentAnalysisResult, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ReloadDocumentRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SentimentAnalysisResult to JSON. + * Converts this ReloadDocumentRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a Sentiment. */ - interface ISentiment { + /** Properties of a HumanAgentAssistantEvent. */ + interface IHumanAgentAssistantEvent { - /** Sentiment score */ - score?: (number|null); + /** HumanAgentAssistantEvent conversation */ + conversation?: (string|null); - /** Sentiment magnitude */ - magnitude?: (number|null); + /** HumanAgentAssistantEvent participant */ + participant?: (string|null); + + /** HumanAgentAssistantEvent suggestionResults */ + suggestionResults?: (google.cloud.dialogflow.v2beta1.ISuggestionResult[]|null); } - /** Represents a Sentiment. */ - class Sentiment implements ISentiment { + /** Represents a HumanAgentAssistantEvent. */ + class HumanAgentAssistantEvent implements IHumanAgentAssistantEvent { /** - * Constructs a new Sentiment. + * Constructs a new HumanAgentAssistantEvent. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ISentiment); + constructor(properties?: google.cloud.dialogflow.v2beta1.IHumanAgentAssistantEvent); - /** Sentiment score. */ - public score: number; + /** HumanAgentAssistantEvent conversation. */ + public conversation: string; - /** Sentiment magnitude. */ - public magnitude: number; + /** HumanAgentAssistantEvent participant. */ + public participant: string; + + /** HumanAgentAssistantEvent suggestionResults. */ + public suggestionResults: google.cloud.dialogflow.v2beta1.ISuggestionResult[]; /** - * Creates a new Sentiment instance using the specified properties. + * Creates a new HumanAgentAssistantEvent instance using the specified properties. * @param [properties] Properties to set - * @returns Sentiment instance + * @returns HumanAgentAssistantEvent instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ISentiment): google.cloud.dialogflow.v2beta1.Sentiment; + public static create(properties?: google.cloud.dialogflow.v2beta1.IHumanAgentAssistantEvent): google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent; /** - * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Sentiment.verify|verify} messages. - * @param message Sentiment message or plain object to encode + * Encodes the specified HumanAgentAssistantEvent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent.verify|verify} messages. + * @param message HumanAgentAssistantEvent message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ISentiment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IHumanAgentAssistantEvent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Sentiment.verify|verify} messages. - * @param message Sentiment message or plain object to encode + * Encodes the specified HumanAgentAssistantEvent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent.verify|verify} messages. + * @param message HumanAgentAssistantEvent message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISentiment, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IHumanAgentAssistantEvent, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a Sentiment message from the specified reader or buffer. + * Decodes a HumanAgentAssistantEvent message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns Sentiment + * @returns HumanAgentAssistantEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.Sentiment; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent; /** - * Decodes a Sentiment message from the specified reader or buffer, length delimited. + * Decodes a HumanAgentAssistantEvent message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns Sentiment + * @returns HumanAgentAssistantEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.Sentiment; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent; /** - * Verifies a Sentiment message. + * Verifies a HumanAgentAssistantEvent message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. + * Creates a HumanAgentAssistantEvent message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns Sentiment + * @returns HumanAgentAssistantEvent */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.Sentiment; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent; /** - * Creates a plain object from a Sentiment message. Also converts values to other types if specified. - * @param message Sentiment + * Creates a plain object from a HumanAgentAssistantEvent message. Also converts values to other types if specified. + * @param message HumanAgentAssistantEvent * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.Sentiment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this Sentiment to JSON. + * Converts this HumanAgentAssistantEvent to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Represents a SessionEntityTypes */ - class SessionEntityTypes extends $protobuf.rpc.Service { + /** Represents a KnowledgeBases */ + class KnowledgeBases extends $protobuf.rpc.Service { /** - * Constructs a new SessionEntityTypes service. + * Constructs a new KnowledgeBases service. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited @@ -28684,800 +50192,802 @@ export namespace google { constructor(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean); /** - * Creates new SessionEntityTypes service using the specified rpc implementation. + * Creates new KnowledgeBases service using the specified rpc implementation. * @param rpcImpl RPC implementation * @param [requestDelimited=false] Whether requests are length-delimited * @param [responseDelimited=false] Whether responses are length-delimited * @returns RPC service. Useful where requests and/or responses are streamed. */ - public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): SessionEntityTypes; + public static create(rpcImpl: $protobuf.RPCImpl, requestDelimited?: boolean, responseDelimited?: boolean): KnowledgeBases; /** - * Calls ListSessionEntityTypes. - * @param request ListSessionEntityTypesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListSessionEntityTypesResponse + * Calls ListKnowledgeBases. + * @param request ListKnowledgeBasesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListKnowledgeBasesResponse */ - public listSessionEntityTypes(request: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, callback: google.cloud.dialogflow.v2beta1.SessionEntityTypes.ListSessionEntityTypesCallback): void; + public listKnowledgeBases(request: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, callback: google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBasesCallback): void; /** - * Calls ListSessionEntityTypes. - * @param request ListSessionEntityTypesRequest message or plain object + * Calls ListKnowledgeBases. + * @param request ListKnowledgeBasesRequest message or plain object * @returns Promise */ - public listSessionEntityTypes(request: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest): Promise; + public listKnowledgeBases(request: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest): Promise; /** - * Calls GetSessionEntityType. - * @param request GetSessionEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SessionEntityType + * Calls GetKnowledgeBase. + * @param request GetKnowledgeBaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and KnowledgeBase */ - public getSessionEntityType(request: google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.SessionEntityTypes.GetSessionEntityTypeCallback): void; + public getKnowledgeBase(request: google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest, callback: google.cloud.dialogflow.v2beta1.KnowledgeBases.GetKnowledgeBaseCallback): void; /** - * Calls GetSessionEntityType. - * @param request GetSessionEntityTypeRequest message or plain object + * Calls GetKnowledgeBase. + * @param request GetKnowledgeBaseRequest message or plain object * @returns Promise */ - public getSessionEntityType(request: google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest): Promise; + public getKnowledgeBase(request: google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest): Promise; /** - * Calls CreateSessionEntityType. - * @param request CreateSessionEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SessionEntityType + * Calls CreateKnowledgeBase. + * @param request CreateKnowledgeBaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and KnowledgeBase */ - public createSessionEntityType(request: google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.SessionEntityTypes.CreateSessionEntityTypeCallback): void; + public createKnowledgeBase(request: google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest, callback: google.cloud.dialogflow.v2beta1.KnowledgeBases.CreateKnowledgeBaseCallback): void; /** - * Calls CreateSessionEntityType. - * @param request CreateSessionEntityTypeRequest message or plain object + * Calls CreateKnowledgeBase. + * @param request CreateKnowledgeBaseRequest message or plain object * @returns Promise */ - public createSessionEntityType(request: google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest): Promise; + public createKnowledgeBase(request: google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest): Promise; /** - * Calls UpdateSessionEntityType. - * @param request UpdateSessionEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and SessionEntityType + * Calls DeleteKnowledgeBase. + * @param request DeleteKnowledgeBaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Empty */ - public updateSessionEntityType(request: google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.SessionEntityTypes.UpdateSessionEntityTypeCallback): void; + public deleteKnowledgeBase(request: google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest, callback: google.cloud.dialogflow.v2beta1.KnowledgeBases.DeleteKnowledgeBaseCallback): void; /** - * Calls UpdateSessionEntityType. - * @param request UpdateSessionEntityTypeRequest message or plain object + * Calls DeleteKnowledgeBase. + * @param request DeleteKnowledgeBaseRequest message or plain object * @returns Promise */ - public updateSessionEntityType(request: google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest): Promise; + public deleteKnowledgeBase(request: google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest): Promise; /** - * Calls DeleteSessionEntityType. - * @param request DeleteSessionEntityTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Empty + * Calls UpdateKnowledgeBase. + * @param request UpdateKnowledgeBaseRequest message or plain object + * @param callback Node-style callback called with the error, if any, and KnowledgeBase */ - public deleteSessionEntityType(request: google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest, callback: google.cloud.dialogflow.v2beta1.SessionEntityTypes.DeleteSessionEntityTypeCallback): void; + public updateKnowledgeBase(request: google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest, callback: google.cloud.dialogflow.v2beta1.KnowledgeBases.UpdateKnowledgeBaseCallback): void; /** - * Calls DeleteSessionEntityType. - * @param request DeleteSessionEntityTypeRequest message or plain object + * Calls UpdateKnowledgeBase. + * @param request UpdateKnowledgeBaseRequest message or plain object * @returns Promise */ - public deleteSessionEntityType(request: google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest): Promise; + public updateKnowledgeBase(request: google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest): Promise; } - namespace SessionEntityTypes { + namespace KnowledgeBases { /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#listSessionEntityTypes}. + * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#listKnowledgeBases}. * @param error Error, if any - * @param [response] ListSessionEntityTypesResponse + * @param [response] ListKnowledgeBasesResponse */ - type ListSessionEntityTypesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse) => void; + type ListKnowledgeBasesCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#getSessionEntityType}. + * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#getKnowledgeBase}. * @param error Error, if any - * @param [response] SessionEntityType + * @param [response] KnowledgeBase */ - type GetSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.SessionEntityType) => void; + type GetKnowledgeBaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.KnowledgeBase) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#createSessionEntityType}. + * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#createKnowledgeBase}. * @param error Error, if any - * @param [response] SessionEntityType + * @param [response] KnowledgeBase */ - type CreateSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.SessionEntityType) => void; + type CreateKnowledgeBaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.KnowledgeBase) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#updateSessionEntityType}. + * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#deleteKnowledgeBase}. * @param error Error, if any - * @param [response] SessionEntityType + * @param [response] Empty */ - type UpdateSessionEntityTypeCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.SessionEntityType) => void; + type DeleteKnowledgeBaseCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#deleteSessionEntityType}. + * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#updateKnowledgeBase}. * @param error Error, if any - * @param [response] Empty + * @param [response] KnowledgeBase */ - type DeleteSessionEntityTypeCallback = (error: (Error|null), response?: google.protobuf.Empty) => void; + type UpdateKnowledgeBaseCallback = (error: (Error|null), response?: google.cloud.dialogflow.v2beta1.KnowledgeBase) => void; } - /** Properties of a SessionEntityType. */ - interface ISessionEntityType { + /** Properties of a KnowledgeBase. */ + interface IKnowledgeBase { - /** SessionEntityType name */ + /** KnowledgeBase name */ name?: (string|null); - /** SessionEntityType entityOverrideMode */ - entityOverrideMode?: (google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode|keyof typeof google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode|null); + /** KnowledgeBase displayName */ + displayName?: (string|null); - /** SessionEntityType entities */ - entities?: (google.cloud.dialogflow.v2beta1.EntityType.IEntity[]|null); + /** KnowledgeBase languageCode */ + languageCode?: (string|null); } - /** Represents a SessionEntityType. */ - class SessionEntityType implements ISessionEntityType { + /** Represents a KnowledgeBase. */ + class KnowledgeBase implements IKnowledgeBase { /** - * Constructs a new SessionEntityType. + * Constructs a new KnowledgeBase. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ISessionEntityType); + constructor(properties?: google.cloud.dialogflow.v2beta1.IKnowledgeBase); - /** SessionEntityType name. */ + /** KnowledgeBase name. */ public name: string; - /** SessionEntityType entityOverrideMode. */ - public entityOverrideMode: (google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode|keyof typeof google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode); + /** KnowledgeBase displayName. */ + public displayName: string; - /** SessionEntityType entities. */ - public entities: google.cloud.dialogflow.v2beta1.EntityType.IEntity[]; + /** KnowledgeBase languageCode. */ + public languageCode: string; /** - * Creates a new SessionEntityType instance using the specified properties. + * Creates a new KnowledgeBase instance using the specified properties. * @param [properties] Properties to set - * @returns SessionEntityType instance + * @returns KnowledgeBase instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ISessionEntityType): google.cloud.dialogflow.v2beta1.SessionEntityType; + public static create(properties?: google.cloud.dialogflow.v2beta1.IKnowledgeBase): google.cloud.dialogflow.v2beta1.KnowledgeBase; /** - * Encodes the specified SessionEntityType message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SessionEntityType.verify|verify} messages. - * @param message SessionEntityType message or plain object to encode + * Encodes the specified KnowledgeBase message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeBase.verify|verify} messages. + * @param message KnowledgeBase message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ISessionEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IKnowledgeBase, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified SessionEntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SessionEntityType.verify|verify} messages. - * @param message SessionEntityType message or plain object to encode + * Encodes the specified KnowledgeBase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeBase.verify|verify} messages. + * @param message KnowledgeBase message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ISessionEntityType, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IKnowledgeBase, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a SessionEntityType message from the specified reader or buffer. + * Decodes a KnowledgeBase message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns SessionEntityType + * @returns KnowledgeBase * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.SessionEntityType; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.KnowledgeBase; /** - * Decodes a SessionEntityType message from the specified reader or buffer, length delimited. + * Decodes a KnowledgeBase message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns SessionEntityType + * @returns KnowledgeBase * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.SessionEntityType; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.KnowledgeBase; /** - * Verifies a SessionEntityType message. + * Verifies a KnowledgeBase message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a SessionEntityType message from a plain object. Also converts values to their respective internal types. + * Creates a KnowledgeBase message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns SessionEntityType + * @returns KnowledgeBase */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.SessionEntityType; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.KnowledgeBase; /** - * Creates a plain object from a SessionEntityType message. Also converts values to other types if specified. - * @param message SessionEntityType + * Creates a plain object from a KnowledgeBase message. Also converts values to other types if specified. + * @param message KnowledgeBase * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.SessionEntityType, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.KnowledgeBase, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this SessionEntityType to JSON. + * Converts this KnowledgeBase to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - namespace SessionEntityType { - - /** EntityOverrideMode enum. */ - enum EntityOverrideMode { - ENTITY_OVERRIDE_MODE_UNSPECIFIED = 0, - ENTITY_OVERRIDE_MODE_OVERRIDE = 1, - ENTITY_OVERRIDE_MODE_SUPPLEMENT = 2 - } - } - - /** Properties of a ListSessionEntityTypesRequest. */ - interface IListSessionEntityTypesRequest { + /** Properties of a ListKnowledgeBasesRequest. */ + interface IListKnowledgeBasesRequest { - /** ListSessionEntityTypesRequest parent */ + /** ListKnowledgeBasesRequest parent */ parent?: (string|null); - /** ListSessionEntityTypesRequest pageSize */ + /** ListKnowledgeBasesRequest pageSize */ pageSize?: (number|null); - /** ListSessionEntityTypesRequest pageToken */ + /** ListKnowledgeBasesRequest pageToken */ pageToken?: (string|null); + + /** ListKnowledgeBasesRequest filter */ + filter?: (string|null); } - /** Represents a ListSessionEntityTypesRequest. */ - class ListSessionEntityTypesRequest implements IListSessionEntityTypesRequest { + /** Represents a ListKnowledgeBasesRequest. */ + class ListKnowledgeBasesRequest implements IListKnowledgeBasesRequest { /** - * Constructs a new ListSessionEntityTypesRequest. + * Constructs a new ListKnowledgeBasesRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest); - /** ListSessionEntityTypesRequest parent. */ + /** ListKnowledgeBasesRequest parent. */ public parent: string; - /** ListSessionEntityTypesRequest pageSize. */ + /** ListKnowledgeBasesRequest pageSize. */ public pageSize: number; - /** ListSessionEntityTypesRequest pageToken. */ + /** ListKnowledgeBasesRequest pageToken. */ public pageToken: string; + /** ListKnowledgeBasesRequest filter. */ + public filter: string; + /** - * Creates a new ListSessionEntityTypesRequest instance using the specified properties. + * Creates a new ListKnowledgeBasesRequest instance using the specified properties. * @param [properties] Properties to set - * @returns ListSessionEntityTypesRequest instance + * @returns ListKnowledgeBasesRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest; /** - * Encodes the specified ListSessionEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest.verify|verify} messages. - * @param message ListSessionEntityTypesRequest message or plain object to encode + * Encodes the specified ListKnowledgeBasesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest.verify|verify} messages. + * @param message ListKnowledgeBasesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSessionEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest.verify|verify} messages. - * @param message ListSessionEntityTypesRequest message or plain object to encode + * Encodes the specified ListKnowledgeBasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest.verify|verify} messages. + * @param message ListKnowledgeBasesRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer. + * Decodes a ListKnowledgeBasesRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSessionEntityTypesRequest + * @returns ListKnowledgeBasesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest; /** - * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListKnowledgeBasesRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSessionEntityTypesRequest + * @returns ListKnowledgeBasesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest; /** - * Verifies a ListSessionEntityTypesRequest message. + * Verifies a ListKnowledgeBasesRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListSessionEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListKnowledgeBasesRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSessionEntityTypesRequest + * @returns ListKnowledgeBasesRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest; /** - * Creates a plain object from a ListSessionEntityTypesRequest message. Also converts values to other types if specified. - * @param message ListSessionEntityTypesRequest + * Creates a plain object from a ListKnowledgeBasesRequest message. Also converts values to other types if specified. + * @param message ListKnowledgeBasesRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSessionEntityTypesRequest to JSON. + * Converts this ListKnowledgeBasesRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a ListSessionEntityTypesResponse. */ - interface IListSessionEntityTypesResponse { + /** Properties of a ListKnowledgeBasesResponse. */ + interface IListKnowledgeBasesResponse { - /** ListSessionEntityTypesResponse sessionEntityTypes */ - sessionEntityTypes?: (google.cloud.dialogflow.v2beta1.ISessionEntityType[]|null); + /** ListKnowledgeBasesResponse knowledgeBases */ + knowledgeBases?: (google.cloud.dialogflow.v2beta1.IKnowledgeBase[]|null); - /** ListSessionEntityTypesResponse nextPageToken */ + /** ListKnowledgeBasesResponse nextPageToken */ nextPageToken?: (string|null); } - /** Represents a ListSessionEntityTypesResponse. */ - class ListSessionEntityTypesResponse implements IListSessionEntityTypesResponse { + /** Represents a ListKnowledgeBasesResponse. */ + class ListKnowledgeBasesResponse implements IListKnowledgeBasesResponse { /** - * Constructs a new ListSessionEntityTypesResponse. + * Constructs a new ListKnowledgeBasesResponse. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse); + constructor(properties?: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse); - /** ListSessionEntityTypesResponse sessionEntityTypes. */ - public sessionEntityTypes: google.cloud.dialogflow.v2beta1.ISessionEntityType[]; + /** ListKnowledgeBasesResponse knowledgeBases. */ + public knowledgeBases: google.cloud.dialogflow.v2beta1.IKnowledgeBase[]; - /** ListSessionEntityTypesResponse nextPageToken. */ + /** ListKnowledgeBasesResponse nextPageToken. */ public nextPageToken: string; /** - * Creates a new ListSessionEntityTypesResponse instance using the specified properties. + * Creates a new ListKnowledgeBasesResponse instance using the specified properties. * @param [properties] Properties to set - * @returns ListSessionEntityTypesResponse instance + * @returns ListKnowledgeBasesResponse instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse; + public static create(properties?: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse; /** - * Encodes the specified ListSessionEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse.verify|verify} messages. - * @param message ListSessionEntityTypesResponse message or plain object to encode + * Encodes the specified ListKnowledgeBasesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse.verify|verify} messages. + * @param message ListKnowledgeBasesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified ListSessionEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse.verify|verify} messages. - * @param message ListSessionEntityTypesResponse message or plain object to encode + * Encodes the specified ListKnowledgeBasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse.verify|verify} messages. + * @param message ListKnowledgeBasesResponse message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer. + * Decodes a ListKnowledgeBasesResponse message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns ListSessionEntityTypesResponse + * @returns ListKnowledgeBasesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse; /** - * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListKnowledgeBasesResponse message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns ListSessionEntityTypesResponse + * @returns ListKnowledgeBasesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse; /** - * Verifies a ListSessionEntityTypesResponse message. + * Verifies a ListKnowledgeBasesResponse message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a ListSessionEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListKnowledgeBasesResponse message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns ListSessionEntityTypesResponse + * @returns ListKnowledgeBasesResponse */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse; /** - * Creates a plain object from a ListSessionEntityTypesResponse message. Also converts values to other types if specified. - * @param message ListSessionEntityTypesResponse + * Creates a plain object from a ListKnowledgeBasesResponse message. Also converts values to other types if specified. + * @param message ListKnowledgeBasesResponse * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this ListSessionEntityTypesResponse to JSON. + * Converts this ListKnowledgeBasesResponse to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a GetSessionEntityTypeRequest. */ - interface IGetSessionEntityTypeRequest { + /** Properties of a GetKnowledgeBaseRequest. */ + interface IGetKnowledgeBaseRequest { - /** GetSessionEntityTypeRequest name */ + /** GetKnowledgeBaseRequest name */ name?: (string|null); } - /** Represents a GetSessionEntityTypeRequest. */ - class GetSessionEntityTypeRequest implements IGetSessionEntityTypeRequest { + /** Represents a GetKnowledgeBaseRequest. */ + class GetKnowledgeBaseRequest implements IGetKnowledgeBaseRequest { /** - * Constructs a new GetSessionEntityTypeRequest. + * Constructs a new GetKnowledgeBaseRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest); - /** GetSessionEntityTypeRequest name. */ + /** GetKnowledgeBaseRequest name. */ public name: string; /** - * Creates a new GetSessionEntityTypeRequest instance using the specified properties. + * Creates a new GetKnowledgeBaseRequest instance using the specified properties. * @param [properties] Properties to set - * @returns GetSessionEntityTypeRequest instance + * @returns GetKnowledgeBaseRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest): google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest): google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest; /** - * Encodes the specified GetSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest.verify|verify} messages. - * @param message GetSessionEntityTypeRequest message or plain object to encode + * Encodes the specified GetKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest.verify|verify} messages. + * @param message GetKnowledgeBaseRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified GetSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest.verify|verify} messages. - * @param message GetSessionEntityTypeRequest message or plain object to encode + * Encodes the specified GetKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest.verify|verify} messages. + * @param message GetKnowledgeBaseRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer. + * Decodes a GetKnowledgeBaseRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns GetSessionEntityTypeRequest + * @returns GetKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest; /** - * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a GetKnowledgeBaseRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns GetSessionEntityTypeRequest + * @returns GetKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest; /** - * Verifies a GetSessionEntityTypeRequest message. + * Verifies a GetKnowledgeBaseRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a GetSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns GetSessionEntityTypeRequest + * @returns GetKnowledgeBaseRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest; /** - * Creates a plain object from a GetSessionEntityTypeRequest message. Also converts values to other types if specified. - * @param message GetSessionEntityTypeRequest + * Creates a plain object from a GetKnowledgeBaseRequest message. Also converts values to other types if specified. + * @param message GetKnowledgeBaseRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this GetSessionEntityTypeRequest to JSON. + * Converts this GetKnowledgeBaseRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a CreateSessionEntityTypeRequest. */ - interface ICreateSessionEntityTypeRequest { + /** Properties of a CreateKnowledgeBaseRequest. */ + interface ICreateKnowledgeBaseRequest { - /** CreateSessionEntityTypeRequest parent */ + /** CreateKnowledgeBaseRequest parent */ parent?: (string|null); - /** CreateSessionEntityTypeRequest sessionEntityType */ - sessionEntityType?: (google.cloud.dialogflow.v2beta1.ISessionEntityType|null); + /** CreateKnowledgeBaseRequest knowledgeBase */ + knowledgeBase?: (google.cloud.dialogflow.v2beta1.IKnowledgeBase|null); } - /** Represents a CreateSessionEntityTypeRequest. */ - class CreateSessionEntityTypeRequest implements ICreateSessionEntityTypeRequest { + /** Represents a CreateKnowledgeBaseRequest. */ + class CreateKnowledgeBaseRequest implements ICreateKnowledgeBaseRequest { /** - * Constructs a new CreateSessionEntityTypeRequest. + * Constructs a new CreateKnowledgeBaseRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest); - /** CreateSessionEntityTypeRequest parent. */ + /** CreateKnowledgeBaseRequest parent. */ public parent: string; - /** CreateSessionEntityTypeRequest sessionEntityType. */ - public sessionEntityType?: (google.cloud.dialogflow.v2beta1.ISessionEntityType|null); + /** CreateKnowledgeBaseRequest knowledgeBase. */ + public knowledgeBase?: (google.cloud.dialogflow.v2beta1.IKnowledgeBase|null); /** - * Creates a new CreateSessionEntityTypeRequest instance using the specified properties. + * Creates a new CreateKnowledgeBaseRequest instance using the specified properties. * @param [properties] Properties to set - * @returns CreateSessionEntityTypeRequest instance + * @returns CreateKnowledgeBaseRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest): google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest): google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest; /** - * Encodes the specified CreateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest.verify|verify} messages. - * @param message CreateSessionEntityTypeRequest message or plain object to encode + * Encodes the specified CreateKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest.verify|verify} messages. + * @param message CreateKnowledgeBaseRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified CreateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest.verify|verify} messages. - * @param message CreateSessionEntityTypeRequest message or plain object to encode + * Encodes the specified CreateKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest.verify|verify} messages. + * @param message CreateKnowledgeBaseRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer. + * Decodes a CreateKnowledgeBaseRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns CreateSessionEntityTypeRequest + * @returns CreateKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest; /** - * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateKnowledgeBaseRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns CreateSessionEntityTypeRequest + * @returns CreateKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest; /** - * Verifies a CreateSessionEntityTypeRequest message. + * Verifies a CreateKnowledgeBaseRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a CreateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns CreateSessionEntityTypeRequest + * @returns CreateKnowledgeBaseRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest; /** - * Creates a plain object from a CreateSessionEntityTypeRequest message. Also converts values to other types if specified. - * @param message CreateSessionEntityTypeRequest + * Creates a plain object from a CreateKnowledgeBaseRequest message. Also converts values to other types if specified. + * @param message CreateKnowledgeBaseRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this CreateSessionEntityTypeRequest to JSON. + * Converts this CreateKnowledgeBaseRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of an UpdateSessionEntityTypeRequest. */ - interface IUpdateSessionEntityTypeRequest { + /** Properties of a DeleteKnowledgeBaseRequest. */ + interface IDeleteKnowledgeBaseRequest { - /** UpdateSessionEntityTypeRequest sessionEntityType */ - sessionEntityType?: (google.cloud.dialogflow.v2beta1.ISessionEntityType|null); + /** DeleteKnowledgeBaseRequest name */ + name?: (string|null); - /** UpdateSessionEntityTypeRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); + /** DeleteKnowledgeBaseRequest force */ + force?: (boolean|null); } - /** Represents an UpdateSessionEntityTypeRequest. */ - class UpdateSessionEntityTypeRequest implements IUpdateSessionEntityTypeRequest { + /** Represents a DeleteKnowledgeBaseRequest. */ + class DeleteKnowledgeBaseRequest implements IDeleteKnowledgeBaseRequest { /** - * Constructs a new UpdateSessionEntityTypeRequest. + * Constructs a new DeleteKnowledgeBaseRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest); - /** UpdateSessionEntityTypeRequest sessionEntityType. */ - public sessionEntityType?: (google.cloud.dialogflow.v2beta1.ISessionEntityType|null); + /** DeleteKnowledgeBaseRequest name. */ + public name: string; - /** UpdateSessionEntityTypeRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); + /** DeleteKnowledgeBaseRequest force. */ + public force: boolean; /** - * Creates a new UpdateSessionEntityTypeRequest instance using the specified properties. + * Creates a new DeleteKnowledgeBaseRequest instance using the specified properties. * @param [properties] Properties to set - * @returns UpdateSessionEntityTypeRequest instance + * @returns DeleteKnowledgeBaseRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest): google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest): google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest; /** - * Encodes the specified UpdateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest.verify|verify} messages. - * @param message UpdateSessionEntityTypeRequest message or plain object to encode + * Encodes the specified DeleteKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.verify|verify} messages. + * @param message DeleteKnowledgeBaseRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified UpdateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest.verify|verify} messages. - * @param message UpdateSessionEntityTypeRequest message or plain object to encode + * Encodes the specified DeleteKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.verify|verify} messages. + * @param message DeleteKnowledgeBaseRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer. + * Decodes a DeleteKnowledgeBaseRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns UpdateSessionEntityTypeRequest + * @returns DeleteKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest; /** - * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteKnowledgeBaseRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns UpdateSessionEntityTypeRequest + * @returns DeleteKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest; /** - * Verifies an UpdateSessionEntityTypeRequest message. + * Verifies a DeleteKnowledgeBaseRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates an UpdateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns UpdateSessionEntityTypeRequest + * @returns DeleteKnowledgeBaseRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest; /** - * Creates a plain object from an UpdateSessionEntityTypeRequest message. Also converts values to other types if specified. - * @param message UpdateSessionEntityTypeRequest + * Creates a plain object from a DeleteKnowledgeBaseRequest message. Also converts values to other types if specified. + * @param message DeleteKnowledgeBaseRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this UpdateSessionEntityTypeRequest to JSON. + * Converts this DeleteKnowledgeBaseRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; } - /** Properties of a DeleteSessionEntityTypeRequest. */ - interface IDeleteSessionEntityTypeRequest { + /** Properties of an UpdateKnowledgeBaseRequest. */ + interface IUpdateKnowledgeBaseRequest { - /** DeleteSessionEntityTypeRequest name */ - name?: (string|null); + /** UpdateKnowledgeBaseRequest knowledgeBase */ + knowledgeBase?: (google.cloud.dialogflow.v2beta1.IKnowledgeBase|null); + + /** UpdateKnowledgeBaseRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); } - /** Represents a DeleteSessionEntityTypeRequest. */ - class DeleteSessionEntityTypeRequest implements IDeleteSessionEntityTypeRequest { + /** Represents an UpdateKnowledgeBaseRequest. */ + class UpdateKnowledgeBaseRequest implements IUpdateKnowledgeBaseRequest { /** - * Constructs a new DeleteSessionEntityTypeRequest. + * Constructs a new UpdateKnowledgeBaseRequest. * @param [properties] Properties to set */ - constructor(properties?: google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest); + constructor(properties?: google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest); - /** DeleteSessionEntityTypeRequest name. */ - public name: string; + /** UpdateKnowledgeBaseRequest knowledgeBase. */ + public knowledgeBase?: (google.cloud.dialogflow.v2beta1.IKnowledgeBase|null); + + /** UpdateKnowledgeBaseRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); /** - * Creates a new DeleteSessionEntityTypeRequest instance using the specified properties. + * Creates a new UpdateKnowledgeBaseRequest instance using the specified properties. * @param [properties] Properties to set - * @returns DeleteSessionEntityTypeRequest instance + * @returns UpdateKnowledgeBaseRequest instance */ - public static create(properties?: google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest): google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest; + public static create(properties?: google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest): google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest; /** - * Encodes the specified DeleteSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest.verify|verify} messages. - * @param message DeleteSessionEntityTypeRequest message or plain object to encode + * Encodes the specified UpdateKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest.verify|verify} messages. + * @param message UpdateKnowledgeBaseRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encode(message: google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encode(message: google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Encodes the specified DeleteSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest.verify|verify} messages. - * @param message DeleteSessionEntityTypeRequest message or plain object to encode + * Encodes the specified UpdateKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest.verify|verify} messages. + * @param message UpdateKnowledgeBaseRequest message or plain object to encode * @param [writer] Writer to encode to * @returns Writer */ - public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + public static encodeDelimited(message: google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest, writer?: $protobuf.Writer): $protobuf.Writer; /** - * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer. + * Decodes an UpdateKnowledgeBaseRequest message from the specified reader or buffer. * @param reader Reader or buffer to decode from * @param [length] Message length if known beforehand - * @returns DeleteSessionEntityTypeRequest + * @returns UpdateKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest; + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest; /** - * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateKnowledgeBaseRequest message from the specified reader or buffer, length delimited. * @param reader Reader or buffer to decode from - * @returns DeleteSessionEntityTypeRequest + * @returns UpdateKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest; + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest; /** - * Verifies a DeleteSessionEntityTypeRequest message. + * Verifies an UpdateKnowledgeBaseRequest message. * @param message Plain object to verify * @returns `null` if valid, otherwise the reason why it is not */ public static verify(message: { [k: string]: any }): (string|null); /** - * Creates a DeleteSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. * @param object Plain object - * @returns DeleteSessionEntityTypeRequest + * @returns UpdateKnowledgeBaseRequest */ - public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest; + public static fromObject(object: { [k: string]: any }): google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest; /** - * Creates a plain object from a DeleteSessionEntityTypeRequest message. Also converts values to other types if specified. - * @param message DeleteSessionEntityTypeRequest + * Creates a plain object from an UpdateKnowledgeBaseRequest message. Also converts values to other types if specified. + * @param message UpdateKnowledgeBaseRequest * @param [options] Conversion options * @returns Plain object */ - public static toObject(message: google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + public static toObject(message: google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; /** - * Converts this DeleteSessionEntityTypeRequest to JSON. + * Converts this UpdateKnowledgeBaseRequest to JSON. * @returns JSON object */ public toJSON(): { [k: string]: any }; @@ -29618,6 +51128,9 @@ export namespace google { /** WebhookResponse followupEventInput */ followupEventInput?: (google.cloud.dialogflow.v2beta1.IEventInput|null); + /** WebhookResponse liveAgentHandoff */ + liveAgentHandoff?: (boolean|null); + /** WebhookResponse endInteraction */ endInteraction?: (boolean|null); @@ -29652,6 +51165,9 @@ export namespace google { /** WebhookResponse followupEventInput. */ public followupEventInput?: (google.cloud.dialogflow.v2beta1.IEventInput|null); + /** WebhookResponse liveAgentHandoff. */ + public liveAgentHandoff: boolean; + /** WebhookResponse endInteraction. */ public endInteraction: boolean; diff --git a/packages/google-cloud-dialogflow/protos/protos.js b/packages/google-cloud-dialogflow/protos/protos.js index b04a6914f16..6e7f31e2bae 100644 --- a/packages/google-cloud-dialogflow/protos/protos.js +++ b/packages/google-cloud-dialogflow/protos/protos.js @@ -3884,52 +3884,127 @@ return ValidationResult; })(); - /** - * AudioEncoding enum. - * @name google.cloud.dialogflow.v2.AudioEncoding - * @enum {number} - * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value - * @property {number} AUDIO_ENCODING_LINEAR_16=1 AUDIO_ENCODING_LINEAR_16 value - * @property {number} AUDIO_ENCODING_FLAC=2 AUDIO_ENCODING_FLAC value - * @property {number} AUDIO_ENCODING_MULAW=3 AUDIO_ENCODING_MULAW value - * @property {number} AUDIO_ENCODING_AMR=4 AUDIO_ENCODING_AMR value - * @property {number} AUDIO_ENCODING_AMR_WB=5 AUDIO_ENCODING_AMR_WB value - * @property {number} AUDIO_ENCODING_OGG_OPUS=6 AUDIO_ENCODING_OGG_OPUS value - * @property {number} AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE=7 AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE value - */ - v2.AudioEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUDIO_ENCODING_LINEAR_16"] = 1; - values[valuesById[2] = "AUDIO_ENCODING_FLAC"] = 2; - values[valuesById[3] = "AUDIO_ENCODING_MULAW"] = 3; - values[valuesById[4] = "AUDIO_ENCODING_AMR"] = 4; - values[valuesById[5] = "AUDIO_ENCODING_AMR_WB"] = 5; - values[valuesById[6] = "AUDIO_ENCODING_OGG_OPUS"] = 6; - values[valuesById[7] = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"] = 7; - return values; + v2.AnswerRecords = (function() { + + /** + * Constructs a new AnswerRecords service. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an AnswerRecords + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AnswerRecords(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AnswerRecords.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AnswerRecords; + + /** + * Creates new AnswerRecords service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2.AnswerRecords + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AnswerRecords} RPC service. Useful where requests and/or responses are streamed. + */ + AnswerRecords.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.AnswerRecords#listAnswerRecords}. + * @memberof google.cloud.dialogflow.v2.AnswerRecords + * @typedef ListAnswerRecordsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.ListAnswerRecordsResponse} [response] ListAnswerRecordsResponse + */ + + /** + * Calls ListAnswerRecords. + * @function listAnswerRecords + * @memberof google.cloud.dialogflow.v2.AnswerRecords + * @instance + * @param {google.cloud.dialogflow.v2.IListAnswerRecordsRequest} request ListAnswerRecordsRequest message or plain object + * @param {google.cloud.dialogflow.v2.AnswerRecords.ListAnswerRecordsCallback} callback Node-style callback called with the error, if any, and ListAnswerRecordsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnswerRecords.prototype.listAnswerRecords = function listAnswerRecords(request, callback) { + return this.rpcCall(listAnswerRecords, $root.google.cloud.dialogflow.v2.ListAnswerRecordsRequest, $root.google.cloud.dialogflow.v2.ListAnswerRecordsResponse, request, callback); + }, "name", { value: "ListAnswerRecords" }); + + /** + * Calls ListAnswerRecords. + * @function listAnswerRecords + * @memberof google.cloud.dialogflow.v2.AnswerRecords + * @instance + * @param {google.cloud.dialogflow.v2.IListAnswerRecordsRequest} request ListAnswerRecordsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.AnswerRecords#updateAnswerRecord}. + * @memberof google.cloud.dialogflow.v2.AnswerRecords + * @typedef UpdateAnswerRecordCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.AnswerRecord} [response] AnswerRecord + */ + + /** + * Calls UpdateAnswerRecord. + * @function updateAnswerRecord + * @memberof google.cloud.dialogflow.v2.AnswerRecords + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest} request UpdateAnswerRecordRequest message or plain object + * @param {google.cloud.dialogflow.v2.AnswerRecords.UpdateAnswerRecordCallback} callback Node-style callback called with the error, if any, and AnswerRecord + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnswerRecords.prototype.updateAnswerRecord = function updateAnswerRecord(request, callback) { + return this.rpcCall(updateAnswerRecord, $root.google.cloud.dialogflow.v2.UpdateAnswerRecordRequest, $root.google.cloud.dialogflow.v2.AnswerRecord, request, callback); + }, "name", { value: "UpdateAnswerRecord" }); + + /** + * Calls UpdateAnswerRecord. + * @function updateAnswerRecord + * @memberof google.cloud.dialogflow.v2.AnswerRecords + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest} request UpdateAnswerRecordRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AnswerRecords; })(); - v2.SpeechContext = (function() { + v2.AnswerRecord = (function() { /** - * Properties of a SpeechContext. + * Properties of an AnswerRecord. * @memberof google.cloud.dialogflow.v2 - * @interface ISpeechContext - * @property {Array.|null} [phrases] SpeechContext phrases - * @property {number|null} [boost] SpeechContext boost + * @interface IAnswerRecord + * @property {string|null} [name] AnswerRecord name + * @property {google.cloud.dialogflow.v2.IAnswerFeedback|null} [answerFeedback] AnswerRecord answerFeedback + * @property {google.cloud.dialogflow.v2.IAgentAssistantRecord|null} [agentAssistantRecord] AnswerRecord agentAssistantRecord */ /** - * Constructs a new SpeechContext. + * Constructs a new AnswerRecord. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a SpeechContext. - * @implements ISpeechContext + * @classdesc Represents an AnswerRecord. + * @implements IAnswerRecord * @constructor - * @param {google.cloud.dialogflow.v2.ISpeechContext=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IAnswerRecord=} [properties] Properties to set */ - function SpeechContext(properties) { - this.phrases = []; + function AnswerRecord(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3937,91 +4012,115 @@ } /** - * SpeechContext phrases. - * @member {Array.} phrases - * @memberof google.cloud.dialogflow.v2.SpeechContext + * AnswerRecord name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.AnswerRecord * @instance */ - SpeechContext.prototype.phrases = $util.emptyArray; + AnswerRecord.prototype.name = ""; /** - * SpeechContext boost. - * @member {number} boost - * @memberof google.cloud.dialogflow.v2.SpeechContext + * AnswerRecord answerFeedback. + * @member {google.cloud.dialogflow.v2.IAnswerFeedback|null|undefined} answerFeedback + * @memberof google.cloud.dialogflow.v2.AnswerRecord * @instance */ - SpeechContext.prototype.boost = 0; + AnswerRecord.prototype.answerFeedback = null; /** - * Creates a new SpeechContext instance using the specified properties. + * AnswerRecord agentAssistantRecord. + * @member {google.cloud.dialogflow.v2.IAgentAssistantRecord|null|undefined} agentAssistantRecord + * @memberof google.cloud.dialogflow.v2.AnswerRecord + * @instance + */ + AnswerRecord.prototype.agentAssistantRecord = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnswerRecord record. + * @member {"agentAssistantRecord"|undefined} record + * @memberof google.cloud.dialogflow.v2.AnswerRecord + * @instance + */ + Object.defineProperty(AnswerRecord.prototype, "record", { + get: $util.oneOfGetter($oneOfFields = ["agentAssistantRecord"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnswerRecord instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.SpeechContext + * @memberof google.cloud.dialogflow.v2.AnswerRecord * @static - * @param {google.cloud.dialogflow.v2.ISpeechContext=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.SpeechContext} SpeechContext instance + * @param {google.cloud.dialogflow.v2.IAnswerRecord=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.AnswerRecord} AnswerRecord instance */ - SpeechContext.create = function create(properties) { - return new SpeechContext(properties); + AnswerRecord.create = function create(properties) { + return new AnswerRecord(properties); }; /** - * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechContext.verify|verify} messages. + * Encodes the specified AnswerRecord message. Does not implicitly {@link google.cloud.dialogflow.v2.AnswerRecord.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.SpeechContext + * @memberof google.cloud.dialogflow.v2.AnswerRecord * @static - * @param {google.cloud.dialogflow.v2.ISpeechContext} message SpeechContext message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAnswerRecord} message AnswerRecord message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpeechContext.encode = function encode(message, writer) { + AnswerRecord.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.phrases != null && message.phrases.length) - for (var i = 0; i < message.phrases.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]); - if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.answerFeedback != null && Object.hasOwnProperty.call(message, "answerFeedback")) + $root.google.cloud.dialogflow.v2.AnswerFeedback.encode(message.answerFeedback, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.agentAssistantRecord != null && Object.hasOwnProperty.call(message, "agentAssistantRecord")) + $root.google.cloud.dialogflow.v2.AgentAssistantRecord.encode(message.agentAssistantRecord, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechContext.verify|verify} messages. + * Encodes the specified AnswerRecord message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AnswerRecord.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.SpeechContext + * @memberof google.cloud.dialogflow.v2.AnswerRecord * @static - * @param {google.cloud.dialogflow.v2.ISpeechContext} message SpeechContext message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAnswerRecord} message AnswerRecord message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpeechContext.encodeDelimited = function encodeDelimited(message, writer) { + AnswerRecord.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SpeechContext message from the specified reader or buffer. + * Decodes an AnswerRecord message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.SpeechContext + * @memberof google.cloud.dialogflow.v2.AnswerRecord * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.SpeechContext} SpeechContext + * @returns {google.cloud.dialogflow.v2.AnswerRecord} AnswerRecord * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpeechContext.decode = function decode(reader, length) { + AnswerRecord.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SpeechContext(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.AnswerRecord(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.phrases && message.phrases.length)) - message.phrases = []; - message.phrases.push(reader.string()); + message.name = reader.string(); break; case 2: - message.boost = reader.float(); + message.answerFeedback = $root.google.cloud.dialogflow.v2.AnswerFeedback.decode(reader, reader.uint32()); + break; + case 4: + message.agentAssistantRecord = $root.google.cloud.dialogflow.v2.AgentAssistantRecord.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4032,131 +4131,143 @@ }; /** - * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * Decodes an AnswerRecord message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.SpeechContext + * @memberof google.cloud.dialogflow.v2.AnswerRecord * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.SpeechContext} SpeechContext + * @returns {google.cloud.dialogflow.v2.AnswerRecord} AnswerRecord * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpeechContext.decodeDelimited = function decodeDelimited(reader) { + AnswerRecord.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SpeechContext message. + * Verifies an AnswerRecord message. * @function verify - * @memberof google.cloud.dialogflow.v2.SpeechContext + * @memberof google.cloud.dialogflow.v2.AnswerRecord * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SpeechContext.verify = function verify(message) { + AnswerRecord.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.phrases != null && message.hasOwnProperty("phrases")) { - if (!Array.isArray(message.phrases)) - return "phrases: array expected"; - for (var i = 0; i < message.phrases.length; ++i) - if (!$util.isString(message.phrases[i])) - return "phrases: string[] expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.answerFeedback != null && message.hasOwnProperty("answerFeedback")) { + var error = $root.google.cloud.dialogflow.v2.AnswerFeedback.verify(message.answerFeedback); + if (error) + return "answerFeedback." + error; + } + if (message.agentAssistantRecord != null && message.hasOwnProperty("agentAssistantRecord")) { + properties.record = 1; + { + var error = $root.google.cloud.dialogflow.v2.AgentAssistantRecord.verify(message.agentAssistantRecord); + if (error) + return "agentAssistantRecord." + error; + } } - if (message.boost != null && message.hasOwnProperty("boost")) - if (typeof message.boost !== "number") - return "boost: number expected"; return null; }; /** - * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * Creates an AnswerRecord message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.SpeechContext + * @memberof google.cloud.dialogflow.v2.AnswerRecord * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.SpeechContext} SpeechContext + * @returns {google.cloud.dialogflow.v2.AnswerRecord} AnswerRecord */ - SpeechContext.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.SpeechContext) + AnswerRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.AnswerRecord) return object; - var message = new $root.google.cloud.dialogflow.v2.SpeechContext(); - if (object.phrases) { - if (!Array.isArray(object.phrases)) - throw TypeError(".google.cloud.dialogflow.v2.SpeechContext.phrases: array expected"); - message.phrases = []; - for (var i = 0; i < object.phrases.length; ++i) - message.phrases[i] = String(object.phrases[i]); + var message = new $root.google.cloud.dialogflow.v2.AnswerRecord(); + if (object.name != null) + message.name = String(object.name); + if (object.answerFeedback != null) { + if (typeof object.answerFeedback !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnswerRecord.answerFeedback: object expected"); + message.answerFeedback = $root.google.cloud.dialogflow.v2.AnswerFeedback.fromObject(object.answerFeedback); + } + if (object.agentAssistantRecord != null) { + if (typeof object.agentAssistantRecord !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnswerRecord.agentAssistantRecord: object expected"); + message.agentAssistantRecord = $root.google.cloud.dialogflow.v2.AgentAssistantRecord.fromObject(object.agentAssistantRecord); } - if (object.boost != null) - message.boost = Number(object.boost); return message; }; /** - * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * Creates a plain object from an AnswerRecord message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.SpeechContext + * @memberof google.cloud.dialogflow.v2.AnswerRecord * @static - * @param {google.cloud.dialogflow.v2.SpeechContext} message SpeechContext + * @param {google.cloud.dialogflow.v2.AnswerRecord} message AnswerRecord * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpeechContext.toObject = function toObject(message, options) { + AnswerRecord.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.phrases = []; - if (options.defaults) - object.boost = 0; - if (message.phrases && message.phrases.length) { - object.phrases = []; - for (var j = 0; j < message.phrases.length; ++j) - object.phrases[j] = message.phrases[j]; + if (options.defaults) { + object.name = ""; + object.answerFeedback = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.answerFeedback != null && message.hasOwnProperty("answerFeedback")) + object.answerFeedback = $root.google.cloud.dialogflow.v2.AnswerFeedback.toObject(message.answerFeedback, options); + if (message.agentAssistantRecord != null && message.hasOwnProperty("agentAssistantRecord")) { + object.agentAssistantRecord = $root.google.cloud.dialogflow.v2.AgentAssistantRecord.toObject(message.agentAssistantRecord, options); + if (options.oneofs) + object.record = "agentAssistantRecord"; } - if (message.boost != null && message.hasOwnProperty("boost")) - object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; return object; }; /** - * Converts this SpeechContext to JSON. + * Converts this AnswerRecord to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.SpeechContext + * @memberof google.cloud.dialogflow.v2.AnswerRecord * @instance * @returns {Object.} JSON object */ - SpeechContext.prototype.toJSON = function toJSON() { + AnswerRecord.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SpeechContext; + return AnswerRecord; })(); - v2.SpeechWordInfo = (function() { + v2.ListAnswerRecordsRequest = (function() { /** - * Properties of a SpeechWordInfo. + * Properties of a ListAnswerRecordsRequest. * @memberof google.cloud.dialogflow.v2 - * @interface ISpeechWordInfo - * @property {string|null} [word] SpeechWordInfo word - * @property {google.protobuf.IDuration|null} [startOffset] SpeechWordInfo startOffset - * @property {google.protobuf.IDuration|null} [endOffset] SpeechWordInfo endOffset - * @property {number|null} [confidence] SpeechWordInfo confidence + * @interface IListAnswerRecordsRequest + * @property {string|null} [parent] ListAnswerRecordsRequest parent + * @property {string|null} [filter] ListAnswerRecordsRequest filter + * @property {number|null} [pageSize] ListAnswerRecordsRequest pageSize + * @property {string|null} [pageToken] ListAnswerRecordsRequest pageToken */ /** - * Constructs a new SpeechWordInfo. + * Constructs a new ListAnswerRecordsRequest. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a SpeechWordInfo. - * @implements ISpeechWordInfo + * @classdesc Represents a ListAnswerRecordsRequest. + * @implements IListAnswerRecordsRequest * @constructor - * @param {google.cloud.dialogflow.v2.ISpeechWordInfo=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListAnswerRecordsRequest=} [properties] Properties to set */ - function SpeechWordInfo(properties) { + function ListAnswerRecordsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4164,114 +4275,114 @@ } /** - * SpeechWordInfo word. - * @member {string} word - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * ListAnswerRecordsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @instance */ - SpeechWordInfo.prototype.word = ""; + ListAnswerRecordsRequest.prototype.parent = ""; /** - * SpeechWordInfo startOffset. - * @member {google.protobuf.IDuration|null|undefined} startOffset - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * ListAnswerRecordsRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @instance */ - SpeechWordInfo.prototype.startOffset = null; + ListAnswerRecordsRequest.prototype.filter = ""; /** - * SpeechWordInfo endOffset. - * @member {google.protobuf.IDuration|null|undefined} endOffset - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * ListAnswerRecordsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @instance */ - SpeechWordInfo.prototype.endOffset = null; + ListAnswerRecordsRequest.prototype.pageSize = 0; /** - * SpeechWordInfo confidence. - * @member {number} confidence - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * ListAnswerRecordsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @instance */ - SpeechWordInfo.prototype.confidence = 0; + ListAnswerRecordsRequest.prototype.pageToken = ""; /** - * Creates a new SpeechWordInfo instance using the specified properties. + * Creates a new ListAnswerRecordsRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @static - * @param {google.cloud.dialogflow.v2.ISpeechWordInfo=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.SpeechWordInfo} SpeechWordInfo instance + * @param {google.cloud.dialogflow.v2.IListAnswerRecordsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListAnswerRecordsRequest} ListAnswerRecordsRequest instance */ - SpeechWordInfo.create = function create(properties) { - return new SpeechWordInfo(properties); + ListAnswerRecordsRequest.create = function create(properties) { + return new ListAnswerRecordsRequest(properties); }; /** - * Encodes the specified SpeechWordInfo message. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechWordInfo.verify|verify} messages. + * Encodes the specified ListAnswerRecordsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListAnswerRecordsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @static - * @param {google.cloud.dialogflow.v2.ISpeechWordInfo} message SpeechWordInfo message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListAnswerRecordsRequest} message ListAnswerRecordsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpeechWordInfo.encode = function encode(message, writer) { + ListAnswerRecordsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) - $root.google.protobuf.Duration.encode(message.startOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) - $root.google.protobuf.Duration.encode(message.endOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.word != null && Object.hasOwnProperty.call(message, "word")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); - if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.filter); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); return writer; }; /** - * Encodes the specified SpeechWordInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechWordInfo.verify|verify} messages. + * Encodes the specified ListAnswerRecordsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListAnswerRecordsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @static - * @param {google.cloud.dialogflow.v2.ISpeechWordInfo} message SpeechWordInfo message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListAnswerRecordsRequest} message ListAnswerRecordsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpeechWordInfo.encodeDelimited = function encodeDelimited(message, writer) { + ListAnswerRecordsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SpeechWordInfo message from the specified reader or buffer. + * Decodes a ListAnswerRecordsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.SpeechWordInfo} SpeechWordInfo + * @returns {google.cloud.dialogflow.v2.ListAnswerRecordsRequest} ListAnswerRecordsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpeechWordInfo.decode = function decode(reader, length) { + ListAnswerRecordsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SpeechWordInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListAnswerRecordsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.word = reader.string(); - break; case 1: - message.startOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 2: - message.endOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.filter = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); break; case 4: - message.confidence = reader.float(); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -4282,170 +4393,134 @@ }; /** - * Decodes a SpeechWordInfo message from the specified reader or buffer, length delimited. + * Decodes a ListAnswerRecordsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.SpeechWordInfo} SpeechWordInfo + * @returns {google.cloud.dialogflow.v2.ListAnswerRecordsRequest} ListAnswerRecordsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpeechWordInfo.decodeDelimited = function decodeDelimited(reader) { + ListAnswerRecordsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SpeechWordInfo message. + * Verifies a ListAnswerRecordsRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SpeechWordInfo.verify = function verify(message) { + ListAnswerRecordsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.word != null && message.hasOwnProperty("word")) - if (!$util.isString(message.word)) - return "word: string expected"; - if (message.startOffset != null && message.hasOwnProperty("startOffset")) { - var error = $root.google.protobuf.Duration.verify(message.startOffset); - if (error) - return "startOffset." + error; - } - if (message.endOffset != null && message.hasOwnProperty("endOffset")) { - var error = $root.google.protobuf.Duration.verify(message.endOffset); - if (error) - return "endOffset." + error; - } - if (message.confidence != null && message.hasOwnProperty("confidence")) - if (typeof message.confidence !== "number") - return "confidence: number expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a SpeechWordInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ListAnswerRecordsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.SpeechWordInfo} SpeechWordInfo + * @returns {google.cloud.dialogflow.v2.ListAnswerRecordsRequest} ListAnswerRecordsRequest */ - SpeechWordInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.SpeechWordInfo) + ListAnswerRecordsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListAnswerRecordsRequest) return object; - var message = new $root.google.cloud.dialogflow.v2.SpeechWordInfo(); - if (object.word != null) - message.word = String(object.word); - if (object.startOffset != null) { - if (typeof object.startOffset !== "object") - throw TypeError(".google.cloud.dialogflow.v2.SpeechWordInfo.startOffset: object expected"); - message.startOffset = $root.google.protobuf.Duration.fromObject(object.startOffset); - } - if (object.endOffset != null) { - if (typeof object.endOffset !== "object") - throw TypeError(".google.cloud.dialogflow.v2.SpeechWordInfo.endOffset: object expected"); - message.endOffset = $root.google.protobuf.Duration.fromObject(object.endOffset); - } - if (object.confidence != null) - message.confidence = Number(object.confidence); + var message = new $root.google.cloud.dialogflow.v2.ListAnswerRecordsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a SpeechWordInfo message. Also converts values to other types if specified. + * Creates a plain object from a ListAnswerRecordsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @static - * @param {google.cloud.dialogflow.v2.SpeechWordInfo} message SpeechWordInfo + * @param {google.cloud.dialogflow.v2.ListAnswerRecordsRequest} message ListAnswerRecordsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpeechWordInfo.toObject = function toObject(message, options) { + ListAnswerRecordsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.startOffset = null; - object.endOffset = null; - object.word = ""; - object.confidence = 0; + object.parent = ""; + object.filter = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.startOffset != null && message.hasOwnProperty("startOffset")) - object.startOffset = $root.google.protobuf.Duration.toObject(message.startOffset, options); - if (message.endOffset != null && message.hasOwnProperty("endOffset")) - object.endOffset = $root.google.protobuf.Duration.toObject(message.endOffset, options); - if (message.word != null && message.hasOwnProperty("word")) - object.word = message.word; - if (message.confidence != null && message.hasOwnProperty("confidence")) - object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this SpeechWordInfo to JSON. + * Converts this ListAnswerRecordsRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsRequest * @instance * @returns {Object.} JSON object */ - SpeechWordInfo.prototype.toJSON = function toJSON() { + ListAnswerRecordsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SpeechWordInfo; - })(); - - /** - * SpeechModelVariant enum. - * @name google.cloud.dialogflow.v2.SpeechModelVariant - * @enum {number} - * @property {number} SPEECH_MODEL_VARIANT_UNSPECIFIED=0 SPEECH_MODEL_VARIANT_UNSPECIFIED value - * @property {number} USE_BEST_AVAILABLE=1 USE_BEST_AVAILABLE value - * @property {number} USE_STANDARD=2 USE_STANDARD value - * @property {number} USE_ENHANCED=3 USE_ENHANCED value - */ - v2.SpeechModelVariant = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SPEECH_MODEL_VARIANT_UNSPECIFIED"] = 0; - values[valuesById[1] = "USE_BEST_AVAILABLE"] = 1; - values[valuesById[2] = "USE_STANDARD"] = 2; - values[valuesById[3] = "USE_ENHANCED"] = 3; - return values; + return ListAnswerRecordsRequest; })(); - v2.InputAudioConfig = (function() { + v2.ListAnswerRecordsResponse = (function() { /** - * Properties of an InputAudioConfig. + * Properties of a ListAnswerRecordsResponse. * @memberof google.cloud.dialogflow.v2 - * @interface IInputAudioConfig - * @property {google.cloud.dialogflow.v2.AudioEncoding|null} [audioEncoding] InputAudioConfig audioEncoding - * @property {number|null} [sampleRateHertz] InputAudioConfig sampleRateHertz - * @property {string|null} [languageCode] InputAudioConfig languageCode - * @property {boolean|null} [enableWordInfo] InputAudioConfig enableWordInfo - * @property {Array.|null} [phraseHints] InputAudioConfig phraseHints - * @property {Array.|null} [speechContexts] InputAudioConfig speechContexts - * @property {string|null} [model] InputAudioConfig model - * @property {google.cloud.dialogflow.v2.SpeechModelVariant|null} [modelVariant] InputAudioConfig modelVariant - * @property {boolean|null} [singleUtterance] InputAudioConfig singleUtterance + * @interface IListAnswerRecordsResponse + * @property {Array.|null} [answerRecords] ListAnswerRecordsResponse answerRecords + * @property {string|null} [nextPageToken] ListAnswerRecordsResponse nextPageToken */ /** - * Constructs a new InputAudioConfig. + * Constructs a new ListAnswerRecordsResponse. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an InputAudioConfig. - * @implements IInputAudioConfig + * @classdesc Represents a ListAnswerRecordsResponse. + * @implements IListAnswerRecordsResponse * @constructor - * @param {google.cloud.dialogflow.v2.IInputAudioConfig=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListAnswerRecordsResponse=} [properties] Properties to set */ - function InputAudioConfig(properties) { - this.phraseHints = []; - this.speechContexts = []; + function ListAnswerRecordsResponse(properties) { + this.answerRecords = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4453,185 +4528,318 @@ } /** - * InputAudioConfig audioEncoding. - * @member {google.cloud.dialogflow.v2.AudioEncoding} audioEncoding - * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * ListAnswerRecordsResponse answerRecords. + * @member {Array.} answerRecords + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsResponse * @instance */ - InputAudioConfig.prototype.audioEncoding = 0; + ListAnswerRecordsResponse.prototype.answerRecords = $util.emptyArray; /** - * InputAudioConfig sampleRateHertz. - * @member {number} sampleRateHertz - * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * ListAnswerRecordsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsResponse * @instance */ - InputAudioConfig.prototype.sampleRateHertz = 0; + ListAnswerRecordsResponse.prototype.nextPageToken = ""; /** - * InputAudioConfig languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.InputAudioConfig - * @instance + * Creates a new ListAnswerRecordsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListAnswerRecordsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListAnswerRecordsResponse} ListAnswerRecordsResponse instance */ - InputAudioConfig.prototype.languageCode = ""; + ListAnswerRecordsResponse.create = function create(properties) { + return new ListAnswerRecordsResponse(properties); + }; /** - * InputAudioConfig enableWordInfo. - * @member {boolean} enableWordInfo - * @memberof google.cloud.dialogflow.v2.InputAudioConfig - * @instance + * Encodes the specified ListAnswerRecordsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListAnswerRecordsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListAnswerRecordsResponse} message ListAnswerRecordsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - InputAudioConfig.prototype.enableWordInfo = false; + ListAnswerRecordsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.answerRecords != null && message.answerRecords.length) + for (var i = 0; i < message.answerRecords.length; ++i) + $root.google.cloud.dialogflow.v2.AnswerRecord.encode(message.answerRecords[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; /** - * InputAudioConfig phraseHints. - * @member {Array.} phraseHints - * @memberof google.cloud.dialogflow.v2.InputAudioConfig - * @instance + * Encodes the specified ListAnswerRecordsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListAnswerRecordsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListAnswerRecordsResponse} message ListAnswerRecordsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - InputAudioConfig.prototype.phraseHints = $util.emptyArray; + ListAnswerRecordsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * InputAudioConfig speechContexts. - * @member {Array.} speechContexts - * @memberof google.cloud.dialogflow.v2.InputAudioConfig - * @instance + * Decodes a ListAnswerRecordsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.ListAnswerRecordsResponse} ListAnswerRecordsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InputAudioConfig.prototype.speechContexts = $util.emptyArray; + ListAnswerRecordsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListAnswerRecordsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.answerRecords && message.answerRecords.length)) + message.answerRecords = []; + message.answerRecords.push($root.google.cloud.dialogflow.v2.AnswerRecord.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * InputAudioConfig model. - * @member {string} model - * @memberof google.cloud.dialogflow.v2.InputAudioConfig - * @instance + * Decodes a ListAnswerRecordsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.ListAnswerRecordsResponse} ListAnswerRecordsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InputAudioConfig.prototype.model = ""; + ListAnswerRecordsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * InputAudioConfig modelVariant. - * @member {google.cloud.dialogflow.v2.SpeechModelVariant} modelVariant - * @memberof google.cloud.dialogflow.v2.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.modelVariant = 0; + * Verifies a ListAnswerRecordsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnswerRecordsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.answerRecords != null && message.hasOwnProperty("answerRecords")) { + if (!Array.isArray(message.answerRecords)) + return "answerRecords: array expected"; + for (var i = 0; i < message.answerRecords.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.AnswerRecord.verify(message.answerRecords[i]); + if (error) + return "answerRecords." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; /** - * InputAudioConfig singleUtterance. - * @member {boolean} singleUtterance - * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * Creates a ListAnswerRecordsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.ListAnswerRecordsResponse} ListAnswerRecordsResponse + */ + ListAnswerRecordsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListAnswerRecordsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2.ListAnswerRecordsResponse(); + if (object.answerRecords) { + if (!Array.isArray(object.answerRecords)) + throw TypeError(".google.cloud.dialogflow.v2.ListAnswerRecordsResponse.answerRecords: array expected"); + message.answerRecords = []; + for (var i = 0; i < object.answerRecords.length; ++i) { + if (typeof object.answerRecords[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListAnswerRecordsResponse.answerRecords: object expected"); + message.answerRecords[i] = $root.google.cloud.dialogflow.v2.AnswerRecord.fromObject(object.answerRecords[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAnswerRecordsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsResponse + * @static + * @param {google.cloud.dialogflow.v2.ListAnswerRecordsResponse} message ListAnswerRecordsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnswerRecordsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.answerRecords = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.answerRecords && message.answerRecords.length) { + object.answerRecords = []; + for (var j = 0; j < message.answerRecords.length; ++j) + object.answerRecords[j] = $root.google.cloud.dialogflow.v2.AnswerRecord.toObject(message.answerRecords[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAnswerRecordsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.ListAnswerRecordsResponse * @instance + * @returns {Object.} JSON object */ - InputAudioConfig.prototype.singleUtterance = false; + ListAnswerRecordsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAnswerRecordsResponse; + })(); + + v2.UpdateAnswerRecordRequest = (function() { /** - * Creates a new InputAudioConfig instance using the specified properties. + * Properties of an UpdateAnswerRecordRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IUpdateAnswerRecordRequest + * @property {google.cloud.dialogflow.v2.IAnswerRecord|null} [answerRecord] UpdateAnswerRecordRequest answerRecord + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAnswerRecordRequest updateMask + */ + + /** + * Constructs a new UpdateAnswerRecordRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an UpdateAnswerRecordRequest. + * @implements IUpdateAnswerRecordRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest=} [properties] Properties to set + */ + function UpdateAnswerRecordRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAnswerRecordRequest answerRecord. + * @member {google.cloud.dialogflow.v2.IAnswerRecord|null|undefined} answerRecord + * @memberof google.cloud.dialogflow.v2.UpdateAnswerRecordRequest + * @instance + */ + UpdateAnswerRecordRequest.prototype.answerRecord = null; + + /** + * UpdateAnswerRecordRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2.UpdateAnswerRecordRequest + * @instance + */ + UpdateAnswerRecordRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAnswerRecordRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateAnswerRecordRequest * @static - * @param {google.cloud.dialogflow.v2.IInputAudioConfig=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.InputAudioConfig} InputAudioConfig instance + * @param {google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.UpdateAnswerRecordRequest} UpdateAnswerRecordRequest instance */ - InputAudioConfig.create = function create(properties) { - return new InputAudioConfig(properties); + UpdateAnswerRecordRequest.create = function create(properties) { + return new UpdateAnswerRecordRequest(properties); }; /** - * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.InputAudioConfig.verify|verify} messages. + * Encodes the specified UpdateAnswerRecordRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateAnswerRecordRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateAnswerRecordRequest * @static - * @param {google.cloud.dialogflow.v2.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest} message UpdateAnswerRecordRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InputAudioConfig.encode = function encode(message, writer) { + UpdateAnswerRecordRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); - if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); - if (message.phraseHints != null && message.phraseHints.length) - for (var i = 0; i < message.phraseHints.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.phraseHints[i]); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.model); - if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.singleUtterance); - if (message.modelVariant != null && Object.hasOwnProperty.call(message, "modelVariant")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.modelVariant); - if (message.speechContexts != null && message.speechContexts.length) - for (var i = 0; i < message.speechContexts.length; ++i) - $root.google.cloud.dialogflow.v2.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.enableWordInfo != null && Object.hasOwnProperty.call(message, "enableWordInfo")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.enableWordInfo); + if (message.answerRecord != null && Object.hasOwnProperty.call(message, "answerRecord")) + $root.google.cloud.dialogflow.v2.AnswerRecord.encode(message.answerRecord, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.InputAudioConfig.verify|verify} messages. + * Encodes the specified UpdateAnswerRecordRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateAnswerRecordRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateAnswerRecordRequest * @static - * @param {google.cloud.dialogflow.v2.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest} message UpdateAnswerRecordRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + UpdateAnswerRecordRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an InputAudioConfig message from the specified reader or buffer. + * Decodes an UpdateAnswerRecordRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateAnswerRecordRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.InputAudioConfig} InputAudioConfig + * @returns {google.cloud.dialogflow.v2.UpdateAnswerRecordRequest} UpdateAnswerRecordRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InputAudioConfig.decode = function decode(reader, length) { + UpdateAnswerRecordRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.InputAudioConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateAnswerRecordRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.audioEncoding = reader.int32(); + message.answerRecord = $root.google.cloud.dialogflow.v2.AnswerRecord.decode(reader, reader.uint32()); break; case 2: - message.sampleRateHertz = reader.int32(); - break; - case 3: - message.languageCode = reader.string(); - break; - case 13: - message.enableWordInfo = reader.bool(); - break; - case 4: - if (!(message.phraseHints && message.phraseHints.length)) - message.phraseHints = []; - message.phraseHints.push(reader.string()); - break; - case 11: - if (!(message.speechContexts && message.speechContexts.length)) - message.speechContexts = []; - message.speechContexts.push($root.google.cloud.dialogflow.v2.SpeechContext.decode(reader, reader.uint32())); - break; - case 7: - message.model = reader.string(); - break; - case 10: - message.modelVariant = reader.int32(); - break; - case 8: - message.singleUtterance = reader.bool(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4642,270 +4850,131 @@ }; /** - * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * Decodes an UpdateAnswerRecordRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateAnswerRecordRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.InputAudioConfig} InputAudioConfig + * @returns {google.cloud.dialogflow.v2.UpdateAnswerRecordRequest} UpdateAnswerRecordRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + UpdateAnswerRecordRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an InputAudioConfig message. + * Verifies an UpdateAnswerRecordRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateAnswerRecordRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - InputAudioConfig.verify = function verify(message) { + UpdateAnswerRecordRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - switch (message.audioEncoding) { - default: - return "audioEncoding: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - if (!$util.isInteger(message.sampleRateHertz)) - return "sampleRateHertz: integer expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.enableWordInfo != null && message.hasOwnProperty("enableWordInfo")) - if (typeof message.enableWordInfo !== "boolean") - return "enableWordInfo: boolean expected"; - if (message.phraseHints != null && message.hasOwnProperty("phraseHints")) { - if (!Array.isArray(message.phraseHints)) - return "phraseHints: array expected"; - for (var i = 0; i < message.phraseHints.length; ++i) - if (!$util.isString(message.phraseHints[i])) - return "phraseHints: string[] expected"; + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) { + var error = $root.google.cloud.dialogflow.v2.AnswerRecord.verify(message.answerRecord); + if (error) + return "answerRecord." + error; } - if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) { - if (!Array.isArray(message.speechContexts)) - return "speechContexts: array expected"; - for (var i = 0; i < message.speechContexts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.SpeechContext.verify(message.speechContexts[i]); - if (error) - return "speechContexts." + error; - } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } - if (message.model != null && message.hasOwnProperty("model")) - if (!$util.isString(message.model)) - return "model: string expected"; - if (message.modelVariant != null && message.hasOwnProperty("modelVariant")) - switch (message.modelVariant) { - default: - return "modelVariant: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) - if (typeof message.singleUtterance !== "boolean") - return "singleUtterance: boolean expected"; return null; }; /** - * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateAnswerRecordRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateAnswerRecordRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.InputAudioConfig} InputAudioConfig + * @returns {google.cloud.dialogflow.v2.UpdateAnswerRecordRequest} UpdateAnswerRecordRequest */ - InputAudioConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.InputAudioConfig) + UpdateAnswerRecordRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.UpdateAnswerRecordRequest) return object; - var message = new $root.google.cloud.dialogflow.v2.InputAudioConfig(); - switch (object.audioEncoding) { - case "AUDIO_ENCODING_UNSPECIFIED": - case 0: - message.audioEncoding = 0; - break; - case "AUDIO_ENCODING_LINEAR_16": - case 1: - message.audioEncoding = 1; - break; - case "AUDIO_ENCODING_FLAC": - case 2: - message.audioEncoding = 2; - break; - case "AUDIO_ENCODING_MULAW": - case 3: - message.audioEncoding = 3; - break; - case "AUDIO_ENCODING_AMR": - case 4: - message.audioEncoding = 4; - break; - case "AUDIO_ENCODING_AMR_WB": - case 5: - message.audioEncoding = 5; - break; - case "AUDIO_ENCODING_OGG_OPUS": - case 6: - message.audioEncoding = 6; - break; - case "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": - case 7: - message.audioEncoding = 7; - break; - } - if (object.sampleRateHertz != null) - message.sampleRateHertz = object.sampleRateHertz | 0; - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.enableWordInfo != null) - message.enableWordInfo = Boolean(object.enableWordInfo); - if (object.phraseHints) { - if (!Array.isArray(object.phraseHints)) - throw TypeError(".google.cloud.dialogflow.v2.InputAudioConfig.phraseHints: array expected"); - message.phraseHints = []; - for (var i = 0; i < object.phraseHints.length; ++i) - message.phraseHints[i] = String(object.phraseHints[i]); - } - if (object.speechContexts) { - if (!Array.isArray(object.speechContexts)) - throw TypeError(".google.cloud.dialogflow.v2.InputAudioConfig.speechContexts: array expected"); - message.speechContexts = []; - for (var i = 0; i < object.speechContexts.length; ++i) { - if (typeof object.speechContexts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.InputAudioConfig.speechContexts: object expected"); - message.speechContexts[i] = $root.google.cloud.dialogflow.v2.SpeechContext.fromObject(object.speechContexts[i]); - } + var message = new $root.google.cloud.dialogflow.v2.UpdateAnswerRecordRequest(); + if (object.answerRecord != null) { + if (typeof object.answerRecord !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateAnswerRecordRequest.answerRecord: object expected"); + message.answerRecord = $root.google.cloud.dialogflow.v2.AnswerRecord.fromObject(object.answerRecord); } - if (object.model != null) - message.model = String(object.model); - switch (object.modelVariant) { - case "SPEECH_MODEL_VARIANT_UNSPECIFIED": - case 0: - message.modelVariant = 0; - break; - case "USE_BEST_AVAILABLE": - case 1: - message.modelVariant = 1; - break; - case "USE_STANDARD": - case 2: - message.modelVariant = 2; - break; - case "USE_ENHANCED": - case 3: - message.modelVariant = 3; - break; + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateAnswerRecordRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.singleUtterance != null) - message.singleUtterance = Boolean(object.singleUtterance); return message; }; /** - * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * Creates a plain object from an UpdateAnswerRecordRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateAnswerRecordRequest * @static - * @param {google.cloud.dialogflow.v2.InputAudioConfig} message InputAudioConfig + * @param {google.cloud.dialogflow.v2.UpdateAnswerRecordRequest} message UpdateAnswerRecordRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InputAudioConfig.toObject = function toObject(message, options) { + UpdateAnswerRecordRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.phraseHints = []; - object.speechContexts = []; - } if (options.defaults) { - object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; - object.sampleRateHertz = 0; - object.languageCode = ""; - object.model = ""; - object.singleUtterance = false; - object.modelVariant = options.enums === String ? "SPEECH_MODEL_VARIANT_UNSPECIFIED" : 0; - object.enableWordInfo = false; - } - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - object.audioEncoding = options.enums === String ? $root.google.cloud.dialogflow.v2.AudioEncoding[message.audioEncoding] : message.audioEncoding; - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - object.sampleRateHertz = message.sampleRateHertz; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.phraseHints && message.phraseHints.length) { - object.phraseHints = []; - for (var j = 0; j < message.phraseHints.length; ++j) - object.phraseHints[j] = message.phraseHints[j]; - } - if (message.model != null && message.hasOwnProperty("model")) - object.model = message.model; - if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) - object.singleUtterance = message.singleUtterance; - if (message.modelVariant != null && message.hasOwnProperty("modelVariant")) - object.modelVariant = options.enums === String ? $root.google.cloud.dialogflow.v2.SpeechModelVariant[message.modelVariant] : message.modelVariant; - if (message.speechContexts && message.speechContexts.length) { - object.speechContexts = []; - for (var j = 0; j < message.speechContexts.length; ++j) - object.speechContexts[j] = $root.google.cloud.dialogflow.v2.SpeechContext.toObject(message.speechContexts[j], options); + object.answerRecord = null; + object.updateMask = null; } - if (message.enableWordInfo != null && message.hasOwnProperty("enableWordInfo")) - object.enableWordInfo = message.enableWordInfo; + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + object.answerRecord = $root.google.cloud.dialogflow.v2.AnswerRecord.toObject(message.answerRecord, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this InputAudioConfig to JSON. + * Converts this UpdateAnswerRecordRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateAnswerRecordRequest * @instance * @returns {Object.} JSON object */ - InputAudioConfig.prototype.toJSON = function toJSON() { + UpdateAnswerRecordRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return InputAudioConfig; + return UpdateAnswerRecordRequest; })(); - v2.VoiceSelectionParams = (function() { + v2.AnswerFeedback = (function() { /** - * Properties of a VoiceSelectionParams. + * Properties of an AnswerFeedback. * @memberof google.cloud.dialogflow.v2 - * @interface IVoiceSelectionParams - * @property {string|null} [name] VoiceSelectionParams name - * @property {google.cloud.dialogflow.v2.SsmlVoiceGender|null} [ssmlGender] VoiceSelectionParams ssmlGender + * @interface IAnswerFeedback + * @property {google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel|null} [correctnessLevel] AnswerFeedback correctnessLevel + * @property {google.cloud.dialogflow.v2.IAgentAssistantFeedback|null} [agentAssistantDetailFeedback] AnswerFeedback agentAssistantDetailFeedback + * @property {boolean|null} [clicked] AnswerFeedback clicked + * @property {google.protobuf.ITimestamp|null} [clickTime] AnswerFeedback clickTime + * @property {boolean|null} [displayed] AnswerFeedback displayed + * @property {google.protobuf.ITimestamp|null} [displayTime] AnswerFeedback displayTime */ /** - * Constructs a new VoiceSelectionParams. + * Constructs a new AnswerFeedback. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a VoiceSelectionParams. - * @implements IVoiceSelectionParams + * @classdesc Represents an AnswerFeedback. + * @implements IAnswerFeedback * @constructor - * @param {google.cloud.dialogflow.v2.IVoiceSelectionParams=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IAnswerFeedback=} [properties] Properties to set */ - function VoiceSelectionParams(properties) { + function AnswerFeedback(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4913,88 +4982,154 @@ } /** - * VoiceSelectionParams name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * AnswerFeedback correctnessLevel. + * @member {google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel} correctnessLevel + * @memberof google.cloud.dialogflow.v2.AnswerFeedback * @instance */ - VoiceSelectionParams.prototype.name = ""; + AnswerFeedback.prototype.correctnessLevel = 0; /** - * VoiceSelectionParams ssmlGender. - * @member {google.cloud.dialogflow.v2.SsmlVoiceGender} ssmlGender - * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * AnswerFeedback agentAssistantDetailFeedback. + * @member {google.cloud.dialogflow.v2.IAgentAssistantFeedback|null|undefined} agentAssistantDetailFeedback + * @memberof google.cloud.dialogflow.v2.AnswerFeedback * @instance */ - VoiceSelectionParams.prototype.ssmlGender = 0; + AnswerFeedback.prototype.agentAssistantDetailFeedback = null; /** - * Creates a new VoiceSelectionParams instance using the specified properties. + * AnswerFeedback clicked. + * @member {boolean} clicked + * @memberof google.cloud.dialogflow.v2.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.clicked = false; + + /** + * AnswerFeedback clickTime. + * @member {google.protobuf.ITimestamp|null|undefined} clickTime + * @memberof google.cloud.dialogflow.v2.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.clickTime = null; + + /** + * AnswerFeedback displayed. + * @member {boolean} displayed + * @memberof google.cloud.dialogflow.v2.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.displayed = false; + + /** + * AnswerFeedback displayTime. + * @member {google.protobuf.ITimestamp|null|undefined} displayTime + * @memberof google.cloud.dialogflow.v2.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.displayTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnswerFeedback detailFeedback. + * @member {"agentAssistantDetailFeedback"|undefined} detailFeedback + * @memberof google.cloud.dialogflow.v2.AnswerFeedback + * @instance + */ + Object.defineProperty(AnswerFeedback.prototype, "detailFeedback", { + get: $util.oneOfGetter($oneOfFields = ["agentAssistantDetailFeedback"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnswerFeedback instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.AnswerFeedback * @static - * @param {google.cloud.dialogflow.v2.IVoiceSelectionParams=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.VoiceSelectionParams} VoiceSelectionParams instance + * @param {google.cloud.dialogflow.v2.IAnswerFeedback=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.AnswerFeedback} AnswerFeedback instance */ - VoiceSelectionParams.create = function create(properties) { - return new VoiceSelectionParams(properties); + AnswerFeedback.create = function create(properties) { + return new AnswerFeedback(properties); }; /** - * Encodes the specified VoiceSelectionParams message. Does not implicitly {@link google.cloud.dialogflow.v2.VoiceSelectionParams.verify|verify} messages. + * Encodes the specified AnswerFeedback message. Does not implicitly {@link google.cloud.dialogflow.v2.AnswerFeedback.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.AnswerFeedback * @static - * @param {google.cloud.dialogflow.v2.IVoiceSelectionParams} message VoiceSelectionParams message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAnswerFeedback} message AnswerFeedback message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VoiceSelectionParams.encode = function encode(message, writer) { + AnswerFeedback.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.ssmlGender != null && Object.hasOwnProperty.call(message, "ssmlGender")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ssmlGender); + if (message.correctnessLevel != null && Object.hasOwnProperty.call(message, "correctnessLevel")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.correctnessLevel); + if (message.agentAssistantDetailFeedback != null && Object.hasOwnProperty.call(message, "agentAssistantDetailFeedback")) + $root.google.cloud.dialogflow.v2.AgentAssistantFeedback.encode(message.agentAssistantDetailFeedback, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.clicked != null && Object.hasOwnProperty.call(message, "clicked")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.clicked); + if (message.displayed != null && Object.hasOwnProperty.call(message, "displayed")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.displayed); + if (message.clickTime != null && Object.hasOwnProperty.call(message, "clickTime")) + $root.google.protobuf.Timestamp.encode(message.clickTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.displayTime != null && Object.hasOwnProperty.call(message, "displayTime")) + $root.google.protobuf.Timestamp.encode(message.displayTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified VoiceSelectionParams message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.VoiceSelectionParams.verify|verify} messages. + * Encodes the specified AnswerFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AnswerFeedback.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.AnswerFeedback * @static - * @param {google.cloud.dialogflow.v2.IVoiceSelectionParams} message VoiceSelectionParams message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAnswerFeedback} message AnswerFeedback message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VoiceSelectionParams.encodeDelimited = function encodeDelimited(message, writer) { + AnswerFeedback.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VoiceSelectionParams message from the specified reader or buffer. + * Decodes an AnswerFeedback message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.AnswerFeedback * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.VoiceSelectionParams} VoiceSelectionParams + * @returns {google.cloud.dialogflow.v2.AnswerFeedback} AnswerFeedback * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VoiceSelectionParams.decode = function decode(reader, length) { + AnswerFeedback.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.VoiceSelectionParams(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.AnswerFeedback(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.correctnessLevel = reader.int32(); break; case 2: - message.ssmlGender = reader.int32(); + message.agentAssistantDetailFeedback = $root.google.cloud.dialogflow.v2.AgentAssistantFeedback.decode(reader, reader.uint32()); + break; + case 3: + message.clicked = reader.bool(); + break; + case 5: + message.clickTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.displayed = reader.bool(); + break; + case 6: + message.displayTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -5005,144 +5140,212 @@ }; /** - * Decodes a VoiceSelectionParams message from the specified reader or buffer, length delimited. + * Decodes an AnswerFeedback message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.AnswerFeedback * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.VoiceSelectionParams} VoiceSelectionParams + * @returns {google.cloud.dialogflow.v2.AnswerFeedback} AnswerFeedback * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VoiceSelectionParams.decodeDelimited = function decodeDelimited(reader) { + AnswerFeedback.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VoiceSelectionParams message. + * Verifies an AnswerFeedback message. * @function verify - * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.AnswerFeedback * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VoiceSelectionParams.verify = function verify(message) { + AnswerFeedback.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.ssmlGender != null && message.hasOwnProperty("ssmlGender")) - switch (message.ssmlGender) { + var properties = {}; + if (message.correctnessLevel != null && message.hasOwnProperty("correctnessLevel")) + switch (message.correctnessLevel) { default: - return "ssmlGender: enum value expected"; + return "correctnessLevel: enum value expected"; case 0: case 1: case 2: case 3: break; } + if (message.agentAssistantDetailFeedback != null && message.hasOwnProperty("agentAssistantDetailFeedback")) { + properties.detailFeedback = 1; + { + var error = $root.google.cloud.dialogflow.v2.AgentAssistantFeedback.verify(message.agentAssistantDetailFeedback); + if (error) + return "agentAssistantDetailFeedback." + error; + } + } + if (message.clicked != null && message.hasOwnProperty("clicked")) + if (typeof message.clicked !== "boolean") + return "clicked: boolean expected"; + if (message.clickTime != null && message.hasOwnProperty("clickTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.clickTime); + if (error) + return "clickTime." + error; + } + if (message.displayed != null && message.hasOwnProperty("displayed")) + if (typeof message.displayed !== "boolean") + return "displayed: boolean expected"; + if (message.displayTime != null && message.hasOwnProperty("displayTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.displayTime); + if (error) + return "displayTime." + error; + } return null; }; /** - * Creates a VoiceSelectionParams message from a plain object. Also converts values to their respective internal types. + * Creates an AnswerFeedback message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.AnswerFeedback * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.VoiceSelectionParams} VoiceSelectionParams + * @returns {google.cloud.dialogflow.v2.AnswerFeedback} AnswerFeedback */ - VoiceSelectionParams.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.VoiceSelectionParams) + AnswerFeedback.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.AnswerFeedback) return object; - var message = new $root.google.cloud.dialogflow.v2.VoiceSelectionParams(); - if (object.name != null) - message.name = String(object.name); - switch (object.ssmlGender) { - case "SSML_VOICE_GENDER_UNSPECIFIED": + var message = new $root.google.cloud.dialogflow.v2.AnswerFeedback(); + switch (object.correctnessLevel) { + case "CORRECTNESS_LEVEL_UNSPECIFIED": case 0: - message.ssmlGender = 0; + message.correctnessLevel = 0; break; - case "SSML_VOICE_GENDER_MALE": + case "NOT_CORRECT": case 1: - message.ssmlGender = 1; + message.correctnessLevel = 1; break; - case "SSML_VOICE_GENDER_FEMALE": + case "PARTIALLY_CORRECT": case 2: - message.ssmlGender = 2; + message.correctnessLevel = 2; break; - case "SSML_VOICE_GENDER_NEUTRAL": + case "FULLY_CORRECT": case 3: - message.ssmlGender = 3; + message.correctnessLevel = 3; break; } + if (object.agentAssistantDetailFeedback != null) { + if (typeof object.agentAssistantDetailFeedback !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnswerFeedback.agentAssistantDetailFeedback: object expected"); + message.agentAssistantDetailFeedback = $root.google.cloud.dialogflow.v2.AgentAssistantFeedback.fromObject(object.agentAssistantDetailFeedback); + } + if (object.clicked != null) + message.clicked = Boolean(object.clicked); + if (object.clickTime != null) { + if (typeof object.clickTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnswerFeedback.clickTime: object expected"); + message.clickTime = $root.google.protobuf.Timestamp.fromObject(object.clickTime); + } + if (object.displayed != null) + message.displayed = Boolean(object.displayed); + if (object.displayTime != null) { + if (typeof object.displayTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnswerFeedback.displayTime: object expected"); + message.displayTime = $root.google.protobuf.Timestamp.fromObject(object.displayTime); + } return message; }; /** - * Creates a plain object from a VoiceSelectionParams message. Also converts values to other types if specified. + * Creates a plain object from an AnswerFeedback message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.AnswerFeedback * @static - * @param {google.cloud.dialogflow.v2.VoiceSelectionParams} message VoiceSelectionParams + * @param {google.cloud.dialogflow.v2.AnswerFeedback} message AnswerFeedback * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VoiceSelectionParams.toObject = function toObject(message, options) { + AnswerFeedback.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.ssmlGender = options.enums === String ? "SSML_VOICE_GENDER_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.ssmlGender != null && message.hasOwnProperty("ssmlGender")) - object.ssmlGender = options.enums === String ? $root.google.cloud.dialogflow.v2.SsmlVoiceGender[message.ssmlGender] : message.ssmlGender; + object.correctnessLevel = options.enums === String ? "CORRECTNESS_LEVEL_UNSPECIFIED" : 0; + object.clicked = false; + object.displayed = false; + object.clickTime = null; + object.displayTime = null; + } + if (message.correctnessLevel != null && message.hasOwnProperty("correctnessLevel")) + object.correctnessLevel = options.enums === String ? $root.google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel[message.correctnessLevel] : message.correctnessLevel; + if (message.agentAssistantDetailFeedback != null && message.hasOwnProperty("agentAssistantDetailFeedback")) { + object.agentAssistantDetailFeedback = $root.google.cloud.dialogflow.v2.AgentAssistantFeedback.toObject(message.agentAssistantDetailFeedback, options); + if (options.oneofs) + object.detailFeedback = "agentAssistantDetailFeedback"; + } + if (message.clicked != null && message.hasOwnProperty("clicked")) + object.clicked = message.clicked; + if (message.displayed != null && message.hasOwnProperty("displayed")) + object.displayed = message.displayed; + if (message.clickTime != null && message.hasOwnProperty("clickTime")) + object.clickTime = $root.google.protobuf.Timestamp.toObject(message.clickTime, options); + if (message.displayTime != null && message.hasOwnProperty("displayTime")) + object.displayTime = $root.google.protobuf.Timestamp.toObject(message.displayTime, options); return object; }; /** - * Converts this VoiceSelectionParams to JSON. + * Converts this AnswerFeedback to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.AnswerFeedback * @instance * @returns {Object.} JSON object */ - VoiceSelectionParams.prototype.toJSON = function toJSON() { + AnswerFeedback.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return VoiceSelectionParams; + /** + * CorrectnessLevel enum. + * @name google.cloud.dialogflow.v2.AnswerFeedback.CorrectnessLevel + * @enum {number} + * @property {number} CORRECTNESS_LEVEL_UNSPECIFIED=0 CORRECTNESS_LEVEL_UNSPECIFIED value + * @property {number} NOT_CORRECT=1 NOT_CORRECT value + * @property {number} PARTIALLY_CORRECT=2 PARTIALLY_CORRECT value + * @property {number} FULLY_CORRECT=3 FULLY_CORRECT value + */ + AnswerFeedback.CorrectnessLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CORRECTNESS_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "NOT_CORRECT"] = 1; + values[valuesById[2] = "PARTIALLY_CORRECT"] = 2; + values[valuesById[3] = "FULLY_CORRECT"] = 3; + return values; + })(); + + return AnswerFeedback; })(); - v2.SynthesizeSpeechConfig = (function() { + v2.AgentAssistantFeedback = (function() { /** - * Properties of a SynthesizeSpeechConfig. + * Properties of an AgentAssistantFeedback. * @memberof google.cloud.dialogflow.v2 - * @interface ISynthesizeSpeechConfig - * @property {number|null} [speakingRate] SynthesizeSpeechConfig speakingRate - * @property {number|null} [pitch] SynthesizeSpeechConfig pitch - * @property {number|null} [volumeGainDb] SynthesizeSpeechConfig volumeGainDb - * @property {Array.|null} [effectsProfileId] SynthesizeSpeechConfig effectsProfileId - * @property {google.cloud.dialogflow.v2.IVoiceSelectionParams|null} [voice] SynthesizeSpeechConfig voice + * @interface IAgentAssistantFeedback + * @property {google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance|null} [answerRelevance] AgentAssistantFeedback answerRelevance + * @property {google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness|null} [documentCorrectness] AgentAssistantFeedback documentCorrectness + * @property {google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency|null} [documentEfficiency] AgentAssistantFeedback documentEfficiency */ /** - * Constructs a new SynthesizeSpeechConfig. + * Constructs a new AgentAssistantFeedback. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a SynthesizeSpeechConfig. - * @implements ISynthesizeSpeechConfig + * @classdesc Represents an AgentAssistantFeedback. + * @implements IAgentAssistantFeedback * @constructor - * @param {google.cloud.dialogflow.v2.ISynthesizeSpeechConfig=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IAgentAssistantFeedback=} [properties] Properties to set */ - function SynthesizeSpeechConfig(properties) { - this.effectsProfileId = []; + function AgentAssistantFeedback(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5150,130 +5353,101 @@ } /** - * SynthesizeSpeechConfig speakingRate. - * @member {number} speakingRate - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * AgentAssistantFeedback answerRelevance. + * @member {google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance} answerRelevance + * @memberof google.cloud.dialogflow.v2.AgentAssistantFeedback * @instance */ - SynthesizeSpeechConfig.prototype.speakingRate = 0; + AgentAssistantFeedback.prototype.answerRelevance = 0; /** - * SynthesizeSpeechConfig pitch. - * @member {number} pitch - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * AgentAssistantFeedback documentCorrectness. + * @member {google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness} documentCorrectness + * @memberof google.cloud.dialogflow.v2.AgentAssistantFeedback * @instance */ - SynthesizeSpeechConfig.prototype.pitch = 0; + AgentAssistantFeedback.prototype.documentCorrectness = 0; /** - * SynthesizeSpeechConfig volumeGainDb. - * @member {number} volumeGainDb - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * AgentAssistantFeedback documentEfficiency. + * @member {google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency} documentEfficiency + * @memberof google.cloud.dialogflow.v2.AgentAssistantFeedback * @instance */ - SynthesizeSpeechConfig.prototype.volumeGainDb = 0; + AgentAssistantFeedback.prototype.documentEfficiency = 0; /** - * SynthesizeSpeechConfig effectsProfileId. - * @member {Array.} effectsProfileId - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig - * @instance - */ - SynthesizeSpeechConfig.prototype.effectsProfileId = $util.emptyArray; - - /** - * SynthesizeSpeechConfig voice. - * @member {google.cloud.dialogflow.v2.IVoiceSelectionParams|null|undefined} voice - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig - * @instance - */ - SynthesizeSpeechConfig.prototype.voice = null; - - /** - * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * Creates a new AgentAssistantFeedback instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantFeedback * @static - * @param {google.cloud.dialogflow.v2.ISynthesizeSpeechConfig=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.SynthesizeSpeechConfig} SynthesizeSpeechConfig instance + * @param {google.cloud.dialogflow.v2.IAgentAssistantFeedback=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.AgentAssistantFeedback} AgentAssistantFeedback instance */ - SynthesizeSpeechConfig.create = function create(properties) { - return new SynthesizeSpeechConfig(properties); + AgentAssistantFeedback.create = function create(properties) { + return new AgentAssistantFeedback(properties); }; /** - * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.SynthesizeSpeechConfig.verify|verify} messages. + * Encodes the specified AgentAssistantFeedback message. Does not implicitly {@link google.cloud.dialogflow.v2.AgentAssistantFeedback.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantFeedback * @static - * @param {google.cloud.dialogflow.v2.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAgentAssistantFeedback} message AgentAssistantFeedback message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SynthesizeSpeechConfig.encode = function encode(message, writer) { + AgentAssistantFeedback.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.speakingRate); - if (message.pitch != null && Object.hasOwnProperty.call(message, "pitch")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.pitch); - if (message.volumeGainDb != null && Object.hasOwnProperty.call(message, "volumeGainDb")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.volumeGainDb); - if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) - $root.google.cloud.dialogflow.v2.VoiceSelectionParams.encode(message.voice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.effectsProfileId != null && message.effectsProfileId.length) - for (var i = 0; i < message.effectsProfileId.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.effectsProfileId[i]); + if (message.answerRelevance != null && Object.hasOwnProperty.call(message, "answerRelevance")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.answerRelevance); + if (message.documentCorrectness != null && Object.hasOwnProperty.call(message, "documentCorrectness")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.documentCorrectness); + if (message.documentEfficiency != null && Object.hasOwnProperty.call(message, "documentEfficiency")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.documentEfficiency); return writer; }; /** - * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SynthesizeSpeechConfig.verify|verify} messages. + * Encodes the specified AgentAssistantFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AgentAssistantFeedback.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantFeedback * @static - * @param {google.cloud.dialogflow.v2.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAgentAssistantFeedback} message AgentAssistantFeedback message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SynthesizeSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + AgentAssistantFeedback.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * Decodes an AgentAssistantFeedback message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantFeedback * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @returns {google.cloud.dialogflow.v2.AgentAssistantFeedback} AgentAssistantFeedback * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SynthesizeSpeechConfig.decode = function decode(reader, length) { + AgentAssistantFeedback.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.AgentAssistantFeedback(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.speakingRate = reader.double(); + message.answerRelevance = reader.int32(); break; case 2: - message.pitch = reader.double(); + message.documentCorrectness = reader.int32(); break; case 3: - message.volumeGainDb = reader.double(); - break; - case 5: - if (!(message.effectsProfileId && message.effectsProfileId.length)) - message.effectsProfileId = []; - message.effectsProfileId.push(reader.string()); - break; - case 4: - message.voice = $root.google.cloud.dialogflow.v2.VoiceSelectionParams.decode(reader, reader.uint32()); + message.documentEfficiency = reader.int32(); break; default: reader.skipType(tag & 7); @@ -5284,178 +5458,227 @@ }; /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * Decodes an AgentAssistantFeedback message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantFeedback * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @returns {google.cloud.dialogflow.v2.AgentAssistantFeedback} AgentAssistantFeedback * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SynthesizeSpeechConfig.decodeDelimited = function decodeDelimited(reader) { + AgentAssistantFeedback.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SynthesizeSpeechConfig message. + * Verifies an AgentAssistantFeedback message. * @function verify - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantFeedback * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SynthesizeSpeechConfig.verify = function verify(message) { + AgentAssistantFeedback.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) - if (typeof message.speakingRate !== "number") - return "speakingRate: number expected"; - if (message.pitch != null && message.hasOwnProperty("pitch")) - if (typeof message.pitch !== "number") - return "pitch: number expected"; - if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) - if (typeof message.volumeGainDb !== "number") - return "volumeGainDb: number expected"; - if (message.effectsProfileId != null && message.hasOwnProperty("effectsProfileId")) { - if (!Array.isArray(message.effectsProfileId)) - return "effectsProfileId: array expected"; - for (var i = 0; i < message.effectsProfileId.length; ++i) - if (!$util.isString(message.effectsProfileId[i])) - return "effectsProfileId: string[] expected"; - } - if (message.voice != null && message.hasOwnProperty("voice")) { - var error = $root.google.cloud.dialogflow.v2.VoiceSelectionParams.verify(message.voice); - if (error) - return "voice." + error; - } + if (message.answerRelevance != null && message.hasOwnProperty("answerRelevance")) + switch (message.answerRelevance) { + default: + return "answerRelevance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.documentCorrectness != null && message.hasOwnProperty("documentCorrectness")) + switch (message.documentCorrectness) { + default: + return "documentCorrectness: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.documentEfficiency != null && message.hasOwnProperty("documentEfficiency")) + switch (message.documentEfficiency) { + default: + return "documentEfficiency: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * Creates an AgentAssistantFeedback message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantFeedback * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @returns {google.cloud.dialogflow.v2.AgentAssistantFeedback} AgentAssistantFeedback */ - SynthesizeSpeechConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig) + AgentAssistantFeedback.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.AgentAssistantFeedback) return object; - var message = new $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig(); - if (object.speakingRate != null) - message.speakingRate = Number(object.speakingRate); - if (object.pitch != null) - message.pitch = Number(object.pitch); - if (object.volumeGainDb != null) - message.volumeGainDb = Number(object.volumeGainDb); - if (object.effectsProfileId) { - if (!Array.isArray(object.effectsProfileId)) - throw TypeError(".google.cloud.dialogflow.v2.SynthesizeSpeechConfig.effectsProfileId: array expected"); - message.effectsProfileId = []; - for (var i = 0; i < object.effectsProfileId.length; ++i) - message.effectsProfileId[i] = String(object.effectsProfileId[i]); + var message = new $root.google.cloud.dialogflow.v2.AgentAssistantFeedback(); + switch (object.answerRelevance) { + case "ANSWER_RELEVANCE_UNSPECIFIED": + case 0: + message.answerRelevance = 0; + break; + case "IRRELEVANT": + case 1: + message.answerRelevance = 1; + break; + case "RELEVANT": + case 2: + message.answerRelevance = 2; + break; } - if (object.voice != null) { - if (typeof object.voice !== "object") - throw TypeError(".google.cloud.dialogflow.v2.SynthesizeSpeechConfig.voice: object expected"); - message.voice = $root.google.cloud.dialogflow.v2.VoiceSelectionParams.fromObject(object.voice); + switch (object.documentCorrectness) { + case "DOCUMENT_CORRECTNESS_UNSPECIFIED": + case 0: + message.documentCorrectness = 0; + break; + case "INCORRECT": + case 1: + message.documentCorrectness = 1; + break; + case "CORRECT": + case 2: + message.documentCorrectness = 2; + break; + } + switch (object.documentEfficiency) { + case "DOCUMENT_EFFICIENCY_UNSPECIFIED": + case 0: + message.documentEfficiency = 0; + break; + case "INEFFICIENT": + case 1: + message.documentEfficiency = 1; + break; + case "EFFICIENT": + case 2: + message.documentEfficiency = 2; + break; } return message; }; /** - * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * Creates a plain object from an AgentAssistantFeedback message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantFeedback * @static - * @param {google.cloud.dialogflow.v2.SynthesizeSpeechConfig} message SynthesizeSpeechConfig + * @param {google.cloud.dialogflow.v2.AgentAssistantFeedback} message AgentAssistantFeedback * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SynthesizeSpeechConfig.toObject = function toObject(message, options) { + AgentAssistantFeedback.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.effectsProfileId = []; if (options.defaults) { - object.speakingRate = 0; - object.pitch = 0; - object.volumeGainDb = 0; - object.voice = null; - } - if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) - object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; - if (message.pitch != null && message.hasOwnProperty("pitch")) - object.pitch = options.json && !isFinite(message.pitch) ? String(message.pitch) : message.pitch; - if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) - object.volumeGainDb = options.json && !isFinite(message.volumeGainDb) ? String(message.volumeGainDb) : message.volumeGainDb; - if (message.voice != null && message.hasOwnProperty("voice")) - object.voice = $root.google.cloud.dialogflow.v2.VoiceSelectionParams.toObject(message.voice, options); - if (message.effectsProfileId && message.effectsProfileId.length) { - object.effectsProfileId = []; - for (var j = 0; j < message.effectsProfileId.length; ++j) - object.effectsProfileId[j] = message.effectsProfileId[j]; - } + object.answerRelevance = options.enums === String ? "ANSWER_RELEVANCE_UNSPECIFIED" : 0; + object.documentCorrectness = options.enums === String ? "DOCUMENT_CORRECTNESS_UNSPECIFIED" : 0; + object.documentEfficiency = options.enums === String ? "DOCUMENT_EFFICIENCY_UNSPECIFIED" : 0; + } + if (message.answerRelevance != null && message.hasOwnProperty("answerRelevance")) + object.answerRelevance = options.enums === String ? $root.google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance[message.answerRelevance] : message.answerRelevance; + if (message.documentCorrectness != null && message.hasOwnProperty("documentCorrectness")) + object.documentCorrectness = options.enums === String ? $root.google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness[message.documentCorrectness] : message.documentCorrectness; + if (message.documentEfficiency != null && message.hasOwnProperty("documentEfficiency")) + object.documentEfficiency = options.enums === String ? $root.google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency[message.documentEfficiency] : message.documentEfficiency; return object; }; /** - * Converts this SynthesizeSpeechConfig to JSON. + * Converts this AgentAssistantFeedback to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantFeedback * @instance * @returns {Object.} JSON object */ - SynthesizeSpeechConfig.prototype.toJSON = function toJSON() { + AgentAssistantFeedback.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SynthesizeSpeechConfig; - })(); + /** + * AnswerRelevance enum. + * @name google.cloud.dialogflow.v2.AgentAssistantFeedback.AnswerRelevance + * @enum {number} + * @property {number} ANSWER_RELEVANCE_UNSPECIFIED=0 ANSWER_RELEVANCE_UNSPECIFIED value + * @property {number} IRRELEVANT=1 IRRELEVANT value + * @property {number} RELEVANT=2 RELEVANT value + */ + AgentAssistantFeedback.AnswerRelevance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANSWER_RELEVANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IRRELEVANT"] = 1; + values[valuesById[2] = "RELEVANT"] = 2; + return values; + })(); - /** - * SsmlVoiceGender enum. - * @name google.cloud.dialogflow.v2.SsmlVoiceGender - * @enum {number} - * @property {number} SSML_VOICE_GENDER_UNSPECIFIED=0 SSML_VOICE_GENDER_UNSPECIFIED value - * @property {number} SSML_VOICE_GENDER_MALE=1 SSML_VOICE_GENDER_MALE value - * @property {number} SSML_VOICE_GENDER_FEMALE=2 SSML_VOICE_GENDER_FEMALE value - * @property {number} SSML_VOICE_GENDER_NEUTRAL=3 SSML_VOICE_GENDER_NEUTRAL value - */ - v2.SsmlVoiceGender = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SSML_VOICE_GENDER_UNSPECIFIED"] = 0; - values[valuesById[1] = "SSML_VOICE_GENDER_MALE"] = 1; - values[valuesById[2] = "SSML_VOICE_GENDER_FEMALE"] = 2; - values[valuesById[3] = "SSML_VOICE_GENDER_NEUTRAL"] = 3; - return values; + /** + * DocumentCorrectness enum. + * @name google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentCorrectness + * @enum {number} + * @property {number} DOCUMENT_CORRECTNESS_UNSPECIFIED=0 DOCUMENT_CORRECTNESS_UNSPECIFIED value + * @property {number} INCORRECT=1 INCORRECT value + * @property {number} CORRECT=2 CORRECT value + */ + AgentAssistantFeedback.DocumentCorrectness = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_CORRECTNESS_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCORRECT"] = 1; + values[valuesById[2] = "CORRECT"] = 2; + return values; + })(); + + /** + * DocumentEfficiency enum. + * @name google.cloud.dialogflow.v2.AgentAssistantFeedback.DocumentEfficiency + * @enum {number} + * @property {number} DOCUMENT_EFFICIENCY_UNSPECIFIED=0 DOCUMENT_EFFICIENCY_UNSPECIFIED value + * @property {number} INEFFICIENT=1 INEFFICIENT value + * @property {number} EFFICIENT=2 EFFICIENT value + */ + AgentAssistantFeedback.DocumentEfficiency = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_EFFICIENCY_UNSPECIFIED"] = 0; + values[valuesById[1] = "INEFFICIENT"] = 1; + values[valuesById[2] = "EFFICIENT"] = 2; + return values; + })(); + + return AgentAssistantFeedback; })(); - v2.OutputAudioConfig = (function() { + v2.AgentAssistantRecord = (function() { /** - * Properties of an OutputAudioConfig. + * Properties of an AgentAssistantRecord. * @memberof google.cloud.dialogflow.v2 - * @interface IOutputAudioConfig - * @property {google.cloud.dialogflow.v2.OutputAudioEncoding|null} [audioEncoding] OutputAudioConfig audioEncoding - * @property {number|null} [sampleRateHertz] OutputAudioConfig sampleRateHertz - * @property {google.cloud.dialogflow.v2.ISynthesizeSpeechConfig|null} [synthesizeSpeechConfig] OutputAudioConfig synthesizeSpeechConfig + * @interface IAgentAssistantRecord + * @property {google.cloud.dialogflow.v2.IArticleAnswer|null} [articleSuggestionAnswer] AgentAssistantRecord articleSuggestionAnswer + * @property {google.cloud.dialogflow.v2.IFaqAnswer|null} [faqAnswer] AgentAssistantRecord faqAnswer */ /** - * Constructs a new OutputAudioConfig. + * Constructs a new AgentAssistantRecord. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an OutputAudioConfig. - * @implements IOutputAudioConfig + * @classdesc Represents an AgentAssistantRecord. + * @implements IAgentAssistantRecord * @constructor - * @param {google.cloud.dialogflow.v2.IOutputAudioConfig=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IAgentAssistantRecord=} [properties] Properties to set */ - function OutputAudioConfig(properties) { + function AgentAssistantRecord(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -5463,101 +5686,102 @@ } /** - * OutputAudioConfig audioEncoding. - * @member {google.cloud.dialogflow.v2.OutputAudioEncoding} audioEncoding - * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * AgentAssistantRecord articleSuggestionAnswer. + * @member {google.cloud.dialogflow.v2.IArticleAnswer|null|undefined} articleSuggestionAnswer + * @memberof google.cloud.dialogflow.v2.AgentAssistantRecord * @instance */ - OutputAudioConfig.prototype.audioEncoding = 0; + AgentAssistantRecord.prototype.articleSuggestionAnswer = null; /** - * OutputAudioConfig sampleRateHertz. - * @member {number} sampleRateHertz - * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * AgentAssistantRecord faqAnswer. + * @member {google.cloud.dialogflow.v2.IFaqAnswer|null|undefined} faqAnswer + * @memberof google.cloud.dialogflow.v2.AgentAssistantRecord * @instance */ - OutputAudioConfig.prototype.sampleRateHertz = 0; + AgentAssistantRecord.prototype.faqAnswer = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * OutputAudioConfig synthesizeSpeechConfig. - * @member {google.cloud.dialogflow.v2.ISynthesizeSpeechConfig|null|undefined} synthesizeSpeechConfig - * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * AgentAssistantRecord answer. + * @member {"articleSuggestionAnswer"|"faqAnswer"|undefined} answer + * @memberof google.cloud.dialogflow.v2.AgentAssistantRecord * @instance */ - OutputAudioConfig.prototype.synthesizeSpeechConfig = null; + Object.defineProperty(AgentAssistantRecord.prototype, "answer", { + get: $util.oneOfGetter($oneOfFields = ["articleSuggestionAnswer", "faqAnswer"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new OutputAudioConfig instance using the specified properties. + * Creates a new AgentAssistantRecord instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantRecord * @static - * @param {google.cloud.dialogflow.v2.IOutputAudioConfig=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.OutputAudioConfig} OutputAudioConfig instance + * @param {google.cloud.dialogflow.v2.IAgentAssistantRecord=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.AgentAssistantRecord} AgentAssistantRecord instance */ - OutputAudioConfig.create = function create(properties) { - return new OutputAudioConfig(properties); + AgentAssistantRecord.create = function create(properties) { + return new AgentAssistantRecord(properties); }; /** - * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.OutputAudioConfig.verify|verify} messages. + * Encodes the specified AgentAssistantRecord message. Does not implicitly {@link google.cloud.dialogflow.v2.AgentAssistantRecord.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantRecord * @static - * @param {google.cloud.dialogflow.v2.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAgentAssistantRecord} message AgentAssistantRecord message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputAudioConfig.encode = function encode(message, writer) { + AgentAssistantRecord.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); - if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); - if (message.synthesizeSpeechConfig != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfig")) - $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.articleSuggestionAnswer != null && Object.hasOwnProperty.call(message, "articleSuggestionAnswer")) + $root.google.cloud.dialogflow.v2.ArticleAnswer.encode(message.articleSuggestionAnswer, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.faqAnswer != null && Object.hasOwnProperty.call(message, "faqAnswer")) + $root.google.cloud.dialogflow.v2.FaqAnswer.encode(message.faqAnswer, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); return writer; }; /** - * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.OutputAudioConfig.verify|verify} messages. + * Encodes the specified AgentAssistantRecord message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AgentAssistantRecord.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantRecord * @static - * @param {google.cloud.dialogflow.v2.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAgentAssistantRecord} message AgentAssistantRecord message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + AgentAssistantRecord.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OutputAudioConfig message from the specified reader or buffer. + * Decodes an AgentAssistantRecord message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantRecord * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.OutputAudioConfig} OutputAudioConfig + * @returns {google.cloud.dialogflow.v2.AgentAssistantRecord} AgentAssistantRecord * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputAudioConfig.decode = function decode(reader, length) { + AgentAssistantRecord.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.OutputAudioConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.AgentAssistantRecord(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.audioEncoding = reader.int32(); - break; - case 2: - message.sampleRateHertz = reader.int32(); + case 5: + message.articleSuggestionAnswer = $root.google.cloud.dialogflow.v2.ArticleAnswer.decode(reader, reader.uint32()); break; - case 3: - message.synthesizeSpeechConfig = $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig.decode(reader, reader.uint32()); + case 6: + message.faqAnswer = $root.google.cloud.dialogflow.v2.FaqAnswer.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -5568,496 +5792,529 @@ }; /** - * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * Decodes an AgentAssistantRecord message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantRecord * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.OutputAudioConfig} OutputAudioConfig + * @returns {google.cloud.dialogflow.v2.AgentAssistantRecord} AgentAssistantRecord * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + AgentAssistantRecord.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OutputAudioConfig message. + * Verifies an AgentAssistantRecord message. * @function verify - * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantRecord * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OutputAudioConfig.verify = function verify(message) { + AgentAssistantRecord.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - switch (message.audioEncoding) { - default: - return "audioEncoding: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + var properties = {}; + if (message.articleSuggestionAnswer != null && message.hasOwnProperty("articleSuggestionAnswer")) { + properties.answer = 1; + { + var error = $root.google.cloud.dialogflow.v2.ArticleAnswer.verify(message.articleSuggestionAnswer); + if (error) + return "articleSuggestionAnswer." + error; + } + } + if (message.faqAnswer != null && message.hasOwnProperty("faqAnswer")) { + if (properties.answer === 1) + return "answer: multiple values"; + properties.answer = 1; + { + var error = $root.google.cloud.dialogflow.v2.FaqAnswer.verify(message.faqAnswer); + if (error) + return "faqAnswer." + error; } - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - if (!$util.isInteger(message.sampleRateHertz)) - return "sampleRateHertz: integer expected"; - if (message.synthesizeSpeechConfig != null && message.hasOwnProperty("synthesizeSpeechConfig")) { - var error = $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfig); - if (error) - return "synthesizeSpeechConfig." + error; } return null; }; /** - * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * Creates an AgentAssistantRecord message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantRecord * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.OutputAudioConfig} OutputAudioConfig + * @returns {google.cloud.dialogflow.v2.AgentAssistantRecord} AgentAssistantRecord */ - OutputAudioConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.OutputAudioConfig) + AgentAssistantRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.AgentAssistantRecord) return object; - var message = new $root.google.cloud.dialogflow.v2.OutputAudioConfig(); - switch (object.audioEncoding) { - case "OUTPUT_AUDIO_ENCODING_UNSPECIFIED": - case 0: - message.audioEncoding = 0; - break; - case "OUTPUT_AUDIO_ENCODING_LINEAR_16": - case 1: - message.audioEncoding = 1; - break; - case "OUTPUT_AUDIO_ENCODING_MP3": - case 2: - message.audioEncoding = 2; - break; - case "OUTPUT_AUDIO_ENCODING_OGG_OPUS": - case 3: - message.audioEncoding = 3; - break; + var message = new $root.google.cloud.dialogflow.v2.AgentAssistantRecord(); + if (object.articleSuggestionAnswer != null) { + if (typeof object.articleSuggestionAnswer !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AgentAssistantRecord.articleSuggestionAnswer: object expected"); + message.articleSuggestionAnswer = $root.google.cloud.dialogflow.v2.ArticleAnswer.fromObject(object.articleSuggestionAnswer); } - if (object.sampleRateHertz != null) - message.sampleRateHertz = object.sampleRateHertz | 0; - if (object.synthesizeSpeechConfig != null) { - if (typeof object.synthesizeSpeechConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2.OutputAudioConfig.synthesizeSpeechConfig: object expected"); - message.synthesizeSpeechConfig = $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfig); + if (object.faqAnswer != null) { + if (typeof object.faqAnswer !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AgentAssistantRecord.faqAnswer: object expected"); + message.faqAnswer = $root.google.cloud.dialogflow.v2.FaqAnswer.fromObject(object.faqAnswer); } return message; }; /** - * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * Creates a plain object from an AgentAssistantRecord message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantRecord * @static - * @param {google.cloud.dialogflow.v2.OutputAudioConfig} message OutputAudioConfig + * @param {google.cloud.dialogflow.v2.AgentAssistantRecord} message AgentAssistantRecord * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OutputAudioConfig.toObject = function toObject(message, options) { + AgentAssistantRecord.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.audioEncoding = options.enums === String ? "OUTPUT_AUDIO_ENCODING_UNSPECIFIED" : 0; - object.sampleRateHertz = 0; - object.synthesizeSpeechConfig = null; + if (message.articleSuggestionAnswer != null && message.hasOwnProperty("articleSuggestionAnswer")) { + object.articleSuggestionAnswer = $root.google.cloud.dialogflow.v2.ArticleAnswer.toObject(message.articleSuggestionAnswer, options); + if (options.oneofs) + object.answer = "articleSuggestionAnswer"; + } + if (message.faqAnswer != null && message.hasOwnProperty("faqAnswer")) { + object.faqAnswer = $root.google.cloud.dialogflow.v2.FaqAnswer.toObject(message.faqAnswer, options); + if (options.oneofs) + object.answer = "faqAnswer"; } - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - object.audioEncoding = options.enums === String ? $root.google.cloud.dialogflow.v2.OutputAudioEncoding[message.audioEncoding] : message.audioEncoding; - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - object.sampleRateHertz = message.sampleRateHertz; - if (message.synthesizeSpeechConfig != null && message.hasOwnProperty("synthesizeSpeechConfig")) - object.synthesizeSpeechConfig = $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfig, options); return object; }; /** - * Converts this OutputAudioConfig to JSON. + * Converts this AgentAssistantRecord to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.AgentAssistantRecord * @instance * @returns {Object.} JSON object */ - OutputAudioConfig.prototype.toJSON = function toJSON() { + AgentAssistantRecord.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OutputAudioConfig; - })(); - - /** - * OutputAudioEncoding enum. - * @name google.cloud.dialogflow.v2.OutputAudioEncoding - * @enum {number} - * @property {number} OUTPUT_AUDIO_ENCODING_UNSPECIFIED=0 OUTPUT_AUDIO_ENCODING_UNSPECIFIED value - * @property {number} OUTPUT_AUDIO_ENCODING_LINEAR_16=1 OUTPUT_AUDIO_ENCODING_LINEAR_16 value - * @property {number} OUTPUT_AUDIO_ENCODING_MP3=2 OUTPUT_AUDIO_ENCODING_MP3 value - * @property {number} OUTPUT_AUDIO_ENCODING_OGG_OPUS=3 OUTPUT_AUDIO_ENCODING_OGG_OPUS value - */ - v2.OutputAudioEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OUTPUT_AUDIO_ENCODING_UNSPECIFIED"] = 0; - values[valuesById[1] = "OUTPUT_AUDIO_ENCODING_LINEAR_16"] = 1; - values[valuesById[2] = "OUTPUT_AUDIO_ENCODING_MP3"] = 2; - values[valuesById[3] = "OUTPUT_AUDIO_ENCODING_OGG_OPUS"] = 3; - return values; + return AgentAssistantRecord; })(); - v2.Contexts = (function() { + v2.Participants = (function() { /** - * Constructs a new Contexts service. + * Constructs a new Participants service. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a Contexts + * @classdesc Represents a Participants * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function Contexts(rpcImpl, requestDelimited, responseDelimited) { + function Participants(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - (Contexts.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Contexts; + (Participants.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Participants; /** - * Creates new Contexts service using the specified rpc implementation. + * Creates new Participants service using the specified rpc implementation. * @function create - * @memberof google.cloud.dialogflow.v2.Contexts + * @memberof google.cloud.dialogflow.v2.Participants * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Contexts} RPC service. Useful where requests and/or responses are streamed. + * @returns {Participants} RPC service. Useful where requests and/or responses are streamed. */ - Contexts.create = function create(rpcImpl, requestDelimited, responseDelimited) { + Participants.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#listContexts}. - * @memberof google.cloud.dialogflow.v2.Contexts - * @typedef ListContextsCallback + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#createParticipant}. + * @memberof google.cloud.dialogflow.v2.Participants + * @typedef CreateParticipantCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.ListContextsResponse} [response] ListContextsResponse + * @param {google.cloud.dialogflow.v2.Participant} [response] Participant */ /** - * Calls ListContexts. - * @function listContexts - * @memberof google.cloud.dialogflow.v2.Contexts + * Calls CreateParticipant. + * @function createParticipant + * @memberof google.cloud.dialogflow.v2.Participants * @instance - * @param {google.cloud.dialogflow.v2.IListContextsRequest} request ListContextsRequest message or plain object - * @param {google.cloud.dialogflow.v2.Contexts.ListContextsCallback} callback Node-style callback called with the error, if any, and ListContextsResponse + * @param {google.cloud.dialogflow.v2.ICreateParticipantRequest} request CreateParticipantRequest message or plain object + * @param {google.cloud.dialogflow.v2.Participants.CreateParticipantCallback} callback Node-style callback called with the error, if any, and Participant * @returns {undefined} * @variation 1 */ - Object.defineProperty(Contexts.prototype.listContexts = function listContexts(request, callback) { - return this.rpcCall(listContexts, $root.google.cloud.dialogflow.v2.ListContextsRequest, $root.google.cloud.dialogflow.v2.ListContextsResponse, request, callback); - }, "name", { value: "ListContexts" }); + Object.defineProperty(Participants.prototype.createParticipant = function createParticipant(request, callback) { + return this.rpcCall(createParticipant, $root.google.cloud.dialogflow.v2.CreateParticipantRequest, $root.google.cloud.dialogflow.v2.Participant, request, callback); + }, "name", { value: "CreateParticipant" }); /** - * Calls ListContexts. - * @function listContexts - * @memberof google.cloud.dialogflow.v2.Contexts + * Calls CreateParticipant. + * @function createParticipant + * @memberof google.cloud.dialogflow.v2.Participants * @instance - * @param {google.cloud.dialogflow.v2.IListContextsRequest} request ListContextsRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2.ICreateParticipantRequest} request CreateParticipantRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#getContext}. - * @memberof google.cloud.dialogflow.v2.Contexts - * @typedef GetContextCallback + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#getParticipant}. + * @memberof google.cloud.dialogflow.v2.Participants + * @typedef GetParticipantCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.Context} [response] Context + * @param {google.cloud.dialogflow.v2.Participant} [response] Participant */ /** - * Calls GetContext. - * @function getContext - * @memberof google.cloud.dialogflow.v2.Contexts + * Calls GetParticipant. + * @function getParticipant + * @memberof google.cloud.dialogflow.v2.Participants * @instance - * @param {google.cloud.dialogflow.v2.IGetContextRequest} request GetContextRequest message or plain object - * @param {google.cloud.dialogflow.v2.Contexts.GetContextCallback} callback Node-style callback called with the error, if any, and Context + * @param {google.cloud.dialogflow.v2.IGetParticipantRequest} request GetParticipantRequest message or plain object + * @param {google.cloud.dialogflow.v2.Participants.GetParticipantCallback} callback Node-style callback called with the error, if any, and Participant * @returns {undefined} * @variation 1 */ - Object.defineProperty(Contexts.prototype.getContext = function getContext(request, callback) { - return this.rpcCall(getContext, $root.google.cloud.dialogflow.v2.GetContextRequest, $root.google.cloud.dialogflow.v2.Context, request, callback); - }, "name", { value: "GetContext" }); + Object.defineProperty(Participants.prototype.getParticipant = function getParticipant(request, callback) { + return this.rpcCall(getParticipant, $root.google.cloud.dialogflow.v2.GetParticipantRequest, $root.google.cloud.dialogflow.v2.Participant, request, callback); + }, "name", { value: "GetParticipant" }); /** - * Calls GetContext. - * @function getContext - * @memberof google.cloud.dialogflow.v2.Contexts + * Calls GetParticipant. + * @function getParticipant + * @memberof google.cloud.dialogflow.v2.Participants * @instance - * @param {google.cloud.dialogflow.v2.IGetContextRequest} request GetContextRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2.IGetParticipantRequest} request GetParticipantRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#createContext}. - * @memberof google.cloud.dialogflow.v2.Contexts - * @typedef CreateContextCallback + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#listParticipants}. + * @memberof google.cloud.dialogflow.v2.Participants + * @typedef ListParticipantsCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.Context} [response] Context + * @param {google.cloud.dialogflow.v2.ListParticipantsResponse} [response] ListParticipantsResponse */ /** - * Calls CreateContext. - * @function createContext - * @memberof google.cloud.dialogflow.v2.Contexts + * Calls ListParticipants. + * @function listParticipants + * @memberof google.cloud.dialogflow.v2.Participants * @instance - * @param {google.cloud.dialogflow.v2.ICreateContextRequest} request CreateContextRequest message or plain object - * @param {google.cloud.dialogflow.v2.Contexts.CreateContextCallback} callback Node-style callback called with the error, if any, and Context + * @param {google.cloud.dialogflow.v2.IListParticipantsRequest} request ListParticipantsRequest message or plain object + * @param {google.cloud.dialogflow.v2.Participants.ListParticipantsCallback} callback Node-style callback called with the error, if any, and ListParticipantsResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(Contexts.prototype.createContext = function createContext(request, callback) { - return this.rpcCall(createContext, $root.google.cloud.dialogflow.v2.CreateContextRequest, $root.google.cloud.dialogflow.v2.Context, request, callback); - }, "name", { value: "CreateContext" }); + Object.defineProperty(Participants.prototype.listParticipants = function listParticipants(request, callback) { + return this.rpcCall(listParticipants, $root.google.cloud.dialogflow.v2.ListParticipantsRequest, $root.google.cloud.dialogflow.v2.ListParticipantsResponse, request, callback); + }, "name", { value: "ListParticipants" }); /** - * Calls CreateContext. - * @function createContext - * @memberof google.cloud.dialogflow.v2.Contexts + * Calls ListParticipants. + * @function listParticipants + * @memberof google.cloud.dialogflow.v2.Participants * @instance - * @param {google.cloud.dialogflow.v2.ICreateContextRequest} request CreateContextRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2.IListParticipantsRequest} request ListParticipantsRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#updateContext}. - * @memberof google.cloud.dialogflow.v2.Contexts - * @typedef UpdateContextCallback + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#updateParticipant}. + * @memberof google.cloud.dialogflow.v2.Participants + * @typedef UpdateParticipantCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.Context} [response] Context + * @param {google.cloud.dialogflow.v2.Participant} [response] Participant */ /** - * Calls UpdateContext. - * @function updateContext - * @memberof google.cloud.dialogflow.v2.Contexts + * Calls UpdateParticipant. + * @function updateParticipant + * @memberof google.cloud.dialogflow.v2.Participants * @instance - * @param {google.cloud.dialogflow.v2.IUpdateContextRequest} request UpdateContextRequest message or plain object - * @param {google.cloud.dialogflow.v2.Contexts.UpdateContextCallback} callback Node-style callback called with the error, if any, and Context + * @param {google.cloud.dialogflow.v2.IUpdateParticipantRequest} request UpdateParticipantRequest message or plain object + * @param {google.cloud.dialogflow.v2.Participants.UpdateParticipantCallback} callback Node-style callback called with the error, if any, and Participant * @returns {undefined} * @variation 1 */ - Object.defineProperty(Contexts.prototype.updateContext = function updateContext(request, callback) { - return this.rpcCall(updateContext, $root.google.cloud.dialogflow.v2.UpdateContextRequest, $root.google.cloud.dialogflow.v2.Context, request, callback); - }, "name", { value: "UpdateContext" }); + Object.defineProperty(Participants.prototype.updateParticipant = function updateParticipant(request, callback) { + return this.rpcCall(updateParticipant, $root.google.cloud.dialogflow.v2.UpdateParticipantRequest, $root.google.cloud.dialogflow.v2.Participant, request, callback); + }, "name", { value: "UpdateParticipant" }); /** - * Calls UpdateContext. - * @function updateContext - * @memberof google.cloud.dialogflow.v2.Contexts + * Calls UpdateParticipant. + * @function updateParticipant + * @memberof google.cloud.dialogflow.v2.Participants * @instance - * @param {google.cloud.dialogflow.v2.IUpdateContextRequest} request UpdateContextRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2.IUpdateParticipantRequest} request UpdateParticipantRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#deleteContext}. - * @memberof google.cloud.dialogflow.v2.Contexts - * @typedef DeleteContextCallback + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#analyzeContent}. + * @memberof google.cloud.dialogflow.v2.Participants + * @typedef AnalyzeContentCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * @param {google.cloud.dialogflow.v2.AnalyzeContentResponse} [response] AnalyzeContentResponse */ /** - * Calls DeleteContext. - * @function deleteContext - * @memberof google.cloud.dialogflow.v2.Contexts + * Calls AnalyzeContent. + * @function analyzeContent + * @memberof google.cloud.dialogflow.v2.Participants * @instance - * @param {google.cloud.dialogflow.v2.IDeleteContextRequest} request DeleteContextRequest message or plain object - * @param {google.cloud.dialogflow.v2.Contexts.DeleteContextCallback} callback Node-style callback called with the error, if any, and Empty + * @param {google.cloud.dialogflow.v2.IAnalyzeContentRequest} request AnalyzeContentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Participants.AnalyzeContentCallback} callback Node-style callback called with the error, if any, and AnalyzeContentResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(Contexts.prototype.deleteContext = function deleteContext(request, callback) { - return this.rpcCall(deleteContext, $root.google.cloud.dialogflow.v2.DeleteContextRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteContext" }); + Object.defineProperty(Participants.prototype.analyzeContent = function analyzeContent(request, callback) { + return this.rpcCall(analyzeContent, $root.google.cloud.dialogflow.v2.AnalyzeContentRequest, $root.google.cloud.dialogflow.v2.AnalyzeContentResponse, request, callback); + }, "name", { value: "AnalyzeContent" }); /** - * Calls DeleteContext. - * @function deleteContext - * @memberof google.cloud.dialogflow.v2.Contexts + * Calls AnalyzeContent. + * @function analyzeContent + * @memberof google.cloud.dialogflow.v2.Participants * @instance - * @param {google.cloud.dialogflow.v2.IDeleteContextRequest} request DeleteContextRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2.IAnalyzeContentRequest} request AnalyzeContentRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#deleteAllContexts}. - * @memberof google.cloud.dialogflow.v2.Contexts - * @typedef DeleteAllContextsCallback + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#streamingAnalyzeContent}. + * @memberof google.cloud.dialogflow.v2.Participants + * @typedef StreamingAnalyzeContentCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * @param {google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse} [response] StreamingAnalyzeContentResponse */ /** - * Calls DeleteAllContexts. - * @function deleteAllContexts - * @memberof google.cloud.dialogflow.v2.Contexts + * Calls StreamingAnalyzeContent. + * @function streamingAnalyzeContent + * @memberof google.cloud.dialogflow.v2.Participants * @instance - * @param {google.cloud.dialogflow.v2.IDeleteAllContextsRequest} request DeleteAllContextsRequest message or plain object - * @param {google.cloud.dialogflow.v2.Contexts.DeleteAllContextsCallback} callback Node-style callback called with the error, if any, and Empty + * @param {google.cloud.dialogflow.v2.IStreamingAnalyzeContentRequest} request StreamingAnalyzeContentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Participants.StreamingAnalyzeContentCallback} callback Node-style callback called with the error, if any, and StreamingAnalyzeContentResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(Contexts.prototype.deleteAllContexts = function deleteAllContexts(request, callback) { - return this.rpcCall(deleteAllContexts, $root.google.cloud.dialogflow.v2.DeleteAllContextsRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteAllContexts" }); + Object.defineProperty(Participants.prototype.streamingAnalyzeContent = function streamingAnalyzeContent(request, callback) { + return this.rpcCall(streamingAnalyzeContent, $root.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest, $root.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse, request, callback); + }, "name", { value: "StreamingAnalyzeContent" }); /** - * Calls DeleteAllContexts. - * @function deleteAllContexts - * @memberof google.cloud.dialogflow.v2.Contexts + * Calls StreamingAnalyzeContent. + * @function streamingAnalyzeContent + * @memberof google.cloud.dialogflow.v2.Participants * @instance - * @param {google.cloud.dialogflow.v2.IDeleteAllContextsRequest} request DeleteAllContextsRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2.IStreamingAnalyzeContentRequest} request StreamingAnalyzeContentRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ - return Contexts; - })(); - - v2.Context = (function() { - /** - * Properties of a Context. - * @memberof google.cloud.dialogflow.v2 - * @interface IContext - * @property {string|null} [name] Context name - * @property {number|null} [lifespanCount] Context lifespanCount - * @property {google.protobuf.IStruct|null} [parameters] Context parameters + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#suggestArticles}. + * @memberof google.cloud.dialogflow.v2.Participants + * @typedef SuggestArticlesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.SuggestArticlesResponse} [response] SuggestArticlesResponse */ /** - * Constructs a new Context. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a Context. - * @implements IContext - * @constructor - * @param {google.cloud.dialogflow.v2.IContext=} [properties] Properties to set + * Calls SuggestArticles. + * @function suggestArticles + * @memberof google.cloud.dialogflow.v2.Participants + * @instance + * @param {google.cloud.dialogflow.v2.ISuggestArticlesRequest} request SuggestArticlesRequest message or plain object + * @param {google.cloud.dialogflow.v2.Participants.SuggestArticlesCallback} callback Node-style callback called with the error, if any, and SuggestArticlesResponse + * @returns {undefined} + * @variation 1 */ - function Context(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + Object.defineProperty(Participants.prototype.suggestArticles = function suggestArticles(request, callback) { + return this.rpcCall(suggestArticles, $root.google.cloud.dialogflow.v2.SuggestArticlesRequest, $root.google.cloud.dialogflow.v2.SuggestArticlesResponse, request, callback); + }, "name", { value: "SuggestArticles" }); /** - * Context name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.Context + * Calls SuggestArticles. + * @function suggestArticles + * @memberof google.cloud.dialogflow.v2.Participants * @instance + * @param {google.cloud.dialogflow.v2.ISuggestArticlesRequest} request SuggestArticlesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Context.prototype.name = ""; /** - * Context lifespanCount. - * @member {number} lifespanCount - * @memberof google.cloud.dialogflow.v2.Context + * Callback as used by {@link google.cloud.dialogflow.v2.Participants#suggestFaqAnswers}. + * @memberof google.cloud.dialogflow.v2.Participants + * @typedef SuggestFaqAnswersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.SuggestFaqAnswersResponse} [response] SuggestFaqAnswersResponse + */ + + /** + * Calls SuggestFaqAnswers. + * @function suggestFaqAnswers + * @memberof google.cloud.dialogflow.v2.Participants * @instance + * @param {google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest} request SuggestFaqAnswersRequest message or plain object + * @param {google.cloud.dialogflow.v2.Participants.SuggestFaqAnswersCallback} callback Node-style callback called with the error, if any, and SuggestFaqAnswersResponse + * @returns {undefined} + * @variation 1 */ - Context.prototype.lifespanCount = 0; + Object.defineProperty(Participants.prototype.suggestFaqAnswers = function suggestFaqAnswers(request, callback) { + return this.rpcCall(suggestFaqAnswers, $root.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest, $root.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse, request, callback); + }, "name", { value: "SuggestFaqAnswers" }); /** - * Context parameters. - * @member {google.protobuf.IStruct|null|undefined} parameters - * @memberof google.cloud.dialogflow.v2.Context + * Calls SuggestFaqAnswers. + * @function suggestFaqAnswers + * @memberof google.cloud.dialogflow.v2.Participants * @instance + * @param {google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest} request SuggestFaqAnswersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - Context.prototype.parameters = null; + + return Participants; + })(); + + v2.Participant = (function() { /** - * Creates a new Context instance using the specified properties. + * Properties of a Participant. + * @memberof google.cloud.dialogflow.v2 + * @interface IParticipant + * @property {string|null} [name] Participant name + * @property {google.cloud.dialogflow.v2.Participant.Role|null} [role] Participant role + * @property {string|null} [sipRecordingMediaLabel] Participant sipRecordingMediaLabel + */ + + /** + * Constructs a new Participant. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a Participant. + * @implements IParticipant + * @constructor + * @param {google.cloud.dialogflow.v2.IParticipant=} [properties] Properties to set + */ + function Participant(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Participant name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.Participant + * @instance + */ + Participant.prototype.name = ""; + + /** + * Participant role. + * @member {google.cloud.dialogflow.v2.Participant.Role} role + * @memberof google.cloud.dialogflow.v2.Participant + * @instance + */ + Participant.prototype.role = 0; + + /** + * Participant sipRecordingMediaLabel. + * @member {string} sipRecordingMediaLabel + * @memberof google.cloud.dialogflow.v2.Participant + * @instance + */ + Participant.prototype.sipRecordingMediaLabel = ""; + + /** + * Creates a new Participant instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.Context + * @memberof google.cloud.dialogflow.v2.Participant * @static - * @param {google.cloud.dialogflow.v2.IContext=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Context} Context instance + * @param {google.cloud.dialogflow.v2.IParticipant=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Participant} Participant instance */ - Context.create = function create(properties) { - return new Context(properties); + Participant.create = function create(properties) { + return new Participant(properties); }; /** - * Encodes the specified Context message. Does not implicitly {@link google.cloud.dialogflow.v2.Context.verify|verify} messages. + * Encodes the specified Participant message. Does not implicitly {@link google.cloud.dialogflow.v2.Participant.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.Context + * @memberof google.cloud.dialogflow.v2.Participant * @static - * @param {google.cloud.dialogflow.v2.IContext} message Context message or plain object to encode + * @param {google.cloud.dialogflow.v2.IParticipant} message Participant message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Context.encode = function encode(message, writer) { + Participant.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.lifespanCount != null && Object.hasOwnProperty.call(message, "lifespanCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.lifespanCount); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.role); + if (message.sipRecordingMediaLabel != null && Object.hasOwnProperty.call(message, "sipRecordingMediaLabel")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sipRecordingMediaLabel); return writer; }; /** - * Encodes the specified Context message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Context.verify|verify} messages. + * Encodes the specified Participant message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Participant.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Context + * @memberof google.cloud.dialogflow.v2.Participant * @static - * @param {google.cloud.dialogflow.v2.IContext} message Context message or plain object to encode + * @param {google.cloud.dialogflow.v2.IParticipant} message Participant message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Context.encodeDelimited = function encodeDelimited(message, writer) { + Participant.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Context message from the specified reader or buffer. + * Decodes a Participant message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.Context + * @memberof google.cloud.dialogflow.v2.Participant * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Context} Context + * @returns {google.cloud.dialogflow.v2.Participant} Participant * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Context.decode = function decode(reader, length) { + Participant.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Context(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Participant(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -6065,10 +6322,10 @@ message.name = reader.string(); break; case 2: - message.lifespanCount = reader.int32(); + message.role = reader.int32(); break; - case 3: - message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + case 6: + message.sipRecordingMediaLabel = reader.string(); break; default: reader.skipType(tag & 7); @@ -6079,131 +6336,171 @@ }; /** - * Decodes a Context message from the specified reader or buffer, length delimited. + * Decodes a Participant message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Context + * @memberof google.cloud.dialogflow.v2.Participant * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Context} Context + * @returns {google.cloud.dialogflow.v2.Participant} Participant * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Context.decodeDelimited = function decodeDelimited(reader) { + Participant.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Context message. + * Verifies a Participant message. * @function verify - * @memberof google.cloud.dialogflow.v2.Context + * @memberof google.cloud.dialogflow.v2.Participant * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Context.verify = function verify(message) { + Participant.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.lifespanCount != null && message.hasOwnProperty("lifespanCount")) - if (!$util.isInteger(message.lifespanCount)) - return "lifespanCount: integer expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - var error = $root.google.protobuf.Struct.verify(message.parameters); - if (error) - return "parameters." + error; - } + if (message.role != null && message.hasOwnProperty("role")) + switch (message.role) { + default: + return "role: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sipRecordingMediaLabel != null && message.hasOwnProperty("sipRecordingMediaLabel")) + if (!$util.isString(message.sipRecordingMediaLabel)) + return "sipRecordingMediaLabel: string expected"; return null; }; /** - * Creates a Context message from a plain object. Also converts values to their respective internal types. + * Creates a Participant message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.Context + * @memberof google.cloud.dialogflow.v2.Participant * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Context} Context + * @returns {google.cloud.dialogflow.v2.Participant} Participant */ - Context.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Context) + Participant.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Participant) return object; - var message = new $root.google.cloud.dialogflow.v2.Context(); + var message = new $root.google.cloud.dialogflow.v2.Participant(); if (object.name != null) message.name = String(object.name); - if (object.lifespanCount != null) - message.lifespanCount = object.lifespanCount | 0; - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Context.parameters: object expected"); - message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters); + switch (object.role) { + case "ROLE_UNSPECIFIED": + case 0: + message.role = 0; + break; + case "HUMAN_AGENT": + case 1: + message.role = 1; + break; + case "AUTOMATED_AGENT": + case 2: + message.role = 2; + break; + case "END_USER": + case 3: + message.role = 3; + break; } + if (object.sipRecordingMediaLabel != null) + message.sipRecordingMediaLabel = String(object.sipRecordingMediaLabel); return message; }; /** - * Creates a plain object from a Context message. Also converts values to other types if specified. + * Creates a plain object from a Participant message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.Context + * @memberof google.cloud.dialogflow.v2.Participant * @static - * @param {google.cloud.dialogflow.v2.Context} message Context + * @param {google.cloud.dialogflow.v2.Participant} message Participant * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Context.toObject = function toObject(message, options) { + Participant.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.lifespanCount = 0; - object.parameters = null; + object.role = options.enums === String ? "ROLE_UNSPECIFIED" : 0; + object.sipRecordingMediaLabel = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.lifespanCount != null && message.hasOwnProperty("lifespanCount")) - object.lifespanCount = message.lifespanCount; - if (message.parameters != null && message.hasOwnProperty("parameters")) - object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + if (message.role != null && message.hasOwnProperty("role")) + object.role = options.enums === String ? $root.google.cloud.dialogflow.v2.Participant.Role[message.role] : message.role; + if (message.sipRecordingMediaLabel != null && message.hasOwnProperty("sipRecordingMediaLabel")) + object.sipRecordingMediaLabel = message.sipRecordingMediaLabel; return object; }; /** - * Converts this Context to JSON. + * Converts this Participant to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.Context + * @memberof google.cloud.dialogflow.v2.Participant * @instance * @returns {Object.} JSON object */ - Context.prototype.toJSON = function toJSON() { + Participant.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Context; + /** + * Role enum. + * @name google.cloud.dialogflow.v2.Participant.Role + * @enum {number} + * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value + * @property {number} HUMAN_AGENT=1 HUMAN_AGENT value + * @property {number} AUTOMATED_AGENT=2 AUTOMATED_AGENT value + * @property {number} END_USER=3 END_USER value + */ + Participant.Role = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HUMAN_AGENT"] = 1; + values[valuesById[2] = "AUTOMATED_AGENT"] = 2; + values[valuesById[3] = "END_USER"] = 3; + return values; + })(); + + return Participant; })(); - v2.ListContextsRequest = (function() { + v2.Message = (function() { /** - * Properties of a ListContextsRequest. + * Properties of a Message. * @memberof google.cloud.dialogflow.v2 - * @interface IListContextsRequest - * @property {string|null} [parent] ListContextsRequest parent - * @property {number|null} [pageSize] ListContextsRequest pageSize - * @property {string|null} [pageToken] ListContextsRequest pageToken + * @interface IMessage + * @property {string|null} [name] Message name + * @property {string|null} [content] Message content + * @property {string|null} [languageCode] Message languageCode + * @property {string|null} [participant] Message participant + * @property {google.cloud.dialogflow.v2.Participant.Role|null} [participantRole] Message participantRole + * @property {google.protobuf.ITimestamp|null} [createTime] Message createTime + * @property {google.cloud.dialogflow.v2.IMessageAnnotation|null} [messageAnnotation] Message messageAnnotation */ /** - * Constructs a new ListContextsRequest. + * Constructs a new Message. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a ListContextsRequest. - * @implements IListContextsRequest + * @classdesc Represents a Message. + * @implements IMessage * @constructor - * @param {google.cloud.dialogflow.v2.IListContextsRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IMessage=} [properties] Properties to set */ - function ListContextsRequest(properties) { + function Message(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6211,101 +6508,153 @@ } /** - * ListContextsRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * Message name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.Message * @instance */ - ListContextsRequest.prototype.parent = ""; + Message.prototype.name = ""; /** - * ListContextsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * Message content. + * @member {string} content + * @memberof google.cloud.dialogflow.v2.Message * @instance */ - ListContextsRequest.prototype.pageSize = 0; + Message.prototype.content = ""; /** - * ListContextsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * Message languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.Message * @instance */ - ListContextsRequest.prototype.pageToken = ""; + Message.prototype.languageCode = ""; /** - * Creates a new ListContextsRequest instance using the specified properties. + * Message participant. + * @member {string} participant + * @memberof google.cloud.dialogflow.v2.Message + * @instance + */ + Message.prototype.participant = ""; + + /** + * Message participantRole. + * @member {google.cloud.dialogflow.v2.Participant.Role} participantRole + * @memberof google.cloud.dialogflow.v2.Message + * @instance + */ + Message.prototype.participantRole = 0; + + /** + * Message createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.v2.Message + * @instance + */ + Message.prototype.createTime = null; + + /** + * Message messageAnnotation. + * @member {google.cloud.dialogflow.v2.IMessageAnnotation|null|undefined} messageAnnotation + * @memberof google.cloud.dialogflow.v2.Message + * @instance + */ + Message.prototype.messageAnnotation = null; + + /** + * Creates a new Message instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.Message * @static - * @param {google.cloud.dialogflow.v2.IListContextsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.ListContextsRequest} ListContextsRequest instance + * @param {google.cloud.dialogflow.v2.IMessage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Message} Message instance */ - ListContextsRequest.create = function create(properties) { - return new ListContextsRequest(properties); + Message.create = function create(properties) { + return new Message(properties); }; /** - * Encodes the specified ListContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsRequest.verify|verify} messages. + * Encodes the specified Message message. Does not implicitly {@link google.cloud.dialogflow.v2.Message.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.Message * @static - * @param {google.cloud.dialogflow.v2.IListContextsRequest} message ListContextsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IMessage} message Message message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListContextsRequest.encode = function encode(message, writer) { + Message.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.participant); + if (message.participantRole != null && Object.hasOwnProperty.call(message, "participantRole")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.participantRole); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.messageAnnotation != null && Object.hasOwnProperty.call(message, "messageAnnotation")) + $root.google.cloud.dialogflow.v2.MessageAnnotation.encode(message.messageAnnotation, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsRequest.verify|verify} messages. + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Message.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.Message * @static - * @param {google.cloud.dialogflow.v2.IListContextsRequest} message ListContextsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IMessage} message Message message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListContextsRequest.encodeDelimited = function encodeDelimited(message, writer) { + Message.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListContextsRequest message from the specified reader or buffer. + * Decodes a Message message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.Message * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.ListContextsRequest} ListContextsRequest + * @returns {google.cloud.dialogflow.v2.Message} Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListContextsRequest.decode = function decode(reader, length) { + Message.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListContextsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Message(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.pageSize = reader.int32(); + message.content = reader.string(); break; case 3: - message.pageToken = reader.string(); + message.languageCode = reader.string(); + break; + case 4: + message.participant = reader.string(); + break; + case 5: + message.participantRole = reader.int32(); + break; + case 6: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.messageAnnotation = $root.google.cloud.dialogflow.v2.MessageAnnotation.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6316,126 +6665,190 @@ }; /** - * Decodes a ListContextsRequest message from the specified reader or buffer, length delimited. + * Decodes a Message message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.Message * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.ListContextsRequest} ListContextsRequest + * @returns {google.cloud.dialogflow.v2.Message} Message * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListContextsRequest.decodeDelimited = function decodeDelimited(reader) { + Message.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListContextsRequest message. + * Verifies a Message message. * @function verify - * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.Message * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListContextsRequest.verify = function verify(message) { + Message.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + if (message.participantRole != null && message.hasOwnProperty("participantRole")) + switch (message.participantRole) { + default: + return "participantRole: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.messageAnnotation != null && message.hasOwnProperty("messageAnnotation")) { + var error = $root.google.cloud.dialogflow.v2.MessageAnnotation.verify(message.messageAnnotation); + if (error) + return "messageAnnotation." + error; + } return null; }; /** - * Creates a ListContextsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Message message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.Message * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.ListContextsRequest} ListContextsRequest + * @returns {google.cloud.dialogflow.v2.Message} Message */ - ListContextsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.ListContextsRequest) + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Message) return object; - var message = new $root.google.cloud.dialogflow.v2.ListContextsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.cloud.dialogflow.v2.Message(); + if (object.name != null) + message.name = String(object.name); + if (object.content != null) + message.content = String(object.content); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.participant != null) + message.participant = String(object.participant); + switch (object.participantRole) { + case "ROLE_UNSPECIFIED": + case 0: + message.participantRole = 0; + break; + case "HUMAN_AGENT": + case 1: + message.participantRole = 1; + break; + case "AUTOMATED_AGENT": + case 2: + message.participantRole = 2; + break; + case "END_USER": + case 3: + message.participantRole = 3; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Message.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.messageAnnotation != null) { + if (typeof object.messageAnnotation !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Message.messageAnnotation: object expected"); + message.messageAnnotation = $root.google.cloud.dialogflow.v2.MessageAnnotation.fromObject(object.messageAnnotation); + } return message; }; /** - * Creates a plain object from a ListContextsRequest message. Also converts values to other types if specified. + * Creates a plain object from a Message message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.Message * @static - * @param {google.cloud.dialogflow.v2.ListContextsRequest} message ListContextsRequest + * @param {google.cloud.dialogflow.v2.Message} message Message * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListContextsRequest.toObject = function toObject(message, options) { + Message.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + object.name = ""; + object.content = ""; + object.languageCode = ""; + object.participant = ""; + object.participantRole = options.enums === String ? "ROLE_UNSPECIFIED" : 0; + object.createTime = null; + object.messageAnnotation = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + if (message.participantRole != null && message.hasOwnProperty("participantRole")) + object.participantRole = options.enums === String ? $root.google.cloud.dialogflow.v2.Participant.Role[message.participantRole] : message.participantRole; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.messageAnnotation != null && message.hasOwnProperty("messageAnnotation")) + object.messageAnnotation = $root.google.cloud.dialogflow.v2.MessageAnnotation.toObject(message.messageAnnotation, options); return object; }; /** - * Converts this ListContextsRequest to JSON. + * Converts this Message to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.Message * @instance * @returns {Object.} JSON object */ - ListContextsRequest.prototype.toJSON = function toJSON() { + Message.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListContextsRequest; + return Message; })(); - v2.ListContextsResponse = (function() { + v2.CreateParticipantRequest = (function() { /** - * Properties of a ListContextsResponse. + * Properties of a CreateParticipantRequest. * @memberof google.cloud.dialogflow.v2 - * @interface IListContextsResponse - * @property {Array.|null} [contexts] ListContextsResponse contexts - * @property {string|null} [nextPageToken] ListContextsResponse nextPageToken + * @interface ICreateParticipantRequest + * @property {string|null} [parent] CreateParticipantRequest parent + * @property {google.cloud.dialogflow.v2.IParticipant|null} [participant] CreateParticipantRequest participant */ /** - * Constructs a new ListContextsResponse. + * Constructs a new CreateParticipantRequest. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a ListContextsResponse. - * @implements IListContextsResponse + * @classdesc Represents a CreateParticipantRequest. + * @implements ICreateParticipantRequest * @constructor - * @param {google.cloud.dialogflow.v2.IListContextsResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ICreateParticipantRequest=} [properties] Properties to set */ - function ListContextsResponse(properties) { - this.contexts = []; + function CreateParticipantRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6443,91 +6856,88 @@ } /** - * ListContextsResponse contexts. - * @member {Array.} contexts - * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * CreateParticipantRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.CreateParticipantRequest * @instance */ - ListContextsResponse.prototype.contexts = $util.emptyArray; + CreateParticipantRequest.prototype.parent = ""; /** - * ListContextsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * CreateParticipantRequest participant. + * @member {google.cloud.dialogflow.v2.IParticipant|null|undefined} participant + * @memberof google.cloud.dialogflow.v2.CreateParticipantRequest * @instance */ - ListContextsResponse.prototype.nextPageToken = ""; + CreateParticipantRequest.prototype.participant = null; /** - * Creates a new ListContextsResponse instance using the specified properties. + * Creates a new CreateParticipantRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.CreateParticipantRequest * @static - * @param {google.cloud.dialogflow.v2.IListContextsResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.ListContextsResponse} ListContextsResponse instance + * @param {google.cloud.dialogflow.v2.ICreateParticipantRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CreateParticipantRequest} CreateParticipantRequest instance */ - ListContextsResponse.create = function create(properties) { - return new ListContextsResponse(properties); + CreateParticipantRequest.create = function create(properties) { + return new CreateParticipantRequest(properties); }; /** - * Encodes the specified ListContextsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsResponse.verify|verify} messages. + * Encodes the specified CreateParticipantRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateParticipantRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.CreateParticipantRequest * @static - * @param {google.cloud.dialogflow.v2.IListContextsResponse} message ListContextsResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateParticipantRequest} message CreateParticipantRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListContextsResponse.encode = function encode(message, writer) { + CreateParticipantRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.contexts != null && message.contexts.length) - for (var i = 0; i < message.contexts.length; ++i) - $root.google.cloud.dialogflow.v2.Context.encode(message.contexts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + $root.google.cloud.dialogflow.v2.Participant.encode(message.participant, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListContextsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsResponse.verify|verify} messages. + * Encodes the specified CreateParticipantRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateParticipantRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.CreateParticipantRequest * @static - * @param {google.cloud.dialogflow.v2.IListContextsResponse} message ListContextsResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateParticipantRequest} message CreateParticipantRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListContextsResponse.encodeDelimited = function encodeDelimited(message, writer) { + CreateParticipantRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListContextsResponse message from the specified reader or buffer. + * Decodes a CreateParticipantRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.CreateParticipantRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.ListContextsResponse} ListContextsResponse + * @returns {google.cloud.dialogflow.v2.CreateParticipantRequest} CreateParticipantRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListContextsResponse.decode = function decode(reader, length) { + CreateParticipantRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListContextsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateParticipantRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.contexts && message.contexts.length)) - message.contexts = []; - message.contexts.push($root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + message.participant = $root.google.cloud.dialogflow.v2.Participant.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -6538,133 +6948,121 @@ }; /** - * Decodes a ListContextsResponse message from the specified reader or buffer, length delimited. + * Decodes a CreateParticipantRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.CreateParticipantRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.ListContextsResponse} ListContextsResponse + * @returns {google.cloud.dialogflow.v2.CreateParticipantRequest} CreateParticipantRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListContextsResponse.decodeDelimited = function decodeDelimited(reader) { + CreateParticipantRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListContextsResponse message. + * Verifies a CreateParticipantRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.CreateParticipantRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListContextsResponse.verify = function verify(message) { + CreateParticipantRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.contexts != null && message.hasOwnProperty("contexts")) { - if (!Array.isArray(message.contexts)) - return "contexts: array expected"; - for (var i = 0; i < message.contexts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Context.verify(message.contexts[i]); - if (error) - return "contexts." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.participant != null && message.hasOwnProperty("participant")) { + var error = $root.google.cloud.dialogflow.v2.Participant.verify(message.participant); + if (error) + return "participant." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListContextsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a CreateParticipantRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.CreateParticipantRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.ListContextsResponse} ListContextsResponse + * @returns {google.cloud.dialogflow.v2.CreateParticipantRequest} CreateParticipantRequest */ - ListContextsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.ListContextsResponse) + CreateParticipantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CreateParticipantRequest) return object; - var message = new $root.google.cloud.dialogflow.v2.ListContextsResponse(); - if (object.contexts) { - if (!Array.isArray(object.contexts)) - throw TypeError(".google.cloud.dialogflow.v2.ListContextsResponse.contexts: array expected"); - message.contexts = []; - for (var i = 0; i < object.contexts.length; ++i) { - if (typeof object.contexts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.ListContextsResponse.contexts: object expected"); - message.contexts[i] = $root.google.cloud.dialogflow.v2.Context.fromObject(object.contexts[i]); - } + var message = new $root.google.cloud.dialogflow.v2.CreateParticipantRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.participant != null) { + if (typeof object.participant !== "object") + throw TypeError(".google.cloud.dialogflow.v2.CreateParticipantRequest.participant: object expected"); + message.participant = $root.google.cloud.dialogflow.v2.Participant.fromObject(object.participant); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListContextsResponse message. Also converts values to other types if specified. + * Creates a plain object from a CreateParticipantRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.CreateParticipantRequest * @static - * @param {google.cloud.dialogflow.v2.ListContextsResponse} message ListContextsResponse + * @param {google.cloud.dialogflow.v2.CreateParticipantRequest} message CreateParticipantRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListContextsResponse.toObject = function toObject(message, options) { + CreateParticipantRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.contexts = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.contexts && message.contexts.length) { - object.contexts = []; - for (var j = 0; j < message.contexts.length; ++j) - object.contexts[j] = $root.google.cloud.dialogflow.v2.Context.toObject(message.contexts[j], options); + if (options.defaults) { + object.parent = ""; + object.participant = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = $root.google.cloud.dialogflow.v2.Participant.toObject(message.participant, options); return object; }; /** - * Converts this ListContextsResponse to JSON. + * Converts this CreateParticipantRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.CreateParticipantRequest * @instance * @returns {Object.} JSON object */ - ListContextsResponse.prototype.toJSON = function toJSON() { + CreateParticipantRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListContextsResponse; + return CreateParticipantRequest; })(); - v2.GetContextRequest = (function() { + v2.GetParticipantRequest = (function() { /** - * Properties of a GetContextRequest. + * Properties of a GetParticipantRequest. * @memberof google.cloud.dialogflow.v2 - * @interface IGetContextRequest - * @property {string|null} [name] GetContextRequest name + * @interface IGetParticipantRequest + * @property {string|null} [name] GetParticipantRequest name */ /** - * Constructs a new GetContextRequest. + * Constructs a new GetParticipantRequest. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a GetContextRequest. - * @implements IGetContextRequest + * @classdesc Represents a GetParticipantRequest. + * @implements IGetParticipantRequest * @constructor - * @param {google.cloud.dialogflow.v2.IGetContextRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IGetParticipantRequest=} [properties] Properties to set */ - function GetContextRequest(properties) { + function GetParticipantRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6672,35 +7070,35 @@ } /** - * GetContextRequest name. + * GetParticipantRequest name. * @member {string} name - * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @memberof google.cloud.dialogflow.v2.GetParticipantRequest * @instance */ - GetContextRequest.prototype.name = ""; + GetParticipantRequest.prototype.name = ""; /** - * Creates a new GetContextRequest instance using the specified properties. + * Creates a new GetParticipantRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @memberof google.cloud.dialogflow.v2.GetParticipantRequest * @static - * @param {google.cloud.dialogflow.v2.IGetContextRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.GetContextRequest} GetContextRequest instance + * @param {google.cloud.dialogflow.v2.IGetParticipantRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.GetParticipantRequest} GetParticipantRequest instance */ - GetContextRequest.create = function create(properties) { - return new GetContextRequest(properties); + GetParticipantRequest.create = function create(properties) { + return new GetParticipantRequest(properties); }; /** - * Encodes the specified GetContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetContextRequest.verify|verify} messages. + * Encodes the specified GetParticipantRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetParticipantRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @memberof google.cloud.dialogflow.v2.GetParticipantRequest * @static - * @param {google.cloud.dialogflow.v2.IGetContextRequest} message GetContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IGetParticipantRequest} message GetParticipantRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetContextRequest.encode = function encode(message, writer) { + GetParticipantRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -6709,33 +7107,33 @@ }; /** - * Encodes the specified GetContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetContextRequest.verify|verify} messages. + * Encodes the specified GetParticipantRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetParticipantRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @memberof google.cloud.dialogflow.v2.GetParticipantRequest * @static - * @param {google.cloud.dialogflow.v2.IGetContextRequest} message GetContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IGetParticipantRequest} message GetParticipantRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetParticipantRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetContextRequest message from the specified reader or buffer. + * Decodes a GetParticipantRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @memberof google.cloud.dialogflow.v2.GetParticipantRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.GetContextRequest} GetContextRequest + * @returns {google.cloud.dialogflow.v2.GetParticipantRequest} GetParticipantRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetContextRequest.decode = function decode(reader, length) { + GetParticipantRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetContextRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetParticipantRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -6751,30 +7149,30 @@ }; /** - * Decodes a GetContextRequest message from the specified reader or buffer, length delimited. + * Decodes a GetParticipantRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @memberof google.cloud.dialogflow.v2.GetParticipantRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.GetContextRequest} GetContextRequest + * @returns {google.cloud.dialogflow.v2.GetParticipantRequest} GetParticipantRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetContextRequest.decodeDelimited = function decodeDelimited(reader) { + GetParticipantRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetContextRequest message. + * Verifies a GetParticipantRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @memberof google.cloud.dialogflow.v2.GetParticipantRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetContextRequest.verify = function verify(message) { + GetParticipantRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -6784,32 +7182,32 @@ }; /** - * Creates a GetContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetParticipantRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @memberof google.cloud.dialogflow.v2.GetParticipantRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.GetContextRequest} GetContextRequest + * @returns {google.cloud.dialogflow.v2.GetParticipantRequest} GetParticipantRequest */ - GetContextRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.GetContextRequest) + GetParticipantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.GetParticipantRequest) return object; - var message = new $root.google.cloud.dialogflow.v2.GetContextRequest(); + var message = new $root.google.cloud.dialogflow.v2.GetParticipantRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetContextRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetParticipantRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @memberof google.cloud.dialogflow.v2.GetParticipantRequest * @static - * @param {google.cloud.dialogflow.v2.GetContextRequest} message GetContextRequest + * @param {google.cloud.dialogflow.v2.GetParticipantRequest} message GetParticipantRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetContextRequest.toObject = function toObject(message, options) { + GetParticipantRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -6821,38 +7219,39 @@ }; /** - * Converts this GetContextRequest to JSON. + * Converts this GetParticipantRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @memberof google.cloud.dialogflow.v2.GetParticipantRequest * @instance * @returns {Object.} JSON object */ - GetContextRequest.prototype.toJSON = function toJSON() { + GetParticipantRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetContextRequest; + return GetParticipantRequest; })(); - v2.CreateContextRequest = (function() { + v2.ListParticipantsRequest = (function() { /** - * Properties of a CreateContextRequest. + * Properties of a ListParticipantsRequest. * @memberof google.cloud.dialogflow.v2 - * @interface ICreateContextRequest - * @property {string|null} [parent] CreateContextRequest parent - * @property {google.cloud.dialogflow.v2.IContext|null} [context] CreateContextRequest context + * @interface IListParticipantsRequest + * @property {string|null} [parent] ListParticipantsRequest parent + * @property {number|null} [pageSize] ListParticipantsRequest pageSize + * @property {string|null} [pageToken] ListParticipantsRequest pageToken */ /** - * Constructs a new CreateContextRequest. + * Constructs a new ListParticipantsRequest. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a CreateContextRequest. - * @implements ICreateContextRequest + * @classdesc Represents a ListParticipantsRequest. + * @implements IListParticipantsRequest * @constructor - * @param {google.cloud.dialogflow.v2.ICreateContextRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListParticipantsRequest=} [properties] Properties to set */ - function CreateContextRequest(properties) { + function ListParticipantsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -6860,80 +7259,90 @@ } /** - * CreateContextRequest parent. + * ListParticipantsRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsRequest * @instance */ - CreateContextRequest.prototype.parent = ""; + ListParticipantsRequest.prototype.parent = ""; /** - * CreateContextRequest context. - * @member {google.cloud.dialogflow.v2.IContext|null|undefined} context - * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * ListParticipantsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListParticipantsRequest * @instance */ - CreateContextRequest.prototype.context = null; + ListParticipantsRequest.prototype.pageSize = 0; /** - * Creates a new CreateContextRequest instance using the specified properties. + * ListParticipantsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListParticipantsRequest + * @instance + */ + ListParticipantsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListParticipantsRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsRequest * @static - * @param {google.cloud.dialogflow.v2.ICreateContextRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.CreateContextRequest} CreateContextRequest instance + * @param {google.cloud.dialogflow.v2.IListParticipantsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListParticipantsRequest} ListParticipantsRequest instance */ - CreateContextRequest.create = function create(properties) { - return new CreateContextRequest(properties); + ListParticipantsRequest.create = function create(properties) { + return new ListParticipantsRequest(properties); }; /** - * Encodes the specified CreateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateContextRequest.verify|verify} messages. + * Encodes the specified ListParticipantsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListParticipantsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsRequest * @static - * @param {google.cloud.dialogflow.v2.ICreateContextRequest} message CreateContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListParticipantsRequest} message ListParticipantsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateContextRequest.encode = function encode(message, writer) { + ListParticipantsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.context != null && Object.hasOwnProperty.call(message, "context")) - $root.google.cloud.dialogflow.v2.Context.encode(message.context, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; }; /** - * Encodes the specified CreateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateContextRequest.verify|verify} messages. + * Encodes the specified ListParticipantsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListParticipantsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsRequest * @static - * @param {google.cloud.dialogflow.v2.ICreateContextRequest} message CreateContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListParticipantsRequest} message ListParticipantsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListParticipantsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateContextRequest message from the specified reader or buffer. + * Decodes a ListParticipantsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.CreateContextRequest} CreateContextRequest + * @returns {google.cloud.dialogflow.v2.ListParticipantsRequest} ListParticipantsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateContextRequest.decode = function decode(reader, length) { + ListParticipantsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateContextRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListParticipantsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -6941,7 +7350,10 @@ message.parent = reader.string(); break; case 2: - message.context = $root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -6952,122 +7364,126 @@ }; /** - * Decodes a CreateContextRequest message from the specified reader or buffer, length delimited. + * Decodes a ListParticipantsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.CreateContextRequest} CreateContextRequest + * @returns {google.cloud.dialogflow.v2.ListParticipantsRequest} ListParticipantsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateContextRequest.decodeDelimited = function decodeDelimited(reader) { + ListParticipantsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateContextRequest message. + * Verifies a ListParticipantsRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateContextRequest.verify = function verify(message) { + ListParticipantsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.context != null && message.hasOwnProperty("context")) { - var error = $root.google.cloud.dialogflow.v2.Context.verify(message.context); - if (error) - return "context." + error; - } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a CreateContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListParticipantsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.CreateContextRequest} CreateContextRequest + * @returns {google.cloud.dialogflow.v2.ListParticipantsRequest} ListParticipantsRequest */ - CreateContextRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.CreateContextRequest) + ListParticipantsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListParticipantsRequest) return object; - var message = new $root.google.cloud.dialogflow.v2.CreateContextRequest(); + var message = new $root.google.cloud.dialogflow.v2.ListParticipantsRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.context != null) { - if (typeof object.context !== "object") - throw TypeError(".google.cloud.dialogflow.v2.CreateContextRequest.context: object expected"); - message.context = $root.google.cloud.dialogflow.v2.Context.fromObject(object.context); - } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a CreateContextRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListParticipantsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsRequest * @static - * @param {google.cloud.dialogflow.v2.CreateContextRequest} message CreateContextRequest + * @param {google.cloud.dialogflow.v2.ListParticipantsRequest} message ListParticipantsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateContextRequest.toObject = function toObject(message, options) { + ListParticipantsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.context = null; + object.pageSize = 0; + object.pageToken = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.context != null && message.hasOwnProperty("context")) - object.context = $root.google.cloud.dialogflow.v2.Context.toObject(message.context, options); + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this CreateContextRequest to JSON. + * Converts this ListParticipantsRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsRequest * @instance * @returns {Object.} JSON object */ - CreateContextRequest.prototype.toJSON = function toJSON() { + ListParticipantsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateContextRequest; + return ListParticipantsRequest; })(); - v2.UpdateContextRequest = (function() { + v2.ListParticipantsResponse = (function() { /** - * Properties of an UpdateContextRequest. + * Properties of a ListParticipantsResponse. * @memberof google.cloud.dialogflow.v2 - * @interface IUpdateContextRequest - * @property {google.cloud.dialogflow.v2.IContext|null} [context] UpdateContextRequest context - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateContextRequest updateMask + * @interface IListParticipantsResponse + * @property {Array.|null} [participants] ListParticipantsResponse participants + * @property {string|null} [nextPageToken] ListParticipantsResponse nextPageToken */ /** - * Constructs a new UpdateContextRequest. + * Constructs a new ListParticipantsResponse. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an UpdateContextRequest. - * @implements IUpdateContextRequest + * @classdesc Represents a ListParticipantsResponse. + * @implements IListParticipantsResponse * @constructor - * @param {google.cloud.dialogflow.v2.IUpdateContextRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListParticipantsResponse=} [properties] Properties to set */ - function UpdateContextRequest(properties) { + function ListParticipantsResponse(properties) { + this.participants = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7075,88 +7491,91 @@ } /** - * UpdateContextRequest context. - * @member {google.cloud.dialogflow.v2.IContext|null|undefined} context - * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * ListParticipantsResponse participants. + * @member {Array.} participants + * @memberof google.cloud.dialogflow.v2.ListParticipantsResponse * @instance */ - UpdateContextRequest.prototype.context = null; + ListParticipantsResponse.prototype.participants = $util.emptyArray; /** - * UpdateContextRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * ListParticipantsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2.ListParticipantsResponse * @instance */ - UpdateContextRequest.prototype.updateMask = null; + ListParticipantsResponse.prototype.nextPageToken = ""; /** - * Creates a new UpdateContextRequest instance using the specified properties. + * Creates a new ListParticipantsResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsResponse * @static - * @param {google.cloud.dialogflow.v2.IUpdateContextRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.UpdateContextRequest} UpdateContextRequest instance + * @param {google.cloud.dialogflow.v2.IListParticipantsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListParticipantsResponse} ListParticipantsResponse instance */ - UpdateContextRequest.create = function create(properties) { - return new UpdateContextRequest(properties); + ListParticipantsResponse.create = function create(properties) { + return new ListParticipantsResponse(properties); }; /** - * Encodes the specified UpdateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateContextRequest.verify|verify} messages. + * Encodes the specified ListParticipantsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListParticipantsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsResponse * @static - * @param {google.cloud.dialogflow.v2.IUpdateContextRequest} message UpdateContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListParticipantsResponse} message ListParticipantsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateContextRequest.encode = function encode(message, writer) { + ListParticipantsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.context != null && Object.hasOwnProperty.call(message, "context")) - $root.google.cloud.dialogflow.v2.Context.encode(message.context, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.participants != null && message.participants.length) + for (var i = 0; i < message.participants.length; ++i) + $root.google.cloud.dialogflow.v2.Participant.encode(message.participants[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified UpdateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateContextRequest.verify|verify} messages. + * Encodes the specified ListParticipantsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListParticipantsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsResponse * @static - * @param {google.cloud.dialogflow.v2.IUpdateContextRequest} message UpdateContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListParticipantsResponse} message ListParticipantsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListParticipantsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateContextRequest message from the specified reader or buffer. + * Decodes a ListParticipantsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.UpdateContextRequest} UpdateContextRequest + * @returns {google.cloud.dialogflow.v2.ListParticipantsResponse} ListParticipantsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateContextRequest.decode = function decode(reader, length) { + ListParticipantsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateContextRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListParticipantsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.context = $root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32()); + if (!(message.participants && message.participants.length)) + message.participants = []; + message.participants.push($root.google.cloud.dialogflow.v2.Participant.decode(reader, reader.uint32())); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -7167,126 +7586,134 @@ }; /** - * Decodes an UpdateContextRequest message from the specified reader or buffer, length delimited. + * Decodes a ListParticipantsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.UpdateContextRequest} UpdateContextRequest + * @returns {google.cloud.dialogflow.v2.ListParticipantsResponse} ListParticipantsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateContextRequest.decodeDelimited = function decodeDelimited(reader) { + ListParticipantsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateContextRequest message. + * Verifies a ListParticipantsResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateContextRequest.verify = function verify(message) { + ListParticipantsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.context != null && message.hasOwnProperty("context")) { - var error = $root.google.cloud.dialogflow.v2.Context.verify(message.context); - if (error) - return "context." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.participants != null && message.hasOwnProperty("participants")) { + if (!Array.isArray(message.participants)) + return "participants: array expected"; + for (var i = 0; i < message.participants.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Participant.verify(message.participants[i]); + if (error) + return "participants." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an UpdateContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListParticipantsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.UpdateContextRequest} UpdateContextRequest + * @returns {google.cloud.dialogflow.v2.ListParticipantsResponse} ListParticipantsResponse */ - UpdateContextRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.UpdateContextRequest) + ListParticipantsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListParticipantsResponse) return object; - var message = new $root.google.cloud.dialogflow.v2.UpdateContextRequest(); - if (object.context != null) { - if (typeof object.context !== "object") - throw TypeError(".google.cloud.dialogflow.v2.UpdateContextRequest.context: object expected"); - message.context = $root.google.cloud.dialogflow.v2.Context.fromObject(object.context); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2.UpdateContextRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.dialogflow.v2.ListParticipantsResponse(); + if (object.participants) { + if (!Array.isArray(object.participants)) + throw TypeError(".google.cloud.dialogflow.v2.ListParticipantsResponse.participants: array expected"); + message.participants = []; + for (var i = 0; i < object.participants.length; ++i) { + if (typeof object.participants[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListParticipantsResponse.participants: object expected"); + message.participants[i] = $root.google.cloud.dialogflow.v2.Participant.fromObject(object.participants[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an UpdateContextRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListParticipantsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsResponse * @static - * @param {google.cloud.dialogflow.v2.UpdateContextRequest} message UpdateContextRequest + * @param {google.cloud.dialogflow.v2.ListParticipantsResponse} message ListParticipantsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateContextRequest.toObject = function toObject(message, options) { + ListParticipantsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.context = null; - object.updateMask = null; + if (options.arrays || options.defaults) + object.participants = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.participants && message.participants.length) { + object.participants = []; + for (var j = 0; j < message.participants.length; ++j) + object.participants[j] = $root.google.cloud.dialogflow.v2.Participant.toObject(message.participants[j], options); } - if (message.context != null && message.hasOwnProperty("context")) - object.context = $root.google.cloud.dialogflow.v2.Context.toObject(message.context, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this UpdateContextRequest to JSON. + * Converts this ListParticipantsResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.ListParticipantsResponse * @instance * @returns {Object.} JSON object */ - UpdateContextRequest.prototype.toJSON = function toJSON() { + ListParticipantsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateContextRequest; + return ListParticipantsResponse; })(); - v2.DeleteContextRequest = (function() { + v2.UpdateParticipantRequest = (function() { /** - * Properties of a DeleteContextRequest. + * Properties of an UpdateParticipantRequest. * @memberof google.cloud.dialogflow.v2 - * @interface IDeleteContextRequest - * @property {string|null} [name] DeleteContextRequest name + * @interface IUpdateParticipantRequest + * @property {google.cloud.dialogflow.v2.IParticipant|null} [participant] UpdateParticipantRequest participant + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateParticipantRequest updateMask */ /** - * Constructs a new DeleteContextRequest. + * Constructs a new UpdateParticipantRequest. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a DeleteContextRequest. - * @implements IDeleteContextRequest + * @classdesc Represents an UpdateParticipantRequest. + * @implements IUpdateParticipantRequest * @constructor - * @param {google.cloud.dialogflow.v2.IDeleteContextRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IUpdateParticipantRequest=} [properties] Properties to set */ - function DeleteContextRequest(properties) { + function UpdateParticipantRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7294,75 +7721,88 @@ } /** - * DeleteContextRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * UpdateParticipantRequest participant. + * @member {google.cloud.dialogflow.v2.IParticipant|null|undefined} participant + * @memberof google.cloud.dialogflow.v2.UpdateParticipantRequest * @instance */ - DeleteContextRequest.prototype.name = ""; + UpdateParticipantRequest.prototype.participant = null; /** - * Creates a new DeleteContextRequest instance using the specified properties. + * UpdateParticipantRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2.UpdateParticipantRequest + * @instance + */ + UpdateParticipantRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateParticipantRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.UpdateParticipantRequest * @static - * @param {google.cloud.dialogflow.v2.IDeleteContextRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.DeleteContextRequest} DeleteContextRequest instance + * @param {google.cloud.dialogflow.v2.IUpdateParticipantRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.UpdateParticipantRequest} UpdateParticipantRequest instance */ - DeleteContextRequest.create = function create(properties) { - return new DeleteContextRequest(properties); + UpdateParticipantRequest.create = function create(properties) { + return new UpdateParticipantRequest(properties); }; /** - * Encodes the specified DeleteContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteContextRequest.verify|verify} messages. + * Encodes the specified UpdateParticipantRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateParticipantRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.UpdateParticipantRequest * @static - * @param {google.cloud.dialogflow.v2.IDeleteContextRequest} message DeleteContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IUpdateParticipantRequest} message UpdateParticipantRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteContextRequest.encode = function encode(message, writer) { + UpdateParticipantRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + $root.google.cloud.dialogflow.v2.Participant.encode(message.participant, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteContextRequest.verify|verify} messages. + * Encodes the specified UpdateParticipantRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateParticipantRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.UpdateParticipantRequest * @static - * @param {google.cloud.dialogflow.v2.IDeleteContextRequest} message DeleteContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IUpdateParticipantRequest} message UpdateParticipantRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateParticipantRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteContextRequest message from the specified reader or buffer. + * Decodes an UpdateParticipantRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.UpdateParticipantRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.DeleteContextRequest} DeleteContextRequest + * @returns {google.cloud.dialogflow.v2.UpdateParticipantRequest} UpdateParticipantRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteContextRequest.decode = function decode(reader, length) { + UpdateParticipantRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteContextRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateParticipantRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.participant = $root.google.cloud.dialogflow.v2.Participant.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -7373,107 +7813,132 @@ }; /** - * Decodes a DeleteContextRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateParticipantRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.UpdateParticipantRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.DeleteContextRequest} DeleteContextRequest + * @returns {google.cloud.dialogflow.v2.UpdateParticipantRequest} UpdateParticipantRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteContextRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateParticipantRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteContextRequest message. + * Verifies an UpdateParticipantRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.UpdateParticipantRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteContextRequest.verify = function verify(message) { + UpdateParticipantRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.participant != null && message.hasOwnProperty("participant")) { + var error = $root.google.cloud.dialogflow.v2.Participant.verify(message.participant); + if (error) + return "participant." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a DeleteContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateParticipantRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.UpdateParticipantRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.DeleteContextRequest} DeleteContextRequest + * @returns {google.cloud.dialogflow.v2.UpdateParticipantRequest} UpdateParticipantRequest */ - DeleteContextRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.DeleteContextRequest) + UpdateParticipantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.UpdateParticipantRequest) return object; - var message = new $root.google.cloud.dialogflow.v2.DeleteContextRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.dialogflow.v2.UpdateParticipantRequest(); + if (object.participant != null) { + if (typeof object.participant !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateParticipantRequest.participant: object expected"); + message.participant = $root.google.cloud.dialogflow.v2.Participant.fromObject(object.participant); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateParticipantRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a DeleteContextRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateParticipantRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.UpdateParticipantRequest * @static - * @param {google.cloud.dialogflow.v2.DeleteContextRequest} message DeleteContextRequest + * @param {google.cloud.dialogflow.v2.UpdateParticipantRequest} message UpdateParticipantRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteContextRequest.toObject = function toObject(message, options) { + UpdateParticipantRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.participant = null; + object.updateMask = null; + } + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = $root.google.cloud.dialogflow.v2.Participant.toObject(message.participant, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this DeleteContextRequest to JSON. + * Converts this UpdateParticipantRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.UpdateParticipantRequest * @instance * @returns {Object.} JSON object */ - DeleteContextRequest.prototype.toJSON = function toJSON() { + UpdateParticipantRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteContextRequest; + return UpdateParticipantRequest; })(); - v2.DeleteAllContextsRequest = (function() { + v2.AnalyzeContentRequest = (function() { /** - * Properties of a DeleteAllContextsRequest. + * Properties of an AnalyzeContentRequest. * @memberof google.cloud.dialogflow.v2 - * @interface IDeleteAllContextsRequest - * @property {string|null} [parent] DeleteAllContextsRequest parent + * @interface IAnalyzeContentRequest + * @property {string|null} [participant] AnalyzeContentRequest participant + * @property {google.cloud.dialogflow.v2.ITextInput|null} [textInput] AnalyzeContentRequest textInput + * @property {google.cloud.dialogflow.v2.IAudioInput|null} [audioInput] AnalyzeContentRequest audioInput + * @property {google.cloud.dialogflow.v2.IEventInput|null} [eventInput] AnalyzeContentRequest eventInput + * @property {google.cloud.dialogflow.v2.IOutputAudioConfig|null} [replyAudioConfig] AnalyzeContentRequest replyAudioConfig + * @property {google.cloud.dialogflow.v2.IQueryParameters|null} [queryParams] AnalyzeContentRequest queryParams + * @property {string|null} [requestId] AnalyzeContentRequest requestId */ /** - * Constructs a new DeleteAllContextsRequest. + * Constructs a new AnalyzeContentRequest. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a DeleteAllContextsRequest. - * @implements IDeleteAllContextsRequest + * @classdesc Represents an AnalyzeContentRequest. + * @implements IAnalyzeContentRequest * @constructor - * @param {google.cloud.dialogflow.v2.IDeleteAllContextsRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IAnalyzeContentRequest=} [properties] Properties to set */ - function DeleteAllContextsRequest(properties) { + function AnalyzeContentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -7481,75 +7946,167 @@ } /** - * DeleteAllContextsRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * AnalyzeContentRequest participant. + * @member {string} participant + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest * @instance */ - DeleteAllContextsRequest.prototype.parent = ""; + AnalyzeContentRequest.prototype.participant = ""; /** - * Creates a new DeleteAllContextsRequest instance using the specified properties. + * AnalyzeContentRequest textInput. + * @member {google.cloud.dialogflow.v2.ITextInput|null|undefined} textInput + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.textInput = null; + + /** + * AnalyzeContentRequest audioInput. + * @member {google.cloud.dialogflow.v2.IAudioInput|null|undefined} audioInput + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.audioInput = null; + + /** + * AnalyzeContentRequest eventInput. + * @member {google.cloud.dialogflow.v2.IEventInput|null|undefined} eventInput + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.eventInput = null; + + /** + * AnalyzeContentRequest replyAudioConfig. + * @member {google.cloud.dialogflow.v2.IOutputAudioConfig|null|undefined} replyAudioConfig + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.replyAudioConfig = null; + + /** + * AnalyzeContentRequest queryParams. + * @member {google.cloud.dialogflow.v2.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.queryParams = null; + + /** + * AnalyzeContentRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.requestId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnalyzeContentRequest input. + * @member {"textInput"|"audioInput"|"eventInput"|undefined} input + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest + * @instance + */ + Object.defineProperty(AnalyzeContentRequest.prototype, "input", { + get: $util.oneOfGetter($oneOfFields = ["textInput", "audioInput", "eventInput"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnalyzeContentRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest * @static - * @param {google.cloud.dialogflow.v2.IDeleteAllContextsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.DeleteAllContextsRequest} DeleteAllContextsRequest instance + * @param {google.cloud.dialogflow.v2.IAnalyzeContentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.AnalyzeContentRequest} AnalyzeContentRequest instance */ - DeleteAllContextsRequest.create = function create(properties) { - return new DeleteAllContextsRequest(properties); + AnalyzeContentRequest.create = function create(properties) { + return new AnalyzeContentRequest(properties); }; /** - * Encodes the specified DeleteAllContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteAllContextsRequest.verify|verify} messages. + * Encodes the specified AnalyzeContentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.AnalyzeContentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest * @static - * @param {google.cloud.dialogflow.v2.IDeleteAllContextsRequest} message DeleteAllContextsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAnalyzeContentRequest} message AnalyzeContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteAllContextsRequest.encode = function encode(message, writer) { + AnalyzeContentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.participant); + if (message.replyAudioConfig != null && Object.hasOwnProperty.call(message, "replyAudioConfig")) + $root.google.cloud.dialogflow.v2.OutputAudioConfig.encode(message.replyAudioConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.textInput != null && Object.hasOwnProperty.call(message, "textInput")) + $root.google.cloud.dialogflow.v2.TextInput.encode(message.textInput, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.audioInput != null && Object.hasOwnProperty.call(message, "audioInput")) + $root.google.cloud.dialogflow.v2.AudioInput.encode(message.audioInput, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.eventInput != null && Object.hasOwnProperty.call(message, "eventInput")) + $root.google.cloud.dialogflow.v2.EventInput.encode(message.eventInput, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.v2.QueryParameters.encode(message.queryParams, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.requestId); return writer; }; /** - * Encodes the specified DeleteAllContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteAllContextsRequest.verify|verify} messages. + * Encodes the specified AnalyzeContentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AnalyzeContentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest * @static - * @param {google.cloud.dialogflow.v2.IDeleteAllContextsRequest} message DeleteAllContextsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAnalyzeContentRequest} message AnalyzeContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteAllContextsRequest.encodeDelimited = function encodeDelimited(message, writer) { + AnalyzeContentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteAllContextsRequest message from the specified reader or buffer. + * Decodes an AnalyzeContentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.DeleteAllContextsRequest} DeleteAllContextsRequest + * @returns {google.cloud.dialogflow.v2.AnalyzeContentRequest} AnalyzeContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteAllContextsRequest.decode = function decode(reader, length) { + AnalyzeContentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteAllContextsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.AnalyzeContentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.participant = reader.string(); + break; + case 6: + message.textInput = $root.google.cloud.dialogflow.v2.TextInput.decode(reader, reader.uint32()); + break; + case 7: + message.audioInput = $root.google.cloud.dialogflow.v2.AudioInput.decode(reader, reader.uint32()); + break; + case 8: + message.eventInput = $root.google.cloud.dialogflow.v2.EventInput.decode(reader, reader.uint32()); + break; + case 5: + message.replyAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.decode(reader, reader.uint32()); + break; + case 9: + message.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.decode(reader, reader.uint32()); + break; + case 11: + message.requestId = reader.string(); break; default: reader.skipType(tag & 7); @@ -7560,478 +8117,779 @@ }; /** - * Decodes a DeleteAllContextsRequest message from the specified reader or buffer, length delimited. + * Decodes an AnalyzeContentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.DeleteAllContextsRequest} DeleteAllContextsRequest + * @returns {google.cloud.dialogflow.v2.AnalyzeContentRequest} AnalyzeContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteAllContextsRequest.decodeDelimited = function decodeDelimited(reader) { + AnalyzeContentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteAllContextsRequest message. + * Verifies an AnalyzeContentRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteAllContextsRequest.verify = function verify(message) { + AnalyzeContentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; + var properties = {}; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + if (message.textInput != null && message.hasOwnProperty("textInput")) { + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2.TextInput.verify(message.textInput); + if (error) + return "textInput." + error; + } + } + if (message.audioInput != null && message.hasOwnProperty("audioInput")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2.AudioInput.verify(message.audioInput); + if (error) + return "audioInput." + error; + } + } + if (message.eventInput != null && message.hasOwnProperty("eventInput")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2.EventInput.verify(message.eventInput); + if (error) + return "eventInput." + error; + } + } + if (message.replyAudioConfig != null && message.hasOwnProperty("replyAudioConfig")) { + var error = $root.google.cloud.dialogflow.v2.OutputAudioConfig.verify(message.replyAudioConfig); + if (error) + return "replyAudioConfig." + error; + } + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.v2.QueryParameters.verify(message.queryParams); + if (error) + return "queryParams." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; return null; }; /** - * Creates a DeleteAllContextsRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AnalyzeContentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.DeleteAllContextsRequest} DeleteAllContextsRequest + * @returns {google.cloud.dialogflow.v2.AnalyzeContentRequest} AnalyzeContentRequest */ - DeleteAllContextsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.DeleteAllContextsRequest) + AnalyzeContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.AnalyzeContentRequest) return object; - var message = new $root.google.cloud.dialogflow.v2.DeleteAllContextsRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.dialogflow.v2.AnalyzeContentRequest(); + if (object.participant != null) + message.participant = String(object.participant); + if (object.textInput != null) { + if (typeof object.textInput !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentRequest.textInput: object expected"); + message.textInput = $root.google.cloud.dialogflow.v2.TextInput.fromObject(object.textInput); + } + if (object.audioInput != null) { + if (typeof object.audioInput !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentRequest.audioInput: object expected"); + message.audioInput = $root.google.cloud.dialogflow.v2.AudioInput.fromObject(object.audioInput); + } + if (object.eventInput != null) { + if (typeof object.eventInput !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentRequest.eventInput: object expected"); + message.eventInput = $root.google.cloud.dialogflow.v2.EventInput.fromObject(object.eventInput); + } + if (object.replyAudioConfig != null) { + if (typeof object.replyAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentRequest.replyAudioConfig: object expected"); + message.replyAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.fromObject(object.replyAudioConfig); + } + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.fromObject(object.queryParams); + } + if (object.requestId != null) + message.requestId = String(object.requestId); return message; }; /** - * Creates a plain object from a DeleteAllContextsRequest message. Also converts values to other types if specified. + * Creates a plain object from an AnalyzeContentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest * @static - * @param {google.cloud.dialogflow.v2.DeleteAllContextsRequest} message DeleteAllContextsRequest + * @param {google.cloud.dialogflow.v2.AnalyzeContentRequest} message AnalyzeContentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteAllContextsRequest.toObject = function toObject(message, options) { + AnalyzeContentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (options.defaults) { + object.participant = ""; + object.replyAudioConfig = null; + object.queryParams = null; + object.requestId = ""; + } + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + if (message.replyAudioConfig != null && message.hasOwnProperty("replyAudioConfig")) + object.replyAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.toObject(message.replyAudioConfig, options); + if (message.textInput != null && message.hasOwnProperty("textInput")) { + object.textInput = $root.google.cloud.dialogflow.v2.TextInput.toObject(message.textInput, options); + if (options.oneofs) + object.input = "textInput"; + } + if (message.audioInput != null && message.hasOwnProperty("audioInput")) { + object.audioInput = $root.google.cloud.dialogflow.v2.AudioInput.toObject(message.audioInput, options); + if (options.oneofs) + object.input = "audioInput"; + } + if (message.eventInput != null && message.hasOwnProperty("eventInput")) { + object.eventInput = $root.google.cloud.dialogflow.v2.EventInput.toObject(message.eventInput, options); + if (options.oneofs) + object.input = "eventInput"; + } + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.toObject(message.queryParams, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; return object; }; /** - * Converts this DeleteAllContextsRequest to JSON. + * Converts this AnalyzeContentRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.AnalyzeContentRequest * @instance * @returns {Object.} JSON object */ - DeleteAllContextsRequest.prototype.toJSON = function toJSON() { + AnalyzeContentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteAllContextsRequest; + return AnalyzeContentRequest; })(); - v2.EntityTypes = (function() { + v2.DtmfParameters = (function() { /** - * Constructs a new EntityTypes service. + * Properties of a DtmfParameters. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an EntityTypes - * @extends $protobuf.rpc.Service + * @interface IDtmfParameters + * @property {boolean|null} [acceptsDtmfInput] DtmfParameters acceptsDtmfInput + */ + + /** + * Constructs a new DtmfParameters. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a DtmfParameters. + * @implements IDtmfParameters * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @param {google.cloud.dialogflow.v2.IDtmfParameters=} [properties] Properties to set */ - function EntityTypes(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + function DtmfParameters(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - (EntityTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EntityTypes; + /** + * DtmfParameters acceptsDtmfInput. + * @member {boolean} acceptsDtmfInput + * @memberof google.cloud.dialogflow.v2.DtmfParameters + * @instance + */ + DtmfParameters.prototype.acceptsDtmfInput = false; /** - * Creates new EntityTypes service using the specified rpc implementation. + * Creates a new DtmfParameters instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.EntityTypes + * @memberof google.cloud.dialogflow.v2.DtmfParameters * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {EntityTypes} RPC service. Useful where requests and/or responses are streamed. + * @param {google.cloud.dialogflow.v2.IDtmfParameters=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.DtmfParameters} DtmfParameters instance */ - EntityTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); + DtmfParameters.create = function create(properties) { + return new DtmfParameters(properties); }; /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#listEntityTypes}. - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @typedef ListEntityTypesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.ListEntityTypesResponse} [response] ListEntityTypesResponse + * Encodes the specified DtmfParameters message. Does not implicitly {@link google.cloud.dialogflow.v2.DtmfParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.DtmfParameters + * @static + * @param {google.cloud.dialogflow.v2.IDtmfParameters} message DtmfParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + DtmfParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.acceptsDtmfInput != null && Object.hasOwnProperty.call(message, "acceptsDtmfInput")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.acceptsDtmfInput); + return writer; + }; /** - * Calls ListEntityTypes. - * @function listEntityTypes - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IListEntityTypesRequest} request ListEntityTypesRequest message or plain object - * @param {google.cloud.dialogflow.v2.EntityTypes.ListEntityTypesCallback} callback Node-style callback called with the error, if any, and ListEntityTypesResponse - * @returns {undefined} - * @variation 1 + * Encodes the specified DtmfParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DtmfParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.DtmfParameters + * @static + * @param {google.cloud.dialogflow.v2.IDtmfParameters} message DtmfParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(EntityTypes.prototype.listEntityTypes = function listEntityTypes(request, callback) { - return this.rpcCall(listEntityTypes, $root.google.cloud.dialogflow.v2.ListEntityTypesRequest, $root.google.cloud.dialogflow.v2.ListEntityTypesResponse, request, callback); - }, "name", { value: "ListEntityTypes" }); + DtmfParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Calls ListEntityTypes. - * @function listEntityTypes - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IListEntityTypesRequest} request ListEntityTypesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Decodes a DtmfParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.DtmfParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.DtmfParameters} DtmfParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + DtmfParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DtmfParameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acceptsDtmfInput = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#getEntityType}. - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @typedef GetEntityTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.EntityType} [response] EntityType - */ - - /** - * Calls GetEntityType. - * @function getEntityType - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IGetEntityTypeRequest} request GetEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2.EntityTypes.GetEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType - * @returns {undefined} - * @variation 1 + * Decodes a DtmfParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.DtmfParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.DtmfParameters} DtmfParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(EntityTypes.prototype.getEntityType = function getEntityType(request, callback) { - return this.rpcCall(getEntityType, $root.google.cloud.dialogflow.v2.GetEntityTypeRequest, $root.google.cloud.dialogflow.v2.EntityType, request, callback); - }, "name", { value: "GetEntityType" }); + DtmfParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls GetEntityType. - * @function getEntityType - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IGetEntityTypeRequest} request GetEntityTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a DtmfParameters message. + * @function verify + * @memberof google.cloud.dialogflow.v2.DtmfParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + DtmfParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.acceptsDtmfInput != null && message.hasOwnProperty("acceptsDtmfInput")) + if (typeof message.acceptsDtmfInput !== "boolean") + return "acceptsDtmfInput: boolean expected"; + return null; + }; /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#createEntityType}. - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @typedef CreateEntityTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.EntityType} [response] EntityType + * Creates a DtmfParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.DtmfParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.DtmfParameters} DtmfParameters */ + DtmfParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.DtmfParameters) + return object; + var message = new $root.google.cloud.dialogflow.v2.DtmfParameters(); + if (object.acceptsDtmfInput != null) + message.acceptsDtmfInput = Boolean(object.acceptsDtmfInput); + return message; + }; /** - * Calls CreateEntityType. - * @function createEntityType - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.ICreateEntityTypeRequest} request CreateEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2.EntityTypes.CreateEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType - * @returns {undefined} - * @variation 1 + * Creates a plain object from a DtmfParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.DtmfParameters + * @static + * @param {google.cloud.dialogflow.v2.DtmfParameters} message DtmfParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(EntityTypes.prototype.createEntityType = function createEntityType(request, callback) { - return this.rpcCall(createEntityType, $root.google.cloud.dialogflow.v2.CreateEntityTypeRequest, $root.google.cloud.dialogflow.v2.EntityType, request, callback); - }, "name", { value: "CreateEntityType" }); + DtmfParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.acceptsDtmfInput = false; + if (message.acceptsDtmfInput != null && message.hasOwnProperty("acceptsDtmfInput")) + object.acceptsDtmfInput = message.acceptsDtmfInput; + return object; + }; /** - * Calls CreateEntityType. - * @function createEntityType - * @memberof google.cloud.dialogflow.v2.EntityTypes + * Converts this DtmfParameters to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.DtmfParameters * @instance - * @param {google.cloud.dialogflow.v2.ICreateEntityTypeRequest} request CreateEntityTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + DtmfParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#updateEntityType}. - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @typedef UpdateEntityTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.EntityType} [response] EntityType - */ + return DtmfParameters; + })(); - /** - * Calls UpdateEntityType. - * @function updateEntityType - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IUpdateEntityTypeRequest} request UpdateEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2.EntityTypes.UpdateEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EntityTypes.prototype.updateEntityType = function updateEntityType(request, callback) { - return this.rpcCall(updateEntityType, $root.google.cloud.dialogflow.v2.UpdateEntityTypeRequest, $root.google.cloud.dialogflow.v2.EntityType, request, callback); - }, "name", { value: "UpdateEntityType" }); + v2.AnalyzeContentResponse = (function() { /** - * Calls UpdateEntityType. - * @function updateEntityType - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IUpdateEntityTypeRequest} request UpdateEntityTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Properties of an AnalyzeContentResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IAnalyzeContentResponse + * @property {string|null} [replyText] AnalyzeContentResponse replyText + * @property {google.cloud.dialogflow.v2.IOutputAudio|null} [replyAudio] AnalyzeContentResponse replyAudio + * @property {google.cloud.dialogflow.v2.IAutomatedAgentReply|null} [automatedAgentReply] AnalyzeContentResponse automatedAgentReply + * @property {google.cloud.dialogflow.v2.IMessage|null} [message] AnalyzeContentResponse message + * @property {Array.|null} [humanAgentSuggestionResults] AnalyzeContentResponse humanAgentSuggestionResults + * @property {Array.|null} [endUserSuggestionResults] AnalyzeContentResponse endUserSuggestionResults + * @property {google.cloud.dialogflow.v2.IDtmfParameters|null} [dtmfParameters] AnalyzeContentResponse dtmfParameters */ /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#deleteEntityType}. - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @typedef DeleteEntityTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Constructs a new AnalyzeContentResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an AnalyzeContentResponse. + * @implements IAnalyzeContentResponse + * @constructor + * @param {google.cloud.dialogflow.v2.IAnalyzeContentResponse=} [properties] Properties to set */ + function AnalyzeContentResponse(properties) { + this.humanAgentSuggestionResults = []; + this.endUserSuggestionResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls DeleteEntityType. - * @function deleteEntityType - * @memberof google.cloud.dialogflow.v2.EntityTypes + * AnalyzeContentResponse replyText. + * @member {string} replyText + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse * @instance - * @param {google.cloud.dialogflow.v2.IDeleteEntityTypeRequest} request DeleteEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2.EntityTypes.DeleteEntityTypeCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(EntityTypes.prototype.deleteEntityType = function deleteEntityType(request, callback) { - return this.rpcCall(deleteEntityType, $root.google.cloud.dialogflow.v2.DeleteEntityTypeRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteEntityType" }); + AnalyzeContentResponse.prototype.replyText = ""; /** - * Calls DeleteEntityType. - * @function deleteEntityType - * @memberof google.cloud.dialogflow.v2.EntityTypes + * AnalyzeContentResponse replyAudio. + * @member {google.cloud.dialogflow.v2.IOutputAudio|null|undefined} replyAudio + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse * @instance - * @param {google.cloud.dialogflow.v2.IDeleteEntityTypeRequest} request DeleteEntityTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchUpdateEntityTypes}. - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @typedef BatchUpdateEntityTypesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation */ + AnalyzeContentResponse.prototype.replyAudio = null; /** - * Calls BatchUpdateEntityTypes. - * @function batchUpdateEntityTypes - * @memberof google.cloud.dialogflow.v2.EntityTypes + * AnalyzeContentResponse automatedAgentReply. + * @member {google.cloud.dialogflow.v2.IAutomatedAgentReply|null|undefined} automatedAgentReply + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse * @instance - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest} request BatchUpdateEntityTypesRequest message or plain object - * @param {google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(EntityTypes.prototype.batchUpdateEntityTypes = function batchUpdateEntityTypes(request, callback) { - return this.rpcCall(batchUpdateEntityTypes, $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchUpdateEntityTypes" }); + AnalyzeContentResponse.prototype.automatedAgentReply = null; /** - * Calls BatchUpdateEntityTypes. - * @function batchUpdateEntityTypes - * @memberof google.cloud.dialogflow.v2.EntityTypes + * AnalyzeContentResponse message. + * @member {google.cloud.dialogflow.v2.IMessage|null|undefined} message + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse * @instance - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest} request BatchUpdateEntityTypesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AnalyzeContentResponse.prototype.message = null; /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchDeleteEntityTypes}. - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @typedef BatchDeleteEntityTypesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * AnalyzeContentResponse humanAgentSuggestionResults. + * @member {Array.} humanAgentSuggestionResults + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse + * @instance */ + AnalyzeContentResponse.prototype.humanAgentSuggestionResults = $util.emptyArray; /** - * Calls BatchDeleteEntityTypes. - * @function batchDeleteEntityTypes - * @memberof google.cloud.dialogflow.v2.EntityTypes + * AnalyzeContentResponse endUserSuggestionResults. + * @member {Array.} endUserSuggestionResults + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse * @instance - * @param {google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest} request BatchDeleteEntityTypesRequest message or plain object - * @param {google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntityTypesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(EntityTypes.prototype.batchDeleteEntityTypes = function batchDeleteEntityTypes(request, callback) { - return this.rpcCall(batchDeleteEntityTypes, $root.google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchDeleteEntityTypes" }); + AnalyzeContentResponse.prototype.endUserSuggestionResults = $util.emptyArray; /** - * Calls BatchDeleteEntityTypes. - * @function batchDeleteEntityTypes - * @memberof google.cloud.dialogflow.v2.EntityTypes + * AnalyzeContentResponse dtmfParameters. + * @member {google.cloud.dialogflow.v2.IDtmfParameters|null|undefined} dtmfParameters + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse * @instance - * @param {google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest} request BatchDeleteEntityTypesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + AnalyzeContentResponse.prototype.dtmfParameters = null; /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchCreateEntities}. - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @typedef BatchCreateEntitiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a new AnalyzeContentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse + * @static + * @param {google.cloud.dialogflow.v2.IAnalyzeContentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.AnalyzeContentResponse} AnalyzeContentResponse instance */ + AnalyzeContentResponse.create = function create(properties) { + return new AnalyzeContentResponse(properties); + }; /** - * Calls BatchCreateEntities. - * @function batchCreateEntities - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest} request BatchCreateEntitiesRequest message or plain object - * @param {google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntitiesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified AnalyzeContentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.AnalyzeContentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse + * @static + * @param {google.cloud.dialogflow.v2.IAnalyzeContentResponse} message AnalyzeContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(EntityTypes.prototype.batchCreateEntities = function batchCreateEntities(request, callback) { - return this.rpcCall(batchCreateEntities, $root.google.cloud.dialogflow.v2.BatchCreateEntitiesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchCreateEntities" }); + AnalyzeContentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replyText != null && Object.hasOwnProperty.call(message, "replyText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.replyText); + if (message.replyAudio != null && Object.hasOwnProperty.call(message, "replyAudio")) + $root.google.cloud.dialogflow.v2.OutputAudio.encode(message.replyAudio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.automatedAgentReply != null && Object.hasOwnProperty.call(message, "automatedAgentReply")) + $root.google.cloud.dialogflow.v2.AutomatedAgentReply.encode(message.automatedAgentReply, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.cloud.dialogflow.v2.Message.encode(message.message, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.humanAgentSuggestionResults != null && message.humanAgentSuggestionResults.length) + for (var i = 0; i < message.humanAgentSuggestionResults.length; ++i) + $root.google.cloud.dialogflow.v2.SuggestionResult.encode(message.humanAgentSuggestionResults[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endUserSuggestionResults != null && message.endUserSuggestionResults.length) + for (var i = 0; i < message.endUserSuggestionResults.length; ++i) + $root.google.cloud.dialogflow.v2.SuggestionResult.encode(message.endUserSuggestionResults[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.dtmfParameters != null && Object.hasOwnProperty.call(message, "dtmfParameters")) + $root.google.cloud.dialogflow.v2.DtmfParameters.encode(message.dtmfParameters, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; /** - * Calls BatchCreateEntities. - * @function batchCreateEntities - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest} request BatchCreateEntitiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified AnalyzeContentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AnalyzeContentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse + * @static + * @param {google.cloud.dialogflow.v2.IAnalyzeContentResponse} message AnalyzeContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + AnalyzeContentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchUpdateEntities}. - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @typedef BatchUpdateEntitiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Decodes an AnalyzeContentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.AnalyzeContentResponse} AnalyzeContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + AnalyzeContentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.AnalyzeContentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.replyText = reader.string(); + break; + case 2: + message.replyAudio = $root.google.cloud.dialogflow.v2.OutputAudio.decode(reader, reader.uint32()); + break; + case 3: + message.automatedAgentReply = $root.google.cloud.dialogflow.v2.AutomatedAgentReply.decode(reader, reader.uint32()); + break; + case 5: + message.message = $root.google.cloud.dialogflow.v2.Message.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.humanAgentSuggestionResults && message.humanAgentSuggestionResults.length)) + message.humanAgentSuggestionResults = []; + message.humanAgentSuggestionResults.push($root.google.cloud.dialogflow.v2.SuggestionResult.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.endUserSuggestionResults && message.endUserSuggestionResults.length)) + message.endUserSuggestionResults = []; + message.endUserSuggestionResults.push($root.google.cloud.dialogflow.v2.SuggestionResult.decode(reader, reader.uint32())); + break; + case 9: + message.dtmfParameters = $root.google.cloud.dialogflow.v2.DtmfParameters.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls BatchUpdateEntities. - * @function batchUpdateEntities - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest} request BatchUpdateEntitiesRequest message or plain object - * @param {google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntitiesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Decodes an AnalyzeContentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.AnalyzeContentResponse} AnalyzeContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(EntityTypes.prototype.batchUpdateEntities = function batchUpdateEntities(request, callback) { - return this.rpcCall(batchUpdateEntities, $root.google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchUpdateEntities" }); + AnalyzeContentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls BatchUpdateEntities. - * @function batchUpdateEntities - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest} request BatchUpdateEntitiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies an AnalyzeContentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + AnalyzeContentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replyText != null && message.hasOwnProperty("replyText")) + if (!$util.isString(message.replyText)) + return "replyText: string expected"; + if (message.replyAudio != null && message.hasOwnProperty("replyAudio")) { + var error = $root.google.cloud.dialogflow.v2.OutputAudio.verify(message.replyAudio); + if (error) + return "replyAudio." + error; + } + if (message.automatedAgentReply != null && message.hasOwnProperty("automatedAgentReply")) { + var error = $root.google.cloud.dialogflow.v2.AutomatedAgentReply.verify(message.automatedAgentReply); + if (error) + return "automatedAgentReply." + error; + } + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.cloud.dialogflow.v2.Message.verify(message.message); + if (error) + return "message." + error; + } + if (message.humanAgentSuggestionResults != null && message.hasOwnProperty("humanAgentSuggestionResults")) { + if (!Array.isArray(message.humanAgentSuggestionResults)) + return "humanAgentSuggestionResults: array expected"; + for (var i = 0; i < message.humanAgentSuggestionResults.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.SuggestionResult.verify(message.humanAgentSuggestionResults[i]); + if (error) + return "humanAgentSuggestionResults." + error; + } + } + if (message.endUserSuggestionResults != null && message.hasOwnProperty("endUserSuggestionResults")) { + if (!Array.isArray(message.endUserSuggestionResults)) + return "endUserSuggestionResults: array expected"; + for (var i = 0; i < message.endUserSuggestionResults.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.SuggestionResult.verify(message.endUserSuggestionResults[i]); + if (error) + return "endUserSuggestionResults." + error; + } + } + if (message.dtmfParameters != null && message.hasOwnProperty("dtmfParameters")) { + var error = $root.google.cloud.dialogflow.v2.DtmfParameters.verify(message.dtmfParameters); + if (error) + return "dtmfParameters." + error; + } + return null; + }; /** - * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchDeleteEntities}. - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @typedef BatchDeleteEntitiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates an AnalyzeContentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.AnalyzeContentResponse} AnalyzeContentResponse */ + AnalyzeContentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.AnalyzeContentResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2.AnalyzeContentResponse(); + if (object.replyText != null) + message.replyText = String(object.replyText); + if (object.replyAudio != null) { + if (typeof object.replyAudio !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentResponse.replyAudio: object expected"); + message.replyAudio = $root.google.cloud.dialogflow.v2.OutputAudio.fromObject(object.replyAudio); + } + if (object.automatedAgentReply != null) { + if (typeof object.automatedAgentReply !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentResponse.automatedAgentReply: object expected"); + message.automatedAgentReply = $root.google.cloud.dialogflow.v2.AutomatedAgentReply.fromObject(object.automatedAgentReply); + } + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentResponse.message: object expected"); + message.message = $root.google.cloud.dialogflow.v2.Message.fromObject(object.message); + } + if (object.humanAgentSuggestionResults) { + if (!Array.isArray(object.humanAgentSuggestionResults)) + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentResponse.humanAgentSuggestionResults: array expected"); + message.humanAgentSuggestionResults = []; + for (var i = 0; i < object.humanAgentSuggestionResults.length; ++i) { + if (typeof object.humanAgentSuggestionResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentResponse.humanAgentSuggestionResults: object expected"); + message.humanAgentSuggestionResults[i] = $root.google.cloud.dialogflow.v2.SuggestionResult.fromObject(object.humanAgentSuggestionResults[i]); + } + } + if (object.endUserSuggestionResults) { + if (!Array.isArray(object.endUserSuggestionResults)) + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentResponse.endUserSuggestionResults: array expected"); + message.endUserSuggestionResults = []; + for (var i = 0; i < object.endUserSuggestionResults.length; ++i) { + if (typeof object.endUserSuggestionResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentResponse.endUserSuggestionResults: object expected"); + message.endUserSuggestionResults[i] = $root.google.cloud.dialogflow.v2.SuggestionResult.fromObject(object.endUserSuggestionResults[i]); + } + } + if (object.dtmfParameters != null) { + if (typeof object.dtmfParameters !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnalyzeContentResponse.dtmfParameters: object expected"); + message.dtmfParameters = $root.google.cloud.dialogflow.v2.DtmfParameters.fromObject(object.dtmfParameters); + } + return message; + }; /** - * Calls BatchDeleteEntities. - * @function batchDeleteEntities - * @memberof google.cloud.dialogflow.v2.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest} request BatchDeleteEntitiesRequest message or plain object - * @param {google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntitiesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Creates a plain object from an AnalyzeContentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse + * @static + * @param {google.cloud.dialogflow.v2.AnalyzeContentResponse} message AnalyzeContentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(EntityTypes.prototype.batchDeleteEntities = function batchDeleteEntities(request, callback) { - return this.rpcCall(batchDeleteEntities, $root.google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchDeleteEntities" }); + AnalyzeContentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.humanAgentSuggestionResults = []; + object.endUserSuggestionResults = []; + } + if (options.defaults) { + object.replyText = ""; + object.replyAudio = null; + object.automatedAgentReply = null; + object.message = null; + object.dtmfParameters = null; + } + if (message.replyText != null && message.hasOwnProperty("replyText")) + object.replyText = message.replyText; + if (message.replyAudio != null && message.hasOwnProperty("replyAudio")) + object.replyAudio = $root.google.cloud.dialogflow.v2.OutputAudio.toObject(message.replyAudio, options); + if (message.automatedAgentReply != null && message.hasOwnProperty("automatedAgentReply")) + object.automatedAgentReply = $root.google.cloud.dialogflow.v2.AutomatedAgentReply.toObject(message.automatedAgentReply, options); + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.cloud.dialogflow.v2.Message.toObject(message.message, options); + if (message.humanAgentSuggestionResults && message.humanAgentSuggestionResults.length) { + object.humanAgentSuggestionResults = []; + for (var j = 0; j < message.humanAgentSuggestionResults.length; ++j) + object.humanAgentSuggestionResults[j] = $root.google.cloud.dialogflow.v2.SuggestionResult.toObject(message.humanAgentSuggestionResults[j], options); + } + if (message.endUserSuggestionResults && message.endUserSuggestionResults.length) { + object.endUserSuggestionResults = []; + for (var j = 0; j < message.endUserSuggestionResults.length; ++j) + object.endUserSuggestionResults[j] = $root.google.cloud.dialogflow.v2.SuggestionResult.toObject(message.endUserSuggestionResults[j], options); + } + if (message.dtmfParameters != null && message.hasOwnProperty("dtmfParameters")) + object.dtmfParameters = $root.google.cloud.dialogflow.v2.DtmfParameters.toObject(message.dtmfParameters, options); + return object; + }; /** - * Calls BatchDeleteEntities. - * @function batchDeleteEntities - * @memberof google.cloud.dialogflow.v2.EntityTypes + * Converts this AnalyzeContentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.AnalyzeContentResponse * @instance - * @param {google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest} request BatchDeleteEntitiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + AnalyzeContentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return EntityTypes; + return AnalyzeContentResponse; })(); - v2.EntityType = (function() { + v2.StreamingAnalyzeContentRequest = (function() { /** - * Properties of an EntityType. + * Properties of a StreamingAnalyzeContentRequest. * @memberof google.cloud.dialogflow.v2 - * @interface IEntityType - * @property {string|null} [name] EntityType name - * @property {string|null} [displayName] EntityType displayName - * @property {google.cloud.dialogflow.v2.EntityType.Kind|null} [kind] EntityType kind - * @property {google.cloud.dialogflow.v2.EntityType.AutoExpansionMode|null} [autoExpansionMode] EntityType autoExpansionMode - * @property {Array.|null} [entities] EntityType entities - * @property {boolean|null} [enableFuzzyExtraction] EntityType enableFuzzyExtraction + * @interface IStreamingAnalyzeContentRequest + * @property {string|null} [participant] StreamingAnalyzeContentRequest participant + * @property {google.cloud.dialogflow.v2.IInputAudioConfig|null} [audioConfig] StreamingAnalyzeContentRequest audioConfig + * @property {google.cloud.dialogflow.v2.IInputTextConfig|null} [textConfig] StreamingAnalyzeContentRequest textConfig + * @property {google.cloud.dialogflow.v2.IOutputAudioConfig|null} [replyAudioConfig] StreamingAnalyzeContentRequest replyAudioConfig + * @property {Uint8Array|null} [inputAudio] StreamingAnalyzeContentRequest inputAudio + * @property {string|null} [inputText] StreamingAnalyzeContentRequest inputText + * @property {google.cloud.dialogflow.v2.ITelephonyDtmfEvents|null} [inputDtmf] StreamingAnalyzeContentRequest inputDtmf + * @property {google.cloud.dialogflow.v2.IQueryParameters|null} [queryParams] StreamingAnalyzeContentRequest queryParams */ /** - * Constructs a new EntityType. + * Constructs a new StreamingAnalyzeContentRequest. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an EntityType. - * @implements IEntityType + * @classdesc Represents a StreamingAnalyzeContentRequest. + * @implements IStreamingAnalyzeContentRequest * @constructor - * @param {google.cloud.dialogflow.v2.IEntityType=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IStreamingAnalyzeContentRequest=} [properties] Properties to set */ - function EntityType(properties) { - this.entities = []; + function StreamingAnalyzeContentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8039,143 +8897,191 @@ } /** - * EntityType name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.EntityType + * StreamingAnalyzeContentRequest participant. + * @member {string} participant + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @instance */ - EntityType.prototype.name = ""; + StreamingAnalyzeContentRequest.prototype.participant = ""; /** - * EntityType displayName. - * @member {string} displayName - * @memberof google.cloud.dialogflow.v2.EntityType + * StreamingAnalyzeContentRequest audioConfig. + * @member {google.cloud.dialogflow.v2.IInputAudioConfig|null|undefined} audioConfig + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @instance */ - EntityType.prototype.displayName = ""; + StreamingAnalyzeContentRequest.prototype.audioConfig = null; /** - * EntityType kind. - * @member {google.cloud.dialogflow.v2.EntityType.Kind} kind - * @memberof google.cloud.dialogflow.v2.EntityType + * StreamingAnalyzeContentRequest textConfig. + * @member {google.cloud.dialogflow.v2.IInputTextConfig|null|undefined} textConfig + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @instance */ - EntityType.prototype.kind = 0; + StreamingAnalyzeContentRequest.prototype.textConfig = null; /** - * EntityType autoExpansionMode. - * @member {google.cloud.dialogflow.v2.EntityType.AutoExpansionMode} autoExpansionMode - * @memberof google.cloud.dialogflow.v2.EntityType + * StreamingAnalyzeContentRequest replyAudioConfig. + * @member {google.cloud.dialogflow.v2.IOutputAudioConfig|null|undefined} replyAudioConfig + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @instance */ - EntityType.prototype.autoExpansionMode = 0; + StreamingAnalyzeContentRequest.prototype.replyAudioConfig = null; /** - * EntityType entities. - * @member {Array.} entities - * @memberof google.cloud.dialogflow.v2.EntityType + * StreamingAnalyzeContentRequest inputAudio. + * @member {Uint8Array} inputAudio + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @instance */ - EntityType.prototype.entities = $util.emptyArray; + StreamingAnalyzeContentRequest.prototype.inputAudio = $util.newBuffer([]); /** - * EntityType enableFuzzyExtraction. - * @member {boolean} enableFuzzyExtraction - * @memberof google.cloud.dialogflow.v2.EntityType + * StreamingAnalyzeContentRequest inputText. + * @member {string} inputText + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @instance */ - EntityType.prototype.enableFuzzyExtraction = false; + StreamingAnalyzeContentRequest.prototype.inputText = ""; /** - * Creates a new EntityType instance using the specified properties. + * StreamingAnalyzeContentRequest inputDtmf. + * @member {google.cloud.dialogflow.v2.ITelephonyDtmfEvents|null|undefined} inputDtmf + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest + * @instance + */ + StreamingAnalyzeContentRequest.prototype.inputDtmf = null; + + /** + * StreamingAnalyzeContentRequest queryParams. + * @member {google.cloud.dialogflow.v2.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest + * @instance + */ + StreamingAnalyzeContentRequest.prototype.queryParams = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamingAnalyzeContentRequest config. + * @member {"audioConfig"|"textConfig"|undefined} config + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest + * @instance + */ + Object.defineProperty(StreamingAnalyzeContentRequest.prototype, "config", { + get: $util.oneOfGetter($oneOfFields = ["audioConfig", "textConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * StreamingAnalyzeContentRequest input. + * @member {"inputAudio"|"inputText"|"inputDtmf"|undefined} input + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest + * @instance + */ + Object.defineProperty(StreamingAnalyzeContentRequest.prototype, "input", { + get: $util.oneOfGetter($oneOfFields = ["inputAudio", "inputText", "inputDtmf"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamingAnalyzeContentRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.EntityType + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @static - * @param {google.cloud.dialogflow.v2.IEntityType=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.EntityType} EntityType instance + * @param {google.cloud.dialogflow.v2.IStreamingAnalyzeContentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest} StreamingAnalyzeContentRequest instance */ - EntityType.create = function create(properties) { - return new EntityType(properties); + StreamingAnalyzeContentRequest.create = function create(properties) { + return new StreamingAnalyzeContentRequest(properties); }; /** - * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.verify|verify} messages. + * Encodes the specified StreamingAnalyzeContentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.EntityType + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @static - * @param {google.cloud.dialogflow.v2.IEntityType} message EntityType message or plain object to encode + * @param {google.cloud.dialogflow.v2.IStreamingAnalyzeContentRequest} message StreamingAnalyzeContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EntityType.encode = function encode(message, writer) { + StreamingAnalyzeContentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.kind); - if (message.autoExpansionMode != null && Object.hasOwnProperty.call(message, "autoExpansionMode")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.autoExpansionMode); - if (message.entities != null && message.entities.length) - for (var i = 0; i < message.entities.length; ++i) - $root.google.cloud.dialogflow.v2.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.enableFuzzyExtraction != null && Object.hasOwnProperty.call(message, "enableFuzzyExtraction")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableFuzzyExtraction); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.participant); + if (message.audioConfig != null && Object.hasOwnProperty.call(message, "audioConfig")) + $root.google.cloud.dialogflow.v2.InputAudioConfig.encode(message.audioConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.textConfig != null && Object.hasOwnProperty.call(message, "textConfig")) + $root.google.cloud.dialogflow.v2.InputTextConfig.encode(message.textConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.replyAudioConfig != null && Object.hasOwnProperty.call(message, "replyAudioConfig")) + $root.google.cloud.dialogflow.v2.OutputAudioConfig.encode(message.replyAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputAudio != null && Object.hasOwnProperty.call(message, "inputAudio")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.inputAudio); + if (message.inputText != null && Object.hasOwnProperty.call(message, "inputText")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.inputText); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.v2.QueryParameters.encode(message.queryParams, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.inputDtmf != null && Object.hasOwnProperty.call(message, "inputDtmf")) + $root.google.cloud.dialogflow.v2.TelephonyDtmfEvents.encode(message.inputDtmf, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); return writer; }; /** - * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.verify|verify} messages. + * Encodes the specified StreamingAnalyzeContentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.EntityType + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @static - * @param {google.cloud.dialogflow.v2.IEntityType} message EntityType message or plain object to encode + * @param {google.cloud.dialogflow.v2.IStreamingAnalyzeContentRequest} message StreamingAnalyzeContentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EntityType.encodeDelimited = function encodeDelimited(message, writer) { + StreamingAnalyzeContentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EntityType message from the specified reader or buffer. + * Decodes a StreamingAnalyzeContentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.EntityType + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.EntityType} EntityType + * @returns {google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest} StreamingAnalyzeContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EntityType.decode = function decode(reader, length) { + StreamingAnalyzeContentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.EntityType(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.participant = reader.string(); break; case 2: - message.displayName = reader.string(); + message.audioConfig = $root.google.cloud.dialogflow.v2.InputAudioConfig.decode(reader, reader.uint32()); break; case 3: - message.kind = reader.int32(); + message.textConfig = $root.google.cloud.dialogflow.v2.InputTextConfig.decode(reader, reader.uint32()); break; case 4: - message.autoExpansionMode = reader.int32(); + message.replyAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.decode(reader, reader.uint32()); + break; + case 5: + message.inputAudio = reader.bytes(); break; case 6: - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.dialogflow.v2.EntityType.Entity.decode(reader, reader.uint32())); + message.inputText = reader.string(); + break; + case 9: + message.inputDtmf = $root.google.cloud.dialogflow.v2.TelephonyDtmfEvents.decode(reader, reader.uint32()); break; case 7: - message.enableFuzzyExtraction = reader.bool(); + message.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -8186,463 +9092,231 @@ }; /** - * Decodes an EntityType message from the specified reader or buffer, length delimited. + * Decodes a StreamingAnalyzeContentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.EntityType + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.EntityType} EntityType + * @returns {google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest} StreamingAnalyzeContentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EntityType.decodeDelimited = function decodeDelimited(reader) { + StreamingAnalyzeContentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EntityType message. + * Verifies a StreamingAnalyzeContentRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2.EntityType + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EntityType.verify = function verify(message) { + StreamingAnalyzeContentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - switch (message.kind) { - default: - return "kind: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + var properties = {}; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { + properties.config = 1; + { + var error = $root.google.cloud.dialogflow.v2.InputAudioConfig.verify(message.audioConfig); + if (error) + return "audioConfig." + error; } - if (message.autoExpansionMode != null && message.hasOwnProperty("autoExpansionMode")) - switch (message.autoExpansionMode) { - default: - return "autoExpansionMode: enum value expected"; - case 0: - case 1: - break; + } + if (message.textConfig != null && message.hasOwnProperty("textConfig")) { + if (properties.config === 1) + return "config: multiple values"; + properties.config = 1; + { + var error = $root.google.cloud.dialogflow.v2.InputTextConfig.verify(message.textConfig); + if (error) + return "textConfig." + error; } - if (message.entities != null && message.hasOwnProperty("entities")) { - if (!Array.isArray(message.entities)) - return "entities: array expected"; - for (var i = 0; i < message.entities.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.EntityType.Entity.verify(message.entities[i]); + } + if (message.replyAudioConfig != null && message.hasOwnProperty("replyAudioConfig")) { + var error = $root.google.cloud.dialogflow.v2.OutputAudioConfig.verify(message.replyAudioConfig); + if (error) + return "replyAudioConfig." + error; + } + if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) { + properties.input = 1; + if (!(message.inputAudio && typeof message.inputAudio.length === "number" || $util.isString(message.inputAudio))) + return "inputAudio: buffer expected"; + } + if (message.inputText != null && message.hasOwnProperty("inputText")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + if (!$util.isString(message.inputText)) + return "inputText: string expected"; + } + if (message.inputDtmf != null && message.hasOwnProperty("inputDtmf")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2.TelephonyDtmfEvents.verify(message.inputDtmf); if (error) - return "entities." + error; + return "inputDtmf." + error; } } - if (message.enableFuzzyExtraction != null && message.hasOwnProperty("enableFuzzyExtraction")) - if (typeof message.enableFuzzyExtraction !== "boolean") - return "enableFuzzyExtraction: boolean expected"; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.v2.QueryParameters.verify(message.queryParams); + if (error) + return "queryParams." + error; + } return null; }; /** - * Creates an EntityType message from a plain object. Also converts values to their respective internal types. + * Creates a StreamingAnalyzeContentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.EntityType + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.EntityType} EntityType + * @returns {google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest} StreamingAnalyzeContentRequest */ - EntityType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.EntityType) + StreamingAnalyzeContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest) return object; - var message = new $root.google.cloud.dialogflow.v2.EntityType(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - switch (object.kind) { - case "KIND_UNSPECIFIED": - case 0: - message.kind = 0; - break; - case "KIND_MAP": - case 1: - message.kind = 1; - break; - case "KIND_LIST": - case 2: - message.kind = 2; - break; - case "KIND_REGEXP": - case 3: - message.kind = 3; - break; + var message = new $root.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest(); + if (object.participant != null) + message.participant = String(object.participant); + if (object.audioConfig != null) { + if (typeof object.audioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.audioConfig: object expected"); + message.audioConfig = $root.google.cloud.dialogflow.v2.InputAudioConfig.fromObject(object.audioConfig); } - switch (object.autoExpansionMode) { - case "AUTO_EXPANSION_MODE_UNSPECIFIED": - case 0: - message.autoExpansionMode = 0; - break; - case "AUTO_EXPANSION_MODE_DEFAULT": - case 1: - message.autoExpansionMode = 1; - break; + if (object.textConfig != null) { + if (typeof object.textConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.textConfig: object expected"); + message.textConfig = $root.google.cloud.dialogflow.v2.InputTextConfig.fromObject(object.textConfig); } - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.dialogflow.v2.EntityType.entities: array expected"); - message.entities = []; - for (var i = 0; i < object.entities.length; ++i) { - if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.EntityType.entities: object expected"); - message.entities[i] = $root.google.cloud.dialogflow.v2.EntityType.Entity.fromObject(object.entities[i]); - } + if (object.replyAudioConfig != null) { + if (typeof object.replyAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.replyAudioConfig: object expected"); + message.replyAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.fromObject(object.replyAudioConfig); + } + if (object.inputAudio != null) + if (typeof object.inputAudio === "string") + $util.base64.decode(object.inputAudio, message.inputAudio = $util.newBuffer($util.base64.length(object.inputAudio)), 0); + else if (object.inputAudio.length) + message.inputAudio = object.inputAudio; + if (object.inputText != null) + message.inputText = String(object.inputText); + if (object.inputDtmf != null) { + if (typeof object.inputDtmf !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.inputDtmf: object expected"); + message.inputDtmf = $root.google.cloud.dialogflow.v2.TelephonyDtmfEvents.fromObject(object.inputDtmf); + } + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.fromObject(object.queryParams); } - if (object.enableFuzzyExtraction != null) - message.enableFuzzyExtraction = Boolean(object.enableFuzzyExtraction); return message; }; /** - * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * Creates a plain object from a StreamingAnalyzeContentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.EntityType + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @static - * @param {google.cloud.dialogflow.v2.EntityType} message EntityType + * @param {google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest} message StreamingAnalyzeContentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EntityType.toObject = function toObject(message, options) { + StreamingAnalyzeContentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entities = []; if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; - object.autoExpansionMode = options.enums === String ? "AUTO_EXPANSION_MODE_UNSPECIFIED" : 0; - object.enableFuzzyExtraction = false; + object.participant = ""; + object.replyAudioConfig = null; + object.queryParams = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = options.enums === String ? $root.google.cloud.dialogflow.v2.EntityType.Kind[message.kind] : message.kind; - if (message.autoExpansionMode != null && message.hasOwnProperty("autoExpansionMode")) - object.autoExpansionMode = options.enums === String ? $root.google.cloud.dialogflow.v2.EntityType.AutoExpansionMode[message.autoExpansionMode] : message.autoExpansionMode; - if (message.entities && message.entities.length) { - object.entities = []; - for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = $root.google.cloud.dialogflow.v2.EntityType.Entity.toObject(message.entities[j], options); + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { + object.audioConfig = $root.google.cloud.dialogflow.v2.InputAudioConfig.toObject(message.audioConfig, options); + if (options.oneofs) + object.config = "audioConfig"; + } + if (message.textConfig != null && message.hasOwnProperty("textConfig")) { + object.textConfig = $root.google.cloud.dialogflow.v2.InputTextConfig.toObject(message.textConfig, options); + if (options.oneofs) + object.config = "textConfig"; + } + if (message.replyAudioConfig != null && message.hasOwnProperty("replyAudioConfig")) + object.replyAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.toObject(message.replyAudioConfig, options); + if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) { + object.inputAudio = options.bytes === String ? $util.base64.encode(message.inputAudio, 0, message.inputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputAudio) : message.inputAudio; + if (options.oneofs) + object.input = "inputAudio"; + } + if (message.inputText != null && message.hasOwnProperty("inputText")) { + object.inputText = message.inputText; + if (options.oneofs) + object.input = "inputText"; + } + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.toObject(message.queryParams, options); + if (message.inputDtmf != null && message.hasOwnProperty("inputDtmf")) { + object.inputDtmf = $root.google.cloud.dialogflow.v2.TelephonyDtmfEvents.toObject(message.inputDtmf, options); + if (options.oneofs) + object.input = "inputDtmf"; } - if (message.enableFuzzyExtraction != null && message.hasOwnProperty("enableFuzzyExtraction")) - object.enableFuzzyExtraction = message.enableFuzzyExtraction; return object; }; /** - * Converts this EntityType to JSON. + * Converts this StreamingAnalyzeContentRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.EntityType + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest * @instance * @returns {Object.} JSON object */ - EntityType.prototype.toJSON = function toJSON() { + StreamingAnalyzeContentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - EntityType.Entity = (function() { - - /** - * Properties of an Entity. - * @memberof google.cloud.dialogflow.v2.EntityType - * @interface IEntity - * @property {string|null} [value] Entity value - * @property {Array.|null} [synonyms] Entity synonyms - */ - - /** - * Constructs a new Entity. - * @memberof google.cloud.dialogflow.v2.EntityType - * @classdesc Represents an Entity. - * @implements IEntity - * @constructor - * @param {google.cloud.dialogflow.v2.EntityType.IEntity=} [properties] Properties to set - */ - function Entity(properties) { - this.synonyms = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Entity value. - * @member {string} value - * @memberof google.cloud.dialogflow.v2.EntityType.Entity - * @instance - */ - Entity.prototype.value = ""; - - /** - * Entity synonyms. - * @member {Array.} synonyms - * @memberof google.cloud.dialogflow.v2.EntityType.Entity - * @instance - */ - Entity.prototype.synonyms = $util.emptyArray; - - /** - * Creates a new Entity instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.EntityType.Entity - * @static - * @param {google.cloud.dialogflow.v2.EntityType.IEntity=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.EntityType.Entity} Entity instance - */ - Entity.create = function create(properties) { - return new Entity(properties); - }; - - /** - * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.Entity.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.EntityType.Entity - * @static - * @param {google.cloud.dialogflow.v2.EntityType.IEntity} message Entity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Entity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.synonyms != null && message.synonyms.length) - for (var i = 0; i < message.synonyms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.synonyms[i]); - return writer; - }; - - /** - * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.Entity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.EntityType.Entity - * @static - * @param {google.cloud.dialogflow.v2.EntityType.IEntity} message Entity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Entity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Entity message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.EntityType.Entity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.EntityType.Entity} Entity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Entity.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.EntityType.Entity(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; - case 2: - if (!(message.synonyms && message.synonyms.length)) - message.synonyms = []; - message.synonyms.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Entity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.EntityType.Entity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.EntityType.Entity} Entity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Entity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Entity message. - * @function verify - * @memberof google.cloud.dialogflow.v2.EntityType.Entity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Entity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - if (message.synonyms != null && message.hasOwnProperty("synonyms")) { - if (!Array.isArray(message.synonyms)) - return "synonyms: array expected"; - for (var i = 0; i < message.synonyms.length; ++i) - if (!$util.isString(message.synonyms[i])) - return "synonyms: string[] expected"; - } - return null; - }; - - /** - * Creates an Entity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.EntityType.Entity - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.EntityType.Entity} Entity - */ - Entity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.EntityType.Entity) - return object; - var message = new $root.google.cloud.dialogflow.v2.EntityType.Entity(); - if (object.value != null) - message.value = String(object.value); - if (object.synonyms) { - if (!Array.isArray(object.synonyms)) - throw TypeError(".google.cloud.dialogflow.v2.EntityType.Entity.synonyms: array expected"); - message.synonyms = []; - for (var i = 0; i < object.synonyms.length; ++i) - message.synonyms[i] = String(object.synonyms[i]); - } - return message; - }; - - /** - * Creates a plain object from an Entity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.EntityType.Entity - * @static - * @param {google.cloud.dialogflow.v2.EntityType.Entity} message Entity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Entity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.synonyms = []; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.synonyms && message.synonyms.length) { - object.synonyms = []; - for (var j = 0; j < message.synonyms.length; ++j) - object.synonyms[j] = message.synonyms[j]; - } - return object; - }; - - /** - * Converts this Entity to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.EntityType.Entity - * @instance - * @returns {Object.} JSON object - */ - Entity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Entity; - })(); - - /** - * Kind enum. - * @name google.cloud.dialogflow.v2.EntityType.Kind - * @enum {number} - * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value - * @property {number} KIND_MAP=1 KIND_MAP value - * @property {number} KIND_LIST=2 KIND_LIST value - * @property {number} KIND_REGEXP=3 KIND_REGEXP value - */ - EntityType.Kind = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; - values[valuesById[1] = "KIND_MAP"] = 1; - values[valuesById[2] = "KIND_LIST"] = 2; - values[valuesById[3] = "KIND_REGEXP"] = 3; - return values; - })(); - - /** - * AutoExpansionMode enum. - * @name google.cloud.dialogflow.v2.EntityType.AutoExpansionMode - * @enum {number} - * @property {number} AUTO_EXPANSION_MODE_UNSPECIFIED=0 AUTO_EXPANSION_MODE_UNSPECIFIED value - * @property {number} AUTO_EXPANSION_MODE_DEFAULT=1 AUTO_EXPANSION_MODE_DEFAULT value - */ - EntityType.AutoExpansionMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AUTO_EXPANSION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUTO_EXPANSION_MODE_DEFAULT"] = 1; - return values; - })(); - - return EntityType; + return StreamingAnalyzeContentRequest; })(); - v2.ListEntityTypesRequest = (function() { + v2.StreamingAnalyzeContentResponse = (function() { /** - * Properties of a ListEntityTypesRequest. + * Properties of a StreamingAnalyzeContentResponse. * @memberof google.cloud.dialogflow.v2 - * @interface IListEntityTypesRequest - * @property {string|null} [parent] ListEntityTypesRequest parent - * @property {string|null} [languageCode] ListEntityTypesRequest languageCode - * @property {number|null} [pageSize] ListEntityTypesRequest pageSize - * @property {string|null} [pageToken] ListEntityTypesRequest pageToken + * @interface IStreamingAnalyzeContentResponse + * @property {google.cloud.dialogflow.v2.IStreamingRecognitionResult|null} [recognitionResult] StreamingAnalyzeContentResponse recognitionResult + * @property {string|null} [replyText] StreamingAnalyzeContentResponse replyText + * @property {google.cloud.dialogflow.v2.IOutputAudio|null} [replyAudio] StreamingAnalyzeContentResponse replyAudio + * @property {google.cloud.dialogflow.v2.IAutomatedAgentReply|null} [automatedAgentReply] StreamingAnalyzeContentResponse automatedAgentReply + * @property {google.cloud.dialogflow.v2.IMessage|null} [message] StreamingAnalyzeContentResponse message + * @property {Array.|null} [humanAgentSuggestionResults] StreamingAnalyzeContentResponse humanAgentSuggestionResults + * @property {Array.|null} [endUserSuggestionResults] StreamingAnalyzeContentResponse endUserSuggestionResults + * @property {google.cloud.dialogflow.v2.IDtmfParameters|null} [dtmfParameters] StreamingAnalyzeContentResponse dtmfParameters */ /** - * Constructs a new ListEntityTypesRequest. + * Constructs a new StreamingAnalyzeContentResponse. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a ListEntityTypesRequest. - * @implements IListEntityTypesRequest + * @classdesc Represents a StreamingAnalyzeContentResponse. + * @implements IStreamingAnalyzeContentResponse * @constructor - * @param {google.cloud.dialogflow.v2.IListEntityTypesRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IStreamingAnalyzeContentResponse=} [properties] Properties to set */ - function ListEntityTypesRequest(properties) { + function StreamingAnalyzeContentResponse(properties) { + this.humanAgentSuggestionResults = []; + this.endUserSuggestionResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8650,114 +9324,172 @@ } /** - * ListEntityTypesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest + * StreamingAnalyzeContentResponse recognitionResult. + * @member {google.cloud.dialogflow.v2.IStreamingRecognitionResult|null|undefined} recognitionResult + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse * @instance */ - ListEntityTypesRequest.prototype.parent = ""; + StreamingAnalyzeContentResponse.prototype.recognitionResult = null; /** - * ListEntityTypesRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest + * StreamingAnalyzeContentResponse replyText. + * @member {string} replyText + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse * @instance */ - ListEntityTypesRequest.prototype.languageCode = ""; + StreamingAnalyzeContentResponse.prototype.replyText = ""; /** - * ListEntityTypesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest + * StreamingAnalyzeContentResponse replyAudio. + * @member {google.cloud.dialogflow.v2.IOutputAudio|null|undefined} replyAudio + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse * @instance */ - ListEntityTypesRequest.prototype.pageSize = 0; + StreamingAnalyzeContentResponse.prototype.replyAudio = null; /** - * ListEntityTypesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest + * StreamingAnalyzeContentResponse automatedAgentReply. + * @member {google.cloud.dialogflow.v2.IAutomatedAgentReply|null|undefined} automatedAgentReply + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse * @instance */ - ListEntityTypesRequest.prototype.pageToken = ""; + StreamingAnalyzeContentResponse.prototype.automatedAgentReply = null; /** - * Creates a new ListEntityTypesRequest instance using the specified properties. + * StreamingAnalyzeContentResponse message. + * @member {google.cloud.dialogflow.v2.IMessage|null|undefined} message + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + * @instance + */ + StreamingAnalyzeContentResponse.prototype.message = null; + + /** + * StreamingAnalyzeContentResponse humanAgentSuggestionResults. + * @member {Array.} humanAgentSuggestionResults + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + * @instance + */ + StreamingAnalyzeContentResponse.prototype.humanAgentSuggestionResults = $util.emptyArray; + + /** + * StreamingAnalyzeContentResponse endUserSuggestionResults. + * @member {Array.} endUserSuggestionResults + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + * @instance + */ + StreamingAnalyzeContentResponse.prototype.endUserSuggestionResults = $util.emptyArray; + + /** + * StreamingAnalyzeContentResponse dtmfParameters. + * @member {google.cloud.dialogflow.v2.IDtmfParameters|null|undefined} dtmfParameters + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + * @instance + */ + StreamingAnalyzeContentResponse.prototype.dtmfParameters = null; + + /** + * Creates a new StreamingAnalyzeContentResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse * @static - * @param {google.cloud.dialogflow.v2.IListEntityTypesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.ListEntityTypesRequest} ListEntityTypesRequest instance + * @param {google.cloud.dialogflow.v2.IStreamingAnalyzeContentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse} StreamingAnalyzeContentResponse instance */ - ListEntityTypesRequest.create = function create(properties) { - return new ListEntityTypesRequest(properties); + StreamingAnalyzeContentResponse.create = function create(properties) { + return new StreamingAnalyzeContentResponse(properties); }; /** - * Encodes the specified ListEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesRequest.verify|verify} messages. + * Encodes the specified StreamingAnalyzeContentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse * @static - * @param {google.cloud.dialogflow.v2.IListEntityTypesRequest} message ListEntityTypesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IStreamingAnalyzeContentResponse} message StreamingAnalyzeContentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEntityTypesRequest.encode = function encode(message, writer) { + StreamingAnalyzeContentResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) + $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.replyText != null && Object.hasOwnProperty.call(message, "replyText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.replyText); + if (message.replyAudio != null && Object.hasOwnProperty.call(message, "replyAudio")) + $root.google.cloud.dialogflow.v2.OutputAudio.encode(message.replyAudio, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.automatedAgentReply != null && Object.hasOwnProperty.call(message, "automatedAgentReply")) + $root.google.cloud.dialogflow.v2.AutomatedAgentReply.encode(message.automatedAgentReply, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.cloud.dialogflow.v2.Message.encode(message.message, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.humanAgentSuggestionResults != null && message.humanAgentSuggestionResults.length) + for (var i = 0; i < message.humanAgentSuggestionResults.length; ++i) + $root.google.cloud.dialogflow.v2.SuggestionResult.encode(message.humanAgentSuggestionResults[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endUserSuggestionResults != null && message.endUserSuggestionResults.length) + for (var i = 0; i < message.endUserSuggestionResults.length; ++i) + $root.google.cloud.dialogflow.v2.SuggestionResult.encode(message.endUserSuggestionResults[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dtmfParameters != null && Object.hasOwnProperty.call(message, "dtmfParameters")) + $root.google.cloud.dialogflow.v2.DtmfParameters.encode(message.dtmfParameters, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesRequest.verify|verify} messages. + * Encodes the specified StreamingAnalyzeContentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse * @static - * @param {google.cloud.dialogflow.v2.IListEntityTypesRequest} message ListEntityTypesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IStreamingAnalyzeContentResponse} message StreamingAnalyzeContentResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + StreamingAnalyzeContentResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListEntityTypesRequest message from the specified reader or buffer. + * Decodes a StreamingAnalyzeContentResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.ListEntityTypesRequest} ListEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse} StreamingAnalyzeContentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEntityTypesRequest.decode = function decode(reader, length) { + StreamingAnalyzeContentResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListEntityTypesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.recognitionResult = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.decode(reader, reader.uint32()); break; case 2: - message.languageCode = reader.string(); + message.replyText = reader.string(); break; case 3: - message.pageSize = reader.int32(); + message.replyAudio = $root.google.cloud.dialogflow.v2.OutputAudio.decode(reader, reader.uint32()); break; case 4: - message.pageToken = reader.string(); + message.automatedAgentReply = $root.google.cloud.dialogflow.v2.AutomatedAgentReply.decode(reader, reader.uint32()); + break; + case 6: + message.message = $root.google.cloud.dialogflow.v2.Message.decode(reader, reader.uint32()); + break; + case 7: + if (!(message.humanAgentSuggestionResults && message.humanAgentSuggestionResults.length)) + message.humanAgentSuggestionResults = []; + message.humanAgentSuggestionResults.push($root.google.cloud.dialogflow.v2.SuggestionResult.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.endUserSuggestionResults && message.endUserSuggestionResults.length)) + message.endUserSuggestionResults = []; + message.endUserSuggestionResults.push($root.google.cloud.dialogflow.v2.SuggestionResult.decode(reader, reader.uint32())); + break; + case 10: + message.dtmfParameters = $root.google.cloud.dialogflow.v2.DtmfParameters.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -8768,134 +9500,227 @@ }; /** - * Decodes a ListEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes a StreamingAnalyzeContentResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.ListEntityTypesRequest} ListEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse} StreamingAnalyzeContentResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + StreamingAnalyzeContentResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListEntityTypesRequest message. + * Verifies a StreamingAnalyzeContentResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListEntityTypesRequest.verify = function verify(message) { + StreamingAnalyzeContentResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListEntityTypesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest - * @static + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + var error = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.verify(message.recognitionResult); + if (error) + return "recognitionResult." + error; + } + if (message.replyText != null && message.hasOwnProperty("replyText")) + if (!$util.isString(message.replyText)) + return "replyText: string expected"; + if (message.replyAudio != null && message.hasOwnProperty("replyAudio")) { + var error = $root.google.cloud.dialogflow.v2.OutputAudio.verify(message.replyAudio); + if (error) + return "replyAudio." + error; + } + if (message.automatedAgentReply != null && message.hasOwnProperty("automatedAgentReply")) { + var error = $root.google.cloud.dialogflow.v2.AutomatedAgentReply.verify(message.automatedAgentReply); + if (error) + return "automatedAgentReply." + error; + } + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.cloud.dialogflow.v2.Message.verify(message.message); + if (error) + return "message." + error; + } + if (message.humanAgentSuggestionResults != null && message.hasOwnProperty("humanAgentSuggestionResults")) { + if (!Array.isArray(message.humanAgentSuggestionResults)) + return "humanAgentSuggestionResults: array expected"; + for (var i = 0; i < message.humanAgentSuggestionResults.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.SuggestionResult.verify(message.humanAgentSuggestionResults[i]); + if (error) + return "humanAgentSuggestionResults." + error; + } + } + if (message.endUserSuggestionResults != null && message.hasOwnProperty("endUserSuggestionResults")) { + if (!Array.isArray(message.endUserSuggestionResults)) + return "endUserSuggestionResults: array expected"; + for (var i = 0; i < message.endUserSuggestionResults.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.SuggestionResult.verify(message.endUserSuggestionResults[i]); + if (error) + return "endUserSuggestionResults." + error; + } + } + if (message.dtmfParameters != null && message.hasOwnProperty("dtmfParameters")) { + var error = $root.google.cloud.dialogflow.v2.DtmfParameters.verify(message.dtmfParameters); + if (error) + return "dtmfParameters." + error; + } + return null; + }; + + /** + * Creates a StreamingAnalyzeContentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.ListEntityTypesRequest} ListEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse} StreamingAnalyzeContentResponse */ - ListEntityTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.ListEntityTypesRequest) + StreamingAnalyzeContentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse) return object; - var message = new $root.google.cloud.dialogflow.v2.ListEntityTypesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse(); + if (object.recognitionResult != null) { + if (typeof object.recognitionResult !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.recognitionResult: object expected"); + message.recognitionResult = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.fromObject(object.recognitionResult); + } + if (object.replyText != null) + message.replyText = String(object.replyText); + if (object.replyAudio != null) { + if (typeof object.replyAudio !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.replyAudio: object expected"); + message.replyAudio = $root.google.cloud.dialogflow.v2.OutputAudio.fromObject(object.replyAudio); + } + if (object.automatedAgentReply != null) { + if (typeof object.automatedAgentReply !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.automatedAgentReply: object expected"); + message.automatedAgentReply = $root.google.cloud.dialogflow.v2.AutomatedAgentReply.fromObject(object.automatedAgentReply); + } + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.message: object expected"); + message.message = $root.google.cloud.dialogflow.v2.Message.fromObject(object.message); + } + if (object.humanAgentSuggestionResults) { + if (!Array.isArray(object.humanAgentSuggestionResults)) + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.humanAgentSuggestionResults: array expected"); + message.humanAgentSuggestionResults = []; + for (var i = 0; i < object.humanAgentSuggestionResults.length; ++i) { + if (typeof object.humanAgentSuggestionResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.humanAgentSuggestionResults: object expected"); + message.humanAgentSuggestionResults[i] = $root.google.cloud.dialogflow.v2.SuggestionResult.fromObject(object.humanAgentSuggestionResults[i]); + } + } + if (object.endUserSuggestionResults) { + if (!Array.isArray(object.endUserSuggestionResults)) + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.endUserSuggestionResults: array expected"); + message.endUserSuggestionResults = []; + for (var i = 0; i < object.endUserSuggestionResults.length; ++i) { + if (typeof object.endUserSuggestionResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.endUserSuggestionResults: object expected"); + message.endUserSuggestionResults[i] = $root.google.cloud.dialogflow.v2.SuggestionResult.fromObject(object.endUserSuggestionResults[i]); + } + } + if (object.dtmfParameters != null) { + if (typeof object.dtmfParameters !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse.dtmfParameters: object expected"); + message.dtmfParameters = $root.google.cloud.dialogflow.v2.DtmfParameters.fromObject(object.dtmfParameters); + } return message; }; /** - * Creates a plain object from a ListEntityTypesRequest message. Also converts values to other types if specified. + * Creates a plain object from a StreamingAnalyzeContentResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse * @static - * @param {google.cloud.dialogflow.v2.ListEntityTypesRequest} message ListEntityTypesRequest + * @param {google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse} message StreamingAnalyzeContentResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListEntityTypesRequest.toObject = function toObject(message, options) { + StreamingAnalyzeContentResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) { + object.humanAgentSuggestionResults = []; + object.endUserSuggestionResults = []; + } if (options.defaults) { - object.parent = ""; - object.languageCode = ""; - object.pageSize = 0; - object.pageToken = ""; + object.recognitionResult = null; + object.replyText = ""; + object.replyAudio = null; + object.automatedAgentReply = null; + object.message = null; + object.dtmfParameters = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) + object.recognitionResult = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.toObject(message.recognitionResult, options); + if (message.replyText != null && message.hasOwnProperty("replyText")) + object.replyText = message.replyText; + if (message.replyAudio != null && message.hasOwnProperty("replyAudio")) + object.replyAudio = $root.google.cloud.dialogflow.v2.OutputAudio.toObject(message.replyAudio, options); + if (message.automatedAgentReply != null && message.hasOwnProperty("automatedAgentReply")) + object.automatedAgentReply = $root.google.cloud.dialogflow.v2.AutomatedAgentReply.toObject(message.automatedAgentReply, options); + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.cloud.dialogflow.v2.Message.toObject(message.message, options); + if (message.humanAgentSuggestionResults && message.humanAgentSuggestionResults.length) { + object.humanAgentSuggestionResults = []; + for (var j = 0; j < message.humanAgentSuggestionResults.length; ++j) + object.humanAgentSuggestionResults[j] = $root.google.cloud.dialogflow.v2.SuggestionResult.toObject(message.humanAgentSuggestionResults[j], options); + } + if (message.endUserSuggestionResults && message.endUserSuggestionResults.length) { + object.endUserSuggestionResults = []; + for (var j = 0; j < message.endUserSuggestionResults.length; ++j) + object.endUserSuggestionResults[j] = $root.google.cloud.dialogflow.v2.SuggestionResult.toObject(message.endUserSuggestionResults[j], options); + } + if (message.dtmfParameters != null && message.hasOwnProperty("dtmfParameters")) + object.dtmfParameters = $root.google.cloud.dialogflow.v2.DtmfParameters.toObject(message.dtmfParameters, options); return object; }; /** - * Converts this ListEntityTypesRequest to JSON. + * Converts this StreamingAnalyzeContentResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse * @instance * @returns {Object.} JSON object */ - ListEntityTypesRequest.prototype.toJSON = function toJSON() { + StreamingAnalyzeContentResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListEntityTypesRequest; + return StreamingAnalyzeContentResponse; })(); - v2.ListEntityTypesResponse = (function() { + v2.SuggestArticlesRequest = (function() { /** - * Properties of a ListEntityTypesResponse. + * Properties of a SuggestArticlesRequest. * @memberof google.cloud.dialogflow.v2 - * @interface IListEntityTypesResponse - * @property {Array.|null} [entityTypes] ListEntityTypesResponse entityTypes - * @property {string|null} [nextPageToken] ListEntityTypesResponse nextPageToken + * @interface ISuggestArticlesRequest + * @property {string|null} [parent] SuggestArticlesRequest parent + * @property {string|null} [latestMessage] SuggestArticlesRequest latestMessage + * @property {number|null} [contextSize] SuggestArticlesRequest contextSize */ /** - * Constructs a new ListEntityTypesResponse. + * Constructs a new SuggestArticlesRequest. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a ListEntityTypesResponse. - * @implements IListEntityTypesResponse + * @classdesc Represents a SuggestArticlesRequest. + * @implements ISuggestArticlesRequest * @constructor - * @param {google.cloud.dialogflow.v2.IListEntityTypesResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ISuggestArticlesRequest=} [properties] Properties to set */ - function ListEntityTypesResponse(properties) { - this.entityTypes = []; + function SuggestArticlesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -8903,91 +9728,101 @@ } /** - * ListEntityTypesResponse entityTypes. - * @member {Array.} entityTypes - * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse + * SuggestArticlesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.SuggestArticlesRequest * @instance */ - ListEntityTypesResponse.prototype.entityTypes = $util.emptyArray; + SuggestArticlesRequest.prototype.parent = ""; /** - * ListEntityTypesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse + * SuggestArticlesRequest latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2.SuggestArticlesRequest * @instance */ - ListEntityTypesResponse.prototype.nextPageToken = ""; + SuggestArticlesRequest.prototype.latestMessage = ""; /** - * Creates a new ListEntityTypesResponse instance using the specified properties. + * SuggestArticlesRequest contextSize. + * @member {number} contextSize + * @memberof google.cloud.dialogflow.v2.SuggestArticlesRequest + * @instance + */ + SuggestArticlesRequest.prototype.contextSize = 0; + + /** + * Creates a new SuggestArticlesRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.SuggestArticlesRequest * @static - * @param {google.cloud.dialogflow.v2.IListEntityTypesResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.ListEntityTypesResponse} ListEntityTypesResponse instance + * @param {google.cloud.dialogflow.v2.ISuggestArticlesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SuggestArticlesRequest} SuggestArticlesRequest instance */ - ListEntityTypesResponse.create = function create(properties) { - return new ListEntityTypesResponse(properties); + SuggestArticlesRequest.create = function create(properties) { + return new SuggestArticlesRequest(properties); }; /** - * Encodes the specified ListEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesResponse.verify|verify} messages. + * Encodes the specified SuggestArticlesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestArticlesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.SuggestArticlesRequest * @static - * @param {google.cloud.dialogflow.v2.IListEntityTypesResponse} message ListEntityTypesResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISuggestArticlesRequest} message SuggestArticlesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEntityTypesResponse.encode = function encode(message, writer) { + SuggestArticlesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.entityTypes != null && message.entityTypes.length) - for (var i = 0; i < message.entityTypes.length; ++i) - $root.google.cloud.dialogflow.v2.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestMessage); + if (message.contextSize != null && Object.hasOwnProperty.call(message, "contextSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contextSize); return writer; }; /** - * Encodes the specified ListEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesResponse.verify|verify} messages. + * Encodes the specified SuggestArticlesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestArticlesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.SuggestArticlesRequest * @static - * @param {google.cloud.dialogflow.v2.IListEntityTypesResponse} message ListEntityTypesResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISuggestArticlesRequest} message SuggestArticlesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + SuggestArticlesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListEntityTypesResponse message from the specified reader or buffer. + * Decodes a SuggestArticlesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.SuggestArticlesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.ListEntityTypesResponse} ListEntityTypesResponse + * @returns {google.cloud.dialogflow.v2.SuggestArticlesRequest} SuggestArticlesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEntityTypesResponse.decode = function decode(reader, length) { + SuggestArticlesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListEntityTypesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SuggestArticlesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.entityTypes && message.entityTypes.length)) - message.entityTypes = []; - message.entityTypes.push($root.google.cloud.dialogflow.v2.EntityType.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + message.latestMessage = reader.string(); + break; + case 3: + message.contextSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -8998,134 +9833,127 @@ }; /** - * Decodes a ListEntityTypesResponse message from the specified reader or buffer, length delimited. + * Decodes a SuggestArticlesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.SuggestArticlesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.ListEntityTypesResponse} ListEntityTypesResponse + * @returns {google.cloud.dialogflow.v2.SuggestArticlesRequest} SuggestArticlesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + SuggestArticlesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListEntityTypesResponse message. + * Verifies a SuggestArticlesRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.SuggestArticlesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListEntityTypesResponse.verify = function verify(message) { + SuggestArticlesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { - if (!Array.isArray(message.entityTypes)) - return "entityTypes: array expected"; - for (var i = 0; i < message.entityTypes.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.EntityType.verify(message.entityTypes[i]); - if (error) - return "entityTypes." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + if (!$util.isInteger(message.contextSize)) + return "contextSize: integer expected"; return null; }; /** - * Creates a ListEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SuggestArticlesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.SuggestArticlesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.ListEntityTypesResponse} ListEntityTypesResponse + * @returns {google.cloud.dialogflow.v2.SuggestArticlesRequest} SuggestArticlesRequest */ - ListEntityTypesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.ListEntityTypesResponse) + SuggestArticlesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SuggestArticlesRequest) return object; - var message = new $root.google.cloud.dialogflow.v2.ListEntityTypesResponse(); - if (object.entityTypes) { - if (!Array.isArray(object.entityTypes)) - throw TypeError(".google.cloud.dialogflow.v2.ListEntityTypesResponse.entityTypes: array expected"); - message.entityTypes = []; - for (var i = 0; i < object.entityTypes.length; ++i) { - if (typeof object.entityTypes[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.ListEntityTypesResponse.entityTypes: object expected"); - message.entityTypes[i] = $root.google.cloud.dialogflow.v2.EntityType.fromObject(object.entityTypes[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.cloud.dialogflow.v2.SuggestArticlesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + if (object.contextSize != null) + message.contextSize = object.contextSize | 0; return message; }; /** - * Creates a plain object from a ListEntityTypesResponse message. Also converts values to other types if specified. + * Creates a plain object from a SuggestArticlesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.SuggestArticlesRequest * @static - * @param {google.cloud.dialogflow.v2.ListEntityTypesResponse} message ListEntityTypesResponse + * @param {google.cloud.dialogflow.v2.SuggestArticlesRequest} message SuggestArticlesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListEntityTypesResponse.toObject = function toObject(message, options) { + SuggestArticlesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entityTypes = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.entityTypes && message.entityTypes.length) { - object.entityTypes = []; - for (var j = 0; j < message.entityTypes.length; ++j) - object.entityTypes[j] = $root.google.cloud.dialogflow.v2.EntityType.toObject(message.entityTypes[j], options); + if (options.defaults) { + object.parent = ""; + object.latestMessage = ""; + object.contextSize = 0; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + object.contextSize = message.contextSize; return object; }; /** - * Converts this ListEntityTypesResponse to JSON. + * Converts this SuggestArticlesRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.SuggestArticlesRequest * @instance * @returns {Object.} JSON object */ - ListEntityTypesResponse.prototype.toJSON = function toJSON() { + SuggestArticlesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListEntityTypesResponse; + return SuggestArticlesRequest; })(); - v2.GetEntityTypeRequest = (function() { + v2.SuggestArticlesResponse = (function() { /** - * Properties of a GetEntityTypeRequest. + * Properties of a SuggestArticlesResponse. * @memberof google.cloud.dialogflow.v2 - * @interface IGetEntityTypeRequest - * @property {string|null} [name] GetEntityTypeRequest name - * @property {string|null} [languageCode] GetEntityTypeRequest languageCode + * @interface ISuggestArticlesResponse + * @property {Array.|null} [articleAnswers] SuggestArticlesResponse articleAnswers + * @property {string|null} [latestMessage] SuggestArticlesResponse latestMessage + * @property {number|null} [contextSize] SuggestArticlesResponse contextSize */ /** - * Constructs a new GetEntityTypeRequest. + * Constructs a new SuggestArticlesResponse. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a GetEntityTypeRequest. - * @implements IGetEntityTypeRequest + * @classdesc Represents a SuggestArticlesResponse. + * @implements ISuggestArticlesResponse * @constructor - * @param {google.cloud.dialogflow.v2.IGetEntityTypeRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ISuggestArticlesResponse=} [properties] Properties to set */ - function GetEntityTypeRequest(properties) { + function SuggestArticlesResponse(properties) { + this.articleAnswers = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9133,88 +9961,104 @@ } /** - * GetEntityTypeRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest + * SuggestArticlesResponse articleAnswers. + * @member {Array.} articleAnswers + * @memberof google.cloud.dialogflow.v2.SuggestArticlesResponse * @instance */ - GetEntityTypeRequest.prototype.name = ""; + SuggestArticlesResponse.prototype.articleAnswers = $util.emptyArray; /** - * GetEntityTypeRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest + * SuggestArticlesResponse latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2.SuggestArticlesResponse * @instance */ - GetEntityTypeRequest.prototype.languageCode = ""; + SuggestArticlesResponse.prototype.latestMessage = ""; /** - * Creates a new GetEntityTypeRequest instance using the specified properties. + * SuggestArticlesResponse contextSize. + * @member {number} contextSize + * @memberof google.cloud.dialogflow.v2.SuggestArticlesResponse + * @instance + */ + SuggestArticlesResponse.prototype.contextSize = 0; + + /** + * Creates a new SuggestArticlesResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestArticlesResponse * @static - * @param {google.cloud.dialogflow.v2.IGetEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.GetEntityTypeRequest} GetEntityTypeRequest instance + * @param {google.cloud.dialogflow.v2.ISuggestArticlesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SuggestArticlesResponse} SuggestArticlesResponse instance */ - GetEntityTypeRequest.create = function create(properties) { - return new GetEntityTypeRequest(properties); + SuggestArticlesResponse.create = function create(properties) { + return new SuggestArticlesResponse(properties); }; /** - * Encodes the specified GetEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetEntityTypeRequest.verify|verify} messages. + * Encodes the specified SuggestArticlesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestArticlesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestArticlesResponse * @static - * @param {google.cloud.dialogflow.v2.IGetEntityTypeRequest} message GetEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISuggestArticlesResponse} message SuggestArticlesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetEntityTypeRequest.encode = function encode(message, writer) { + SuggestArticlesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.articleAnswers != null && message.articleAnswers.length) + for (var i = 0; i < message.articleAnswers.length; ++i) + $root.google.cloud.dialogflow.v2.ArticleAnswer.encode(message.articleAnswers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestMessage); + if (message.contextSize != null && Object.hasOwnProperty.call(message, "contextSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contextSize); return writer; }; /** - * Encodes the specified GetEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetEntityTypeRequest.verify|verify} messages. + * Encodes the specified SuggestArticlesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestArticlesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestArticlesResponse * @static - * @param {google.cloud.dialogflow.v2.IGetEntityTypeRequest} message GetEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISuggestArticlesResponse} message SuggestArticlesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + SuggestArticlesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetEntityTypeRequest message from the specified reader or buffer. + * Decodes a SuggestArticlesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestArticlesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.GetEntityTypeRequest} GetEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.SuggestArticlesResponse} SuggestArticlesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetEntityTypeRequest.decode = function decode(reader, length) { + SuggestArticlesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetEntityTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SuggestArticlesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.articleAnswers && message.articleAnswers.length)) + message.articleAnswers = []; + message.articleAnswers.push($root.google.cloud.dialogflow.v2.ArticleAnswer.decode(reader, reader.uint32())); break; case 2: - message.languageCode = reader.string(); + message.latestMessage = reader.string(); + break; + case 3: + message.contextSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -9225,118 +10069,144 @@ }; /** - * Decodes a GetEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a SuggestArticlesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestArticlesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.GetEntityTypeRequest} GetEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.SuggestArticlesResponse} SuggestArticlesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + SuggestArticlesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetEntityTypeRequest message. + * Verifies a SuggestArticlesResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestArticlesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetEntityTypeRequest.verify = function verify(message) { + SuggestArticlesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; + if (message.articleAnswers != null && message.hasOwnProperty("articleAnswers")) { + if (!Array.isArray(message.articleAnswers)) + return "articleAnswers: array expected"; + for (var i = 0; i < message.articleAnswers.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.ArticleAnswer.verify(message.articleAnswers[i]); + if (error) + return "articleAnswers." + error; + } + } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + if (!$util.isInteger(message.contextSize)) + return "contextSize: integer expected"; return null; }; /** - * Creates a GetEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SuggestArticlesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestArticlesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.GetEntityTypeRequest} GetEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.SuggestArticlesResponse} SuggestArticlesResponse */ - GetEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.GetEntityTypeRequest) + SuggestArticlesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SuggestArticlesResponse) return object; - var message = new $root.google.cloud.dialogflow.v2.GetEntityTypeRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); + var message = new $root.google.cloud.dialogflow.v2.SuggestArticlesResponse(); + if (object.articleAnswers) { + if (!Array.isArray(object.articleAnswers)) + throw TypeError(".google.cloud.dialogflow.v2.SuggestArticlesResponse.articleAnswers: array expected"); + message.articleAnswers = []; + for (var i = 0; i < object.articleAnswers.length; ++i) { + if (typeof object.articleAnswers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.SuggestArticlesResponse.articleAnswers: object expected"); + message.articleAnswers[i] = $root.google.cloud.dialogflow.v2.ArticleAnswer.fromObject(object.articleAnswers[i]); + } + } + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + if (object.contextSize != null) + message.contextSize = object.contextSize | 0; return message; }; /** - * Creates a plain object from a GetEntityTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from a SuggestArticlesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestArticlesResponse * @static - * @param {google.cloud.dialogflow.v2.GetEntityTypeRequest} message GetEntityTypeRequest + * @param {google.cloud.dialogflow.v2.SuggestArticlesResponse} message SuggestArticlesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetEntityTypeRequest.toObject = function toObject(message, options) { + SuggestArticlesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.articleAnswers = []; if (options.defaults) { - object.name = ""; - object.languageCode = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; + object.latestMessage = ""; + object.contextSize = 0; + } + if (message.articleAnswers && message.articleAnswers.length) { + object.articleAnswers = []; + for (var j = 0; j < message.articleAnswers.length; ++j) + object.articleAnswers[j] = $root.google.cloud.dialogflow.v2.ArticleAnswer.toObject(message.articleAnswers[j], options); + } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + object.contextSize = message.contextSize; return object; }; /** - * Converts this GetEntityTypeRequest to JSON. + * Converts this SuggestArticlesResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestArticlesResponse * @instance * @returns {Object.} JSON object */ - GetEntityTypeRequest.prototype.toJSON = function toJSON() { + SuggestArticlesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetEntityTypeRequest; + return SuggestArticlesResponse; })(); - v2.CreateEntityTypeRequest = (function() { + v2.SuggestFaqAnswersRequest = (function() { /** - * Properties of a CreateEntityTypeRequest. + * Properties of a SuggestFaqAnswersRequest. * @memberof google.cloud.dialogflow.v2 - * @interface ICreateEntityTypeRequest - * @property {string|null} [parent] CreateEntityTypeRequest parent - * @property {google.cloud.dialogflow.v2.IEntityType|null} [entityType] CreateEntityTypeRequest entityType - * @property {string|null} [languageCode] CreateEntityTypeRequest languageCode + * @interface ISuggestFaqAnswersRequest + * @property {string|null} [parent] SuggestFaqAnswersRequest parent + * @property {string|null} [latestMessage] SuggestFaqAnswersRequest latestMessage + * @property {number|null} [contextSize] SuggestFaqAnswersRequest contextSize */ /** - * Constructs a new CreateEntityTypeRequest. + * Constructs a new SuggestFaqAnswersRequest. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a CreateEntityTypeRequest. - * @implements ICreateEntityTypeRequest + * @classdesc Represents a SuggestFaqAnswersRequest. + * @implements ISuggestFaqAnswersRequest * @constructor - * @param {google.cloud.dialogflow.v2.ICreateEntityTypeRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest=} [properties] Properties to set */ - function CreateEntityTypeRequest(properties) { + function SuggestFaqAnswersRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9344,90 +10214,90 @@ } /** - * CreateEntityTypeRequest parent. + * SuggestFaqAnswersRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersRequest * @instance */ - CreateEntityTypeRequest.prototype.parent = ""; + SuggestFaqAnswersRequest.prototype.parent = ""; /** - * CreateEntityTypeRequest entityType. - * @member {google.cloud.dialogflow.v2.IEntityType|null|undefined} entityType - * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest + * SuggestFaqAnswersRequest latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersRequest * @instance */ - CreateEntityTypeRequest.prototype.entityType = null; + SuggestFaqAnswersRequest.prototype.latestMessage = ""; /** - * CreateEntityTypeRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest + * SuggestFaqAnswersRequest contextSize. + * @member {number} contextSize + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersRequest * @instance */ - CreateEntityTypeRequest.prototype.languageCode = ""; + SuggestFaqAnswersRequest.prototype.contextSize = 0; /** - * Creates a new CreateEntityTypeRequest instance using the specified properties. + * Creates a new SuggestFaqAnswersRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersRequest * @static - * @param {google.cloud.dialogflow.v2.ICreateEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.CreateEntityTypeRequest} CreateEntityTypeRequest instance + * @param {google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SuggestFaqAnswersRequest} SuggestFaqAnswersRequest instance */ - CreateEntityTypeRequest.create = function create(properties) { - return new CreateEntityTypeRequest(properties); + SuggestFaqAnswersRequest.create = function create(properties) { + return new SuggestFaqAnswersRequest(properties); }; /** - * Encodes the specified CreateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateEntityTypeRequest.verify|verify} messages. + * Encodes the specified SuggestFaqAnswersRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersRequest * @static - * @param {google.cloud.dialogflow.v2.ICreateEntityTypeRequest} message CreateEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest} message SuggestFaqAnswersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateEntityTypeRequest.encode = function encode(message, writer) { + SuggestFaqAnswersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) - $root.google.cloud.dialogflow.v2.EntityType.encode(message.entityType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestMessage); + if (message.contextSize != null && Object.hasOwnProperty.call(message, "contextSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contextSize); return writer; }; /** - * Encodes the specified CreateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateEntityTypeRequest.verify|verify} messages. + * Encodes the specified SuggestFaqAnswersRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestFaqAnswersRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersRequest * @static - * @param {google.cloud.dialogflow.v2.ICreateEntityTypeRequest} message CreateEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest} message SuggestFaqAnswersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + SuggestFaqAnswersRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateEntityTypeRequest message from the specified reader or buffer. + * Decodes a SuggestFaqAnswersRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.CreateEntityTypeRequest} CreateEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.SuggestFaqAnswersRequest} SuggestFaqAnswersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateEntityTypeRequest.decode = function decode(reader, length) { + SuggestFaqAnswersRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateEntityTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -9435,10 +10305,10 @@ message.parent = reader.string(); break; case 2: - message.entityType = $root.google.cloud.dialogflow.v2.EntityType.decode(reader, reader.uint32()); + message.latestMessage = reader.string(); break; case 3: - message.languageCode = reader.string(); + message.contextSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -9449,131 +10319,127 @@ }; /** - * Decodes a CreateEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a SuggestFaqAnswersRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.CreateEntityTypeRequest} CreateEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.SuggestFaqAnswersRequest} SuggestFaqAnswersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + SuggestFaqAnswersRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateEntityTypeRequest message. + * Verifies a SuggestFaqAnswersRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateEntityTypeRequest.verify = function verify(message) { + SuggestFaqAnswersRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.entityType != null && message.hasOwnProperty("entityType")) { - var error = $root.google.cloud.dialogflow.v2.EntityType.verify(message.entityType); - if (error) - return "entityType." + error; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + if (!$util.isInteger(message.contextSize)) + return "contextSize: integer expected"; return null; }; /** - * Creates a CreateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SuggestFaqAnswersRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.CreateEntityTypeRequest} CreateEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.SuggestFaqAnswersRequest} SuggestFaqAnswersRequest */ - CreateEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.CreateEntityTypeRequest) + SuggestFaqAnswersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest) return object; - var message = new $root.google.cloud.dialogflow.v2.CreateEntityTypeRequest(); + var message = new $root.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.entityType != null) { - if (typeof object.entityType !== "object") - throw TypeError(".google.cloud.dialogflow.v2.CreateEntityTypeRequest.entityType: object expected"); - message.entityType = $root.google.cloud.dialogflow.v2.EntityType.fromObject(object.entityType); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + if (object.contextSize != null) + message.contextSize = object.contextSize | 0; return message; }; /** - * Creates a plain object from a CreateEntityTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from a SuggestFaqAnswersRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersRequest * @static - * @param {google.cloud.dialogflow.v2.CreateEntityTypeRequest} message CreateEntityTypeRequest + * @param {google.cloud.dialogflow.v2.SuggestFaqAnswersRequest} message SuggestFaqAnswersRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateEntityTypeRequest.toObject = function toObject(message, options) { + SuggestFaqAnswersRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.entityType = null; - object.languageCode = ""; + object.latestMessage = ""; + object.contextSize = 0; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.entityType != null && message.hasOwnProperty("entityType")) - object.entityType = $root.google.cloud.dialogflow.v2.EntityType.toObject(message.entityType, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + object.contextSize = message.contextSize; return object; }; /** - * Converts this CreateEntityTypeRequest to JSON. + * Converts this SuggestFaqAnswersRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersRequest * @instance * @returns {Object.} JSON object */ - CreateEntityTypeRequest.prototype.toJSON = function toJSON() { + SuggestFaqAnswersRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateEntityTypeRequest; + return SuggestFaqAnswersRequest; })(); - v2.UpdateEntityTypeRequest = (function() { + v2.SuggestFaqAnswersResponse = (function() { /** - * Properties of an UpdateEntityTypeRequest. + * Properties of a SuggestFaqAnswersResponse. * @memberof google.cloud.dialogflow.v2 - * @interface IUpdateEntityTypeRequest - * @property {google.cloud.dialogflow.v2.IEntityType|null} [entityType] UpdateEntityTypeRequest entityType - * @property {string|null} [languageCode] UpdateEntityTypeRequest languageCode - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEntityTypeRequest updateMask + * @interface ISuggestFaqAnswersResponse + * @property {Array.|null} [faqAnswers] SuggestFaqAnswersResponse faqAnswers + * @property {string|null} [latestMessage] SuggestFaqAnswersResponse latestMessage + * @property {number|null} [contextSize] SuggestFaqAnswersResponse contextSize */ /** - * Constructs a new UpdateEntityTypeRequest. + * Constructs a new SuggestFaqAnswersResponse. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an UpdateEntityTypeRequest. - * @implements IUpdateEntityTypeRequest + * @classdesc Represents a SuggestFaqAnswersResponse. + * @implements ISuggestFaqAnswersResponse * @constructor - * @param {google.cloud.dialogflow.v2.IUpdateEntityTypeRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse=} [properties] Properties to set */ - function UpdateEntityTypeRequest(properties) { + function SuggestFaqAnswersResponse(properties) { + this.faqAnswers = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9581,101 +10447,104 @@ } /** - * UpdateEntityTypeRequest entityType. - * @member {google.cloud.dialogflow.v2.IEntityType|null|undefined} entityType - * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest + * SuggestFaqAnswersResponse faqAnswers. + * @member {Array.} faqAnswers + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersResponse * @instance */ - UpdateEntityTypeRequest.prototype.entityType = null; + SuggestFaqAnswersResponse.prototype.faqAnswers = $util.emptyArray; /** - * UpdateEntityTypeRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest + * SuggestFaqAnswersResponse latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersResponse * @instance */ - UpdateEntityTypeRequest.prototype.languageCode = ""; + SuggestFaqAnswersResponse.prototype.latestMessage = ""; /** - * UpdateEntityTypeRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest + * SuggestFaqAnswersResponse contextSize. + * @member {number} contextSize + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersResponse * @instance */ - UpdateEntityTypeRequest.prototype.updateMask = null; + SuggestFaqAnswersResponse.prototype.contextSize = 0; /** - * Creates a new UpdateEntityTypeRequest instance using the specified properties. + * Creates a new SuggestFaqAnswersResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersResponse * @static - * @param {google.cloud.dialogflow.v2.IUpdateEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.UpdateEntityTypeRequest} UpdateEntityTypeRequest instance + * @param {google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SuggestFaqAnswersResponse} SuggestFaqAnswersResponse instance */ - UpdateEntityTypeRequest.create = function create(properties) { - return new UpdateEntityTypeRequest(properties); + SuggestFaqAnswersResponse.create = function create(properties) { + return new SuggestFaqAnswersResponse(properties); }; /** - * Encodes the specified UpdateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateEntityTypeRequest.verify|verify} messages. + * Encodes the specified SuggestFaqAnswersResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersResponse * @static - * @param {google.cloud.dialogflow.v2.IUpdateEntityTypeRequest} message UpdateEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse} message SuggestFaqAnswersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateEntityTypeRequest.encode = function encode(message, writer) { + SuggestFaqAnswersResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) - $root.google.cloud.dialogflow.v2.EntityType.encode(message.entityType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.faqAnswers != null && message.faqAnswers.length) + for (var i = 0; i < message.faqAnswers.length; ++i) + $root.google.cloud.dialogflow.v2.FaqAnswer.encode(message.faqAnswers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestMessage); + if (message.contextSize != null && Object.hasOwnProperty.call(message, "contextSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contextSize); return writer; }; /** - * Encodes the specified UpdateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateEntityTypeRequest.verify|verify} messages. + * Encodes the specified SuggestFaqAnswersResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersResponse * @static - * @param {google.cloud.dialogflow.v2.IUpdateEntityTypeRequest} message UpdateEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse} message SuggestFaqAnswersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + SuggestFaqAnswersResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer. + * Decodes a SuggestFaqAnswersResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.UpdateEntityTypeRequest} UpdateEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.SuggestFaqAnswersResponse} SuggestFaqAnswersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateEntityTypeRequest.decode = function decode(reader, length) { + SuggestFaqAnswersResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateEntityTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.entityType = $root.google.cloud.dialogflow.v2.EntityType.decode(reader, reader.uint32()); + if (!(message.faqAnswers && message.faqAnswers.length)) + message.faqAnswers = []; + message.faqAnswers.push($root.google.cloud.dialogflow.v2.FaqAnswer.decode(reader, reader.uint32())); break; case 2: - message.languageCode = reader.string(); + message.latestMessage = reader.string(); break; case 3: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.contextSize = reader.int32(); break; default: reader.skipType(tag & 7); @@ -9686,134 +10555,143 @@ }; /** - * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a SuggestFaqAnswersResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.UpdateEntityTypeRequest} UpdateEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.SuggestFaqAnswersResponse} SuggestFaqAnswersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + SuggestFaqAnswersResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateEntityTypeRequest message. + * Verifies a SuggestFaqAnswersResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateEntityTypeRequest.verify = function verify(message) { + SuggestFaqAnswersResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.entityType != null && message.hasOwnProperty("entityType")) { - var error = $root.google.cloud.dialogflow.v2.EntityType.verify(message.entityType); - if (error) - return "entityType." + error; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.faqAnswers != null && message.hasOwnProperty("faqAnswers")) { + if (!Array.isArray(message.faqAnswers)) + return "faqAnswers: array expected"; + for (var i = 0; i < message.faqAnswers.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.FaqAnswer.verify(message.faqAnswers[i]); + if (error) + return "faqAnswers." + error; + } } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + if (!$util.isInteger(message.contextSize)) + return "contextSize: integer expected"; return null; }; /** - * Creates an UpdateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SuggestFaqAnswersResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.UpdateEntityTypeRequest} UpdateEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.SuggestFaqAnswersResponse} SuggestFaqAnswersResponse */ - UpdateEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.UpdateEntityTypeRequest) + SuggestFaqAnswersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse) return object; - var message = new $root.google.cloud.dialogflow.v2.UpdateEntityTypeRequest(); - if (object.entityType != null) { - if (typeof object.entityType !== "object") - throw TypeError(".google.cloud.dialogflow.v2.UpdateEntityTypeRequest.entityType: object expected"); - message.entityType = $root.google.cloud.dialogflow.v2.EntityType.fromObject(object.entityType); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2.UpdateEntityTypeRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse(); + if (object.faqAnswers) { + if (!Array.isArray(object.faqAnswers)) + throw TypeError(".google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.faqAnswers: array expected"); + message.faqAnswers = []; + for (var i = 0; i < object.faqAnswers.length; ++i) { + if (typeof object.faqAnswers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.faqAnswers: object expected"); + message.faqAnswers[i] = $root.google.cloud.dialogflow.v2.FaqAnswer.fromObject(object.faqAnswers[i]); + } + } + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + if (object.contextSize != null) + message.contextSize = object.contextSize | 0; return message; }; /** - * Creates a plain object from an UpdateEntityTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from a SuggestFaqAnswersResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersResponse * @static - * @param {google.cloud.dialogflow.v2.UpdateEntityTypeRequest} message UpdateEntityTypeRequest + * @param {google.cloud.dialogflow.v2.SuggestFaqAnswersResponse} message SuggestFaqAnswersResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateEntityTypeRequest.toObject = function toObject(message, options) { + SuggestFaqAnswersResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.faqAnswers = []; if (options.defaults) { - object.entityType = null; - object.languageCode = ""; - object.updateMask = null; - } - if (message.entityType != null && message.hasOwnProperty("entityType")) - object.entityType = $root.google.cloud.dialogflow.v2.EntityType.toObject(message.entityType, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + object.latestMessage = ""; + object.contextSize = 0; + } + if (message.faqAnswers && message.faqAnswers.length) { + object.faqAnswers = []; + for (var j = 0; j < message.faqAnswers.length; ++j) + object.faqAnswers[j] = $root.google.cloud.dialogflow.v2.FaqAnswer.toObject(message.faqAnswers[j], options); + } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + object.contextSize = message.contextSize; return object; }; /** - * Converts this UpdateEntityTypeRequest to JSON. + * Converts this SuggestFaqAnswersResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.SuggestFaqAnswersResponse * @instance * @returns {Object.} JSON object */ - UpdateEntityTypeRequest.prototype.toJSON = function toJSON() { + SuggestFaqAnswersResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateEntityTypeRequest; + return SuggestFaqAnswersResponse; })(); - v2.DeleteEntityTypeRequest = (function() { + v2.AudioInput = (function() { /** - * Properties of a DeleteEntityTypeRequest. + * Properties of an AudioInput. * @memberof google.cloud.dialogflow.v2 - * @interface IDeleteEntityTypeRequest - * @property {string|null} [name] DeleteEntityTypeRequest name + * @interface IAudioInput + * @property {google.cloud.dialogflow.v2.IInputAudioConfig|null} [config] AudioInput config + * @property {Uint8Array|null} [audio] AudioInput audio */ /** - * Constructs a new DeleteEntityTypeRequest. + * Constructs a new AudioInput. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a DeleteEntityTypeRequest. - * @implements IDeleteEntityTypeRequest + * @classdesc Represents an AudioInput. + * @implements IAudioInput * @constructor - * @param {google.cloud.dialogflow.v2.IDeleteEntityTypeRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IAudioInput=} [properties] Properties to set */ - function DeleteEntityTypeRequest(properties) { + function AudioInput(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -9821,75 +10699,88 @@ } /** - * DeleteEntityTypeRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest + * AudioInput config. + * @member {google.cloud.dialogflow.v2.IInputAudioConfig|null|undefined} config + * @memberof google.cloud.dialogflow.v2.AudioInput * @instance */ - DeleteEntityTypeRequest.prototype.name = ""; + AudioInput.prototype.config = null; /** - * Creates a new DeleteEntityTypeRequest instance using the specified properties. + * AudioInput audio. + * @member {Uint8Array} audio + * @memberof google.cloud.dialogflow.v2.AudioInput + * @instance + */ + AudioInput.prototype.audio = $util.newBuffer([]); + + /** + * Creates a new AudioInput instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.AudioInput * @static - * @param {google.cloud.dialogflow.v2.IDeleteEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.DeleteEntityTypeRequest} DeleteEntityTypeRequest instance + * @param {google.cloud.dialogflow.v2.IAudioInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.AudioInput} AudioInput instance */ - DeleteEntityTypeRequest.create = function create(properties) { - return new DeleteEntityTypeRequest(properties); + AudioInput.create = function create(properties) { + return new AudioInput(properties); }; /** - * Encodes the specified DeleteEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteEntityTypeRequest.verify|verify} messages. + * Encodes the specified AudioInput message. Does not implicitly {@link google.cloud.dialogflow.v2.AudioInput.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.AudioInput * @static - * @param {google.cloud.dialogflow.v2.IDeleteEntityTypeRequest} message DeleteEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAudioInput} message AudioInput message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteEntityTypeRequest.encode = function encode(message, writer) { + AudioInput.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.dialogflow.v2.InputAudioConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); return writer; }; /** - * Encodes the specified DeleteEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteEntityTypeRequest.verify|verify} messages. + * Encodes the specified AudioInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AudioInput.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.AudioInput * @static - * @param {google.cloud.dialogflow.v2.IDeleteEntityTypeRequest} message DeleteEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAudioInput} message AudioInput message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + AudioInput.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer. + * Decodes an AudioInput message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.AudioInput * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.DeleteEntityTypeRequest} DeleteEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.AudioInput} AudioInput * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteEntityTypeRequest.decode = function decode(reader, length) { + AudioInput.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteEntityTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.AudioInput(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.config = $root.google.cloud.dialogflow.v2.InputAudioConfig.decode(reader, reader.uint32()); + break; + case 2: + message.audio = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -9900,111 +10791,131 @@ }; /** - * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes an AudioInput message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.AudioInput * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.DeleteEntityTypeRequest} DeleteEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.AudioInput} AudioInput * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + AudioInput.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteEntityTypeRequest message. + * Verifies an AudioInput message. * @function verify - * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.AudioInput * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteEntityTypeRequest.verify = function verify(message) { + AudioInput.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.dialogflow.v2.InputAudioConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; return null; }; /** - * Creates a DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AudioInput message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.AudioInput * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.DeleteEntityTypeRequest} DeleteEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.AudioInput} AudioInput */ - DeleteEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.DeleteEntityTypeRequest) + AudioInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.AudioInput) return object; - var message = new $root.google.cloud.dialogflow.v2.DeleteEntityTypeRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.dialogflow.v2.AudioInput(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AudioInput.config: object expected"); + message.config = $root.google.cloud.dialogflow.v2.InputAudioConfig.fromObject(object.config); + } + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length) + message.audio = object.audio; return message; }; /** - * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from an AudioInput message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.AudioInput * @static - * @param {google.cloud.dialogflow.v2.DeleteEntityTypeRequest} message DeleteEntityTypeRequest + * @param {google.cloud.dialogflow.v2.AudioInput} message AudioInput * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteEntityTypeRequest.toObject = function toObject(message, options) { + AudioInput.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.config = null; + if (options.bytes === String) + object.audio = ""; + else { + object.audio = []; + if (options.bytes !== Array) + object.audio = $util.newBuffer(object.audio); + } + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.dialogflow.v2.InputAudioConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; return object; }; /** - * Converts this DeleteEntityTypeRequest to JSON. + * Converts this AudioInput to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.AudioInput * @instance * @returns {Object.} JSON object */ - DeleteEntityTypeRequest.prototype.toJSON = function toJSON() { + AudioInput.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteEntityTypeRequest; + return AudioInput; })(); - v2.BatchUpdateEntityTypesRequest = (function() { + v2.OutputAudio = (function() { /** - * Properties of a BatchUpdateEntityTypesRequest. + * Properties of an OutputAudio. * @memberof google.cloud.dialogflow.v2 - * @interface IBatchUpdateEntityTypesRequest - * @property {string|null} [parent] BatchUpdateEntityTypesRequest parent - * @property {string|null} [entityTypeBatchUri] BatchUpdateEntityTypesRequest entityTypeBatchUri - * @property {google.cloud.dialogflow.v2.IEntityTypeBatch|null} [entityTypeBatchInline] BatchUpdateEntityTypesRequest entityTypeBatchInline - * @property {string|null} [languageCode] BatchUpdateEntityTypesRequest languageCode - * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateEntityTypesRequest updateMask + * @interface IOutputAudio + * @property {google.cloud.dialogflow.v2.IOutputAudioConfig|null} [config] OutputAudio config + * @property {Uint8Array|null} [audio] OutputAudio audio */ /** - * Constructs a new BatchUpdateEntityTypesRequest. + * Constructs a new OutputAudio. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a BatchUpdateEntityTypesRequest. - * @implements IBatchUpdateEntityTypesRequest + * @classdesc Represents an OutputAudio. + * @implements IOutputAudio * @constructor - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IOutputAudio=} [properties] Properties to set */ - function BatchUpdateEntityTypesRequest(properties) { + function OutputAudio(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10012,141 +10923,88 @@ } /** - * BatchUpdateEntityTypesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest - * @instance - */ - BatchUpdateEntityTypesRequest.prototype.parent = ""; - - /** - * BatchUpdateEntityTypesRequest entityTypeBatchUri. - * @member {string} entityTypeBatchUri - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest - * @instance - */ - BatchUpdateEntityTypesRequest.prototype.entityTypeBatchUri = ""; - - /** - * BatchUpdateEntityTypesRequest entityTypeBatchInline. - * @member {google.cloud.dialogflow.v2.IEntityTypeBatch|null|undefined} entityTypeBatchInline - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest - * @instance - */ - BatchUpdateEntityTypesRequest.prototype.entityTypeBatchInline = null; - - /** - * BatchUpdateEntityTypesRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest - * @instance - */ - BatchUpdateEntityTypesRequest.prototype.languageCode = ""; - - /** - * BatchUpdateEntityTypesRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * OutputAudio config. + * @member {google.cloud.dialogflow.v2.IOutputAudioConfig|null|undefined} config + * @memberof google.cloud.dialogflow.v2.OutputAudio * @instance */ - BatchUpdateEntityTypesRequest.prototype.updateMask = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + OutputAudio.prototype.config = null; /** - * BatchUpdateEntityTypesRequest entityTypeBatch. - * @member {"entityTypeBatchUri"|"entityTypeBatchInline"|undefined} entityTypeBatch - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * OutputAudio audio. + * @member {Uint8Array} audio + * @memberof google.cloud.dialogflow.v2.OutputAudio * @instance */ - Object.defineProperty(BatchUpdateEntityTypesRequest.prototype, "entityTypeBatch", { - get: $util.oneOfGetter($oneOfFields = ["entityTypeBatchUri", "entityTypeBatchInline"]), - set: $util.oneOfSetter($oneOfFields) - }); + OutputAudio.prototype.audio = $util.newBuffer([]); /** - * Creates a new BatchUpdateEntityTypesRequest instance using the specified properties. + * Creates a new OutputAudio instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.OutputAudio * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest instance + * @param {google.cloud.dialogflow.v2.IOutputAudio=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.OutputAudio} OutputAudio instance */ - BatchUpdateEntityTypesRequest.create = function create(properties) { - return new BatchUpdateEntityTypesRequest(properties); + OutputAudio.create = function create(properties) { + return new OutputAudio(properties); }; /** - * Encodes the specified BatchUpdateEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.verify|verify} messages. + * Encodes the specified OutputAudio message. Does not implicitly {@link google.cloud.dialogflow.v2.OutputAudio.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.OutputAudio * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest} message BatchUpdateEntityTypesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IOutputAudio} message OutputAudio message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchUpdateEntityTypesRequest.encode = function encode(message, writer) { + OutputAudio.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.entityTypeBatchUri != null && Object.hasOwnProperty.call(message, "entityTypeBatchUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityTypeBatchUri); - if (message.entityTypeBatchInline != null && Object.hasOwnProperty.call(message, "entityTypeBatchInline")) - $root.google.cloud.dialogflow.v2.EntityTypeBatch.encode(message.entityTypeBatchInline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.dialogflow.v2.OutputAudioConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); return writer; }; /** - * Encodes the specified BatchUpdateEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.verify|verify} messages. + * Encodes the specified OutputAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.OutputAudio.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.OutputAudio * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest} message BatchUpdateEntityTypesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IOutputAudio} message OutputAudio message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchUpdateEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + OutputAudio.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer. + * Decodes an OutputAudio message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.OutputAudio * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.OutputAudio} OutputAudio * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchUpdateEntityTypesRequest.decode = function decode(reader, length) { + OutputAudio.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.OutputAudio(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.config = $root.google.cloud.dialogflow.v2.OutputAudioConfig.decode(reader, reader.uint32()); break; case 2: - message.entityTypeBatchUri = reader.string(); - break; - case 3: - message.entityTypeBatchInline = $root.google.cloud.dialogflow.v2.EntityTypeBatch.decode(reader, reader.uint32()); - break; - case 4: - message.languageCode = reader.string(); - break; - case 5: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.audio = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -10157,163 +11015,130 @@ }; /** - * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes an OutputAudio message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.OutputAudio * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.OutputAudio} OutputAudio * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchUpdateEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + OutputAudio.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchUpdateEntityTypesRequest message. + * Verifies an OutputAudio message. * @function verify - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.OutputAudio * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchUpdateEntityTypesRequest.verify = function verify(message) { + OutputAudio.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.entityTypeBatchUri != null && message.hasOwnProperty("entityTypeBatchUri")) { - properties.entityTypeBatch = 1; - if (!$util.isString(message.entityTypeBatchUri)) - return "entityTypeBatchUri: string expected"; - } - if (message.entityTypeBatchInline != null && message.hasOwnProperty("entityTypeBatchInline")) { - if (properties.entityTypeBatch === 1) - return "entityTypeBatch: multiple values"; - properties.entityTypeBatch = 1; - { - var error = $root.google.cloud.dialogflow.v2.EntityTypeBatch.verify(message.entityTypeBatchInline); - if (error) - return "entityTypeBatchInline." + error; - } - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.dialogflow.v2.OutputAudioConfig.verify(message.config); if (error) - return "updateMask." + error; + return "config." + error; } + if (message.audio != null && message.hasOwnProperty("audio")) + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; return null; }; /** - * Creates a BatchUpdateEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an OutputAudio message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.OutputAudio * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.OutputAudio} OutputAudio */ - BatchUpdateEntityTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest) + OutputAudio.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.OutputAudio) return object; - var message = new $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.entityTypeBatchUri != null) - message.entityTypeBatchUri = String(object.entityTypeBatchUri); - if (object.entityTypeBatchInline != null) { - if (typeof object.entityTypeBatchInline !== "object") - throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.entityTypeBatchInline: object expected"); - message.entityTypeBatchInline = $root.google.cloud.dialogflow.v2.EntityTypeBatch.fromObject(object.entityTypeBatchInline); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.dialogflow.v2.OutputAudio(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.dialogflow.v2.OutputAudio.config: object expected"); + message.config = $root.google.cloud.dialogflow.v2.OutputAudioConfig.fromObject(object.config); + } + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length) + message.audio = object.audio; return message; }; /** - * Creates a plain object from a BatchUpdateEntityTypesRequest message. Also converts values to other types if specified. + * Creates a plain object from an OutputAudio message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.OutputAudio * @static - * @param {google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest} message BatchUpdateEntityTypesRequest + * @param {google.cloud.dialogflow.v2.OutputAudio} message OutputAudio * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchUpdateEntityTypesRequest.toObject = function toObject(message, options) { + OutputAudio.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.languageCode = ""; - object.updateMask = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.entityTypeBatchUri != null && message.hasOwnProperty("entityTypeBatchUri")) { - object.entityTypeBatchUri = message.entityTypeBatchUri; - if (options.oneofs) - object.entityTypeBatch = "entityTypeBatchUri"; - } - if (message.entityTypeBatchInline != null && message.hasOwnProperty("entityTypeBatchInline")) { - object.entityTypeBatchInline = $root.google.cloud.dialogflow.v2.EntityTypeBatch.toObject(message.entityTypeBatchInline, options); - if (options.oneofs) - object.entityTypeBatch = "entityTypeBatchInline"; + object.config = null; + if (options.bytes === String) + object.audio = ""; + else { + object.audio = []; + if (options.bytes !== Array) + object.audio = $util.newBuffer(object.audio); + } } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.dialogflow.v2.OutputAudioConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; return object; }; /** - * Converts this BatchUpdateEntityTypesRequest to JSON. + * Converts this OutputAudio to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.OutputAudio * @instance * @returns {Object.} JSON object */ - BatchUpdateEntityTypesRequest.prototype.toJSON = function toJSON() { + OutputAudio.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchUpdateEntityTypesRequest; + return OutputAudio; })(); - v2.BatchUpdateEntityTypesResponse = (function() { + v2.AutomatedAgentReply = (function() { /** - * Properties of a BatchUpdateEntityTypesResponse. + * Properties of an AutomatedAgentReply. * @memberof google.cloud.dialogflow.v2 - * @interface IBatchUpdateEntityTypesResponse - * @property {Array.|null} [entityTypes] BatchUpdateEntityTypesResponse entityTypes + * @interface IAutomatedAgentReply + * @property {google.cloud.dialogflow.v2.IDetectIntentResponse|null} [detectIntentResponse] AutomatedAgentReply detectIntentResponse */ /** - * Constructs a new BatchUpdateEntityTypesResponse. + * Constructs a new AutomatedAgentReply. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a BatchUpdateEntityTypesResponse. - * @implements IBatchUpdateEntityTypesResponse + * @classdesc Represents an AutomatedAgentReply. + * @implements IAutomatedAgentReply * @constructor - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IAutomatedAgentReply=} [properties] Properties to set */ - function BatchUpdateEntityTypesResponse(properties) { - this.entityTypes = []; + function AutomatedAgentReply(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10321,78 +11146,75 @@ } /** - * BatchUpdateEntityTypesResponse entityTypes. - * @member {Array.} entityTypes - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse + * AutomatedAgentReply detectIntentResponse. + * @member {google.cloud.dialogflow.v2.IDetectIntentResponse|null|undefined} detectIntentResponse + * @memberof google.cloud.dialogflow.v2.AutomatedAgentReply * @instance */ - BatchUpdateEntityTypesResponse.prototype.entityTypes = $util.emptyArray; + AutomatedAgentReply.prototype.detectIntentResponse = null; /** - * Creates a new BatchUpdateEntityTypesResponse instance using the specified properties. + * Creates a new AutomatedAgentReply instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.AutomatedAgentReply * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse instance + * @param {google.cloud.dialogflow.v2.IAutomatedAgentReply=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.AutomatedAgentReply} AutomatedAgentReply instance */ - BatchUpdateEntityTypesResponse.create = function create(properties) { - return new BatchUpdateEntityTypesResponse(properties); + AutomatedAgentReply.create = function create(properties) { + return new AutomatedAgentReply(properties); }; /** - * Encodes the specified BatchUpdateEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.verify|verify} messages. + * Encodes the specified AutomatedAgentReply message. Does not implicitly {@link google.cloud.dialogflow.v2.AutomatedAgentReply.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.AutomatedAgentReply * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse} message BatchUpdateEntityTypesResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAutomatedAgentReply} message AutomatedAgentReply message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchUpdateEntityTypesResponse.encode = function encode(message, writer) { + AutomatedAgentReply.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.entityTypes != null && message.entityTypes.length) - for (var i = 0; i < message.entityTypes.length; ++i) - $root.google.cloud.dialogflow.v2.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.detectIntentResponse != null && Object.hasOwnProperty.call(message, "detectIntentResponse")) + $root.google.cloud.dialogflow.v2.DetectIntentResponse.encode(message.detectIntentResponse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchUpdateEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.verify|verify} messages. + * Encodes the specified AutomatedAgentReply message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AutomatedAgentReply.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.AutomatedAgentReply * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse} message BatchUpdateEntityTypesResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAutomatedAgentReply} message AutomatedAgentReply message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchUpdateEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + AutomatedAgentReply.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer. + * Decodes an AutomatedAgentReply message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.AutomatedAgentReply * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse + * @returns {google.cloud.dialogflow.v2.AutomatedAgentReply} AutomatedAgentReply * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchUpdateEntityTypesResponse.decode = function decode(reader, length) { + AutomatedAgentReply.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.AutomatedAgentReply(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.entityTypes && message.entityTypes.length)) - message.entityTypes = []; - message.entityTypes.push($root.google.cloud.dialogflow.v2.EntityType.decode(reader, reader.uint32())); + message.detectIntentResponse = $root.google.cloud.dialogflow.v2.DetectIntentResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -10403,126 +11225,119 @@ }; /** - * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer, length delimited. + * Decodes an AutomatedAgentReply message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.AutomatedAgentReply * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse + * @returns {google.cloud.dialogflow.v2.AutomatedAgentReply} AutomatedAgentReply * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchUpdateEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + AutomatedAgentReply.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchUpdateEntityTypesResponse message. + * Verifies an AutomatedAgentReply message. * @function verify - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.AutomatedAgentReply * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchUpdateEntityTypesResponse.verify = function verify(message) { + AutomatedAgentReply.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { - if (!Array.isArray(message.entityTypes)) - return "entityTypes: array expected"; - for (var i = 0; i < message.entityTypes.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.EntityType.verify(message.entityTypes[i]); - if (error) - return "entityTypes." + error; - } + if (message.detectIntentResponse != null && message.hasOwnProperty("detectIntentResponse")) { + var error = $root.google.cloud.dialogflow.v2.DetectIntentResponse.verify(message.detectIntentResponse); + if (error) + return "detectIntentResponse." + error; } return null; }; /** - * Creates a BatchUpdateEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AutomatedAgentReply message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.AutomatedAgentReply * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse + * @returns {google.cloud.dialogflow.v2.AutomatedAgentReply} AutomatedAgentReply */ - BatchUpdateEntityTypesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse) + AutomatedAgentReply.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.AutomatedAgentReply) return object; - var message = new $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse(); - if (object.entityTypes) { - if (!Array.isArray(object.entityTypes)) - throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.entityTypes: array expected"); - message.entityTypes = []; - for (var i = 0; i < object.entityTypes.length; ++i) { - if (typeof object.entityTypes[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.entityTypes: object expected"); - message.entityTypes[i] = $root.google.cloud.dialogflow.v2.EntityType.fromObject(object.entityTypes[i]); - } + var message = new $root.google.cloud.dialogflow.v2.AutomatedAgentReply(); + if (object.detectIntentResponse != null) { + if (typeof object.detectIntentResponse !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AutomatedAgentReply.detectIntentResponse: object expected"); + message.detectIntentResponse = $root.google.cloud.dialogflow.v2.DetectIntentResponse.fromObject(object.detectIntentResponse); } return message; }; /** - * Creates a plain object from a BatchUpdateEntityTypesResponse message. Also converts values to other types if specified. + * Creates a plain object from an AutomatedAgentReply message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.AutomatedAgentReply * @static - * @param {google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse} message BatchUpdateEntityTypesResponse + * @param {google.cloud.dialogflow.v2.AutomatedAgentReply} message AutomatedAgentReply * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchUpdateEntityTypesResponse.toObject = function toObject(message, options) { + AutomatedAgentReply.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entityTypes = []; - if (message.entityTypes && message.entityTypes.length) { - object.entityTypes = []; - for (var j = 0; j < message.entityTypes.length; ++j) - object.entityTypes[j] = $root.google.cloud.dialogflow.v2.EntityType.toObject(message.entityTypes[j], options); - } + if (options.defaults) + object.detectIntentResponse = null; + if (message.detectIntentResponse != null && message.hasOwnProperty("detectIntentResponse")) + object.detectIntentResponse = $root.google.cloud.dialogflow.v2.DetectIntentResponse.toObject(message.detectIntentResponse, options); return object; }; /** - * Converts this BatchUpdateEntityTypesResponse to JSON. + * Converts this AutomatedAgentReply to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.AutomatedAgentReply * @instance * @returns {Object.} JSON object */ - BatchUpdateEntityTypesResponse.prototype.toJSON = function toJSON() { + AutomatedAgentReply.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchUpdateEntityTypesResponse; + return AutomatedAgentReply; })(); - v2.BatchDeleteEntityTypesRequest = (function() { + v2.ArticleAnswer = (function() { /** - * Properties of a BatchDeleteEntityTypesRequest. + * Properties of an ArticleAnswer. * @memberof google.cloud.dialogflow.v2 - * @interface IBatchDeleteEntityTypesRequest - * @property {string|null} [parent] BatchDeleteEntityTypesRequest parent - * @property {Array.|null} [entityTypeNames] BatchDeleteEntityTypesRequest entityTypeNames + * @interface IArticleAnswer + * @property {string|null} [title] ArticleAnswer title + * @property {string|null} [uri] ArticleAnswer uri + * @property {Array.|null} [snippets] ArticleAnswer snippets + * @property {number|null} [confidence] ArticleAnswer confidence + * @property {Object.|null} [metadata] ArticleAnswer metadata + * @property {string|null} [answerRecord] ArticleAnswer answerRecord */ /** - * Constructs a new BatchDeleteEntityTypesRequest. + * Constructs a new ArticleAnswer. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a BatchDeleteEntityTypesRequest. - * @implements IBatchDeleteEntityTypesRequest + * @classdesc Represents an ArticleAnswer. + * @implements IArticleAnswer * @constructor - * @param {google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IArticleAnswer=} [properties] Properties to set */ - function BatchDeleteEntityTypesRequest(properties) { - this.entityTypeNames = []; + function ArticleAnswer(properties) { + this.snippets = []; + this.metadata = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10530,91 +11345,163 @@ } /** - * BatchDeleteEntityTypesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + * ArticleAnswer title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2.ArticleAnswer * @instance */ - BatchDeleteEntityTypesRequest.prototype.parent = ""; + ArticleAnswer.prototype.title = ""; /** - * BatchDeleteEntityTypesRequest entityTypeNames. - * @member {Array.} entityTypeNames - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + * ArticleAnswer uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.v2.ArticleAnswer * @instance */ - BatchDeleteEntityTypesRequest.prototype.entityTypeNames = $util.emptyArray; + ArticleAnswer.prototype.uri = ""; /** - * Creates a new BatchDeleteEntityTypesRequest instance using the specified properties. + * ArticleAnswer snippets. + * @member {Array.} snippets + * @memberof google.cloud.dialogflow.v2.ArticleAnswer + * @instance + */ + ArticleAnswer.prototype.snippets = $util.emptyArray; + + /** + * ArticleAnswer confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.v2.ArticleAnswer + * @instance + */ + ArticleAnswer.prototype.confidence = 0; + + /** + * ArticleAnswer metadata. + * @member {Object.} metadata + * @memberof google.cloud.dialogflow.v2.ArticleAnswer + * @instance + */ + ArticleAnswer.prototype.metadata = $util.emptyObject; + + /** + * ArticleAnswer answerRecord. + * @member {string} answerRecord + * @memberof google.cloud.dialogflow.v2.ArticleAnswer + * @instance + */ + ArticleAnswer.prototype.answerRecord = ""; + + /** + * Creates a new ArticleAnswer instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ArticleAnswer * @static - * @param {google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest instance + * @param {google.cloud.dialogflow.v2.IArticleAnswer=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ArticleAnswer} ArticleAnswer instance */ - BatchDeleteEntityTypesRequest.create = function create(properties) { - return new BatchDeleteEntityTypesRequest(properties); + ArticleAnswer.create = function create(properties) { + return new ArticleAnswer(properties); }; /** - * Encodes the specified BatchDeleteEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest.verify|verify} messages. + * Encodes the specified ArticleAnswer message. Does not implicitly {@link google.cloud.dialogflow.v2.ArticleAnswer.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ArticleAnswer * @static - * @param {google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest} message BatchDeleteEntityTypesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IArticleAnswer} message ArticleAnswer message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDeleteEntityTypesRequest.encode = function encode(message, writer) { + ArticleAnswer.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.entityTypeNames != null && message.entityTypeNames.length) - for (var i = 0; i < message.entityTypeNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityTypeNames[i]); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.snippets != null && message.snippets.length) + for (var i = 0; i < message.snippets.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snippets[i]); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.answerRecord != null && Object.hasOwnProperty.call(message, "answerRecord")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.answerRecord); return writer; }; /** - * Encodes the specified BatchDeleteEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest.verify|verify} messages. + * Encodes the specified ArticleAnswer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ArticleAnswer.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ArticleAnswer * @static - * @param {google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest} message BatchDeleteEntityTypesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IArticleAnswer} message ArticleAnswer message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDeleteEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + ArticleAnswer.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer. + * Decodes an ArticleAnswer message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ArticleAnswer * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.ArticleAnswer} ArticleAnswer * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchDeleteEntityTypesRequest.decode = function decode(reader, length) { + ArticleAnswer.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ArticleAnswer(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.title = reader.string(); break; case 2: - if (!(message.entityTypeNames && message.entityTypeNames.length)) - message.entityTypeNames = []; - message.entityTypeNames.push(reader.string()); + message.uri = reader.string(); + break; + case 3: + if (!(message.snippets && message.snippets.length)) + message.snippets = []; + message.snippets.push(reader.string()); + break; + case 4: + message.confidence = reader.float(); + break; + case 5: + if (message.metadata === $util.emptyObject) + message.metadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + case 6: + message.answerRecord = reader.string(); break; default: reader.skipType(tag & 7); @@ -10625,131 +11512,182 @@ }; /** - * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes an ArticleAnswer message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ArticleAnswer * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.ArticleAnswer} ArticleAnswer * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchDeleteEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + ArticleAnswer.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchDeleteEntityTypesRequest message. + * Verifies an ArticleAnswer message. * @function verify - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ArticleAnswer * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchDeleteEntityTypesRequest.verify = function verify(message) { + ArticleAnswer.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.entityTypeNames != null && message.hasOwnProperty("entityTypeNames")) { - if (!Array.isArray(message.entityTypeNames)) - return "entityTypeNames: array expected"; - for (var i = 0; i < message.entityTypeNames.length; ++i) - if (!$util.isString(message.entityTypeNames[i])) - return "entityTypeNames: string[] expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.snippets != null && message.hasOwnProperty("snippets")) { + if (!Array.isArray(message.snippets)) + return "snippets: array expected"; + for (var i = 0; i < message.snippets.length; ++i) + if (!$util.isString(message.snippets[i])) + return "snippets: string[] expected"; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; } + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + if (!$util.isString(message.answerRecord)) + return "answerRecord: string expected"; return null; }; /** - * Creates a BatchDeleteEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ArticleAnswer message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ArticleAnswer * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.ArticleAnswer} ArticleAnswer */ - BatchDeleteEntityTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest) + ArticleAnswer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ArticleAnswer) return object; - var message = new $root.google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.entityTypeNames) { - if (!Array.isArray(object.entityTypeNames)) - throw TypeError(".google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest.entityTypeNames: array expected"); - message.entityTypeNames = []; - for (var i = 0; i < object.entityTypeNames.length; ++i) - message.entityTypeNames[i] = String(object.entityTypeNames[i]); + var message = new $root.google.cloud.dialogflow.v2.ArticleAnswer(); + if (object.title != null) + message.title = String(object.title); + if (object.uri != null) + message.uri = String(object.uri); + if (object.snippets) { + if (!Array.isArray(object.snippets)) + throw TypeError(".google.cloud.dialogflow.v2.ArticleAnswer.snippets: array expected"); + message.snippets = []; + for (var i = 0; i < object.snippets.length; ++i) + message.snippets[i] = String(object.snippets[i]); } + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ArticleAnswer.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.answerRecord != null) + message.answerRecord = String(object.answerRecord); return message; }; /** - * Creates a plain object from a BatchDeleteEntityTypesRequest message. Also converts values to other types if specified. + * Creates a plain object from an ArticleAnswer message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ArticleAnswer * @static - * @param {google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest} message BatchDeleteEntityTypesRequest + * @param {google.cloud.dialogflow.v2.ArticleAnswer} message ArticleAnswer * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchDeleteEntityTypesRequest.toObject = function toObject(message, options) { + ArticleAnswer.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.entityTypeNames = []; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.entityTypeNames && message.entityTypeNames.length) { - object.entityTypeNames = []; - for (var j = 0; j < message.entityTypeNames.length; ++j) - object.entityTypeNames[j] = message.entityTypeNames[j]; + object.snippets = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.title = ""; + object.uri = ""; + object.confidence = 0; + object.answerRecord = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.snippets && message.snippets.length) { + object.snippets = []; + for (var j = 0; j < message.snippets.length; ++j) + object.snippets[j] = message.snippets[j]; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; } + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + object.answerRecord = message.answerRecord; return object; }; /** - * Converts this BatchDeleteEntityTypesRequest to JSON. + * Converts this ArticleAnswer to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ArticleAnswer * @instance * @returns {Object.} JSON object */ - BatchDeleteEntityTypesRequest.prototype.toJSON = function toJSON() { + ArticleAnswer.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchDeleteEntityTypesRequest; + return ArticleAnswer; })(); - v2.BatchCreateEntitiesRequest = (function() { + v2.FaqAnswer = (function() { /** - * Properties of a BatchCreateEntitiesRequest. + * Properties of a FaqAnswer. * @memberof google.cloud.dialogflow.v2 - * @interface IBatchCreateEntitiesRequest - * @property {string|null} [parent] BatchCreateEntitiesRequest parent - * @property {Array.|null} [entities] BatchCreateEntitiesRequest entities - * @property {string|null} [languageCode] BatchCreateEntitiesRequest languageCode + * @interface IFaqAnswer + * @property {string|null} [answer] FaqAnswer answer + * @property {number|null} [confidence] FaqAnswer confidence + * @property {string|null} [question] FaqAnswer question + * @property {string|null} [source] FaqAnswer source + * @property {Object.|null} [metadata] FaqAnswer metadata + * @property {string|null} [answerRecord] FaqAnswer answerRecord */ /** - * Constructs a new BatchCreateEntitiesRequest. + * Constructs a new FaqAnswer. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a BatchCreateEntitiesRequest. - * @implements IBatchCreateEntitiesRequest + * @classdesc Represents a FaqAnswer. + * @implements IFaqAnswer * @constructor - * @param {google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IFaqAnswer=} [properties] Properties to set */ - function BatchCreateEntitiesRequest(properties) { - this.entities = []; + function FaqAnswer(properties) { + this.metadata = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -10757,104 +11695,160 @@ } /** - * BatchCreateEntitiesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + * FaqAnswer answer. + * @member {string} answer + * @memberof google.cloud.dialogflow.v2.FaqAnswer * @instance */ - BatchCreateEntitiesRequest.prototype.parent = ""; + FaqAnswer.prototype.answer = ""; /** - * BatchCreateEntitiesRequest entities. - * @member {Array.} entities - * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + * FaqAnswer confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.v2.FaqAnswer * @instance */ - BatchCreateEntitiesRequest.prototype.entities = $util.emptyArray; + FaqAnswer.prototype.confidence = 0; /** - * BatchCreateEntitiesRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + * FaqAnswer question. + * @member {string} question + * @memberof google.cloud.dialogflow.v2.FaqAnswer * @instance */ - BatchCreateEntitiesRequest.prototype.languageCode = ""; + FaqAnswer.prototype.question = ""; /** - * Creates a new BatchCreateEntitiesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest instance - */ - BatchCreateEntitiesRequest.create = function create(properties) { - return new BatchCreateEntitiesRequest(properties); + * FaqAnswer source. + * @member {string} source + * @memberof google.cloud.dialogflow.v2.FaqAnswer + * @instance + */ + FaqAnswer.prototype.source = ""; + + /** + * FaqAnswer metadata. + * @member {Object.} metadata + * @memberof google.cloud.dialogflow.v2.FaqAnswer + * @instance + */ + FaqAnswer.prototype.metadata = $util.emptyObject; + + /** + * FaqAnswer answerRecord. + * @member {string} answerRecord + * @memberof google.cloud.dialogflow.v2.FaqAnswer + * @instance + */ + FaqAnswer.prototype.answerRecord = ""; + + /** + * Creates a new FaqAnswer instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.FaqAnswer + * @static + * @param {google.cloud.dialogflow.v2.IFaqAnswer=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.FaqAnswer} FaqAnswer instance + */ + FaqAnswer.create = function create(properties) { + return new FaqAnswer(properties); }; /** - * Encodes the specified BatchCreateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.verify|verify} messages. + * Encodes the specified FaqAnswer message. Does not implicitly {@link google.cloud.dialogflow.v2.FaqAnswer.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.FaqAnswer * @static - * @param {google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest} message BatchCreateEntitiesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IFaqAnswer} message FaqAnswer message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateEntitiesRequest.encode = function encode(message, writer) { + FaqAnswer.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.entities != null && message.entities.length) - for (var i = 0; i < message.entities.length; ++i) - $root.google.cloud.dialogflow.v2.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.answer != null && Object.hasOwnProperty.call(message, "answer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.answer); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.question != null && Object.hasOwnProperty.call(message, "question")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.question); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.source); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.answerRecord != null && Object.hasOwnProperty.call(message, "answerRecord")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.answerRecord); return writer; }; /** - * Encodes the specified BatchCreateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.verify|verify} messages. + * Encodes the specified FaqAnswer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.FaqAnswer.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.FaqAnswer * @static - * @param {google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest} message BatchCreateEntitiesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IFaqAnswer} message FaqAnswer message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchCreateEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + FaqAnswer.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer. + * Decodes a FaqAnswer message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.FaqAnswer * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest + * @returns {google.cloud.dialogflow.v2.FaqAnswer} FaqAnswer * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateEntitiesRequest.decode = function decode(reader, length) { + FaqAnswer.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchCreateEntitiesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.FaqAnswer(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.answer = reader.string(); break; case 2: - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.dialogflow.v2.EntityType.Entity.decode(reader, reader.uint32())); + message.confidence = reader.float(); break; case 3: - message.languageCode = reader.string(); + message.question = reader.string(); + break; + case 4: + message.source = reader.string(); + break; + case 5: + if (message.metadata === $util.emptyObject) + message.metadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + case 6: + message.answerRecord = reader.string(); break; default: reader.skipType(tag & 7); @@ -10865,146 +11859,165 @@ }; /** - * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer, length delimited. + * Decodes a FaqAnswer message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.FaqAnswer * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest + * @returns {google.cloud.dialogflow.v2.FaqAnswer} FaqAnswer * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchCreateEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + FaqAnswer.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchCreateEntitiesRequest message. + * Verifies a FaqAnswer message. * @function verify - * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.FaqAnswer * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchCreateEntitiesRequest.verify = function verify(message) { + FaqAnswer.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.entities != null && message.hasOwnProperty("entities")) { - if (!Array.isArray(message.entities)) - return "entities: array expected"; - for (var i = 0; i < message.entities.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.EntityType.Entity.verify(message.entities[i]); - if (error) - return "entities." + error; - } + if (message.answer != null && message.hasOwnProperty("answer")) + if (!$util.isString(message.answer)) + return "answer: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.question != null && message.hasOwnProperty("question")) + if (!$util.isString(message.question)) + return "question: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + if (!$util.isString(message.answerRecord)) + return "answerRecord: string expected"; return null; }; /** - * Creates a BatchCreateEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a FaqAnswer message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.FaqAnswer * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest + * @returns {google.cloud.dialogflow.v2.FaqAnswer} FaqAnswer */ - BatchCreateEntitiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.BatchCreateEntitiesRequest) + FaqAnswer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.FaqAnswer) return object; - var message = new $root.google.cloud.dialogflow.v2.BatchCreateEntitiesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.entities: array expected"); - message.entities = []; - for (var i = 0; i < object.entities.length; ++i) { - if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.entities: object expected"); - message.entities[i] = $root.google.cloud.dialogflow.v2.EntityType.Entity.fromObject(object.entities[i]); - } - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); + var message = new $root.google.cloud.dialogflow.v2.FaqAnswer(); + if (object.answer != null) + message.answer = String(object.answer); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.question != null) + message.question = String(object.question); + if (object.source != null) + message.source = String(object.source); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.v2.FaqAnswer.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.answerRecord != null) + message.answerRecord = String(object.answerRecord); return message; }; /** - * Creates a plain object from a BatchCreateEntitiesRequest message. Also converts values to other types if specified. + * Creates a plain object from a FaqAnswer message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.FaqAnswer * @static - * @param {google.cloud.dialogflow.v2.BatchCreateEntitiesRequest} message BatchCreateEntitiesRequest + * @param {google.cloud.dialogflow.v2.FaqAnswer} message FaqAnswer * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchCreateEntitiesRequest.toObject = function toObject(message, options) { + FaqAnswer.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entities = []; + if (options.objects || options.defaults) + object.metadata = {}; if (options.defaults) { - object.parent = ""; - object.languageCode = ""; + object.answer = ""; + object.confidence = 0; + object.question = ""; + object.source = ""; + object.answerRecord = ""; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.entities && message.entities.length) { - object.entities = []; - for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = $root.google.cloud.dialogflow.v2.EntityType.Entity.toObject(message.entities[j], options); + if (message.answer != null && message.hasOwnProperty("answer")) + object.answer = message.answer; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.question != null && message.hasOwnProperty("question")) + object.question = message.question; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + object.answerRecord = message.answerRecord; return object; }; /** - * Converts this BatchCreateEntitiesRequest to JSON. + * Converts this FaqAnswer to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.FaqAnswer * @instance * @returns {Object.} JSON object */ - BatchCreateEntitiesRequest.prototype.toJSON = function toJSON() { + FaqAnswer.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchCreateEntitiesRequest; + return FaqAnswer; })(); - v2.BatchUpdateEntitiesRequest = (function() { + v2.SuggestionResult = (function() { /** - * Properties of a BatchUpdateEntitiesRequest. + * Properties of a SuggestionResult. * @memberof google.cloud.dialogflow.v2 - * @interface IBatchUpdateEntitiesRequest - * @property {string|null} [parent] BatchUpdateEntitiesRequest parent - * @property {Array.|null} [entities] BatchUpdateEntitiesRequest entities - * @property {string|null} [languageCode] BatchUpdateEntitiesRequest languageCode - * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateEntitiesRequest updateMask + * @interface ISuggestionResult + * @property {google.rpc.IStatus|null} [error] SuggestionResult error + * @property {google.cloud.dialogflow.v2.ISuggestArticlesResponse|null} [suggestArticlesResponse] SuggestionResult suggestArticlesResponse + * @property {google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse|null} [suggestFaqAnswersResponse] SuggestionResult suggestFaqAnswersResponse */ /** - * Constructs a new BatchUpdateEntitiesRequest. + * Constructs a new SuggestionResult. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a BatchUpdateEntitiesRequest. - * @implements IBatchUpdateEntitiesRequest + * @classdesc Represents a SuggestionResult. + * @implements ISuggestionResult * @constructor - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ISuggestionResult=} [properties] Properties to set */ - function BatchUpdateEntitiesRequest(properties) { - this.entities = []; + function SuggestionResult(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11012,117 +12025,115 @@ } /** - * BatchUpdateEntitiesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * SuggestionResult error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @instance */ - BatchUpdateEntitiesRequest.prototype.parent = ""; + SuggestionResult.prototype.error = null; /** - * BatchUpdateEntitiesRequest entities. - * @member {Array.} entities - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * SuggestionResult suggestArticlesResponse. + * @member {google.cloud.dialogflow.v2.ISuggestArticlesResponse|null|undefined} suggestArticlesResponse + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @instance */ - BatchUpdateEntitiesRequest.prototype.entities = $util.emptyArray; + SuggestionResult.prototype.suggestArticlesResponse = null; /** - * BatchUpdateEntitiesRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * SuggestionResult suggestFaqAnswersResponse. + * @member {google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse|null|undefined} suggestFaqAnswersResponse + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @instance */ - BatchUpdateEntitiesRequest.prototype.languageCode = ""; + SuggestionResult.prototype.suggestFaqAnswersResponse = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * BatchUpdateEntitiesRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * SuggestionResult suggestionResponse. + * @member {"error"|"suggestArticlesResponse"|"suggestFaqAnswersResponse"|undefined} suggestionResponse + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @instance */ - BatchUpdateEntitiesRequest.prototype.updateMask = null; + Object.defineProperty(SuggestionResult.prototype, "suggestionResponse", { + get: $util.oneOfGetter($oneOfFields = ["error", "suggestArticlesResponse", "suggestFaqAnswersResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new BatchUpdateEntitiesRequest instance using the specified properties. + * Creates a new SuggestionResult instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest instance + * @param {google.cloud.dialogflow.v2.ISuggestionResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SuggestionResult} SuggestionResult instance */ - BatchUpdateEntitiesRequest.create = function create(properties) { - return new BatchUpdateEntitiesRequest(properties); + SuggestionResult.create = function create(properties) { + return new SuggestionResult(properties); }; /** - * Encodes the specified BatchUpdateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.verify|verify} messages. + * Encodes the specified SuggestionResult message. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestionResult.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest} message BatchUpdateEntitiesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISuggestionResult} message SuggestionResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchUpdateEntitiesRequest.encode = function encode(message, writer) { + SuggestionResult.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.entities != null && message.entities.length) - for (var i = 0; i < message.entities.length; ++i) - $root.google.cloud.dialogflow.v2.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.suggestArticlesResponse != null && Object.hasOwnProperty.call(message, "suggestArticlesResponse")) + $root.google.cloud.dialogflow.v2.SuggestArticlesResponse.encode(message.suggestArticlesResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.suggestFaqAnswersResponse != null && Object.hasOwnProperty.call(message, "suggestFaqAnswersResponse")) + $root.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.encode(message.suggestFaqAnswersResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchUpdateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.verify|verify} messages. + * Encodes the specified SuggestionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestionResult.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest} message BatchUpdateEntitiesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISuggestionResult} message SuggestionResult message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchUpdateEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + SuggestionResult.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer. + * Decodes a SuggestionResult message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest + * @returns {google.cloud.dialogflow.v2.SuggestionResult} SuggestionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchUpdateEntitiesRequest.decode = function decode(reader, length) { + SuggestionResult.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SuggestionResult(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); break; case 2: - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.dialogflow.v2.EntityType.Entity.decode(reader, reader.uint32())); + message.suggestArticlesResponse = $root.google.cloud.dialogflow.v2.SuggestArticlesResponse.decode(reader, reader.uint32()); break; case 3: - message.languageCode = reader.string(); - break; - case 4: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.suggestFaqAnswersResponse = $root.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11133,158 +12144,157 @@ }; /** - * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer, length delimited. + * Decodes a SuggestionResult message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest + * @returns {google.cloud.dialogflow.v2.SuggestionResult} SuggestionResult * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchUpdateEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + SuggestionResult.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchUpdateEntitiesRequest message. + * Verifies a SuggestionResult message. * @function verify - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchUpdateEntitiesRequest.verify = function verify(message) { + SuggestionResult.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.entities != null && message.hasOwnProperty("entities")) { - if (!Array.isArray(message.entities)) - return "entities: array expected"; - for (var i = 0; i < message.entities.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.EntityType.Entity.verify(message.entities[i]); + var properties = {}; + if (message.error != null && message.hasOwnProperty("error")) { + properties.suggestionResponse = 1; + { + var error = $root.google.rpc.Status.verify(message.error); if (error) - return "entities." + error; + return "error." + error; } } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; + if (message.suggestArticlesResponse != null && message.hasOwnProperty("suggestArticlesResponse")) { + if (properties.suggestionResponse === 1) + return "suggestionResponse: multiple values"; + properties.suggestionResponse = 1; + { + var error = $root.google.cloud.dialogflow.v2.SuggestArticlesResponse.verify(message.suggestArticlesResponse); + if (error) + return "suggestArticlesResponse." + error; + } + } + if (message.suggestFaqAnswersResponse != null && message.hasOwnProperty("suggestFaqAnswersResponse")) { + if (properties.suggestionResponse === 1) + return "suggestionResponse: multiple values"; + properties.suggestionResponse = 1; + { + var error = $root.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.verify(message.suggestFaqAnswersResponse); + if (error) + return "suggestFaqAnswersResponse." + error; + } } return null; }; /** - * Creates a BatchUpdateEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SuggestionResult message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest + * @returns {google.cloud.dialogflow.v2.SuggestionResult} SuggestionResult */ - BatchUpdateEntitiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest) + SuggestionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SuggestionResult) return object; - var message = new $root.google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.entities: array expected"); - message.entities = []; - for (var i = 0; i < object.entities.length; ++i) { - if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.entities: object expected"); - message.entities[i] = $root.google.cloud.dialogflow.v2.EntityType.Entity.fromObject(object.entities[i]); - } - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.dialogflow.v2.SuggestionResult(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.dialogflow.v2.SuggestionResult.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.suggestArticlesResponse != null) { + if (typeof object.suggestArticlesResponse !== "object") + throw TypeError(".google.cloud.dialogflow.v2.SuggestionResult.suggestArticlesResponse: object expected"); + message.suggestArticlesResponse = $root.google.cloud.dialogflow.v2.SuggestArticlesResponse.fromObject(object.suggestArticlesResponse); + } + if (object.suggestFaqAnswersResponse != null) { + if (typeof object.suggestFaqAnswersResponse !== "object") + throw TypeError(".google.cloud.dialogflow.v2.SuggestionResult.suggestFaqAnswersResponse: object expected"); + message.suggestFaqAnswersResponse = $root.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.fromObject(object.suggestFaqAnswersResponse); } return message; }; /** - * Creates a plain object from a BatchUpdateEntitiesRequest message. Also converts values to other types if specified. + * Creates a plain object from a SuggestionResult message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @static - * @param {google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest} message BatchUpdateEntitiesRequest + * @param {google.cloud.dialogflow.v2.SuggestionResult} message SuggestionResult * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchUpdateEntitiesRequest.toObject = function toObject(message, options) { + SuggestionResult.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entities = []; - if (options.defaults) { - object.parent = ""; - object.languageCode = ""; - object.updateMask = null; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.suggestionResponse = "error"; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.entities && message.entities.length) { - object.entities = []; - for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = $root.google.cloud.dialogflow.v2.EntityType.Entity.toObject(message.entities[j], options); + if (message.suggestArticlesResponse != null && message.hasOwnProperty("suggestArticlesResponse")) { + object.suggestArticlesResponse = $root.google.cloud.dialogflow.v2.SuggestArticlesResponse.toObject(message.suggestArticlesResponse, options); + if (options.oneofs) + object.suggestionResponse = "suggestArticlesResponse"; + } + if (message.suggestFaqAnswersResponse != null && message.hasOwnProperty("suggestFaqAnswersResponse")) { + object.suggestFaqAnswersResponse = $root.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse.toObject(message.suggestFaqAnswersResponse, options); + if (options.oneofs) + object.suggestionResponse = "suggestFaqAnswersResponse"; } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this BatchUpdateEntitiesRequest to JSON. + * Converts this SuggestionResult to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * @memberof google.cloud.dialogflow.v2.SuggestionResult * @instance * @returns {Object.} JSON object */ - BatchUpdateEntitiesRequest.prototype.toJSON = function toJSON() { + SuggestionResult.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchUpdateEntitiesRequest; + return SuggestionResult; })(); - v2.BatchDeleteEntitiesRequest = (function() { + v2.InputTextConfig = (function() { /** - * Properties of a BatchDeleteEntitiesRequest. + * Properties of an InputTextConfig. * @memberof google.cloud.dialogflow.v2 - * @interface IBatchDeleteEntitiesRequest - * @property {string|null} [parent] BatchDeleteEntitiesRequest parent - * @property {Array.|null} [entityValues] BatchDeleteEntitiesRequest entityValues - * @property {string|null} [languageCode] BatchDeleteEntitiesRequest languageCode + * @interface IInputTextConfig + * @property {string|null} [languageCode] InputTextConfig languageCode */ /** - * Constructs a new BatchDeleteEntitiesRequest. + * Constructs a new InputTextConfig. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a BatchDeleteEntitiesRequest. - * @implements IBatchDeleteEntitiesRequest + * @classdesc Represents an InputTextConfig. + * @implements IInputTextConfig * @constructor - * @param {google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IInputTextConfig=} [properties] Properties to set */ - function BatchDeleteEntitiesRequest(properties) { - this.entityValues = []; + function InputTextConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11292,103 +12302,74 @@ } /** - * BatchDeleteEntitiesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest - * @instance - */ - BatchDeleteEntitiesRequest.prototype.parent = ""; - - /** - * BatchDeleteEntitiesRequest entityValues. - * @member {Array.} entityValues - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest - * @instance - */ - BatchDeleteEntitiesRequest.prototype.entityValues = $util.emptyArray; - - /** - * BatchDeleteEntitiesRequest languageCode. + * InputTextConfig languageCode. * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + * @memberof google.cloud.dialogflow.v2.InputTextConfig * @instance */ - BatchDeleteEntitiesRequest.prototype.languageCode = ""; + InputTextConfig.prototype.languageCode = ""; /** - * Creates a new BatchDeleteEntitiesRequest instance using the specified properties. + * Creates a new InputTextConfig instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + * @memberof google.cloud.dialogflow.v2.InputTextConfig * @static - * @param {google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest instance + * @param {google.cloud.dialogflow.v2.IInputTextConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.InputTextConfig} InputTextConfig instance */ - BatchDeleteEntitiesRequest.create = function create(properties) { - return new BatchDeleteEntitiesRequest(properties); + InputTextConfig.create = function create(properties) { + return new InputTextConfig(properties); }; /** - * Encodes the specified BatchDeleteEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.verify|verify} messages. + * Encodes the specified InputTextConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.InputTextConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + * @memberof google.cloud.dialogflow.v2.InputTextConfig * @static - * @param {google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest} message BatchDeleteEntitiesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IInputTextConfig} message InputTextConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDeleteEntitiesRequest.encode = function encode(message, writer) { + InputTextConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.entityValues != null && message.entityValues.length) - for (var i = 0; i < message.entityValues.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityValues[i]); if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); return writer; }; /** - * Encodes the specified BatchDeleteEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.verify|verify} messages. + * Encodes the specified InputTextConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.InputTextConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + * @memberof google.cloud.dialogflow.v2.InputTextConfig * @static - * @param {google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest} message BatchDeleteEntitiesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IInputTextConfig} message InputTextConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchDeleteEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + InputTextConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer. + * Decodes an InputTextConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + * @memberof google.cloud.dialogflow.v2.InputTextConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest + * @returns {google.cloud.dialogflow.v2.InputTextConfig} InputTextConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchDeleteEntitiesRequest.decode = function decode(reader, length) { + InputTextConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.InputTextConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - if (!(message.entityValues && message.entityValues.length)) - message.entityValues = []; - message.entityValues.push(reader.string()); - break; - case 3: message.languageCode = reader.string(); break; default: @@ -11400,42 +12381,32 @@ }; /** - * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer, length delimited. + * Decodes an InputTextConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + * @memberof google.cloud.dialogflow.v2.InputTextConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest + * @returns {google.cloud.dialogflow.v2.InputTextConfig} InputTextConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchDeleteEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + InputTextConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchDeleteEntitiesRequest message. + * Verifies an InputTextConfig message. * @function verify - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + * @memberof google.cloud.dialogflow.v2.InputTextConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchDeleteEntitiesRequest.verify = function verify(message) { + InputTextConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.entityValues != null && message.hasOwnProperty("entityValues")) { - if (!Array.isArray(message.entityValues)) - return "entityValues: array expected"; - for (var i = 0; i < message.entityValues.length; ++i) - if (!$util.isString(message.entityValues[i])) - return "entityValues: string[] expected"; - } if (message.languageCode != null && message.hasOwnProperty("languageCode")) if (!$util.isString(message.languageCode)) return "languageCode: string expected"; @@ -11443,95 +12414,76 @@ }; /** - * Creates a BatchDeleteEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an InputTextConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + * @memberof google.cloud.dialogflow.v2.InputTextConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest + * @returns {google.cloud.dialogflow.v2.InputTextConfig} InputTextConfig */ - BatchDeleteEntitiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest) + InputTextConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.InputTextConfig) return object; - var message = new $root.google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.entityValues) { - if (!Array.isArray(object.entityValues)) - throw TypeError(".google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.entityValues: array expected"); - message.entityValues = []; - for (var i = 0; i < object.entityValues.length; ++i) - message.entityValues[i] = String(object.entityValues[i]); - } + var message = new $root.google.cloud.dialogflow.v2.InputTextConfig(); if (object.languageCode != null) message.languageCode = String(object.languageCode); return message; }; /** - * Creates a plain object from a BatchDeleteEntitiesRequest message. Also converts values to other types if specified. + * Creates a plain object from an InputTextConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + * @memberof google.cloud.dialogflow.v2.InputTextConfig * @static - * @param {google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest} message BatchDeleteEntitiesRequest + * @param {google.cloud.dialogflow.v2.InputTextConfig} message InputTextConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchDeleteEntitiesRequest.toObject = function toObject(message, options) { + InputTextConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entityValues = []; - if (options.defaults) { - object.parent = ""; + if (options.defaults) object.languageCode = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.entityValues && message.entityValues.length) { - object.entityValues = []; - for (var j = 0; j < message.entityValues.length; ++j) - object.entityValues[j] = message.entityValues[j]; - } if (message.languageCode != null && message.hasOwnProperty("languageCode")) object.languageCode = message.languageCode; return object; }; /** - * Converts this BatchDeleteEntitiesRequest to JSON. + * Converts this InputTextConfig to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + * @memberof google.cloud.dialogflow.v2.InputTextConfig * @instance * @returns {Object.} JSON object */ - BatchDeleteEntitiesRequest.prototype.toJSON = function toJSON() { + InputTextConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchDeleteEntitiesRequest; + return InputTextConfig; })(); - v2.EntityTypeBatch = (function() { + v2.AnnotatedMessagePart = (function() { /** - * Properties of an EntityTypeBatch. + * Properties of an AnnotatedMessagePart. * @memberof google.cloud.dialogflow.v2 - * @interface IEntityTypeBatch - * @property {Array.|null} [entityTypes] EntityTypeBatch entityTypes + * @interface IAnnotatedMessagePart + * @property {string|null} [text] AnnotatedMessagePart text + * @property {string|null} [entityType] AnnotatedMessagePart entityType + * @property {google.protobuf.IValue|null} [formattedValue] AnnotatedMessagePart formattedValue */ /** - * Constructs a new EntityTypeBatch. + * Constructs a new AnnotatedMessagePart. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an EntityTypeBatch. - * @implements IEntityTypeBatch + * @classdesc Represents an AnnotatedMessagePart. + * @implements IAnnotatedMessagePart * @constructor - * @param {google.cloud.dialogflow.v2.IEntityTypeBatch=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IAnnotatedMessagePart=} [properties] Properties to set */ - function EntityTypeBatch(properties) { - this.entityTypes = []; + function AnnotatedMessagePart(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11539,78 +12491,101 @@ } /** - * EntityTypeBatch entityTypes. - * @member {Array.} entityTypes - * @memberof google.cloud.dialogflow.v2.EntityTypeBatch + * AnnotatedMessagePart text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2.AnnotatedMessagePart * @instance */ - EntityTypeBatch.prototype.entityTypes = $util.emptyArray; + AnnotatedMessagePart.prototype.text = ""; /** - * Creates a new EntityTypeBatch instance using the specified properties. + * AnnotatedMessagePart entityType. + * @member {string} entityType + * @memberof google.cloud.dialogflow.v2.AnnotatedMessagePart + * @instance + */ + AnnotatedMessagePart.prototype.entityType = ""; + + /** + * AnnotatedMessagePart formattedValue. + * @member {google.protobuf.IValue|null|undefined} formattedValue + * @memberof google.cloud.dialogflow.v2.AnnotatedMessagePart + * @instance + */ + AnnotatedMessagePart.prototype.formattedValue = null; + + /** + * Creates a new AnnotatedMessagePart instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.EntityTypeBatch + * @memberof google.cloud.dialogflow.v2.AnnotatedMessagePart * @static - * @param {google.cloud.dialogflow.v2.IEntityTypeBatch=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.EntityTypeBatch} EntityTypeBatch instance + * @param {google.cloud.dialogflow.v2.IAnnotatedMessagePart=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.AnnotatedMessagePart} AnnotatedMessagePart instance */ - EntityTypeBatch.create = function create(properties) { - return new EntityTypeBatch(properties); + AnnotatedMessagePart.create = function create(properties) { + return new AnnotatedMessagePart(properties); }; /** - * Encodes the specified EntityTypeBatch message. Does not implicitly {@link google.cloud.dialogflow.v2.EntityTypeBatch.verify|verify} messages. + * Encodes the specified AnnotatedMessagePart message. Does not implicitly {@link google.cloud.dialogflow.v2.AnnotatedMessagePart.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.EntityTypeBatch + * @memberof google.cloud.dialogflow.v2.AnnotatedMessagePart * @static - * @param {google.cloud.dialogflow.v2.IEntityTypeBatch} message EntityTypeBatch message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAnnotatedMessagePart} message AnnotatedMessagePart message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EntityTypeBatch.encode = function encode(message, writer) { + AnnotatedMessagePart.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.entityTypes != null && message.entityTypes.length) - for (var i = 0; i < message.entityTypes.length; ++i) - $root.google.cloud.dialogflow.v2.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityType); + if (message.formattedValue != null && Object.hasOwnProperty.call(message, "formattedValue")) + $root.google.protobuf.Value.encode(message.formattedValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified EntityTypeBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EntityTypeBatch.verify|verify} messages. + * Encodes the specified AnnotatedMessagePart message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AnnotatedMessagePart.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.EntityTypeBatch + * @memberof google.cloud.dialogflow.v2.AnnotatedMessagePart * @static - * @param {google.cloud.dialogflow.v2.IEntityTypeBatch} message EntityTypeBatch message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAnnotatedMessagePart} message AnnotatedMessagePart message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EntityTypeBatch.encodeDelimited = function encodeDelimited(message, writer) { + AnnotatedMessagePart.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EntityTypeBatch message from the specified reader or buffer. + * Decodes an AnnotatedMessagePart message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.EntityTypeBatch + * @memberof google.cloud.dialogflow.v2.AnnotatedMessagePart * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.EntityTypeBatch} EntityTypeBatch + * @returns {google.cloud.dialogflow.v2.AnnotatedMessagePart} AnnotatedMessagePart * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EntityTypeBatch.decode = function decode(reader, length) { + AnnotatedMessagePart.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.EntityTypeBatch(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.AnnotatedMessagePart(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.entityTypes && message.entityTypes.length)) - message.entityTypes = []; - message.entityTypes.push($root.google.cloud.dialogflow.v2.EntityType.decode(reader, reader.uint32())); + message.text = reader.string(); + break; + case 2: + message.entityType = reader.string(); + break; + case 3: + message.formattedValue = $root.google.protobuf.Value.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -11621,196 +12596,131 @@ }; /** - * Decodes an EntityTypeBatch message from the specified reader or buffer, length delimited. + * Decodes an AnnotatedMessagePart message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.EntityTypeBatch + * @memberof google.cloud.dialogflow.v2.AnnotatedMessagePart * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.EntityTypeBatch} EntityTypeBatch + * @returns {google.cloud.dialogflow.v2.AnnotatedMessagePart} AnnotatedMessagePart * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EntityTypeBatch.decodeDelimited = function decodeDelimited(reader) { + AnnotatedMessagePart.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EntityTypeBatch message. + * Verifies an AnnotatedMessagePart message. * @function verify - * @memberof google.cloud.dialogflow.v2.EntityTypeBatch + * @memberof google.cloud.dialogflow.v2.AnnotatedMessagePart * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EntityTypeBatch.verify = function verify(message) { + AnnotatedMessagePart.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { - if (!Array.isArray(message.entityTypes)) - return "entityTypes: array expected"; - for (var i = 0; i < message.entityTypes.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.EntityType.verify(message.entityTypes[i]); - if (error) - return "entityTypes." + error; - } + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) + if (!$util.isString(message.entityType)) + return "entityType: string expected"; + if (message.formattedValue != null && message.hasOwnProperty("formattedValue")) { + var error = $root.google.protobuf.Value.verify(message.formattedValue); + if (error) + return "formattedValue." + error; } return null; }; /** - * Creates an EntityTypeBatch message from a plain object. Also converts values to their respective internal types. + * Creates an AnnotatedMessagePart message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.EntityTypeBatch + * @memberof google.cloud.dialogflow.v2.AnnotatedMessagePart * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.EntityTypeBatch} EntityTypeBatch + * @returns {google.cloud.dialogflow.v2.AnnotatedMessagePart} AnnotatedMessagePart */ - EntityTypeBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.EntityTypeBatch) + AnnotatedMessagePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.AnnotatedMessagePart) return object; - var message = new $root.google.cloud.dialogflow.v2.EntityTypeBatch(); - if (object.entityTypes) { - if (!Array.isArray(object.entityTypes)) - throw TypeError(".google.cloud.dialogflow.v2.EntityTypeBatch.entityTypes: array expected"); - message.entityTypes = []; - for (var i = 0; i < object.entityTypes.length; ++i) { - if (typeof object.entityTypes[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.EntityTypeBatch.entityTypes: object expected"); - message.entityTypes[i] = $root.google.cloud.dialogflow.v2.EntityType.fromObject(object.entityTypes[i]); - } + var message = new $root.google.cloud.dialogflow.v2.AnnotatedMessagePart(); + if (object.text != null) + message.text = String(object.text); + if (object.entityType != null) + message.entityType = String(object.entityType); + if (object.formattedValue != null) { + if (typeof object.formattedValue !== "object") + throw TypeError(".google.cloud.dialogflow.v2.AnnotatedMessagePart.formattedValue: object expected"); + message.formattedValue = $root.google.protobuf.Value.fromObject(object.formattedValue); } return message; }; /** - * Creates a plain object from an EntityTypeBatch message. Also converts values to other types if specified. + * Creates a plain object from an AnnotatedMessagePart message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.EntityTypeBatch + * @memberof google.cloud.dialogflow.v2.AnnotatedMessagePart * @static - * @param {google.cloud.dialogflow.v2.EntityTypeBatch} message EntityTypeBatch + * @param {google.cloud.dialogflow.v2.AnnotatedMessagePart} message AnnotatedMessagePart * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EntityTypeBatch.toObject = function toObject(message, options) { + AnnotatedMessagePart.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entityTypes = []; - if (message.entityTypes && message.entityTypes.length) { - object.entityTypes = []; - for (var j = 0; j < message.entityTypes.length; ++j) - object.entityTypes[j] = $root.google.cloud.dialogflow.v2.EntityType.toObject(message.entityTypes[j], options); + if (options.defaults) { + object.text = ""; + object.entityType = ""; + object.formattedValue = null; } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = message.entityType; + if (message.formattedValue != null && message.hasOwnProperty("formattedValue")) + object.formattedValue = $root.google.protobuf.Value.toObject(message.formattedValue, options); return object; }; /** - * Converts this EntityTypeBatch to JSON. + * Converts this AnnotatedMessagePart to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.EntityTypeBatch + * @memberof google.cloud.dialogflow.v2.AnnotatedMessagePart * @instance * @returns {Object.} JSON object */ - EntityTypeBatch.prototype.toJSON = function toJSON() { + AnnotatedMessagePart.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return EntityTypeBatch; - })(); - - v2.Environments = (function() { - - /** - * Constructs a new Environments service. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an Environments - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Environments(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Environments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Environments; - - /** - * Creates new Environments service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dialogflow.v2.Environments - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Environments} RPC service. Useful where requests and/or responses are streamed. - */ - Environments.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dialogflow.v2.Environments#listEnvironments}. - * @memberof google.cloud.dialogflow.v2.Environments - * @typedef ListEnvironmentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.ListEnvironmentsResponse} [response] ListEnvironmentsResponse - */ - - /** - * Calls ListEnvironments. - * @function listEnvironments - * @memberof google.cloud.dialogflow.v2.Environments - * @instance - * @param {google.cloud.dialogflow.v2.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object - * @param {google.cloud.dialogflow.v2.Environments.ListEnvironmentsCallback} callback Node-style callback called with the error, if any, and ListEnvironmentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Environments.prototype.listEnvironments = function listEnvironments(request, callback) { - return this.rpcCall(listEnvironments, $root.google.cloud.dialogflow.v2.ListEnvironmentsRequest, $root.google.cloud.dialogflow.v2.ListEnvironmentsResponse, request, callback); - }, "name", { value: "ListEnvironments" }); - - /** - * Calls ListEnvironments. - * @function listEnvironments - * @memberof google.cloud.dialogflow.v2.Environments - * @instance - * @param {google.cloud.dialogflow.v2.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Environments; + return AnnotatedMessagePart; })(); - v2.Environment = (function() { + v2.MessageAnnotation = (function() { /** - * Properties of an Environment. + * Properties of a MessageAnnotation. * @memberof google.cloud.dialogflow.v2 - * @interface IEnvironment - * @property {string|null} [name] Environment name - * @property {string|null} [description] Environment description - * @property {string|null} [agentVersion] Environment agentVersion - * @property {google.cloud.dialogflow.v2.Environment.State|null} [state] Environment state - * @property {google.protobuf.ITimestamp|null} [updateTime] Environment updateTime + * @interface IMessageAnnotation + * @property {Array.|null} [parts] MessageAnnotation parts + * @property {boolean|null} [containEntities] MessageAnnotation containEntities */ /** - * Constructs a new Environment. + * Constructs a new MessageAnnotation. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an Environment. - * @implements IEnvironment + * @classdesc Represents a MessageAnnotation. + * @implements IMessageAnnotation * @constructor - * @param {google.cloud.dialogflow.v2.IEnvironment=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IMessageAnnotation=} [properties] Properties to set */ - function Environment(properties) { + function MessageAnnotation(properties) { + this.parts = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -11818,127 +12728,91 @@ } /** - * Environment name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.Environment - * @instance - */ - Environment.prototype.name = ""; - - /** - * Environment description. - * @member {string} description - * @memberof google.cloud.dialogflow.v2.Environment - * @instance - */ - Environment.prototype.description = ""; - - /** - * Environment agentVersion. - * @member {string} agentVersion - * @memberof google.cloud.dialogflow.v2.Environment - * @instance - */ - Environment.prototype.agentVersion = ""; - - /** - * Environment state. - * @member {google.cloud.dialogflow.v2.Environment.State} state - * @memberof google.cloud.dialogflow.v2.Environment + * MessageAnnotation parts. + * @member {Array.} parts + * @memberof google.cloud.dialogflow.v2.MessageAnnotation * @instance */ - Environment.prototype.state = 0; + MessageAnnotation.prototype.parts = $util.emptyArray; /** - * Environment updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.dialogflow.v2.Environment + * MessageAnnotation containEntities. + * @member {boolean} containEntities + * @memberof google.cloud.dialogflow.v2.MessageAnnotation * @instance */ - Environment.prototype.updateTime = null; + MessageAnnotation.prototype.containEntities = false; /** - * Creates a new Environment instance using the specified properties. + * Creates a new MessageAnnotation instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.Environment + * @memberof google.cloud.dialogflow.v2.MessageAnnotation * @static - * @param {google.cloud.dialogflow.v2.IEnvironment=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Environment} Environment instance + * @param {google.cloud.dialogflow.v2.IMessageAnnotation=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.MessageAnnotation} MessageAnnotation instance */ - Environment.create = function create(properties) { - return new Environment(properties); + MessageAnnotation.create = function create(properties) { + return new MessageAnnotation(properties); }; /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dialogflow.v2.Environment.verify|verify} messages. + * Encodes the specified MessageAnnotation message. Does not implicitly {@link google.cloud.dialogflow.v2.MessageAnnotation.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.Environment + * @memberof google.cloud.dialogflow.v2.MessageAnnotation * @static - * @param {google.cloud.dialogflow.v2.IEnvironment} message Environment message or plain object to encode + * @param {google.cloud.dialogflow.v2.IMessageAnnotation} message MessageAnnotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Environment.encode = function encode(message, writer) { + MessageAnnotation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.agentVersion != null && Object.hasOwnProperty.call(message, "agentVersion")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.agentVersion); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.parts != null && message.parts.length) + for (var i = 0; i < message.parts.length; ++i) + $root.google.cloud.dialogflow.v2.AnnotatedMessagePart.encode(message.parts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.containEntities != null && Object.hasOwnProperty.call(message, "containEntities")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.containEntities); return writer; }; /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Environment.verify|verify} messages. + * Encodes the specified MessageAnnotation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.MessageAnnotation.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Environment + * @memberof google.cloud.dialogflow.v2.MessageAnnotation * @static - * @param {google.cloud.dialogflow.v2.IEnvironment} message Environment message or plain object to encode + * @param {google.cloud.dialogflow.v2.IMessageAnnotation} message MessageAnnotation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Environment.encodeDelimited = function encodeDelimited(message, writer) { + MessageAnnotation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Environment message from the specified reader or buffer. + * Decodes a MessageAnnotation message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.Environment + * @memberof google.cloud.dialogflow.v2.MessageAnnotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Environment} Environment + * @returns {google.cloud.dialogflow.v2.MessageAnnotation} MessageAnnotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Environment.decode = function decode(reader, length) { + MessageAnnotation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Environment(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.MessageAnnotation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + if (!(message.parts && message.parts.length)) + message.parts = []; + message.parts.push($root.google.cloud.dialogflow.v2.AnnotatedMessagePart.decode(reader, reader.uint32())); break; case 2: - message.description = reader.string(); - break; - case 3: - message.agentVersion = reader.string(); - break; - case 4: - message.state = reader.int32(); - break; - case 5: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + message.containEntities = reader.bool(); break; default: reader.skipType(tag & 7); @@ -11949,188 +12823,135 @@ }; /** - * Decodes an Environment message from the specified reader or buffer, length delimited. + * Decodes a MessageAnnotation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Environment + * @memberof google.cloud.dialogflow.v2.MessageAnnotation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Environment} Environment + * @returns {google.cloud.dialogflow.v2.MessageAnnotation} MessageAnnotation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Environment.decodeDelimited = function decodeDelimited(reader) { + MessageAnnotation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Environment message. + * Verifies a MessageAnnotation message. * @function verify - * @memberof google.cloud.dialogflow.v2.Environment + * @memberof google.cloud.dialogflow.v2.MessageAnnotation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Environment.verify = function verify(message) { + MessageAnnotation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.agentVersion != null && message.hasOwnProperty("agentVersion")) - if (!$util.isString(message.agentVersion)) - return "agentVersion: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + if (message.parts != null && message.hasOwnProperty("parts")) { + if (!Array.isArray(message.parts)) + return "parts: array expected"; + for (var i = 0; i < message.parts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.AnnotatedMessagePart.verify(message.parts[i]); + if (error) + return "parts." + error; } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; } + if (message.containEntities != null && message.hasOwnProperty("containEntities")) + if (typeof message.containEntities !== "boolean") + return "containEntities: boolean expected"; return null; }; /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * Creates a MessageAnnotation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.Environment + * @memberof google.cloud.dialogflow.v2.MessageAnnotation * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Environment} Environment + * @returns {google.cloud.dialogflow.v2.MessageAnnotation} MessageAnnotation */ - Environment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Environment) + MessageAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.MessageAnnotation) return object; - var message = new $root.google.cloud.dialogflow.v2.Environment(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.agentVersion != null) - message.agentVersion = String(object.agentVersion); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "STOPPED": - case 1: - message.state = 1; - break; - case "LOADING": - case 2: - message.state = 2; - break; - case "RUNNING": - case 3: - message.state = 3; - break; - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Environment.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } + var message = new $root.google.cloud.dialogflow.v2.MessageAnnotation(); + if (object.parts) { + if (!Array.isArray(object.parts)) + throw TypeError(".google.cloud.dialogflow.v2.MessageAnnotation.parts: array expected"); + message.parts = []; + for (var i = 0; i < object.parts.length; ++i) { + if (typeof object.parts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.MessageAnnotation.parts: object expected"); + message.parts[i] = $root.google.cloud.dialogflow.v2.AnnotatedMessagePart.fromObject(object.parts[i]); + } + } + if (object.containEntities != null) + message.containEntities = Boolean(object.containEntities); return message; }; /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. + * Creates a plain object from a MessageAnnotation message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.Environment + * @memberof google.cloud.dialogflow.v2.MessageAnnotation * @static - * @param {google.cloud.dialogflow.v2.Environment} message Environment + * @param {google.cloud.dialogflow.v2.MessageAnnotation} message MessageAnnotation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Environment.toObject = function toObject(message, options) { + MessageAnnotation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.agentVersion = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.updateTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.agentVersion != null && message.hasOwnProperty("agentVersion")) - object.agentVersion = message.agentVersion; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dialogflow.v2.Environment.State[message.state] : message.state; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.arrays || options.defaults) + object.parts = []; + if (options.defaults) + object.containEntities = false; + if (message.parts && message.parts.length) { + object.parts = []; + for (var j = 0; j < message.parts.length; ++j) + object.parts[j] = $root.google.cloud.dialogflow.v2.AnnotatedMessagePart.toObject(message.parts[j], options); + } + if (message.containEntities != null && message.hasOwnProperty("containEntities")) + object.containEntities = message.containEntities; return object; }; /** - * Converts this Environment to JSON. + * Converts this MessageAnnotation to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.Environment + * @memberof google.cloud.dialogflow.v2.MessageAnnotation * @instance * @returns {Object.} JSON object */ - Environment.prototype.toJSON = function toJSON() { + MessageAnnotation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.dialogflow.v2.Environment.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} STOPPED=1 STOPPED value - * @property {number} LOADING=2 LOADING value - * @property {number} RUNNING=3 RUNNING value - */ - Environment.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STOPPED"] = 1; - values[valuesById[2] = "LOADING"] = 2; - values[valuesById[3] = "RUNNING"] = 3; - return values; - })(); - - return Environment; + return MessageAnnotation; })(); - v2.ListEnvironmentsRequest = (function() { + v2.SpeechContext = (function() { /** - * Properties of a ListEnvironmentsRequest. + * Properties of a SpeechContext. * @memberof google.cloud.dialogflow.v2 - * @interface IListEnvironmentsRequest - * @property {string|null} [parent] ListEnvironmentsRequest parent - * @property {number|null} [pageSize] ListEnvironmentsRequest pageSize - * @property {string|null} [pageToken] ListEnvironmentsRequest pageToken + * @interface ISpeechContext + * @property {Array.|null} [phrases] SpeechContext phrases + * @property {number|null} [boost] SpeechContext boost */ /** - * Constructs a new ListEnvironmentsRequest. + * Constructs a new SpeechContext. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a ListEnvironmentsRequest. - * @implements IListEnvironmentsRequest + * @classdesc Represents a SpeechContext. + * @implements ISpeechContext * @constructor - * @param {google.cloud.dialogflow.v2.IListEnvironmentsRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ISpeechContext=} [properties] Properties to set */ - function ListEnvironmentsRequest(properties) { + function SpeechContext(properties) { + this.phrases = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12138,101 +12959,91 @@ } /** - * ListEnvironmentsRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest - * @instance - */ - ListEnvironmentsRequest.prototype.parent = ""; - - /** - * ListEnvironmentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * SpeechContext phrases. + * @member {Array.} phrases + * @memberof google.cloud.dialogflow.v2.SpeechContext * @instance */ - ListEnvironmentsRequest.prototype.pageSize = 0; + SpeechContext.prototype.phrases = $util.emptyArray; /** - * ListEnvironmentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * SpeechContext boost. + * @member {number} boost + * @memberof google.cloud.dialogflow.v2.SpeechContext * @instance */ - ListEnvironmentsRequest.prototype.pageToken = ""; + SpeechContext.prototype.boost = 0; /** - * Creates a new ListEnvironmentsRequest instance using the specified properties. + * Creates a new SpeechContext instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @memberof google.cloud.dialogflow.v2.SpeechContext * @static - * @param {google.cloud.dialogflow.v2.IListEnvironmentsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.ListEnvironmentsRequest} ListEnvironmentsRequest instance + * @param {google.cloud.dialogflow.v2.ISpeechContext=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SpeechContext} SpeechContext instance */ - ListEnvironmentsRequest.create = function create(properties) { - return new ListEnvironmentsRequest(properties); + SpeechContext.create = function create(properties) { + return new SpeechContext(properties); }; /** - * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsRequest.verify|verify} messages. + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechContext.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @memberof google.cloud.dialogflow.v2.SpeechContext * @static - * @param {google.cloud.dialogflow.v2.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISpeechContext} message SpeechContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEnvironmentsRequest.encode = function encode(message, writer) { + SpeechContext.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.phrases != null && message.phrases.length) + for (var i = 0; i < message.phrases.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); return writer; }; /** - * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsRequest.verify|verify} messages. + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechContext.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @memberof google.cloud.dialogflow.v2.SpeechContext * @static - * @param {google.cloud.dialogflow.v2.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISpeechContext} message SpeechContext message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEnvironmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + SpeechContext.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * Decodes a SpeechContext message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @memberof google.cloud.dialogflow.v2.SpeechContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.ListEnvironmentsRequest} ListEnvironmentsRequest + * @returns {google.cloud.dialogflow.v2.SpeechContext} SpeechContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEnvironmentsRequest.decode = function decode(reader, length) { + SpeechContext.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListEnvironmentsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SpeechContext(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (!(message.phrases && message.phrases.length)) + message.phrases = []; + message.phrases.push(reader.string()); break; case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); + message.boost = reader.float(); break; default: reader.skipType(tag & 7); @@ -12243,126 +13054,157 @@ }; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @memberof google.cloud.dialogflow.v2.SpeechContext * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.ListEnvironmentsRequest} ListEnvironmentsRequest + * @returns {google.cloud.dialogflow.v2.SpeechContext} SpeechContext * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEnvironmentsRequest.decodeDelimited = function decodeDelimited(reader) { + SpeechContext.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListEnvironmentsRequest message. + * Verifies a SpeechContext message. * @function verify - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @memberof google.cloud.dialogflow.v2.SpeechContext * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListEnvironmentsRequest.verify = function verify(message) { + SpeechContext.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.phrases != null && message.hasOwnProperty("phrases")) { + if (!Array.isArray(message.phrases)) + return "phrases: array expected"; + for (var i = 0; i < message.phrases.length; ++i) + if (!$util.isString(message.phrases[i])) + return "phrases: string[] expected"; + } + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; return null; }; /** - * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @memberof google.cloud.dialogflow.v2.SpeechContext * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.ListEnvironmentsRequest} ListEnvironmentsRequest + * @returns {google.cloud.dialogflow.v2.SpeechContext} SpeechContext */ - ListEnvironmentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.ListEnvironmentsRequest) + SpeechContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SpeechContext) return object; - var message = new $root.google.cloud.dialogflow.v2.ListEnvironmentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + var message = new $root.google.cloud.dialogflow.v2.SpeechContext(); + if (object.phrases) { + if (!Array.isArray(object.phrases)) + throw TypeError(".google.cloud.dialogflow.v2.SpeechContext.phrases: array expected"); + message.phrases = []; + for (var i = 0; i < object.phrases.length; ++i) + message.phrases[i] = String(object.phrases[i]); + } + if (object.boost != null) + message.boost = Number(object.boost); return message; }; /** - * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @memberof google.cloud.dialogflow.v2.SpeechContext * @static - * @param {google.cloud.dialogflow.v2.ListEnvironmentsRequest} message ListEnvironmentsRequest + * @param {google.cloud.dialogflow.v2.SpeechContext} message SpeechContext * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListEnvironmentsRequest.toObject = function toObject(message, options) { + SpeechContext.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + if (options.arrays || options.defaults) + object.phrases = []; + if (options.defaults) + object.boost = 0; + if (message.phrases && message.phrases.length) { + object.phrases = []; + for (var j = 0; j < message.phrases.length; ++j) + object.phrases[j] = message.phrases[j]; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; return object; }; /** - * Converts this ListEnvironmentsRequest to JSON. + * Converts this SpeechContext to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @memberof google.cloud.dialogflow.v2.SpeechContext * @instance * @returns {Object.} JSON object */ - ListEnvironmentsRequest.prototype.toJSON = function toJSON() { + SpeechContext.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListEnvironmentsRequest; + return SpeechContext; })(); - v2.ListEnvironmentsResponse = (function() { + /** + * AudioEncoding enum. + * @name google.cloud.dialogflow.v2.AudioEncoding + * @enum {number} + * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value + * @property {number} AUDIO_ENCODING_LINEAR_16=1 AUDIO_ENCODING_LINEAR_16 value + * @property {number} AUDIO_ENCODING_FLAC=2 AUDIO_ENCODING_FLAC value + * @property {number} AUDIO_ENCODING_MULAW=3 AUDIO_ENCODING_MULAW value + * @property {number} AUDIO_ENCODING_AMR=4 AUDIO_ENCODING_AMR value + * @property {number} AUDIO_ENCODING_AMR_WB=5 AUDIO_ENCODING_AMR_WB value + * @property {number} AUDIO_ENCODING_OGG_OPUS=6 AUDIO_ENCODING_OGG_OPUS value + * @property {number} AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE=7 AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE value + */ + v2.AudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUDIO_ENCODING_LINEAR_16"] = 1; + values[valuesById[2] = "AUDIO_ENCODING_FLAC"] = 2; + values[valuesById[3] = "AUDIO_ENCODING_MULAW"] = 3; + values[valuesById[4] = "AUDIO_ENCODING_AMR"] = 4; + values[valuesById[5] = "AUDIO_ENCODING_AMR_WB"] = 5; + values[valuesById[6] = "AUDIO_ENCODING_OGG_OPUS"] = 6; + values[valuesById[7] = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"] = 7; + return values; + })(); - /** - * Properties of a ListEnvironmentsResponse. + v2.SpeechWordInfo = (function() { + + /** + * Properties of a SpeechWordInfo. * @memberof google.cloud.dialogflow.v2 - * @interface IListEnvironmentsResponse - * @property {Array.|null} [environments] ListEnvironmentsResponse environments - * @property {string|null} [nextPageToken] ListEnvironmentsResponse nextPageToken + * @interface ISpeechWordInfo + * @property {string|null} [word] SpeechWordInfo word + * @property {google.protobuf.IDuration|null} [startOffset] SpeechWordInfo startOffset + * @property {google.protobuf.IDuration|null} [endOffset] SpeechWordInfo endOffset + * @property {number|null} [confidence] SpeechWordInfo confidence */ /** - * Constructs a new ListEnvironmentsResponse. + * Constructs a new SpeechWordInfo. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a ListEnvironmentsResponse. - * @implements IListEnvironmentsResponse + * @classdesc Represents a SpeechWordInfo. + * @implements ISpeechWordInfo * @constructor - * @param {google.cloud.dialogflow.v2.IListEnvironmentsResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ISpeechWordInfo=} [properties] Properties to set */ - function ListEnvironmentsResponse(properties) { - this.environments = []; + function SpeechWordInfo(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -12370,91 +13212,114 @@ } /** - * ListEnvironmentsResponse environments. - * @member {Array.} environments - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * SpeechWordInfo word. + * @member {string} word + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo * @instance */ - ListEnvironmentsResponse.prototype.environments = $util.emptyArray; + SpeechWordInfo.prototype.word = ""; /** - * ListEnvironmentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * SpeechWordInfo startOffset. + * @member {google.protobuf.IDuration|null|undefined} startOffset + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo * @instance */ - ListEnvironmentsResponse.prototype.nextPageToken = ""; + SpeechWordInfo.prototype.startOffset = null; /** - * Creates a new ListEnvironmentsResponse instance using the specified properties. + * SpeechWordInfo endOffset. + * @member {google.protobuf.IDuration|null|undefined} endOffset + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.endOffset = null; + + /** + * SpeechWordInfo confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.confidence = 0; + + /** + * Creates a new SpeechWordInfo instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo * @static - * @param {google.cloud.dialogflow.v2.IListEnvironmentsResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.ListEnvironmentsResponse} ListEnvironmentsResponse instance + * @param {google.cloud.dialogflow.v2.ISpeechWordInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SpeechWordInfo} SpeechWordInfo instance */ - ListEnvironmentsResponse.create = function create(properties) { - return new ListEnvironmentsResponse(properties); + SpeechWordInfo.create = function create(properties) { + return new SpeechWordInfo(properties); }; /** - * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsResponse.verify|verify} messages. + * Encodes the specified SpeechWordInfo message. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechWordInfo.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo * @static - * @param {google.cloud.dialogflow.v2.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISpeechWordInfo} message SpeechWordInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEnvironmentsResponse.encode = function encode(message, writer) { + SpeechWordInfo.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.environments != null && message.environments.length) - for (var i = 0; i < message.environments.length; ++i) - $root.google.cloud.dialogflow.v2.Environment.encode(message.environments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + $root.google.protobuf.Duration.encode(message.startOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + $root.google.protobuf.Duration.encode(message.endOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.word != null && Object.hasOwnProperty.call(message, "word")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); return writer; }; /** - * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsResponse.verify|verify} messages. + * Encodes the specified SpeechWordInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechWordInfo.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo * @static - * @param {google.cloud.dialogflow.v2.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISpeechWordInfo} message SpeechWordInfo message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEnvironmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + SpeechWordInfo.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * Decodes a SpeechWordInfo message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.ListEnvironmentsResponse} ListEnvironmentsResponse + * @returns {google.cloud.dialogflow.v2.SpeechWordInfo} SpeechWordInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEnvironmentsResponse.decode = function decode(reader, length) { + SpeechWordInfo.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListEnvironmentsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SpeechWordInfo(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { + case 3: + message.word = reader.string(); + break; case 1: - if (!(message.environments && message.environments.length)) - message.environments = []; - message.environments.push($root.google.cloud.dialogflow.v2.Environment.decode(reader, reader.uint32())); + message.startOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); break; case 2: - message.nextPageToken = reader.string(); + message.endOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 4: + message.confidence = reader.float(); break; default: reader.skipType(tag & 7); @@ -12465,753 +13330,370 @@ }; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * Decodes a SpeechWordInfo message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.ListEnvironmentsResponse} ListEnvironmentsResponse + * @returns {google.cloud.dialogflow.v2.SpeechWordInfo} SpeechWordInfo * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEnvironmentsResponse.decodeDelimited = function decodeDelimited(reader) { + SpeechWordInfo.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListEnvironmentsResponse message. + * Verifies a SpeechWordInfo message. * @function verify - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListEnvironmentsResponse.verify = function verify(message) { + SpeechWordInfo.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.environments != null && message.hasOwnProperty("environments")) { - if (!Array.isArray(message.environments)) - return "environments: array expected"; - for (var i = 0; i < message.environments.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Environment.verify(message.environments[i]); - if (error) - return "environments." + error; - } + if (message.word != null && message.hasOwnProperty("word")) + if (!$util.isString(message.word)) + return "word: string expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startOffset); + if (error) + return "startOffset." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.endOffset != null && message.hasOwnProperty("endOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endOffset); + if (error) + return "endOffset." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; return null; }; /** - * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SpeechWordInfo message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.ListEnvironmentsResponse} ListEnvironmentsResponse + * @returns {google.cloud.dialogflow.v2.SpeechWordInfo} SpeechWordInfo */ - ListEnvironmentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.ListEnvironmentsResponse) + SpeechWordInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SpeechWordInfo) return object; - var message = new $root.google.cloud.dialogflow.v2.ListEnvironmentsResponse(); - if (object.environments) { - if (!Array.isArray(object.environments)) - throw TypeError(".google.cloud.dialogflow.v2.ListEnvironmentsResponse.environments: array expected"); - message.environments = []; - for (var i = 0; i < object.environments.length; ++i) { - if (typeof object.environments[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.ListEnvironmentsResponse.environments: object expected"); - message.environments[i] = $root.google.cloud.dialogflow.v2.Environment.fromObject(object.environments[i]); - } + var message = new $root.google.cloud.dialogflow.v2.SpeechWordInfo(); + if (object.word != null) + message.word = String(object.word); + if (object.startOffset != null) { + if (typeof object.startOffset !== "object") + throw TypeError(".google.cloud.dialogflow.v2.SpeechWordInfo.startOffset: object expected"); + message.startOffset = $root.google.protobuf.Duration.fromObject(object.startOffset); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + if (object.endOffset != null) { + if (typeof object.endOffset !== "object") + throw TypeError(".google.cloud.dialogflow.v2.SpeechWordInfo.endOffset: object expected"); + message.endOffset = $root.google.protobuf.Duration.fromObject(object.endOffset); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); return message; }; /** - * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * Creates a plain object from a SpeechWordInfo message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo * @static - * @param {google.cloud.dialogflow.v2.ListEnvironmentsResponse} message ListEnvironmentsResponse + * @param {google.cloud.dialogflow.v2.SpeechWordInfo} message SpeechWordInfo * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListEnvironmentsResponse.toObject = function toObject(message, options) { + SpeechWordInfo.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.environments = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.environments && message.environments.length) { - object.environments = []; - for (var j = 0; j < message.environments.length; ++j) - object.environments[j] = $root.google.cloud.dialogflow.v2.Environment.toObject(message.environments[j], options); + if (options.defaults) { + object.startOffset = null; + object.endOffset = null; + object.word = ""; + object.confidence = 0; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + object.startOffset = $root.google.protobuf.Duration.toObject(message.startOffset, options); + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + object.endOffset = $root.google.protobuf.Duration.toObject(message.endOffset, options); + if (message.word != null && message.hasOwnProperty("word")) + object.word = message.word; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; return object; }; /** - * Converts this ListEnvironmentsResponse to JSON. + * Converts this SpeechWordInfo to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @memberof google.cloud.dialogflow.v2.SpeechWordInfo * @instance * @returns {Object.} JSON object */ - ListEnvironmentsResponse.prototype.toJSON = function toJSON() { + SpeechWordInfo.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListEnvironmentsResponse; + return SpeechWordInfo; })(); - v2.Intents = (function() { - - /** - * Constructs a new Intents service. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an Intents - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Intents(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + /** + * SpeechModelVariant enum. + * @name google.cloud.dialogflow.v2.SpeechModelVariant + * @enum {number} + * @property {number} SPEECH_MODEL_VARIANT_UNSPECIFIED=0 SPEECH_MODEL_VARIANT_UNSPECIFIED value + * @property {number} USE_BEST_AVAILABLE=1 USE_BEST_AVAILABLE value + * @property {number} USE_STANDARD=2 USE_STANDARD value + * @property {number} USE_ENHANCED=3 USE_ENHANCED value + */ + v2.SpeechModelVariant = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPEECH_MODEL_VARIANT_UNSPECIFIED"] = 0; + values[valuesById[1] = "USE_BEST_AVAILABLE"] = 1; + values[valuesById[2] = "USE_STANDARD"] = 2; + values[valuesById[3] = "USE_ENHANCED"] = 3; + return values; + })(); - (Intents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Intents; + v2.InputAudioConfig = (function() { /** - * Creates new Intents service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dialogflow.v2.Intents - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Intents} RPC service. Useful where requests and/or responses are streamed. + * Properties of an InputAudioConfig. + * @memberof google.cloud.dialogflow.v2 + * @interface IInputAudioConfig + * @property {google.cloud.dialogflow.v2.AudioEncoding|null} [audioEncoding] InputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] InputAudioConfig sampleRateHertz + * @property {string|null} [languageCode] InputAudioConfig languageCode + * @property {boolean|null} [enableWordInfo] InputAudioConfig enableWordInfo + * @property {Array.|null} [phraseHints] InputAudioConfig phraseHints + * @property {Array.|null} [speechContexts] InputAudioConfig speechContexts + * @property {string|null} [model] InputAudioConfig model + * @property {google.cloud.dialogflow.v2.SpeechModelVariant|null} [modelVariant] InputAudioConfig modelVariant + * @property {boolean|null} [singleUtterance] InputAudioConfig singleUtterance + * @property {boolean|null} [disableNoSpeechRecognizedEvent] InputAudioConfig disableNoSpeechRecognizedEvent */ - Intents.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#listIntents}. - * @memberof google.cloud.dialogflow.v2.Intents - * @typedef ListIntentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.ListIntentsResponse} [response] ListIntentsResponse + * Constructs a new InputAudioConfig. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an InputAudioConfig. + * @implements IInputAudioConfig + * @constructor + * @param {google.cloud.dialogflow.v2.IInputAudioConfig=} [properties] Properties to set */ + function InputAudioConfig(properties) { + this.phraseHints = []; + this.speechContexts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls ListIntents. - * @function listIntents - * @memberof google.cloud.dialogflow.v2.Intents + * InputAudioConfig audioEncoding. + * @member {google.cloud.dialogflow.v2.AudioEncoding} audioEncoding + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @instance - * @param {google.cloud.dialogflow.v2.IListIntentsRequest} request ListIntentsRequest message or plain object - * @param {google.cloud.dialogflow.v2.Intents.ListIntentsCallback} callback Node-style callback called with the error, if any, and ListIntentsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Intents.prototype.listIntents = function listIntents(request, callback) { - return this.rpcCall(listIntents, $root.google.cloud.dialogflow.v2.ListIntentsRequest, $root.google.cloud.dialogflow.v2.ListIntentsResponse, request, callback); - }, "name", { value: "ListIntents" }); + InputAudioConfig.prototype.audioEncoding = 0; /** - * Calls ListIntents. - * @function listIntents - * @memberof google.cloud.dialogflow.v2.Intents + * InputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @instance - * @param {google.cloud.dialogflow.v2.IListIntentsRequest} request ListIntentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#getIntent}. - * @memberof google.cloud.dialogflow.v2.Intents - * @typedef GetIntentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.Intent} [response] Intent */ + InputAudioConfig.prototype.sampleRateHertz = 0; /** - * Calls GetIntent. - * @function getIntent - * @memberof google.cloud.dialogflow.v2.Intents + * InputAudioConfig languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @instance - * @param {google.cloud.dialogflow.v2.IGetIntentRequest} request GetIntentRequest message or plain object - * @param {google.cloud.dialogflow.v2.Intents.GetIntentCallback} callback Node-style callback called with the error, if any, and Intent - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Intents.prototype.getIntent = function getIntent(request, callback) { - return this.rpcCall(getIntent, $root.google.cloud.dialogflow.v2.GetIntentRequest, $root.google.cloud.dialogflow.v2.Intent, request, callback); - }, "name", { value: "GetIntent" }); + InputAudioConfig.prototype.languageCode = ""; /** - * Calls GetIntent. - * @function getIntent - * @memberof google.cloud.dialogflow.v2.Intents + * InputAudioConfig enableWordInfo. + * @member {boolean} enableWordInfo + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @instance - * @param {google.cloud.dialogflow.v2.IGetIntentRequest} request GetIntentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + InputAudioConfig.prototype.enableWordInfo = false; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#createIntent}. - * @memberof google.cloud.dialogflow.v2.Intents - * @typedef CreateIntentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.Intent} [response] Intent + * InputAudioConfig phraseHints. + * @member {Array.} phraseHints + * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @instance */ + InputAudioConfig.prototype.phraseHints = $util.emptyArray; /** - * Calls CreateIntent. - * @function createIntent - * @memberof google.cloud.dialogflow.v2.Intents + * InputAudioConfig speechContexts. + * @member {Array.} speechContexts + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @instance - * @param {google.cloud.dialogflow.v2.ICreateIntentRequest} request CreateIntentRequest message or plain object - * @param {google.cloud.dialogflow.v2.Intents.CreateIntentCallback} callback Node-style callback called with the error, if any, and Intent - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Intents.prototype.createIntent = function createIntent(request, callback) { - return this.rpcCall(createIntent, $root.google.cloud.dialogflow.v2.CreateIntentRequest, $root.google.cloud.dialogflow.v2.Intent, request, callback); - }, "name", { value: "CreateIntent" }); + InputAudioConfig.prototype.speechContexts = $util.emptyArray; /** - * Calls CreateIntent. - * @function createIntent - * @memberof google.cloud.dialogflow.v2.Intents + * InputAudioConfig model. + * @member {string} model + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @instance - * @param {google.cloud.dialogflow.v2.ICreateIntentRequest} request CreateIntentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + InputAudioConfig.prototype.model = ""; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#updateIntent}. - * @memberof google.cloud.dialogflow.v2.Intents - * @typedef UpdateIntentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.Intent} [response] Intent + * InputAudioConfig modelVariant. + * @member {google.cloud.dialogflow.v2.SpeechModelVariant} modelVariant + * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @instance */ + InputAudioConfig.prototype.modelVariant = 0; /** - * Calls UpdateIntent. - * @function updateIntent - * @memberof google.cloud.dialogflow.v2.Intents + * InputAudioConfig singleUtterance. + * @member {boolean} singleUtterance + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @instance - * @param {google.cloud.dialogflow.v2.IUpdateIntentRequest} request UpdateIntentRequest message or plain object - * @param {google.cloud.dialogflow.v2.Intents.UpdateIntentCallback} callback Node-style callback called with the error, if any, and Intent - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Intents.prototype.updateIntent = function updateIntent(request, callback) { - return this.rpcCall(updateIntent, $root.google.cloud.dialogflow.v2.UpdateIntentRequest, $root.google.cloud.dialogflow.v2.Intent, request, callback); - }, "name", { value: "UpdateIntent" }); + InputAudioConfig.prototype.singleUtterance = false; /** - * Calls UpdateIntent. - * @function updateIntent - * @memberof google.cloud.dialogflow.v2.Intents + * InputAudioConfig disableNoSpeechRecognizedEvent. + * @member {boolean} disableNoSpeechRecognizedEvent + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @instance - * @param {google.cloud.dialogflow.v2.IUpdateIntentRequest} request UpdateIntentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + InputAudioConfig.prototype.disableNoSpeechRecognizedEvent = false; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#deleteIntent}. - * @memberof google.cloud.dialogflow.v2.Intents - * @typedef DeleteIntentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Creates a new InputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2.IInputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.InputAudioConfig} InputAudioConfig instance */ + InputAudioConfig.create = function create(properties) { + return new InputAudioConfig(properties); + }; /** - * Calls DeleteIntent. - * @function deleteIntent - * @memberof google.cloud.dialogflow.v2.Intents - * @instance - * @param {google.cloud.dialogflow.v2.IDeleteIntentRequest} request DeleteIntentRequest message or plain object - * @param {google.cloud.dialogflow.v2.Intents.DeleteIntentCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.InputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(Intents.prototype.deleteIntent = function deleteIntent(request, callback) { - return this.rpcCall(deleteIntent, $root.google.cloud.dialogflow.v2.DeleteIntentRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteIntent" }); + InputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.phraseHints != null && message.phraseHints.length) + for (var i = 0; i < message.phraseHints.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.phraseHints[i]); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.model); + if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.singleUtterance); + if (message.modelVariant != null && Object.hasOwnProperty.call(message, "modelVariant")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.modelVariant); + if (message.speechContexts != null && message.speechContexts.length) + for (var i = 0; i < message.speechContexts.length; ++i) + $root.google.cloud.dialogflow.v2.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.enableWordInfo != null && Object.hasOwnProperty.call(message, "enableWordInfo")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.enableWordInfo); + if (message.disableNoSpeechRecognizedEvent != null && Object.hasOwnProperty.call(message, "disableNoSpeechRecognizedEvent")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.disableNoSpeechRecognizedEvent); + return writer; + }; /** - * Calls DeleteIntent. - * @function deleteIntent - * @memberof google.cloud.dialogflow.v2.Intents - * @instance - * @param {google.cloud.dialogflow.v2.IDeleteIntentRequest} request DeleteIntentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.InputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + InputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#batchUpdateIntents}. - * @memberof google.cloud.dialogflow.v2.Intents - * @typedef BatchUpdateIntentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchUpdateIntents. - * @function batchUpdateIntents - * @memberof google.cloud.dialogflow.v2.Intents - * @instance - * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest} request BatchUpdateIntentsRequest message or plain object - * @param {google.cloud.dialogflow.v2.Intents.BatchUpdateIntentsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Intents.prototype.batchUpdateIntents = function batchUpdateIntents(request, callback) { - return this.rpcCall(batchUpdateIntents, $root.google.cloud.dialogflow.v2.BatchUpdateIntentsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchUpdateIntents" }); - - /** - * Calls BatchUpdateIntents. - * @function batchUpdateIntents - * @memberof google.cloud.dialogflow.v2.Intents - * @instance - * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest} request BatchUpdateIntentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2.Intents#batchDeleteIntents}. - * @memberof google.cloud.dialogflow.v2.Intents - * @typedef BatchDeleteIntentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchDeleteIntents. - * @function batchDeleteIntents - * @memberof google.cloud.dialogflow.v2.Intents - * @instance - * @param {google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest} request BatchDeleteIntentsRequest message or plain object - * @param {google.cloud.dialogflow.v2.Intents.BatchDeleteIntentsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Intents.prototype.batchDeleteIntents = function batchDeleteIntents(request, callback) { - return this.rpcCall(batchDeleteIntents, $root.google.cloud.dialogflow.v2.BatchDeleteIntentsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchDeleteIntents" }); - - /** - * Calls BatchDeleteIntents. - * @function batchDeleteIntents - * @memberof google.cloud.dialogflow.v2.Intents - * @instance - * @param {google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest} request BatchDeleteIntentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Intents; - })(); - - v2.Intent = (function() { - - /** - * Properties of an Intent. - * @memberof google.cloud.dialogflow.v2 - * @interface IIntent - * @property {string|null} [name] Intent name - * @property {string|null} [displayName] Intent displayName - * @property {google.cloud.dialogflow.v2.Intent.WebhookState|null} [webhookState] Intent webhookState - * @property {number|null} [priority] Intent priority - * @property {boolean|null} [isFallback] Intent isFallback - * @property {boolean|null} [mlDisabled] Intent mlDisabled - * @property {Array.|null} [inputContextNames] Intent inputContextNames - * @property {Array.|null} [events] Intent events - * @property {Array.|null} [trainingPhrases] Intent trainingPhrases - * @property {string|null} [action] Intent action - * @property {Array.|null} [outputContexts] Intent outputContexts - * @property {boolean|null} [resetContexts] Intent resetContexts - * @property {Array.|null} [parameters] Intent parameters - * @property {Array.|null} [messages] Intent messages - * @property {Array.|null} [defaultResponsePlatforms] Intent defaultResponsePlatforms - * @property {string|null} [rootFollowupIntentName] Intent rootFollowupIntentName - * @property {string|null} [parentFollowupIntentName] Intent parentFollowupIntentName - * @property {Array.|null} [followupIntentInfo] Intent followupIntentInfo - */ - - /** - * Constructs a new Intent. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an Intent. - * @implements IIntent - * @constructor - * @param {google.cloud.dialogflow.v2.IIntent=} [properties] Properties to set - */ - function Intent(properties) { - this.inputContextNames = []; - this.events = []; - this.trainingPhrases = []; - this.outputContexts = []; - this.parameters = []; - this.messages = []; - this.defaultResponsePlatforms = []; - this.followupIntentInfo = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Intent name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.name = ""; - - /** - * Intent displayName. - * @member {string} displayName - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.displayName = ""; - - /** - * Intent webhookState. - * @member {google.cloud.dialogflow.v2.Intent.WebhookState} webhookState - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.webhookState = 0; - - /** - * Intent priority. - * @member {number} priority - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.priority = 0; - - /** - * Intent isFallback. - * @member {boolean} isFallback - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.isFallback = false; - - /** - * Intent mlDisabled. - * @member {boolean} mlDisabled - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.mlDisabled = false; - - /** - * Intent inputContextNames. - * @member {Array.} inputContextNames - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.inputContextNames = $util.emptyArray; - - /** - * Intent events. - * @member {Array.} events - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.events = $util.emptyArray; - - /** - * Intent trainingPhrases. - * @member {Array.} trainingPhrases - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.trainingPhrases = $util.emptyArray; - - /** - * Intent action. - * @member {string} action - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.action = ""; - - /** - * Intent outputContexts. - * @member {Array.} outputContexts - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.outputContexts = $util.emptyArray; - - /** - * Intent resetContexts. - * @member {boolean} resetContexts - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.resetContexts = false; - - /** - * Intent parameters. - * @member {Array.} parameters - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.parameters = $util.emptyArray; - - /** - * Intent messages. - * @member {Array.} messages - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.messages = $util.emptyArray; - - /** - * Intent defaultResponsePlatforms. - * @member {Array.} defaultResponsePlatforms - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.defaultResponsePlatforms = $util.emptyArray; - - /** - * Intent rootFollowupIntentName. - * @member {string} rootFollowupIntentName - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.rootFollowupIntentName = ""; - - /** - * Intent parentFollowupIntentName. - * @member {string} parentFollowupIntentName - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.parentFollowupIntentName = ""; - - /** - * Intent followupIntentInfo. - * @member {Array.} followupIntentInfo - * @memberof google.cloud.dialogflow.v2.Intent - * @instance - */ - Intent.prototype.followupIntentInfo = $util.emptyArray; - - /** - * Creates a new Intent instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent - * @static - * @param {google.cloud.dialogflow.v2.IIntent=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent} Intent instance - */ - Intent.create = function create(properties) { - return new Intent(properties); - }; - - /** - * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent - * @static - * @param {google.cloud.dialogflow.v2.IIntent} message Intent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Intent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.priority); - if (message.isFallback != null && Object.hasOwnProperty.call(message, "isFallback")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isFallback); - if (message.webhookState != null && Object.hasOwnProperty.call(message, "webhookState")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.webhookState); - if (message.inputContextNames != null && message.inputContextNames.length) - for (var i = 0; i < message.inputContextNames.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.inputContextNames[i]); - if (message.events != null && message.events.length) - for (var i = 0; i < message.events.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.events[i]); - if (message.trainingPhrases != null && message.trainingPhrases.length) - for (var i = 0; i < message.trainingPhrases.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.encode(message.trainingPhrases[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.action); - if (message.outputContexts != null && message.outputContexts.length) - for (var i = 0; i < message.outputContexts.length; ++i) - $root.google.cloud.dialogflow.v2.Context.encode(message.outputContexts[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.resetContexts != null && Object.hasOwnProperty.call(message, "resetContexts")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.resetContexts); - if (message.parameters != null && message.parameters.length) - for (var i = 0; i < message.parameters.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Parameter.encode(message.parameters[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.encode(message.messages[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.defaultResponsePlatforms != null && message.defaultResponsePlatforms.length) { - writer.uint32(/* id 15, wireType 2 =*/122).fork(); - for (var i = 0; i < message.defaultResponsePlatforms.length; ++i) - writer.int32(message.defaultResponsePlatforms[i]); - writer.ldelim(); - } - if (message.rootFollowupIntentName != null && Object.hasOwnProperty.call(message, "rootFollowupIntentName")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.rootFollowupIntentName); - if (message.parentFollowupIntentName != null && Object.hasOwnProperty.call(message, "parentFollowupIntentName")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.parentFollowupIntentName); - if (message.followupIntentInfo != null && message.followupIntentInfo.length) - for (var i = 0; i < message.followupIntentInfo.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.encode(message.followupIntentInfo[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.mlDisabled != null && Object.hasOwnProperty.call(message, "mlDisabled")) - writer.uint32(/* id 19, wireType 0 =*/152).bool(message.mlDisabled); - return writer; - }; - - /** - * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent - * @static - * @param {google.cloud.dialogflow.v2.IIntent} message Intent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Intent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Intent message from the specified reader or buffer. + * Decodes an InputAudioConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.Intent + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent} Intent + * @returns {google.cloud.dialogflow.v2.InputAudioConfig} InputAudioConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Intent.decode = function decode(reader, length) { + InputAudioConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.InputAudioConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.audioEncoding = reader.int32(); break; case 2: - message.displayName = reader.string(); - break; - case 6: - message.webhookState = reader.int32(); + message.sampleRateHertz = reader.int32(); break; case 3: - message.priority = reader.int32(); + message.languageCode = reader.string(); + break; + case 13: + message.enableWordInfo = reader.bool(); break; case 4: - message.isFallback = reader.bool(); + if (!(message.phraseHints && message.phraseHints.length)) + message.phraseHints = []; + message.phraseHints.push(reader.string()); break; - case 19: - message.mlDisabled = reader.bool(); + case 11: + if (!(message.speechContexts && message.speechContexts.length)) + message.speechContexts = []; + message.speechContexts.push($root.google.cloud.dialogflow.v2.SpeechContext.decode(reader, reader.uint32())); break; case 7: - if (!(message.inputContextNames && message.inputContextNames.length)) - message.inputContextNames = []; - message.inputContextNames.push(reader.string()); - break; - case 8: - if (!(message.events && message.events.length)) - message.events = []; - message.events.push(reader.string()); - break; - case 9: - if (!(message.trainingPhrases && message.trainingPhrases.length)) - message.trainingPhrases = []; - message.trainingPhrases.push($root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.decode(reader, reader.uint32())); + message.model = reader.string(); break; case 10: - message.action = reader.string(); - break; - case 11: - if (!(message.outputContexts && message.outputContexts.length)) - message.outputContexts = []; - message.outputContexts.push($root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32())); - break; - case 12: - message.resetContexts = reader.bool(); + message.modelVariant = reader.int32(); break; - case 13: - if (!(message.parameters && message.parameters.length)) - message.parameters = []; - message.parameters.push($root.google.cloud.dialogflow.v2.Intent.Parameter.decode(reader, reader.uint32())); + case 8: + message.singleUtterance = reader.bool(); break; case 14: - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.cloud.dialogflow.v2.Intent.Message.decode(reader, reader.uint32())); - break; - case 15: - if (!(message.defaultResponsePlatforms && message.defaultResponsePlatforms.length)) - message.defaultResponsePlatforms = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.defaultResponsePlatforms.push(reader.int32()); - } else - message.defaultResponsePlatforms.push(reader.int32()); - break; - case 16: - message.rootFollowupIntentName = reader.string(); - break; - case 17: - message.parentFollowupIntentName = reader.string(); - break; - case 18: - if (!(message.followupIntentInfo && message.followupIntentInfo.length)) - message.followupIntentInfo = []; - message.followupIntentInfo.push($root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.decode(reader, reader.uint32())); + message.disableNoSpeechRecognizedEvent = reader.bool(); break; default: reader.skipType(tag & 7); @@ -13222,8988 +13704,8316 @@ }; /** - * Decodes an Intent message from the specified reader or buffer, length delimited. + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent} Intent + * @returns {google.cloud.dialogflow.v2.InputAudioConfig} InputAudioConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Intent.decodeDelimited = function decodeDelimited(reader) { + InputAudioConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Intent message. + * Verifies an InputAudioConfig message. * @function verify - * @memberof google.cloud.dialogflow.v2.Intent + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Intent.verify = function verify(message) { + InputAudioConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.webhookState != null && message.hasOwnProperty("webhookState")) - switch (message.webhookState) { + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { default: - return "webhookState: enum value expected"; + return "audioEncoding: enum value expected"; case 0: case 1: case 2: + case 3: + case 4: + case 5: + case 6: + case 7: break; } - if (message.priority != null && message.hasOwnProperty("priority")) - if (!$util.isInteger(message.priority)) - return "priority: integer expected"; - if (message.isFallback != null && message.hasOwnProperty("isFallback")) - if (typeof message.isFallback !== "boolean") - return "isFallback: boolean expected"; - if (message.mlDisabled != null && message.hasOwnProperty("mlDisabled")) - if (typeof message.mlDisabled !== "boolean") - return "mlDisabled: boolean expected"; - if (message.inputContextNames != null && message.hasOwnProperty("inputContextNames")) { - if (!Array.isArray(message.inputContextNames)) - return "inputContextNames: array expected"; - for (var i = 0; i < message.inputContextNames.length; ++i) - if (!$util.isString(message.inputContextNames[i])) - return "inputContextNames: string[] expected"; - } - if (message.events != null && message.hasOwnProperty("events")) { - if (!Array.isArray(message.events)) - return "events: array expected"; - for (var i = 0; i < message.events.length; ++i) - if (!$util.isString(message.events[i])) - return "events: string[] expected"; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.enableWordInfo != null && message.hasOwnProperty("enableWordInfo")) + if (typeof message.enableWordInfo !== "boolean") + return "enableWordInfo: boolean expected"; + if (message.phraseHints != null && message.hasOwnProperty("phraseHints")) { + if (!Array.isArray(message.phraseHints)) + return "phraseHints: array expected"; + for (var i = 0; i < message.phraseHints.length; ++i) + if (!$util.isString(message.phraseHints[i])) + return "phraseHints: string[] expected"; } - if (message.trainingPhrases != null && message.hasOwnProperty("trainingPhrases")) { - if (!Array.isArray(message.trainingPhrases)) - return "trainingPhrases: array expected"; - for (var i = 0; i < message.trainingPhrases.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.verify(message.trainingPhrases[i]); + if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) { + if (!Array.isArray(message.speechContexts)) + return "speechContexts: array expected"; + for (var i = 0; i < message.speechContexts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.SpeechContext.verify(message.speechContexts[i]); if (error) - return "trainingPhrases." + error; - } - } - if (message.action != null && message.hasOwnProperty("action")) - if (!$util.isString(message.action)) - return "action: string expected"; - if (message.outputContexts != null && message.hasOwnProperty("outputContexts")) { - if (!Array.isArray(message.outputContexts)) - return "outputContexts: array expected"; - for (var i = 0; i < message.outputContexts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Context.verify(message.outputContexts[i]); - if (error) - return "outputContexts." + error; - } - } - if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) - if (typeof message.resetContexts !== "boolean") - return "resetContexts: boolean expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - if (!Array.isArray(message.parameters)) - return "parameters: array expected"; - for (var i = 0; i < message.parameters.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Parameter.verify(message.parameters[i]); - if (error) - return "parameters." + error; - } - } - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.verify(message.messages[i]); - if (error) - return "messages." + error; + return "speechContexts." + error; } } - if (message.defaultResponsePlatforms != null && message.hasOwnProperty("defaultResponsePlatforms")) { - if (!Array.isArray(message.defaultResponsePlatforms)) - return "defaultResponsePlatforms: array expected"; - for (var i = 0; i < message.defaultResponsePlatforms.length; ++i) - switch (message.defaultResponsePlatforms[i]) { - default: - return "defaultResponsePlatforms: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 11: - break; - } - } - if (message.rootFollowupIntentName != null && message.hasOwnProperty("rootFollowupIntentName")) - if (!$util.isString(message.rootFollowupIntentName)) - return "rootFollowupIntentName: string expected"; - if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) - if (!$util.isString(message.parentFollowupIntentName)) - return "parentFollowupIntentName: string expected"; - if (message.followupIntentInfo != null && message.hasOwnProperty("followupIntentInfo")) { - if (!Array.isArray(message.followupIntentInfo)) - return "followupIntentInfo: array expected"; - for (var i = 0; i < message.followupIntentInfo.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.verify(message.followupIntentInfo[i]); - if (error) - return "followupIntentInfo." + error; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.modelVariant != null && message.hasOwnProperty("modelVariant")) + switch (message.modelVariant) { + default: + return "modelVariant: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; } - } + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (typeof message.singleUtterance !== "boolean") + return "singleUtterance: boolean expected"; + if (message.disableNoSpeechRecognizedEvent != null && message.hasOwnProperty("disableNoSpeechRecognizedEvent")) + if (typeof message.disableNoSpeechRecognizedEvent !== "boolean") + return "disableNoSpeechRecognizedEvent: boolean expected"; return null; }; /** - * Creates an Intent message from a plain object. Also converts values to their respective internal types. + * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent} Intent + * @returns {google.cloud.dialogflow.v2.InputAudioConfig} InputAudioConfig */ - Intent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent) + InputAudioConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.InputAudioConfig) return object; - var message = new $root.google.cloud.dialogflow.v2.Intent(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - switch (object.webhookState) { - case "WEBHOOK_STATE_UNSPECIFIED": + var message = new $root.google.cloud.dialogflow.v2.InputAudioConfig(); + switch (object.audioEncoding) { + case "AUDIO_ENCODING_UNSPECIFIED": case 0: - message.webhookState = 0; + message.audioEncoding = 0; break; - case "WEBHOOK_STATE_ENABLED": + case "AUDIO_ENCODING_LINEAR_16": case 1: - message.webhookState = 1; + message.audioEncoding = 1; break; - case "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING": + case "AUDIO_ENCODING_FLAC": case 2: - message.webhookState = 2; + message.audioEncoding = 2; + break; + case "AUDIO_ENCODING_MULAW": + case 3: + message.audioEncoding = 3; + break; + case "AUDIO_ENCODING_AMR": + case 4: + message.audioEncoding = 4; + break; + case "AUDIO_ENCODING_AMR_WB": + case 5: + message.audioEncoding = 5; + break; + case "AUDIO_ENCODING_OGG_OPUS": + case 6: + message.audioEncoding = 6; + break; + case "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": + case 7: + message.audioEncoding = 7; break; } - if (object.priority != null) - message.priority = object.priority | 0; - if (object.isFallback != null) - message.isFallback = Boolean(object.isFallback); - if (object.mlDisabled != null) - message.mlDisabled = Boolean(object.mlDisabled); - if (object.inputContextNames) { - if (!Array.isArray(object.inputContextNames)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.inputContextNames: array expected"); - message.inputContextNames = []; - for (var i = 0; i < object.inputContextNames.length; ++i) - message.inputContextNames[i] = String(object.inputContextNames[i]); - } - if (object.events) { - if (!Array.isArray(object.events)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.events: array expected"); - message.events = []; - for (var i = 0; i < object.events.length; ++i) - message.events[i] = String(object.events[i]); - } - if (object.trainingPhrases) { - if (!Array.isArray(object.trainingPhrases)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.trainingPhrases: array expected"); - message.trainingPhrases = []; - for (var i = 0; i < object.trainingPhrases.length; ++i) { - if (typeof object.trainingPhrases[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.trainingPhrases: object expected"); - message.trainingPhrases[i] = $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.fromObject(object.trainingPhrases[i]); - } - } - if (object.action != null) - message.action = String(object.action); - if (object.outputContexts) { - if (!Array.isArray(object.outputContexts)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.outputContexts: array expected"); - message.outputContexts = []; - for (var i = 0; i < object.outputContexts.length; ++i) { - if (typeof object.outputContexts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.outputContexts: object expected"); - message.outputContexts[i] = $root.google.cloud.dialogflow.v2.Context.fromObject(object.outputContexts[i]); - } - } - if (object.resetContexts != null) - message.resetContexts = Boolean(object.resetContexts); - if (object.parameters) { - if (!Array.isArray(object.parameters)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.parameters: array expected"); - message.parameters = []; - for (var i = 0; i < object.parameters.length; ++i) { - if (typeof object.parameters[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.parameters: object expected"); - message.parameters[i] = $root.google.cloud.dialogflow.v2.Intent.Parameter.fromObject(object.parameters[i]); - } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.enableWordInfo != null) + message.enableWordInfo = Boolean(object.enableWordInfo); + if (object.phraseHints) { + if (!Array.isArray(object.phraseHints)) + throw TypeError(".google.cloud.dialogflow.v2.InputAudioConfig.phraseHints: array expected"); + message.phraseHints = []; + for (var i = 0; i < object.phraseHints.length; ++i) + message.phraseHints[i] = String(object.phraseHints[i]); } - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.messages: object expected"); - message.messages[i] = $root.google.cloud.dialogflow.v2.Intent.Message.fromObject(object.messages[i]); + if (object.speechContexts) { + if (!Array.isArray(object.speechContexts)) + throw TypeError(".google.cloud.dialogflow.v2.InputAudioConfig.speechContexts: array expected"); + message.speechContexts = []; + for (var i = 0; i < object.speechContexts.length; ++i) { + if (typeof object.speechContexts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.InputAudioConfig.speechContexts: object expected"); + message.speechContexts[i] = $root.google.cloud.dialogflow.v2.SpeechContext.fromObject(object.speechContexts[i]); } } - if (object.defaultResponsePlatforms) { - if (!Array.isArray(object.defaultResponsePlatforms)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.defaultResponsePlatforms: array expected"); - message.defaultResponsePlatforms = []; - for (var i = 0; i < object.defaultResponsePlatforms.length; ++i) - switch (object.defaultResponsePlatforms[i]) { - default: - case "PLATFORM_UNSPECIFIED": - case 0: - message.defaultResponsePlatforms[i] = 0; - break; - case "FACEBOOK": - case 1: - message.defaultResponsePlatforms[i] = 1; - break; - case "SLACK": - case 2: - message.defaultResponsePlatforms[i] = 2; - break; - case "TELEGRAM": - case 3: - message.defaultResponsePlatforms[i] = 3; - break; - case "KIK": - case 4: - message.defaultResponsePlatforms[i] = 4; - break; - case "SKYPE": - case 5: - message.defaultResponsePlatforms[i] = 5; - break; - case "LINE": - case 6: - message.defaultResponsePlatforms[i] = 6; - break; - case "VIBER": - case 7: - message.defaultResponsePlatforms[i] = 7; - break; - case "ACTIONS_ON_GOOGLE": - case 8: - message.defaultResponsePlatforms[i] = 8; - break; - case "GOOGLE_HANGOUTS": - case 11: - message.defaultResponsePlatforms[i] = 11; - break; - } - } - if (object.rootFollowupIntentName != null) - message.rootFollowupIntentName = String(object.rootFollowupIntentName); - if (object.parentFollowupIntentName != null) - message.parentFollowupIntentName = String(object.parentFollowupIntentName); - if (object.followupIntentInfo) { - if (!Array.isArray(object.followupIntentInfo)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.followupIntentInfo: array expected"); - message.followupIntentInfo = []; - for (var i = 0; i < object.followupIntentInfo.length; ++i) { - if (typeof object.followupIntentInfo[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.followupIntentInfo: object expected"); - message.followupIntentInfo[i] = $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.fromObject(object.followupIntentInfo[i]); - } + if (object.model != null) + message.model = String(object.model); + switch (object.modelVariant) { + case "SPEECH_MODEL_VARIANT_UNSPECIFIED": + case 0: + message.modelVariant = 0; + break; + case "USE_BEST_AVAILABLE": + case 1: + message.modelVariant = 1; + break; + case "USE_STANDARD": + case 2: + message.modelVariant = 2; + break; + case "USE_ENHANCED": + case 3: + message.modelVariant = 3; + break; } + if (object.singleUtterance != null) + message.singleUtterance = Boolean(object.singleUtterance); + if (object.disableNoSpeechRecognizedEvent != null) + message.disableNoSpeechRecognizedEvent = Boolean(object.disableNoSpeechRecognizedEvent); return message; }; /** - * Creates a plain object from an Intent message. Also converts values to other types if specified. + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @static - * @param {google.cloud.dialogflow.v2.Intent} message Intent + * @param {google.cloud.dialogflow.v2.InputAudioConfig} message InputAudioConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Intent.toObject = function toObject(message, options) { + InputAudioConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) { - object.inputContextNames = []; - object.events = []; - object.trainingPhrases = []; - object.outputContexts = []; - object.parameters = []; - object.messages = []; - object.defaultResponsePlatforms = []; - object.followupIntentInfo = []; + object.phraseHints = []; + object.speechContexts = []; } if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.priority = 0; - object.isFallback = false; - object.webhookState = options.enums === String ? "WEBHOOK_STATE_UNSPECIFIED" : 0; - object.action = ""; - object.resetContexts = false; - object.rootFollowupIntentName = ""; - object.parentFollowupIntentName = ""; - object.mlDisabled = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.priority != null && message.hasOwnProperty("priority")) - object.priority = message.priority; - if (message.isFallback != null && message.hasOwnProperty("isFallback")) - object.isFallback = message.isFallback; - if (message.webhookState != null && message.hasOwnProperty("webhookState")) - object.webhookState = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.WebhookState[message.webhookState] : message.webhookState; - if (message.inputContextNames && message.inputContextNames.length) { - object.inputContextNames = []; - for (var j = 0; j < message.inputContextNames.length; ++j) - object.inputContextNames[j] = message.inputContextNames[j]; - } - if (message.events && message.events.length) { - object.events = []; - for (var j = 0; j < message.events.length; ++j) - object.events[j] = message.events[j]; - } - if (message.trainingPhrases && message.trainingPhrases.length) { - object.trainingPhrases = []; - for (var j = 0; j < message.trainingPhrases.length; ++j) - object.trainingPhrases[j] = $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.toObject(message.trainingPhrases[j], options); - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = message.action; - if (message.outputContexts && message.outputContexts.length) { - object.outputContexts = []; - for (var j = 0; j < message.outputContexts.length; ++j) - object.outputContexts[j] = $root.google.cloud.dialogflow.v2.Context.toObject(message.outputContexts[j], options); - } - if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) - object.resetContexts = message.resetContexts; - if (message.parameters && message.parameters.length) { - object.parameters = []; - for (var j = 0; j < message.parameters.length; ++j) - object.parameters[j] = $root.google.cloud.dialogflow.v2.Intent.Parameter.toObject(message.parameters[j], options); - } - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.cloud.dialogflow.v2.Intent.Message.toObject(message.messages[j], options); + object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.languageCode = ""; + object.model = ""; + object.singleUtterance = false; + object.modelVariant = options.enums === String ? "SPEECH_MODEL_VARIANT_UNSPECIFIED" : 0; + object.enableWordInfo = false; + object.disableNoSpeechRecognizedEvent = false; } - if (message.defaultResponsePlatforms && message.defaultResponsePlatforms.length) { - object.defaultResponsePlatforms = []; - for (var j = 0; j < message.defaultResponsePlatforms.length; ++j) - object.defaultResponsePlatforms[j] = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.Message.Platform[message.defaultResponsePlatforms[j]] : message.defaultResponsePlatforms[j]; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.dialogflow.v2.AudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.phraseHints && message.phraseHints.length) { + object.phraseHints = []; + for (var j = 0; j < message.phraseHints.length; ++j) + object.phraseHints[j] = message.phraseHints[j]; } - if (message.rootFollowupIntentName != null && message.hasOwnProperty("rootFollowupIntentName")) - object.rootFollowupIntentName = message.rootFollowupIntentName; - if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) - object.parentFollowupIntentName = message.parentFollowupIntentName; - if (message.followupIntentInfo && message.followupIntentInfo.length) { - object.followupIntentInfo = []; - for (var j = 0; j < message.followupIntentInfo.length; ++j) - object.followupIntentInfo[j] = $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.toObject(message.followupIntentInfo[j], options); + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + object.singleUtterance = message.singleUtterance; + if (message.modelVariant != null && message.hasOwnProperty("modelVariant")) + object.modelVariant = options.enums === String ? $root.google.cloud.dialogflow.v2.SpeechModelVariant[message.modelVariant] : message.modelVariant; + if (message.speechContexts && message.speechContexts.length) { + object.speechContexts = []; + for (var j = 0; j < message.speechContexts.length; ++j) + object.speechContexts[j] = $root.google.cloud.dialogflow.v2.SpeechContext.toObject(message.speechContexts[j], options); } - if (message.mlDisabled != null && message.hasOwnProperty("mlDisabled")) - object.mlDisabled = message.mlDisabled; + if (message.enableWordInfo != null && message.hasOwnProperty("enableWordInfo")) + object.enableWordInfo = message.enableWordInfo; + if (message.disableNoSpeechRecognizedEvent != null && message.hasOwnProperty("disableNoSpeechRecognizedEvent")) + object.disableNoSpeechRecognizedEvent = message.disableNoSpeechRecognizedEvent; return object; }; /** - * Converts this Intent to JSON. + * Converts this InputAudioConfig to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent + * @memberof google.cloud.dialogflow.v2.InputAudioConfig * @instance * @returns {Object.} JSON object */ - Intent.prototype.toJSON = function toJSON() { + InputAudioConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Intent.TrainingPhrase = (function() { - - /** - * Properties of a TrainingPhrase. - * @memberof google.cloud.dialogflow.v2.Intent - * @interface ITrainingPhrase - * @property {string|null} [name] TrainingPhrase name - * @property {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type|null} [type] TrainingPhrase type - * @property {Array.|null} [parts] TrainingPhrase parts - * @property {number|null} [timesAddedCount] TrainingPhrase timesAddedCount - */ + return InputAudioConfig; + })(); - /** - * Constructs a new TrainingPhrase. - * @memberof google.cloud.dialogflow.v2.Intent - * @classdesc Represents a TrainingPhrase. - * @implements ITrainingPhrase - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.ITrainingPhrase=} [properties] Properties to set - */ - function TrainingPhrase(properties) { - this.parts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v2.VoiceSelectionParams = (function() { - /** - * TrainingPhrase name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @instance - */ - TrainingPhrase.prototype.name = ""; + /** + * Properties of a VoiceSelectionParams. + * @memberof google.cloud.dialogflow.v2 + * @interface IVoiceSelectionParams + * @property {string|null} [name] VoiceSelectionParams name + * @property {google.cloud.dialogflow.v2.SsmlVoiceGender|null} [ssmlGender] VoiceSelectionParams ssmlGender + */ - /** - * TrainingPhrase type. - * @member {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type} type - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @instance - */ - TrainingPhrase.prototype.type = 0; + /** + * Constructs a new VoiceSelectionParams. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a VoiceSelectionParams. + * @implements IVoiceSelectionParams + * @constructor + * @param {google.cloud.dialogflow.v2.IVoiceSelectionParams=} [properties] Properties to set + */ + function VoiceSelectionParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * TrainingPhrase parts. - * @member {Array.} parts - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @instance - */ - TrainingPhrase.prototype.parts = $util.emptyArray; + /** + * VoiceSelectionParams name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @instance + */ + VoiceSelectionParams.prototype.name = ""; - /** - * TrainingPhrase timesAddedCount. - * @member {number} timesAddedCount - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @instance - */ - TrainingPhrase.prototype.timesAddedCount = 0; + /** + * VoiceSelectionParams ssmlGender. + * @member {google.cloud.dialogflow.v2.SsmlVoiceGender} ssmlGender + * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @instance + */ + VoiceSelectionParams.prototype.ssmlGender = 0; - /** - * Creates a new TrainingPhrase instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @static - * @param {google.cloud.dialogflow.v2.Intent.ITrainingPhrase=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase} TrainingPhrase instance - */ - TrainingPhrase.create = function create(properties) { - return new TrainingPhrase(properties); - }; + /** + * Creates a new VoiceSelectionParams instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.v2.IVoiceSelectionParams=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.VoiceSelectionParams} VoiceSelectionParams instance + */ + VoiceSelectionParams.create = function create(properties) { + return new VoiceSelectionParams(properties); + }; - /** - * Encodes the specified TrainingPhrase message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @static - * @param {google.cloud.dialogflow.v2.Intent.ITrainingPhrase} message TrainingPhrase message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainingPhrase.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.parts != null && message.parts.length) - for (var i = 0; i < message.parts.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.encode(message.parts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.timesAddedCount != null && Object.hasOwnProperty.call(message, "timesAddedCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.timesAddedCount); - return writer; - }; + /** + * Encodes the specified VoiceSelectionParams message. Does not implicitly {@link google.cloud.dialogflow.v2.VoiceSelectionParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.v2.IVoiceSelectionParams} message VoiceSelectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceSelectionParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ssmlGender != null && Object.hasOwnProperty.call(message, "ssmlGender")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ssmlGender); + return writer; + }; - /** - * Encodes the specified TrainingPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @static - * @param {google.cloud.dialogflow.v2.Intent.ITrainingPhrase} message TrainingPhrase message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TrainingPhrase.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified VoiceSelectionParams message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.VoiceSelectionParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.v2.IVoiceSelectionParams} message VoiceSelectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceSelectionParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a TrainingPhrase message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase} TrainingPhrase - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainingPhrase.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.type = reader.int32(); - break; - case 3: - if (!(message.parts && message.parts.length)) - message.parts = []; - message.parts.push($root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.decode(reader, reader.uint32())); - break; - case 4: - message.timesAddedCount = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.VoiceSelectionParams} VoiceSelectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceSelectionParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.VoiceSelectionParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.ssmlGender = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a TrainingPhrase message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase} TrainingPhrase - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TrainingPhrase.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a TrainingPhrase message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TrainingPhrase.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.parts != null && message.hasOwnProperty("parts")) { - if (!Array.isArray(message.parts)) - return "parts: array expected"; - for (var i = 0; i < message.parts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.verify(message.parts[i]); - if (error) - return "parts." + error; - } - } - if (message.timesAddedCount != null && message.hasOwnProperty("timesAddedCount")) - if (!$util.isInteger(message.timesAddedCount)) - return "timesAddedCount: integer expected"; - return null; - }; + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.VoiceSelectionParams} VoiceSelectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceSelectionParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a TrainingPhrase message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase} TrainingPhrase - */ - TrainingPhrase.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase(); - if (object.name != null) - message.name = String(object.name); - switch (object.type) { - case "TYPE_UNSPECIFIED": + /** + * Verifies a VoiceSelectionParams message. + * @function verify + * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceSelectionParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ssmlGender != null && message.hasOwnProperty("ssmlGender")) + switch (message.ssmlGender) { + default: + return "ssmlGender: enum value expected"; case 0: - message.type = 0; - break; - case "EXAMPLE": case 1: - message.type = 1; - break; - case "TEMPLATE": case 2: - message.type = 2; + case 3: break; } - if (object.parts) { - if (!Array.isArray(object.parts)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.TrainingPhrase.parts: array expected"); - message.parts = []; - for (var i = 0; i < object.parts.length; ++i) { - if (typeof object.parts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.TrainingPhrase.parts: object expected"); - message.parts[i] = $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.fromObject(object.parts[i]); - } - } - if (object.timesAddedCount != null) - message.timesAddedCount = object.timesAddedCount | 0; - return message; - }; + return null; + }; - /** - * Creates a plain object from a TrainingPhrase message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @static - * @param {google.cloud.dialogflow.v2.Intent.TrainingPhrase} message TrainingPhrase - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TrainingPhrase.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.parts = []; - if (options.defaults) { - object.name = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.timesAddedCount = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type[message.type] : message.type; - if (message.parts && message.parts.length) { - object.parts = []; - for (var j = 0; j < message.parts.length; ++j) - object.parts[j] = $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.toObject(message.parts[j], options); - } - if (message.timesAddedCount != null && message.hasOwnProperty("timesAddedCount")) - object.timesAddedCount = message.timesAddedCount; + /** + * Creates a VoiceSelectionParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.VoiceSelectionParams} VoiceSelectionParams + */ + VoiceSelectionParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.VoiceSelectionParams) return object; - }; + var message = new $root.google.cloud.dialogflow.v2.VoiceSelectionParams(); + if (object.name != null) + message.name = String(object.name); + switch (object.ssmlGender) { + case "SSML_VOICE_GENDER_UNSPECIFIED": + case 0: + message.ssmlGender = 0; + break; + case "SSML_VOICE_GENDER_MALE": + case 1: + message.ssmlGender = 1; + break; + case "SSML_VOICE_GENDER_FEMALE": + case 2: + message.ssmlGender = 2; + break; + case "SSML_VOICE_GENDER_NEUTRAL": + case 3: + message.ssmlGender = 3; + break; + } + return message; + }; - /** - * Converts this TrainingPhrase to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @instance - * @returns {Object.} JSON object - */ - TrainingPhrase.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a VoiceSelectionParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.v2.VoiceSelectionParams} message VoiceSelectionParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoiceSelectionParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ssmlGender = options.enums === String ? "SSML_VOICE_GENDER_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ssmlGender != null && message.hasOwnProperty("ssmlGender")) + object.ssmlGender = options.enums === String ? $root.google.cloud.dialogflow.v2.SsmlVoiceGender[message.ssmlGender] : message.ssmlGender; + return object; + }; - TrainingPhrase.Part = (function() { + /** + * Converts this VoiceSelectionParams to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.VoiceSelectionParams + * @instance + * @returns {Object.} JSON object + */ + VoiceSelectionParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a Part. - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @interface IPart - * @property {string|null} [text] Part text - * @property {string|null} [entityType] Part entityType - * @property {string|null} [alias] Part alias - * @property {boolean|null} [userDefined] Part userDefined - */ + return VoiceSelectionParams; + })(); - /** - * Constructs a new Part. - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase - * @classdesc Represents a Part. - * @implements IPart - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart=} [properties] Properties to set - */ - function Part(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v2.SynthesizeSpeechConfig = (function() { - /** - * Part text. - * @member {string} text - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @instance - */ - Part.prototype.text = ""; + /** + * Properties of a SynthesizeSpeechConfig. + * @memberof google.cloud.dialogflow.v2 + * @interface ISynthesizeSpeechConfig + * @property {number|null} [speakingRate] SynthesizeSpeechConfig speakingRate + * @property {number|null} [pitch] SynthesizeSpeechConfig pitch + * @property {number|null} [volumeGainDb] SynthesizeSpeechConfig volumeGainDb + * @property {Array.|null} [effectsProfileId] SynthesizeSpeechConfig effectsProfileId + * @property {google.cloud.dialogflow.v2.IVoiceSelectionParams|null} [voice] SynthesizeSpeechConfig voice + */ - /** - * Part entityType. - * @member {string} entityType - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @instance - */ - Part.prototype.entityType = ""; + /** + * Constructs a new SynthesizeSpeechConfig. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a SynthesizeSpeechConfig. + * @implements ISynthesizeSpeechConfig + * @constructor + * @param {google.cloud.dialogflow.v2.ISynthesizeSpeechConfig=} [properties] Properties to set + */ + function SynthesizeSpeechConfig(properties) { + this.effectsProfileId = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Part alias. - * @member {string} alias - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @instance - */ - Part.prototype.alias = ""; + /** + * SynthesizeSpeechConfig speakingRate. + * @member {number} speakingRate + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.speakingRate = 0; - /** - * Part userDefined. - * @member {boolean} userDefined - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @instance - */ - Part.prototype.userDefined = false; + /** + * SynthesizeSpeechConfig pitch. + * @member {number} pitch + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.pitch = 0; - /** - * Creates a new Part instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @static - * @param {google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part} Part instance - */ - Part.create = function create(properties) { - return new Part(properties); - }; + /** + * SynthesizeSpeechConfig volumeGainDb. + * @member {number} volumeGainDb + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.volumeGainDb = 0; - /** - * Encodes the specified Part message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @static - * @param {google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityType); - if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.alias); - if (message.userDefined != null && Object.hasOwnProperty.call(message, "userDefined")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.userDefined); - return writer; - }; + /** + * SynthesizeSpeechConfig effectsProfileId. + * @member {Array.} effectsProfileId + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.effectsProfileId = $util.emptyArray; - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @static - * @param {google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * SynthesizeSpeechConfig voice. + * @member {google.cloud.dialogflow.v2.IVoiceSelectionParams|null|undefined} voice + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.voice = null; - /** - * Decodes a Part message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = reader.string(); - break; - case 2: - message.entityType = reader.string(); - break; - case 3: - message.alias = reader.string(); - break; - case 4: - message.userDefined = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.v2.ISynthesizeSpeechConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SynthesizeSpeechConfig} SynthesizeSpeechConfig instance + */ + SynthesizeSpeechConfig.create = function create(properties) { + return new SynthesizeSpeechConfig(properties); + }; - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.SynthesizeSpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.v2.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.speakingRate); + if (message.pitch != null && Object.hasOwnProperty.call(message, "pitch")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.pitch); + if (message.volumeGainDb != null && Object.hasOwnProperty.call(message, "volumeGainDb")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.volumeGainDb); + if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) + $root.google.cloud.dialogflow.v2.VoiceSelectionParams.encode(message.voice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.effectsProfileId != null && message.effectsProfileId.length) + for (var i = 0; i < message.effectsProfileId.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.effectsProfileId[i]); + return writer; + }; - /** - * Verifies a Part message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Part.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.entityType != null && message.hasOwnProperty("entityType")) - if (!$util.isString(message.entityType)) - return "entityType: string expected"; - if (message.alias != null && message.hasOwnProperty("alias")) - if (!$util.isString(message.alias)) - return "alias: string expected"; - if (message.userDefined != null && message.hasOwnProperty("userDefined")) - if (typeof message.userDefined !== "boolean") - return "userDefined: boolean expected"; - return null; - }; + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SynthesizeSpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.v2.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part} Part - */ - Part.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part(); - if (object.text != null) - message.text = String(object.text); - if (object.entityType != null) - message.entityType = String(object.entityType); - if (object.alias != null) - message.alias = String(object.alias); - if (object.userDefined != null) - message.userDefined = Boolean(object.userDefined); - return message; - }; + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.speakingRate = reader.double(); + break; + case 2: + message.pitch = reader.double(); + break; + case 3: + message.volumeGainDb = reader.double(); + break; + case 5: + if (!(message.effectsProfileId && message.effectsProfileId.length)) + message.effectsProfileId = []; + message.effectsProfileId.push(reader.string()); + break; + case 4: + message.voice = $root.google.cloud.dialogflow.v2.VoiceSelectionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @static - * @param {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part} message Part - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Part.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.entityType = ""; - object.alias = ""; - object.userDefined = false; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.entityType != null && message.hasOwnProperty("entityType")) - object.entityType = message.entityType; - if (message.alias != null && message.hasOwnProperty("alias")) - object.alias = message.alias; - if (message.userDefined != null && message.hasOwnProperty("userDefined")) - object.userDefined = message.userDefined; - return object; - }; + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this Part to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part - * @instance - * @returns {Object.} JSON object - */ - Part.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a SynthesizeSpeechConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SynthesizeSpeechConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + if (typeof message.speakingRate !== "number") + return "speakingRate: number expected"; + if (message.pitch != null && message.hasOwnProperty("pitch")) + if (typeof message.pitch !== "number") + return "pitch: number expected"; + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + if (typeof message.volumeGainDb !== "number") + return "volumeGainDb: number expected"; + if (message.effectsProfileId != null && message.hasOwnProperty("effectsProfileId")) { + if (!Array.isArray(message.effectsProfileId)) + return "effectsProfileId: array expected"; + for (var i = 0; i < message.effectsProfileId.length; ++i) + if (!$util.isString(message.effectsProfileId[i])) + return "effectsProfileId: string[] expected"; + } + if (message.voice != null && message.hasOwnProperty("voice")) { + var error = $root.google.cloud.dialogflow.v2.VoiceSelectionParams.verify(message.voice); + if (error) + return "voice." + error; + } + return null; + }; - return Part; - })(); + /** + * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.SynthesizeSpeechConfig} SynthesizeSpeechConfig + */ + SynthesizeSpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig(); + if (object.speakingRate != null) + message.speakingRate = Number(object.speakingRate); + if (object.pitch != null) + message.pitch = Number(object.pitch); + if (object.volumeGainDb != null) + message.volumeGainDb = Number(object.volumeGainDb); + if (object.effectsProfileId) { + if (!Array.isArray(object.effectsProfileId)) + throw TypeError(".google.cloud.dialogflow.v2.SynthesizeSpeechConfig.effectsProfileId: array expected"); + message.effectsProfileId = []; + for (var i = 0; i < object.effectsProfileId.length; ++i) + message.effectsProfileId[i] = String(object.effectsProfileId[i]); + } + if (object.voice != null) { + if (typeof object.voice !== "object") + throw TypeError(".google.cloud.dialogflow.v2.SynthesizeSpeechConfig.voice: object expected"); + message.voice = $root.google.cloud.dialogflow.v2.VoiceSelectionParams.fromObject(object.voice); + } + return message; + }; - /** - * Type enum. - * @name google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} EXAMPLE=1 EXAMPLE value - * @property {number} TEMPLATE=2 TEMPLATE value - */ - TrainingPhrase.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "EXAMPLE"] = 1; - values[valuesById[2] = "TEMPLATE"] = 2; - return values; - })(); + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.v2.SynthesizeSpeechConfig} message SynthesizeSpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SynthesizeSpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.effectsProfileId = []; + if (options.defaults) { + object.speakingRate = 0; + object.pitch = 0; + object.volumeGainDb = 0; + object.voice = null; + } + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; + if (message.pitch != null && message.hasOwnProperty("pitch")) + object.pitch = options.json && !isFinite(message.pitch) ? String(message.pitch) : message.pitch; + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + object.volumeGainDb = options.json && !isFinite(message.volumeGainDb) ? String(message.volumeGainDb) : message.volumeGainDb; + if (message.voice != null && message.hasOwnProperty("voice")) + object.voice = $root.google.cloud.dialogflow.v2.VoiceSelectionParams.toObject(message.voice, options); + if (message.effectsProfileId && message.effectsProfileId.length) { + object.effectsProfileId = []; + for (var j = 0; j < message.effectsProfileId.length; ++j) + object.effectsProfileId[j] = message.effectsProfileId[j]; + } + return object; + }; - return TrainingPhrase; - })(); + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.SynthesizeSpeechConfig + * @instance + * @returns {Object.} JSON object + */ + SynthesizeSpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - Intent.Parameter = (function() { + return SynthesizeSpeechConfig; + })(); - /** - * Properties of a Parameter. - * @memberof google.cloud.dialogflow.v2.Intent - * @interface IParameter - * @property {string|null} [name] Parameter name - * @property {string|null} [displayName] Parameter displayName - * @property {string|null} [value] Parameter value - * @property {string|null} [defaultValue] Parameter defaultValue - * @property {string|null} [entityTypeDisplayName] Parameter entityTypeDisplayName - * @property {boolean|null} [mandatory] Parameter mandatory - * @property {Array.|null} [prompts] Parameter prompts - * @property {boolean|null} [isList] Parameter isList - */ + /** + * SsmlVoiceGender enum. + * @name google.cloud.dialogflow.v2.SsmlVoiceGender + * @enum {number} + * @property {number} SSML_VOICE_GENDER_UNSPECIFIED=0 SSML_VOICE_GENDER_UNSPECIFIED value + * @property {number} SSML_VOICE_GENDER_MALE=1 SSML_VOICE_GENDER_MALE value + * @property {number} SSML_VOICE_GENDER_FEMALE=2 SSML_VOICE_GENDER_FEMALE value + * @property {number} SSML_VOICE_GENDER_NEUTRAL=3 SSML_VOICE_GENDER_NEUTRAL value + */ + v2.SsmlVoiceGender = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSML_VOICE_GENDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "SSML_VOICE_GENDER_MALE"] = 1; + values[valuesById[2] = "SSML_VOICE_GENDER_FEMALE"] = 2; + values[valuesById[3] = "SSML_VOICE_GENDER_NEUTRAL"] = 3; + return values; + })(); - /** - * Constructs a new Parameter. - * @memberof google.cloud.dialogflow.v2.Intent - * @classdesc Represents a Parameter. - * @implements IParameter - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.IParameter=} [properties] Properties to set - */ - function Parameter(properties) { - this.prompts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v2.OutputAudioConfig = (function() { - /** - * Parameter name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @instance - */ - Parameter.prototype.name = ""; + /** + * Properties of an OutputAudioConfig. + * @memberof google.cloud.dialogflow.v2 + * @interface IOutputAudioConfig + * @property {google.cloud.dialogflow.v2.OutputAudioEncoding|null} [audioEncoding] OutputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] OutputAudioConfig sampleRateHertz + * @property {google.cloud.dialogflow.v2.ISynthesizeSpeechConfig|null} [synthesizeSpeechConfig] OutputAudioConfig synthesizeSpeechConfig + */ - /** - * Parameter displayName. - * @member {string} displayName - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @instance - */ - Parameter.prototype.displayName = ""; + /** + * Constructs a new OutputAudioConfig. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an OutputAudioConfig. + * @implements IOutputAudioConfig + * @constructor + * @param {google.cloud.dialogflow.v2.IOutputAudioConfig=} [properties] Properties to set + */ + function OutputAudioConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Parameter value. - * @member {string} value - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @instance - */ - Parameter.prototype.value = ""; + /** + * OutputAudioConfig audioEncoding. + * @member {google.cloud.dialogflow.v2.OutputAudioEncoding} audioEncoding + * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.audioEncoding = 0; - /** - * Parameter defaultValue. - * @member {string} defaultValue - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @instance - */ - Parameter.prototype.defaultValue = ""; + /** + * OutputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.sampleRateHertz = 0; - /** - * Parameter entityTypeDisplayName. - * @member {string} entityTypeDisplayName - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @instance - */ - Parameter.prototype.entityTypeDisplayName = ""; + /** + * OutputAudioConfig synthesizeSpeechConfig. + * @member {google.cloud.dialogflow.v2.ISynthesizeSpeechConfig|null|undefined} synthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.synthesizeSpeechConfig = null; - /** - * Parameter mandatory. - * @member {boolean} mandatory - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @instance - */ - Parameter.prototype.mandatory = false; + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2.IOutputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.OutputAudioConfig} OutputAudioConfig instance + */ + OutputAudioConfig.create = function create(properties) { + return new OutputAudioConfig(properties); + }; - /** - * Parameter prompts. - * @member {Array.} prompts - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @instance - */ - Parameter.prototype.prompts = $util.emptyArray; + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.OutputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.synthesizeSpeechConfig != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfig")) + $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Parameter isList. - * @member {boolean} isList - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @instance - */ - Parameter.prototype.isList = false; + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.OutputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new Parameter instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @static - * @param {google.cloud.dialogflow.v2.Intent.IParameter=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Parameter} Parameter instance - */ - Parameter.create = function create(properties) { - return new Parameter(properties); - }; + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.OutputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.audioEncoding = reader.int32(); + break; + case 2: + message.sampleRateHertz = reader.int32(); + break; + case 3: + message.synthesizeSpeechConfig = $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Parameter.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @static - * @param {google.cloud.dialogflow.v2.Intent.IParameter} message Parameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Parameter.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.value); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.defaultValue); - if (message.entityTypeDisplayName != null && Object.hasOwnProperty.call(message, "entityTypeDisplayName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.entityTypeDisplayName); - if (message.mandatory != null && Object.hasOwnProperty.call(message, "mandatory")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.mandatory); - if (message.prompts != null && message.prompts.length) - for (var i = 0; i < message.prompts.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.prompts[i]); - if (message.isList != null && Object.hasOwnProperty.call(message, "isList")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.isList); - return writer; - }; + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Parameter.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @static - * @param {google.cloud.dialogflow.v2.Intent.IParameter} message Parameter message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Parameter.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies an OutputAudioConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputAudioConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.synthesizeSpeechConfig != null && message.hasOwnProperty("synthesizeSpeechConfig")) { + var error = $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfig); + if (error) + return "synthesizeSpeechConfig." + error; + } + return null; + }; - /** - * Decodes a Parameter message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Parameter} Parameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Parameter.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Parameter(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.OutputAudioConfig} OutputAudioConfig + */ + OutputAudioConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.OutputAudioConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2.OutputAudioConfig(); + switch (object.audioEncoding) { + case "OUTPUT_AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "OUTPUT_AUDIO_ENCODING_LINEAR_16": + case 1: + message.audioEncoding = 1; + break; + case "OUTPUT_AUDIO_ENCODING_MP3": + case 2: + message.audioEncoding = 2; + break; + case "OUTPUT_AUDIO_ENCODING_OGG_OPUS": + case 3: + message.audioEncoding = 3; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.synthesizeSpeechConfig != null) { + if (typeof object.synthesizeSpeechConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.OutputAudioConfig.synthesizeSpeechConfig: object expected"); + message.synthesizeSpeechConfig = $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfig); + } + return message; + }; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2.OutputAudioConfig} message OutputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioEncoding = options.enums === String ? "OUTPUT_AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.synthesizeSpeechConfig = null; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.dialogflow.v2.OutputAudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.synthesizeSpeechConfig != null && message.hasOwnProperty("synthesizeSpeechConfig")) + object.synthesizeSpeechConfig = $root.google.cloud.dialogflow.v2.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfig, options); + return object; + }; + + /** + * Converts this OutputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.OutputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + OutputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputAudioConfig; + })(); + + v2.TelephonyDtmfEvents = (function() { + + /** + * Properties of a TelephonyDtmfEvents. + * @memberof google.cloud.dialogflow.v2 + * @interface ITelephonyDtmfEvents + * @property {Array.|null} [dtmfEvents] TelephonyDtmfEvents dtmfEvents + */ + + /** + * Constructs a new TelephonyDtmfEvents. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a TelephonyDtmfEvents. + * @implements ITelephonyDtmfEvents + * @constructor + * @param {google.cloud.dialogflow.v2.ITelephonyDtmfEvents=} [properties] Properties to set + */ + function TelephonyDtmfEvents(properties) { + this.dtmfEvents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TelephonyDtmfEvents dtmfEvents. + * @member {Array.} dtmfEvents + * @memberof google.cloud.dialogflow.v2.TelephonyDtmfEvents + * @instance + */ + TelephonyDtmfEvents.prototype.dtmfEvents = $util.emptyArray; + + /** + * Creates a new TelephonyDtmfEvents instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.TelephonyDtmfEvents + * @static + * @param {google.cloud.dialogflow.v2.ITelephonyDtmfEvents=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.TelephonyDtmfEvents} TelephonyDtmfEvents instance + */ + TelephonyDtmfEvents.create = function create(properties) { + return new TelephonyDtmfEvents(properties); + }; + + /** + * Encodes the specified TelephonyDtmfEvents message. Does not implicitly {@link google.cloud.dialogflow.v2.TelephonyDtmfEvents.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.TelephonyDtmfEvents + * @static + * @param {google.cloud.dialogflow.v2.ITelephonyDtmfEvents} message TelephonyDtmfEvents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonyDtmfEvents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dtmfEvents != null && message.dtmfEvents.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.dtmfEvents.length; ++i) + writer.int32(message.dtmfEvents[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified TelephonyDtmfEvents message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.TelephonyDtmfEvents.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.TelephonyDtmfEvents + * @static + * @param {google.cloud.dialogflow.v2.ITelephonyDtmfEvents} message TelephonyDtmfEvents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonyDtmfEvents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TelephonyDtmfEvents message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.TelephonyDtmfEvents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.TelephonyDtmfEvents} TelephonyDtmfEvents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonyDtmfEvents.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.TelephonyDtmfEvents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.dtmfEvents && message.dtmfEvents.length)) + message.dtmfEvents = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.dtmfEvents.push(reader.int32()); + } else + message.dtmfEvents.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TelephonyDtmfEvents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.TelephonyDtmfEvents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.TelephonyDtmfEvents} TelephonyDtmfEvents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonyDtmfEvents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TelephonyDtmfEvents message. + * @function verify + * @memberof google.cloud.dialogflow.v2.TelephonyDtmfEvents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TelephonyDtmfEvents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dtmfEvents != null && message.hasOwnProperty("dtmfEvents")) { + if (!Array.isArray(message.dtmfEvents)) + return "dtmfEvents: array expected"; + for (var i = 0; i < message.dtmfEvents.length; ++i) + switch (message.dtmfEvents[i]) { + default: + return "dtmfEvents: enum value[] expected"; + case 0: case 1: - message.name = reader.string(); + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + break; + } + } + return null; + }; + + /** + * Creates a TelephonyDtmfEvents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.TelephonyDtmfEvents + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.TelephonyDtmfEvents} TelephonyDtmfEvents + */ + TelephonyDtmfEvents.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.TelephonyDtmfEvents) + return object; + var message = new $root.google.cloud.dialogflow.v2.TelephonyDtmfEvents(); + if (object.dtmfEvents) { + if (!Array.isArray(object.dtmfEvents)) + throw TypeError(".google.cloud.dialogflow.v2.TelephonyDtmfEvents.dtmfEvents: array expected"); + message.dtmfEvents = []; + for (var i = 0; i < object.dtmfEvents.length; ++i) + switch (object.dtmfEvents[i]) { + default: + case "TELEPHONY_DTMF_UNSPECIFIED": + case 0: + message.dtmfEvents[i] = 0; + break; + case "DTMF_ONE": + case 1: + message.dtmfEvents[i] = 1; break; + case "DTMF_TWO": case 2: - message.displayName = reader.string(); + message.dtmfEvents[i] = 2; break; + case "DTMF_THREE": case 3: - message.value = reader.string(); + message.dtmfEvents[i] = 3; break; + case "DTMF_FOUR": case 4: - message.defaultValue = reader.string(); + message.dtmfEvents[i] = 4; break; + case "DTMF_FIVE": case 5: - message.entityTypeDisplayName = reader.string(); + message.dtmfEvents[i] = 5; break; + case "DTMF_SIX": case 6: - message.mandatory = reader.bool(); + message.dtmfEvents[i] = 6; break; + case "DTMF_SEVEN": case 7: - if (!(message.prompts && message.prompts.length)) - message.prompts = []; - message.prompts.push(reader.string()); + message.dtmfEvents[i] = 7; break; + case "DTMF_EIGHT": case 8: - message.isList = reader.bool(); + message.dtmfEvents[i] = 8; break; - default: - reader.skipType(tag & 7); + case "DTMF_NINE": + case 9: + message.dtmfEvents[i] = 9; + break; + case "DTMF_ZERO": + case 10: + message.dtmfEvents[i] = 10; + break; + case "DTMF_A": + case 11: + message.dtmfEvents[i] = 11; + break; + case "DTMF_B": + case 12: + message.dtmfEvents[i] = 12; + break; + case "DTMF_C": + case 13: + message.dtmfEvents[i] = 13; + break; + case "DTMF_D": + case 14: + message.dtmfEvents[i] = 14; + break; + case "DTMF_STAR": + case 15: + message.dtmfEvents[i] = 15; + break; + case "DTMF_POUND": + case 16: + message.dtmfEvents[i] = 16; break; } - } - return message; - }; - - /** - * Decodes a Parameter message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Parameter} Parameter - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Parameter.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Parameter message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Parameter.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.entityTypeDisplayName != null && message.hasOwnProperty("entityTypeDisplayName")) - if (!$util.isString(message.entityTypeDisplayName)) - return "entityTypeDisplayName: string expected"; - if (message.mandatory != null && message.hasOwnProperty("mandatory")) - if (typeof message.mandatory !== "boolean") - return "mandatory: boolean expected"; - if (message.prompts != null && message.hasOwnProperty("prompts")) { - if (!Array.isArray(message.prompts)) - return "prompts: array expected"; - for (var i = 0; i < message.prompts.length; ++i) - if (!$util.isString(message.prompts[i])) - return "prompts: string[] expected"; - } - if (message.isList != null && message.hasOwnProperty("isList")) - if (typeof message.isList !== "boolean") - return "isList: boolean expected"; - return null; - }; - - /** - * Creates a Parameter message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Parameter} Parameter - */ - Parameter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Parameter) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Parameter(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.value != null) - message.value = String(object.value); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.entityTypeDisplayName != null) - message.entityTypeDisplayName = String(object.entityTypeDisplayName); - if (object.mandatory != null) - message.mandatory = Boolean(object.mandatory); - if (object.prompts) { - if (!Array.isArray(object.prompts)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Parameter.prompts: array expected"); - message.prompts = []; - for (var i = 0; i < object.prompts.length; ++i) - message.prompts[i] = String(object.prompts[i]); - } - if (object.isList != null) - message.isList = Boolean(object.isList); - return message; - }; - - /** - * Creates a plain object from a Parameter message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @static - * @param {google.cloud.dialogflow.v2.Intent.Parameter} message Parameter - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Parameter.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.prompts = []; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.value = ""; - object.defaultValue = ""; - object.entityTypeDisplayName = ""; - object.mandatory = false; - object.isList = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.entityTypeDisplayName != null && message.hasOwnProperty("entityTypeDisplayName")) - object.entityTypeDisplayName = message.entityTypeDisplayName; - if (message.mandatory != null && message.hasOwnProperty("mandatory")) - object.mandatory = message.mandatory; - if (message.prompts && message.prompts.length) { - object.prompts = []; - for (var j = 0; j < message.prompts.length; ++j) - object.prompts[j] = message.prompts[j]; - } - if (message.isList != null && message.hasOwnProperty("isList")) - object.isList = message.isList; - return object; - }; - - /** - * Converts this Parameter to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Parameter - * @instance - * @returns {Object.} JSON object - */ - Parameter.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + } + return message; + }; - return Parameter; - })(); + /** + * Creates a plain object from a TelephonyDtmfEvents message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.TelephonyDtmfEvents + * @static + * @param {google.cloud.dialogflow.v2.TelephonyDtmfEvents} message TelephonyDtmfEvents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TelephonyDtmfEvents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dtmfEvents = []; + if (message.dtmfEvents && message.dtmfEvents.length) { + object.dtmfEvents = []; + for (var j = 0; j < message.dtmfEvents.length; ++j) + object.dtmfEvents[j] = options.enums === String ? $root.google.cloud.dialogflow.v2.TelephonyDtmf[message.dtmfEvents[j]] : message.dtmfEvents[j]; + } + return object; + }; - Intent.Message = (function() { + /** + * Converts this TelephonyDtmfEvents to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.TelephonyDtmfEvents + * @instance + * @returns {Object.} JSON object + */ + TelephonyDtmfEvents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a Message. - * @memberof google.cloud.dialogflow.v2.Intent - * @interface IMessage - * @property {google.cloud.dialogflow.v2.Intent.Message.IText|null} [text] Message text - * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [image] Message image - * @property {google.cloud.dialogflow.v2.Intent.Message.IQuickReplies|null} [quickReplies] Message quickReplies - * @property {google.cloud.dialogflow.v2.Intent.Message.ICard|null} [card] Message card - * @property {google.protobuf.IStruct|null} [payload] Message payload - * @property {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses|null} [simpleResponses] Message simpleResponses - * @property {google.cloud.dialogflow.v2.Intent.Message.IBasicCard|null} [basicCard] Message basicCard - * @property {google.cloud.dialogflow.v2.Intent.Message.ISuggestions|null} [suggestions] Message suggestions - * @property {google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion|null} [linkOutSuggestion] Message linkOutSuggestion - * @property {google.cloud.dialogflow.v2.Intent.Message.IListSelect|null} [listSelect] Message listSelect - * @property {google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect|null} [carouselSelect] Message carouselSelect - * @property {google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard|null} [browseCarouselCard] Message browseCarouselCard - * @property {google.cloud.dialogflow.v2.Intent.Message.ITableCard|null} [tableCard] Message tableCard - * @property {google.cloud.dialogflow.v2.Intent.Message.IMediaContent|null} [mediaContent] Message mediaContent - * @property {google.cloud.dialogflow.v2.Intent.Message.Platform|null} [platform] Message platform - */ + return TelephonyDtmfEvents; + })(); - /** - * Constructs a new Message. - * @memberof google.cloud.dialogflow.v2.Intent - * @classdesc Represents a Message. - * @implements IMessage - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.IMessage=} [properties] Properties to set - */ - function Message(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * OutputAudioEncoding enum. + * @name google.cloud.dialogflow.v2.OutputAudioEncoding + * @enum {number} + * @property {number} OUTPUT_AUDIO_ENCODING_UNSPECIFIED=0 OUTPUT_AUDIO_ENCODING_UNSPECIFIED value + * @property {number} OUTPUT_AUDIO_ENCODING_LINEAR_16=1 OUTPUT_AUDIO_ENCODING_LINEAR_16 value + * @property {number} OUTPUT_AUDIO_ENCODING_MP3=2 OUTPUT_AUDIO_ENCODING_MP3 value + * @property {number} OUTPUT_AUDIO_ENCODING_OGG_OPUS=3 OUTPUT_AUDIO_ENCODING_OGG_OPUS value + */ + v2.OutputAudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTPUT_AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "OUTPUT_AUDIO_ENCODING_LINEAR_16"] = 1; + values[valuesById[2] = "OUTPUT_AUDIO_ENCODING_MP3"] = 2; + values[valuesById[3] = "OUTPUT_AUDIO_ENCODING_OGG_OPUS"] = 3; + return values; + })(); - /** - * Message text. - * @member {google.cloud.dialogflow.v2.Intent.Message.IText|null|undefined} text - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.text = null; + v2.SpeechToTextConfig = (function() { - /** - * Message image. - * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} image - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.image = null; + /** + * Properties of a SpeechToTextConfig. + * @memberof google.cloud.dialogflow.v2 + * @interface ISpeechToTextConfig + * @property {google.cloud.dialogflow.v2.SpeechModelVariant|null} [speechModelVariant] SpeechToTextConfig speechModelVariant + */ - /** - * Message quickReplies. - * @member {google.cloud.dialogflow.v2.Intent.Message.IQuickReplies|null|undefined} quickReplies - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.quickReplies = null; + /** + * Constructs a new SpeechToTextConfig. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a SpeechToTextConfig. + * @implements ISpeechToTextConfig + * @constructor + * @param {google.cloud.dialogflow.v2.ISpeechToTextConfig=} [properties] Properties to set + */ + function SpeechToTextConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Message card. - * @member {google.cloud.dialogflow.v2.Intent.Message.ICard|null|undefined} card - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.card = null; + /** + * SpeechToTextConfig speechModelVariant. + * @member {google.cloud.dialogflow.v2.SpeechModelVariant} speechModelVariant + * @memberof google.cloud.dialogflow.v2.SpeechToTextConfig + * @instance + */ + SpeechToTextConfig.prototype.speechModelVariant = 0; - /** - * Message payload. - * @member {google.protobuf.IStruct|null|undefined} payload - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.payload = null; + /** + * Creates a new SpeechToTextConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.SpeechToTextConfig + * @static + * @param {google.cloud.dialogflow.v2.ISpeechToTextConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SpeechToTextConfig} SpeechToTextConfig instance + */ + SpeechToTextConfig.create = function create(properties) { + return new SpeechToTextConfig(properties); + }; - /** - * Message simpleResponses. - * @member {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses|null|undefined} simpleResponses - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.simpleResponses = null; + /** + * Encodes the specified SpeechToTextConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechToTextConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.SpeechToTextConfig + * @static + * @param {google.cloud.dialogflow.v2.ISpeechToTextConfig} message SpeechToTextConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechToTextConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speechModelVariant != null && Object.hasOwnProperty.call(message, "speechModelVariant")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.speechModelVariant); + return writer; + }; - /** - * Message basicCard. - * @member {google.cloud.dialogflow.v2.Intent.Message.IBasicCard|null|undefined} basicCard - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.basicCard = null; + /** + * Encodes the specified SpeechToTextConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SpeechToTextConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.SpeechToTextConfig + * @static + * @param {google.cloud.dialogflow.v2.ISpeechToTextConfig} message SpeechToTextConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechToTextConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Message suggestions. - * @member {google.cloud.dialogflow.v2.Intent.Message.ISuggestions|null|undefined} suggestions - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.suggestions = null; + /** + * Decodes a SpeechToTextConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.SpeechToTextConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.SpeechToTextConfig} SpeechToTextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechToTextConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SpeechToTextConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.speechModelVariant = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Message linkOutSuggestion. - * @member {google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion|null|undefined} linkOutSuggestion - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.linkOutSuggestion = null; + /** + * Decodes a SpeechToTextConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.SpeechToTextConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.SpeechToTextConfig} SpeechToTextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechToTextConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Message listSelect. - * @member {google.cloud.dialogflow.v2.Intent.Message.IListSelect|null|undefined} listSelect - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.listSelect = null; + /** + * Verifies a SpeechToTextConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2.SpeechToTextConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechToTextConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speechModelVariant != null && message.hasOwnProperty("speechModelVariant")) + switch (message.speechModelVariant) { + default: + return "speechModelVariant: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; - /** - * Message carouselSelect. - * @member {google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect|null|undefined} carouselSelect - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.carouselSelect = null; + /** + * Creates a SpeechToTextConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.SpeechToTextConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.SpeechToTextConfig} SpeechToTextConfig + */ + SpeechToTextConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SpeechToTextConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2.SpeechToTextConfig(); + switch (object.speechModelVariant) { + case "SPEECH_MODEL_VARIANT_UNSPECIFIED": + case 0: + message.speechModelVariant = 0; + break; + case "USE_BEST_AVAILABLE": + case 1: + message.speechModelVariant = 1; + break; + case "USE_STANDARD": + case 2: + message.speechModelVariant = 2; + break; + case "USE_ENHANCED": + case 3: + message.speechModelVariant = 3; + break; + } + return message; + }; - /** - * Message browseCarouselCard. - * @member {google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard|null|undefined} browseCarouselCard - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.browseCarouselCard = null; + /** + * Creates a plain object from a SpeechToTextConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.SpeechToTextConfig + * @static + * @param {google.cloud.dialogflow.v2.SpeechToTextConfig} message SpeechToTextConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechToTextConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.speechModelVariant = options.enums === String ? "SPEECH_MODEL_VARIANT_UNSPECIFIED" : 0; + if (message.speechModelVariant != null && message.hasOwnProperty("speechModelVariant")) + object.speechModelVariant = options.enums === String ? $root.google.cloud.dialogflow.v2.SpeechModelVariant[message.speechModelVariant] : message.speechModelVariant; + return object; + }; - /** - * Message tableCard. - * @member {google.cloud.dialogflow.v2.Intent.Message.ITableCard|null|undefined} tableCard - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.tableCard = null; + /** + * Converts this SpeechToTextConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.SpeechToTextConfig + * @instance + * @returns {Object.} JSON object + */ + SpeechToTextConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Message mediaContent. - * @member {google.cloud.dialogflow.v2.Intent.Message.IMediaContent|null|undefined} mediaContent - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.mediaContent = null; + return SpeechToTextConfig; + })(); - /** - * Message platform. - * @member {google.cloud.dialogflow.v2.Intent.Message.Platform} platform - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Message.prototype.platform = 0; + /** + * TelephonyDtmf enum. + * @name google.cloud.dialogflow.v2.TelephonyDtmf + * @enum {number} + * @property {number} TELEPHONY_DTMF_UNSPECIFIED=0 TELEPHONY_DTMF_UNSPECIFIED value + * @property {number} DTMF_ONE=1 DTMF_ONE value + * @property {number} DTMF_TWO=2 DTMF_TWO value + * @property {number} DTMF_THREE=3 DTMF_THREE value + * @property {number} DTMF_FOUR=4 DTMF_FOUR value + * @property {number} DTMF_FIVE=5 DTMF_FIVE value + * @property {number} DTMF_SIX=6 DTMF_SIX value + * @property {number} DTMF_SEVEN=7 DTMF_SEVEN value + * @property {number} DTMF_EIGHT=8 DTMF_EIGHT value + * @property {number} DTMF_NINE=9 DTMF_NINE value + * @property {number} DTMF_ZERO=10 DTMF_ZERO value + * @property {number} DTMF_A=11 DTMF_A value + * @property {number} DTMF_B=12 DTMF_B value + * @property {number} DTMF_C=13 DTMF_C value + * @property {number} DTMF_D=14 DTMF_D value + * @property {number} DTMF_STAR=15 DTMF_STAR value + * @property {number} DTMF_POUND=16 DTMF_POUND value + */ + v2.TelephonyDtmf = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TELEPHONY_DTMF_UNSPECIFIED"] = 0; + values[valuesById[1] = "DTMF_ONE"] = 1; + values[valuesById[2] = "DTMF_TWO"] = 2; + values[valuesById[3] = "DTMF_THREE"] = 3; + values[valuesById[4] = "DTMF_FOUR"] = 4; + values[valuesById[5] = "DTMF_FIVE"] = 5; + values[valuesById[6] = "DTMF_SIX"] = 6; + values[valuesById[7] = "DTMF_SEVEN"] = 7; + values[valuesById[8] = "DTMF_EIGHT"] = 8; + values[valuesById[9] = "DTMF_NINE"] = 9; + values[valuesById[10] = "DTMF_ZERO"] = 10; + values[valuesById[11] = "DTMF_A"] = 11; + values[valuesById[12] = "DTMF_B"] = 12; + values[valuesById[13] = "DTMF_C"] = 13; + values[valuesById[14] = "DTMF_D"] = 14; + values[valuesById[15] = "DTMF_STAR"] = 15; + values[valuesById[16] = "DTMF_POUND"] = 16; + return values; + })(); - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + v2.Sessions = (function() { - /** - * Message message. - * @member {"text"|"image"|"quickReplies"|"card"|"payload"|"simpleResponses"|"basicCard"|"suggestions"|"linkOutSuggestion"|"listSelect"|"carouselSelect"|"browseCarouselCard"|"tableCard"|"mediaContent"|undefined} message - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - */ - Object.defineProperty(Message.prototype, "message", { - get: $util.oneOfGetter($oneOfFields = ["text", "image", "quickReplies", "card", "payload", "simpleResponses", "basicCard", "suggestions", "linkOutSuggestion", "listSelect", "carouselSelect", "browseCarouselCard", "tableCard", "mediaContent"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Constructs a new Sessions service. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a Sessions + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Sessions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Creates a new Message instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @static - * @param {google.cloud.dialogflow.v2.Intent.IMessage=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message} Message instance - */ - Message.create = function create(properties) { - return new Message(properties); - }; + (Sessions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Sessions; - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @static - * @param {google.cloud.dialogflow.v2.Intent.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - $root.google.cloud.dialogflow.v2.Intent.Message.Text.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.image, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.quickReplies != null && Object.hasOwnProperty.call(message, "quickReplies")) - $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies.encode(message.quickReplies, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.card != null && Object.hasOwnProperty.call(message, "card")) - $root.google.cloud.dialogflow.v2.Intent.Message.Card.encode(message.card, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.platform != null && Object.hasOwnProperty.call(message, "platform")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.platform); - if (message.simpleResponses != null && Object.hasOwnProperty.call(message, "simpleResponses")) - $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.encode(message.simpleResponses, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.basicCard != null && Object.hasOwnProperty.call(message, "basicCard")) - $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.encode(message.basicCard, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.suggestions != null && Object.hasOwnProperty.call(message, "suggestions")) - $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions.encode(message.suggestions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.linkOutSuggestion != null && Object.hasOwnProperty.call(message, "linkOutSuggestion")) - $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.encode(message.linkOutSuggestion, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.listSelect != null && Object.hasOwnProperty.call(message, "listSelect")) - $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.encode(message.listSelect, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.carouselSelect != null && Object.hasOwnProperty.call(message, "carouselSelect")) - $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.encode(message.carouselSelect, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.browseCarouselCard != null && Object.hasOwnProperty.call(message, "browseCarouselCard")) - $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.encode(message.browseCarouselCard, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.tableCard != null && Object.hasOwnProperty.call(message, "tableCard")) - $root.google.cloud.dialogflow.v2.Intent.Message.TableCard.encode(message.tableCard, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.mediaContent != null && Object.hasOwnProperty.call(message, "mediaContent")) - $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.encode(message.mediaContent, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - return writer; - }; + /** + * Creates new Sessions service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2.Sessions + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Sessions} RPC service. Useful where requests and/or responses are streamed. + */ + Sessions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @static - * @param {google.cloud.dialogflow.v2.Intent.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Sessions#detectIntent}. + * @memberof google.cloud.dialogflow.v2.Sessions + * @typedef DetectIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.DetectIntentResponse} [response] DetectIntentResponse + */ - /** - * Decodes a Message message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = $root.google.cloud.dialogflow.v2.Intent.Message.Text.decode(reader, reader.uint32()); - break; - case 2: - message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); - break; - case 3: - message.quickReplies = $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies.decode(reader, reader.uint32()); - break; - case 4: - message.card = $root.google.cloud.dialogflow.v2.Intent.Message.Card.decode(reader, reader.uint32()); - break; - case 5: - message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 7: - message.simpleResponses = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.decode(reader, reader.uint32()); - break; - case 8: - message.basicCard = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.decode(reader, reader.uint32()); - break; - case 9: - message.suggestions = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions.decode(reader, reader.uint32()); - break; - case 10: - message.linkOutSuggestion = $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.decode(reader, reader.uint32()); - break; - case 11: - message.listSelect = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.decode(reader, reader.uint32()); - break; - case 12: - message.carouselSelect = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.decode(reader, reader.uint32()); - break; - case 22: - message.browseCarouselCard = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.decode(reader, reader.uint32()); - break; - case 23: - message.tableCard = $root.google.cloud.dialogflow.v2.Intent.Message.TableCard.decode(reader, reader.uint32()); - break; - case 24: - message.mediaContent = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.decode(reader, reader.uint32()); - break; - case 6: - message.platform = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls DetectIntent. + * @function detectIntent + * @memberof google.cloud.dialogflow.v2.Sessions + * @instance + * @param {google.cloud.dialogflow.v2.IDetectIntentRequest} request DetectIntentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Sessions.DetectIntentCallback} callback Node-style callback called with the error, if any, and DetectIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.detectIntent = function detectIntent(request, callback) { + return this.rpcCall(detectIntent, $root.google.cloud.dialogflow.v2.DetectIntentRequest, $root.google.cloud.dialogflow.v2.DetectIntentResponse, request, callback); + }, "name", { value: "DetectIntent" }); - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls DetectIntent. + * @function detectIntent + * @memberof google.cloud.dialogflow.v2.Sessions + * @instance + * @param {google.cloud.dialogflow.v2.IDetectIntentRequest} request DetectIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Verifies a Message message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Message.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.text != null && message.hasOwnProperty("text")) { - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Text.verify(message.text); - if (error) - return "text." + error; - } - } - if (message.image != null && message.hasOwnProperty("image")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.image); - if (error) - return "image." + error; - } - } - if (message.quickReplies != null && message.hasOwnProperty("quickReplies")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies.verify(message.quickReplies); - if (error) - return "quickReplies." + error; - } - } - if (message.card != null && message.hasOwnProperty("card")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Card.verify(message.card); - if (error) - return "card." + error; - } - } - if (message.payload != null && message.hasOwnProperty("payload")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.protobuf.Struct.verify(message.payload); - if (error) - return "payload." + error; - } - } - if (message.simpleResponses != null && message.hasOwnProperty("simpleResponses")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.verify(message.simpleResponses); - if (error) - return "simpleResponses." + error; - } - } - if (message.basicCard != null && message.hasOwnProperty("basicCard")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.verify(message.basicCard); - if (error) - return "basicCard." + error; - } - } - if (message.suggestions != null && message.hasOwnProperty("suggestions")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions.verify(message.suggestions); - if (error) - return "suggestions." + error; - } - } - if (message.linkOutSuggestion != null && message.hasOwnProperty("linkOutSuggestion")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.verify(message.linkOutSuggestion); - if (error) - return "linkOutSuggestion." + error; - } - } - if (message.listSelect != null && message.hasOwnProperty("listSelect")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.verify(message.listSelect); - if (error) - return "listSelect." + error; - } - } - if (message.carouselSelect != null && message.hasOwnProperty("carouselSelect")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.verify(message.carouselSelect); - if (error) - return "carouselSelect." + error; - } - } - if (message.browseCarouselCard != null && message.hasOwnProperty("browseCarouselCard")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.verify(message.browseCarouselCard); - if (error) - return "browseCarouselCard." + error; - } - } - if (message.tableCard != null && message.hasOwnProperty("tableCard")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.TableCard.verify(message.tableCard); - if (error) - return "tableCard." + error; - } - } - if (message.mediaContent != null && message.hasOwnProperty("mediaContent")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.verify(message.mediaContent); - if (error) - return "mediaContent." + error; - } - } - if (message.platform != null && message.hasOwnProperty("platform")) - switch (message.platform) { - default: - return "platform: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 11: - break; - } - return null; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Sessions#streamingDetectIntent}. + * @memberof google.cloud.dialogflow.v2.Sessions + * @typedef StreamingDetectIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.StreamingDetectIntentResponse} [response] StreamingDetectIntentResponse + */ - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message} Message - */ - Message.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message(); - if (object.text != null) { - if (typeof object.text !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.text: object expected"); - message.text = $root.google.cloud.dialogflow.v2.Intent.Message.Text.fromObject(object.text); - } - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.image: object expected"); - message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.image); - } - if (object.quickReplies != null) { - if (typeof object.quickReplies !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.quickReplies: object expected"); - message.quickReplies = $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies.fromObject(object.quickReplies); - } - if (object.card != null) { - if (typeof object.card !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.card: object expected"); - message.card = $root.google.cloud.dialogflow.v2.Intent.Message.Card.fromObject(object.card); - } - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.payload: object expected"); - message.payload = $root.google.protobuf.Struct.fromObject(object.payload); - } - if (object.simpleResponses != null) { - if (typeof object.simpleResponses !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.simpleResponses: object expected"); - message.simpleResponses = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.fromObject(object.simpleResponses); - } - if (object.basicCard != null) { - if (typeof object.basicCard !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.basicCard: object expected"); - message.basicCard = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.fromObject(object.basicCard); - } - if (object.suggestions != null) { - if (typeof object.suggestions !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.suggestions: object expected"); - message.suggestions = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions.fromObject(object.suggestions); - } - if (object.linkOutSuggestion != null) { - if (typeof object.linkOutSuggestion !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.linkOutSuggestion: object expected"); - message.linkOutSuggestion = $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.fromObject(object.linkOutSuggestion); - } - if (object.listSelect != null) { - if (typeof object.listSelect !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.listSelect: object expected"); - message.listSelect = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.fromObject(object.listSelect); - } - if (object.carouselSelect != null) { - if (typeof object.carouselSelect !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.carouselSelect: object expected"); - message.carouselSelect = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.fromObject(object.carouselSelect); - } - if (object.browseCarouselCard != null) { - if (typeof object.browseCarouselCard !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.browseCarouselCard: object expected"); - message.browseCarouselCard = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.fromObject(object.browseCarouselCard); - } - if (object.tableCard != null) { - if (typeof object.tableCard !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.tableCard: object expected"); - message.tableCard = $root.google.cloud.dialogflow.v2.Intent.Message.TableCard.fromObject(object.tableCard); - } - if (object.mediaContent != null) { - if (typeof object.mediaContent !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.mediaContent: object expected"); - message.mediaContent = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.fromObject(object.mediaContent); - } - switch (object.platform) { - case "PLATFORM_UNSPECIFIED": - case 0: - message.platform = 0; - break; - case "FACEBOOK": + /** + * Calls StreamingDetectIntent. + * @function streamingDetectIntent + * @memberof google.cloud.dialogflow.v2.Sessions + * @instance + * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentRequest} request StreamingDetectIntentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Sessions.StreamingDetectIntentCallback} callback Node-style callback called with the error, if any, and StreamingDetectIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.streamingDetectIntent = function streamingDetectIntent(request, callback) { + return this.rpcCall(streamingDetectIntent, $root.google.cloud.dialogflow.v2.StreamingDetectIntentRequest, $root.google.cloud.dialogflow.v2.StreamingDetectIntentResponse, request, callback); + }, "name", { value: "StreamingDetectIntent" }); + + /** + * Calls StreamingDetectIntent. + * @function streamingDetectIntent + * @memberof google.cloud.dialogflow.v2.Sessions + * @instance + * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentRequest} request StreamingDetectIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Sessions; + })(); + + v2.DetectIntentRequest = (function() { + + /** + * Properties of a DetectIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IDetectIntentRequest + * @property {string|null} [session] DetectIntentRequest session + * @property {google.cloud.dialogflow.v2.IQueryParameters|null} [queryParams] DetectIntentRequest queryParams + * @property {google.cloud.dialogflow.v2.IQueryInput|null} [queryInput] DetectIntentRequest queryInput + * @property {google.cloud.dialogflow.v2.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentRequest outputAudioConfig + * @property {google.protobuf.IFieldMask|null} [outputAudioConfigMask] DetectIntentRequest outputAudioConfigMask + * @property {Uint8Array|null} [inputAudio] DetectIntentRequest inputAudio + */ + + /** + * Constructs a new DetectIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a DetectIntentRequest. + * @implements IDetectIntentRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IDetectIntentRequest=} [properties] Properties to set + */ + function DetectIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectIntentRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.session = ""; + + /** + * DetectIntentRequest queryParams. + * @member {google.cloud.dialogflow.v2.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.queryParams = null; + + /** + * DetectIntentRequest queryInput. + * @member {google.cloud.dialogflow.v2.IQueryInput|null|undefined} queryInput + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.queryInput = null; + + /** + * DetectIntentRequest outputAudioConfig. + * @member {google.cloud.dialogflow.v2.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.outputAudioConfig = null; + + /** + * DetectIntentRequest outputAudioConfigMask. + * @member {google.protobuf.IFieldMask|null|undefined} outputAudioConfigMask + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.outputAudioConfigMask = null; + + /** + * DetectIntentRequest inputAudio. + * @member {Uint8Array} inputAudio + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.inputAudio = $util.newBuffer([]); + + /** + * Creates a new DetectIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.IDetectIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.DetectIntentRequest} DetectIntentRequest instance + */ + DetectIntentRequest.create = function create(properties) { + return new DetectIntentRequest(properties); + }; + + /** + * Encodes the specified DetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.IDetectIntentRequest} message DetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.v2.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) + $root.google.cloud.dialogflow.v2.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.v2.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputAudio != null && Object.hasOwnProperty.call(message, "inputAudio")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.inputAudio); + if (message.outputAudioConfigMask != null && Object.hasOwnProperty.call(message, "outputAudioConfigMask")) + $root.google.protobuf.FieldMask.encode(message.outputAudioConfigMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.IDetectIntentRequest} message DetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.DetectIntentRequest} DetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DetectIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.platform = 1; + message.session = reader.string(); break; - case "SLACK": case 2: - message.platform = 2; + message.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.decode(reader, reader.uint32()); break; - case "TELEGRAM": case 3: - message.platform = 3; + message.queryInput = $root.google.cloud.dialogflow.v2.QueryInput.decode(reader, reader.uint32()); break; - case "KIK": case 4: - message.platform = 4; - break; - case "SKYPE": - case 5: - message.platform = 5; - break; - case "LINE": - case 6: - message.platform = 6; + message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.decode(reader, reader.uint32()); break; - case "VIBER": case 7: - message.platform = 7; + message.outputAudioConfigMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; - case "ACTIONS_ON_GOOGLE": - case 8: - message.platform = 8; + case 5: + message.inputAudio = reader.bytes(); break; - case "GOOGLE_HANGOUTS": - case 11: - message.platform = 11; + default: + reader.skipType(tag & 7); break; } - return message; - }; - - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message} message Message - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Message.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.platform = options.enums === String ? "PLATFORM_UNSPECIFIED" : 0; - if (message.text != null && message.hasOwnProperty("text")) { - object.text = $root.google.cloud.dialogflow.v2.Intent.Message.Text.toObject(message.text, options); - if (options.oneofs) - object.message = "text"; - } - if (message.image != null && message.hasOwnProperty("image")) { - object.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.image, options); - if (options.oneofs) - object.message = "image"; - } - if (message.quickReplies != null && message.hasOwnProperty("quickReplies")) { - object.quickReplies = $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies.toObject(message.quickReplies, options); - if (options.oneofs) - object.message = "quickReplies"; - } - if (message.card != null && message.hasOwnProperty("card")) { - object.card = $root.google.cloud.dialogflow.v2.Intent.Message.Card.toObject(message.card, options); - if (options.oneofs) - object.message = "card"; - } - if (message.payload != null && message.hasOwnProperty("payload")) { - object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); - if (options.oneofs) - object.message = "payload"; - } - if (message.platform != null && message.hasOwnProperty("platform")) - object.platform = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.Message.Platform[message.platform] : message.platform; - if (message.simpleResponses != null && message.hasOwnProperty("simpleResponses")) { - object.simpleResponses = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.toObject(message.simpleResponses, options); - if (options.oneofs) - object.message = "simpleResponses"; - } - if (message.basicCard != null && message.hasOwnProperty("basicCard")) { - object.basicCard = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.toObject(message.basicCard, options); - if (options.oneofs) - object.message = "basicCard"; - } - if (message.suggestions != null && message.hasOwnProperty("suggestions")) { - object.suggestions = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions.toObject(message.suggestions, options); - if (options.oneofs) - object.message = "suggestions"; - } - if (message.linkOutSuggestion != null && message.hasOwnProperty("linkOutSuggestion")) { - object.linkOutSuggestion = $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.toObject(message.linkOutSuggestion, options); - if (options.oneofs) - object.message = "linkOutSuggestion"; - } - if (message.listSelect != null && message.hasOwnProperty("listSelect")) { - object.listSelect = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.toObject(message.listSelect, options); - if (options.oneofs) - object.message = "listSelect"; - } - if (message.carouselSelect != null && message.hasOwnProperty("carouselSelect")) { - object.carouselSelect = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.toObject(message.carouselSelect, options); - if (options.oneofs) - object.message = "carouselSelect"; - } - if (message.browseCarouselCard != null && message.hasOwnProperty("browseCarouselCard")) { - object.browseCarouselCard = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.toObject(message.browseCarouselCard, options); - if (options.oneofs) - object.message = "browseCarouselCard"; - } - if (message.tableCard != null && message.hasOwnProperty("tableCard")) { - object.tableCard = $root.google.cloud.dialogflow.v2.Intent.Message.TableCard.toObject(message.tableCard, options); - if (options.oneofs) - object.message = "tableCard"; - } - if (message.mediaContent != null && message.hasOwnProperty("mediaContent")) { - object.mediaContent = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.toObject(message.mediaContent, options); - if (options.oneofs) - object.message = "mediaContent"; - } - return object; - }; + } + return message; + }; - /** - * Converts this Message to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @instance - * @returns {Object.} JSON object - */ - Message.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.DetectIntentRequest} DetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - Message.Text = (function() { + /** + * Verifies a DetectIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectIntentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.v2.QueryParameters.verify(message.queryParams); + if (error) + return "queryParams." + error; + } + if (message.queryInput != null && message.hasOwnProperty("queryInput")) { + var error = $root.google.cloud.dialogflow.v2.QueryInput.verify(message.queryInput); + if (error) + return "queryInput." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.v2.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.outputAudioConfigMask); + if (error) + return "outputAudioConfigMask." + error; + } + if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) + if (!(message.inputAudio && typeof message.inputAudio.length === "number" || $util.isString(message.inputAudio))) + return "inputAudio: buffer expected"; + return null; + }; - /** - * Properties of a Text. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface IText - * @property {Array.|null} [text] Text text - */ + /** + * Creates a DetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.DetectIntentRequest} DetectIntentRequest + */ + DetectIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.DetectIntentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.DetectIntentRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.v2.DetectIntentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.fromObject(object.queryParams); + } + if (object.queryInput != null) { + if (typeof object.queryInput !== "object") + throw TypeError(".google.cloud.dialogflow.v2.DetectIntentRequest.queryInput: object expected"); + message.queryInput = $root.google.cloud.dialogflow.v2.QueryInput.fromObject(object.queryInput); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.DetectIntentRequest.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + if (object.outputAudioConfigMask != null) { + if (typeof object.outputAudioConfigMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.DetectIntentRequest.outputAudioConfigMask: object expected"); + message.outputAudioConfigMask = $root.google.protobuf.FieldMask.fromObject(object.outputAudioConfigMask); + } + if (object.inputAudio != null) + if (typeof object.inputAudio === "string") + $util.base64.decode(object.inputAudio, message.inputAudio = $util.newBuffer($util.base64.length(object.inputAudio)), 0); + else if (object.inputAudio.length) + message.inputAudio = object.inputAudio; + return message; + }; - /** - * Constructs a new Text. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a Text. - * @implements IText - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.IText=} [properties] Properties to set - */ - function Text(properties) { - this.text = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Creates a plain object from a DetectIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.DetectIntentRequest} message DetectIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.queryParams = null; + object.queryInput = null; + object.outputAudioConfig = null; + if (options.bytes === String) + object.inputAudio = ""; + else { + object.inputAudio = []; + if (options.bytes !== Array) + object.inputAudio = $util.newBuffer(object.inputAudio); } + object.outputAudioConfigMask = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.toObject(message.queryParams, options); + if (message.queryInput != null && message.hasOwnProperty("queryInput")) + object.queryInput = $root.google.cloud.dialogflow.v2.QueryInput.toObject(message.queryInput, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) + object.inputAudio = options.bytes === String ? $util.base64.encode(message.inputAudio, 0, message.inputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputAudio) : message.inputAudio; + if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) + object.outputAudioConfigMask = $root.google.protobuf.FieldMask.toObject(message.outputAudioConfigMask, options); + return object; + }; - /** - * Text text. - * @member {Array.} text - * @memberof google.cloud.dialogflow.v2.Intent.Message.Text - * @instance - */ - Text.prototype.text = $util.emptyArray; - - /** - * Creates a new Text instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.Text - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IText=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.Text} Text instance - */ - Text.create = function create(properties) { - return new Text(properties); - }; + /** + * Converts this DetectIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.DetectIntentRequest + * @instance + * @returns {Object.} JSON object + */ + DetectIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Text.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.Text - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IText} message Text message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Text.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && message.text.length) - for (var i = 0; i < message.text.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text[i]); - return writer; - }; + return DetectIntentRequest; + })(); - /** - * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Text.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.Text - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IText} message Text message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Text.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v2.DetectIntentResponse = (function() { - /** - * Decodes a Text message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.Text - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.Text} Text - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Text.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.Text(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.text && message.text.length)) - message.text = []; - message.text.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a DetectIntentResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IDetectIntentResponse + * @property {string|null} [responseId] DetectIntentResponse responseId + * @property {google.cloud.dialogflow.v2.IQueryResult|null} [queryResult] DetectIntentResponse queryResult + * @property {google.rpc.IStatus|null} [webhookStatus] DetectIntentResponse webhookStatus + * @property {Uint8Array|null} [outputAudio] DetectIntentResponse outputAudio + * @property {google.cloud.dialogflow.v2.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentResponse outputAudioConfig + */ - /** - * Decodes a Text message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.Text - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.Text} Text - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Text.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new DetectIntentResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a DetectIntentResponse. + * @implements IDetectIntentResponse + * @constructor + * @param {google.cloud.dialogflow.v2.IDetectIntentResponse=} [properties] Properties to set + */ + function DetectIntentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Verifies a Text message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.Text - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Text.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) { - if (!Array.isArray(message.text)) - return "text: array expected"; - for (var i = 0; i < message.text.length; ++i) - if (!$util.isString(message.text[i])) - return "text: string[] expected"; - } - return null; - }; + /** + * DetectIntentResponse responseId. + * @member {string} responseId + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.responseId = ""; - /** - * Creates a Text message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.Text - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.Text} Text - */ - Text.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.Text) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.Text(); - if (object.text) { - if (!Array.isArray(object.text)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.Text.text: array expected"); - message.text = []; - for (var i = 0; i < object.text.length; ++i) - message.text[i] = String(object.text[i]); - } - return message; - }; + /** + * DetectIntentResponse queryResult. + * @member {google.cloud.dialogflow.v2.IQueryResult|null|undefined} queryResult + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.queryResult = null; - /** - * Creates a plain object from a Text message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.Text - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.Text} message Text - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Text.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.text = []; - if (message.text && message.text.length) { - object.text = []; - for (var j = 0; j < message.text.length; ++j) - object.text[j] = message.text[j]; - } - return object; - }; + /** + * DetectIntentResponse webhookStatus. + * @member {google.rpc.IStatus|null|undefined} webhookStatus + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.webhookStatus = null; - /** - * Converts this Text to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.Text - * @instance - * @returns {Object.} JSON object - */ - Text.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * DetectIntentResponse outputAudio. + * @member {Uint8Array} outputAudio + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.outputAudio = $util.newBuffer([]); - return Text; - })(); + /** + * DetectIntentResponse outputAudioConfig. + * @member {google.cloud.dialogflow.v2.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.outputAudioConfig = null; - Message.Image = (function() { + /** + * Creates a new DetectIntentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2.IDetectIntentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.DetectIntentResponse} DetectIntentResponse instance + */ + DetectIntentResponse.create = function create(properties) { + return new DetectIntentResponse(properties); + }; - /** - * Properties of an Image. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface IImage - * @property {string|null} [imageUri] Image imageUri - * @property {string|null} [accessibilityText] Image accessibilityText - */ + /** + * Encodes the specified DetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2.IDetectIntentResponse} message DetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) + $root.google.cloud.dialogflow.v2.QueryResult.encode(message.queryResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.webhookStatus != null && Object.hasOwnProperty.call(message, "webhookStatus")) + $root.google.rpc.Status.encode(message.webhookStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputAudio != null && Object.hasOwnProperty.call(message, "outputAudio")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.outputAudio); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.v2.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; - /** - * Constructs a new Image. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents an Image. - * @implements IImage - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.IImage=} [properties] Properties to set - */ - function Image(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Encodes the specified DetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2.IDetectIntentResponse} message DetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.DetectIntentResponse} DetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DetectIntentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.responseId = reader.string(); + break; + case 2: + message.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.decode(reader, reader.uint32()); + break; + case 3: + message.webhookStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 4: + message.outputAudio = reader.bytes(); + break; + case 6: + message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * Image imageUri. - * @member {string} imageUri - * @memberof google.cloud.dialogflow.v2.Intent.Message.Image - * @instance - */ - Image.prototype.imageUri = ""; + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.DetectIntentResponse} DetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Image accessibilityText. - * @member {string} accessibilityText - * @memberof google.cloud.dialogflow.v2.Intent.Message.Image - * @instance - */ - Image.prototype.accessibilityText = ""; + /** + * Verifies a DetectIntentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectIntentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + var error = $root.google.cloud.dialogflow.v2.QueryResult.verify(message.queryResult); + if (error) + return "queryResult." + error; + } + if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) { + var error = $root.google.rpc.Status.verify(message.webhookStatus); + if (error) + return "webhookStatus." + error; + } + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + if (!(message.outputAudio && typeof message.outputAudio.length === "number" || $util.isString(message.outputAudio))) + return "outputAudio: buffer expected"; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.v2.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + return null; + }; - /** - * Creates a new Image instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.Image - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IImage=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.Image} Image instance - */ - Image.create = function create(properties) { - return new Image(properties); - }; + /** + * Creates a DetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.DetectIntentResponse} DetectIntentResponse + */ + DetectIntentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.DetectIntentResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2.DetectIntentResponse(); + if (object.responseId != null) + message.responseId = String(object.responseId); + if (object.queryResult != null) { + if (typeof object.queryResult !== "object") + throw TypeError(".google.cloud.dialogflow.v2.DetectIntentResponse.queryResult: object expected"); + message.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.fromObject(object.queryResult); + } + if (object.webhookStatus != null) { + if (typeof object.webhookStatus !== "object") + throw TypeError(".google.cloud.dialogflow.v2.DetectIntentResponse.webhookStatus: object expected"); + message.webhookStatus = $root.google.rpc.Status.fromObject(object.webhookStatus); + } + if (object.outputAudio != null) + if (typeof object.outputAudio === "string") + $util.base64.decode(object.outputAudio, message.outputAudio = $util.newBuffer($util.base64.length(object.outputAudio)), 0); + else if (object.outputAudio.length) + message.outputAudio = object.outputAudio; + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.DetectIntentResponse.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + return message; + }; - /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Image.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.Image - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); - if (message.accessibilityText != null && Object.hasOwnProperty.call(message, "accessibilityText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.accessibilityText); - return writer; - }; + /** + * Creates a plain object from a DetectIntentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2.DetectIntentResponse} message DetectIntentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectIntentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseId = ""; + object.queryResult = null; + object.webhookStatus = null; + if (options.bytes === String) + object.outputAudio = ""; + else { + object.outputAudio = []; + if (options.bytes !== Array) + object.outputAudio = $util.newBuffer(object.outputAudio); + } + object.outputAudioConfig = null; + } + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) + object.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.toObject(message.queryResult, options); + if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) + object.webhookStatus = $root.google.rpc.Status.toObject(message.webhookStatus, options); + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.toObject(message.outputAudioConfig, options); + return object; + }; - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Image.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.Image - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this DetectIntentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.DetectIntentResponse + * @instance + * @returns {Object.} JSON object + */ + DetectIntentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an Image message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.Image(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.imageUri = reader.string(); - break; - case 2: - message.accessibilityText = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return DetectIntentResponse; + })(); - /** - * Decodes an Image message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + v2.QueryParameters = (function() { - /** - * Verifies an Image message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.Image - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Image.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.accessibilityText != null && message.hasOwnProperty("accessibilityText")) - if (!$util.isString(message.accessibilityText)) - return "accessibilityText: string expected"; - return null; - }; + /** + * Properties of a QueryParameters. + * @memberof google.cloud.dialogflow.v2 + * @interface IQueryParameters + * @property {string|null} [timeZone] QueryParameters timeZone + * @property {google.type.ILatLng|null} [geoLocation] QueryParameters geoLocation + * @property {Array.|null} [contexts] QueryParameters contexts + * @property {boolean|null} [resetContexts] QueryParameters resetContexts + * @property {Array.|null} [sessionEntityTypes] QueryParameters sessionEntityTypes + * @property {google.protobuf.IStruct|null} [payload] QueryParameters payload + * @property {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig|null} [sentimentAnalysisRequestConfig] QueryParameters sentimentAnalysisRequestConfig + * @property {Object.|null} [webhookHeaders] QueryParameters webhookHeaders + */ - /** - * Creates an Image message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.Image - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.Image} Image - */ - Image.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.Image) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.Image(); - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.accessibilityText != null) - message.accessibilityText = String(object.accessibilityText); - return message; - }; + /** + * Constructs a new QueryParameters. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a QueryParameters. + * @implements IQueryParameters + * @constructor + * @param {google.cloud.dialogflow.v2.IQueryParameters=} [properties] Properties to set + */ + function QueryParameters(properties) { + this.contexts = []; + this.sessionEntityTypes = []; + this.webhookHeaders = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.Image - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.Image} message Image - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Image.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.imageUri = ""; - object.accessibilityText = ""; - } - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.accessibilityText != null && message.hasOwnProperty("accessibilityText")) - object.accessibilityText = message.accessibilityText; - return object; - }; + /** + * QueryParameters timeZone. + * @member {string} timeZone + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @instance + */ + QueryParameters.prototype.timeZone = ""; - /** - * Converts this Image to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.Image - * @instance - * @returns {Object.} JSON object - */ - Image.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * QueryParameters geoLocation. + * @member {google.type.ILatLng|null|undefined} geoLocation + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @instance + */ + QueryParameters.prototype.geoLocation = null; - return Image; - })(); + /** + * QueryParameters contexts. + * @member {Array.} contexts + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @instance + */ + QueryParameters.prototype.contexts = $util.emptyArray; - Message.QuickReplies = (function() { + /** + * QueryParameters resetContexts. + * @member {boolean} resetContexts + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @instance + */ + QueryParameters.prototype.resetContexts = false; - /** - * Properties of a QuickReplies. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface IQuickReplies - * @property {string|null} [title] QuickReplies title - * @property {Array.|null} [quickReplies] QuickReplies quickReplies - */ + /** + * QueryParameters sessionEntityTypes. + * @member {Array.} sessionEntityTypes + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @instance + */ + QueryParameters.prototype.sessionEntityTypes = $util.emptyArray; - /** - * Constructs a new QuickReplies. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a QuickReplies. - * @implements IQuickReplies - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.IQuickReplies=} [properties] Properties to set - */ - function QuickReplies(properties) { - this.quickReplies = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * QueryParameters payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @instance + */ + QueryParameters.prototype.payload = null; - /** - * QuickReplies title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies - * @instance - */ - QuickReplies.prototype.title = ""; + /** + * QueryParameters sentimentAnalysisRequestConfig. + * @member {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig|null|undefined} sentimentAnalysisRequestConfig + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @instance + */ + QueryParameters.prototype.sentimentAnalysisRequestConfig = null; - /** - * QuickReplies quickReplies. - * @member {Array.} quickReplies - * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies - * @instance - */ - QuickReplies.prototype.quickReplies = $util.emptyArray; + /** + * QueryParameters webhookHeaders. + * @member {Object.} webhookHeaders + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @instance + */ + QueryParameters.prototype.webhookHeaders = $util.emptyObject; - /** - * Creates a new QuickReplies instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IQuickReplies=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.QuickReplies} QuickReplies instance - */ - QuickReplies.create = function create(properties) { - return new QuickReplies(properties); - }; + /** + * Creates a new QueryParameters instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @static + * @param {google.cloud.dialogflow.v2.IQueryParameters=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.QueryParameters} QueryParameters instance + */ + QueryParameters.create = function create(properties) { + return new QueryParameters(properties); + }; - /** - * Encodes the specified QuickReplies message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.QuickReplies.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IQuickReplies} message QuickReplies message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuickReplies.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.quickReplies != null && message.quickReplies.length) - for (var i = 0; i < message.quickReplies.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.quickReplies[i]); - return writer; - }; + /** + * Encodes the specified QueryParameters message. Does not implicitly {@link google.cloud.dialogflow.v2.QueryParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @static + * @param {google.cloud.dialogflow.v2.IQueryParameters} message QueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeZone); + if (message.geoLocation != null && Object.hasOwnProperty.call(message, "geoLocation")) + $root.google.type.LatLng.encode(message.geoLocation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contexts != null && message.contexts.length) + for (var i = 0; i < message.contexts.length; ++i) + $root.google.cloud.dialogflow.v2.Context.encode(message.contexts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.resetContexts != null && Object.hasOwnProperty.call(message, "resetContexts")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.resetContexts); + if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) + for (var i = 0; i < message.sessionEntityTypes.length; ++i) + $root.google.cloud.dialogflow.v2.SessionEntityType.encode(message.sessionEntityTypes[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.sentimentAnalysisRequestConfig != null && Object.hasOwnProperty.call(message, "sentimentAnalysisRequestConfig")) + $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.encode(message.sentimentAnalysisRequestConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.webhookHeaders != null && Object.hasOwnProperty.call(message, "webhookHeaders")) + for (var keys = Object.keys(message.webhookHeaders), i = 0; i < keys.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.webhookHeaders[keys[i]]).ldelim(); + return writer; + }; - /** - * Encodes the specified QuickReplies message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.QuickReplies.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IQuickReplies} message QuickReplies message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuickReplies.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified QueryParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.QueryParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @static + * @param {google.cloud.dialogflow.v2.IQueryParameters} message QueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a QuickReplies message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.QuickReplies} QuickReplies - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuickReplies.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Decodes a QueryParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.QueryParameters} QueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.QueryParameters(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timeZone = reader.string(); + break; + case 2: + message.geoLocation = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.contexts && message.contexts.length)) + message.contexts = []; + message.contexts.push($root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32())); + break; + case 4: + message.resetContexts = reader.bool(); + break; + case 5: + if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) + message.sessionEntityTypes = []; + message.sessionEntityTypes.push($root.google.cloud.dialogflow.v2.SessionEntityType.decode(reader, reader.uint32())); + break; + case 6: + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 10: + message.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.decode(reader, reader.uint32()); + break; + case 14: + if (message.webhookHeaders === $util.emptyObject) + message.webhookHeaders = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { case 1: - message.title = reader.string(); + key = reader.string(); break; case 2: - if (!(message.quickReplies && message.quickReplies.length)) - message.quickReplies = []; - message.quickReplies.push(reader.string()); + value = reader.string(); break; default: - reader.skipType(tag & 7); + reader.skipType(tag2 & 7); break; } } - return message; - }; - - /** - * Decodes a QuickReplies message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.QuickReplies} QuickReplies - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuickReplies.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuickReplies message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuickReplies.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.quickReplies != null && message.hasOwnProperty("quickReplies")) { - if (!Array.isArray(message.quickReplies)) - return "quickReplies: array expected"; - for (var i = 0; i < message.quickReplies.length; ++i) - if (!$util.isString(message.quickReplies[i])) - return "quickReplies: string[] expected"; - } - return null; - }; + message.webhookHeaders[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a QuickReplies message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.QuickReplies} QuickReplies - */ - QuickReplies.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies(); - if (object.title != null) - message.title = String(object.title); - if (object.quickReplies) { - if (!Array.isArray(object.quickReplies)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.QuickReplies.quickReplies: array expected"); - message.quickReplies = []; - for (var i = 0; i < object.quickReplies.length; ++i) - message.quickReplies[i] = String(object.quickReplies[i]); - } - return message; - }; + /** + * Decodes a QueryParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.QueryParameters} QueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a QuickReplies message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.QuickReplies} message QuickReplies - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuickReplies.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.quickReplies = []; - if (options.defaults) - object.title = ""; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.quickReplies && message.quickReplies.length) { - object.quickReplies = []; - for (var j = 0; j < message.quickReplies.length; ++j) - object.quickReplies[j] = message.quickReplies[j]; - } - return object; - }; + /** + * Verifies a QueryParameters message. + * @function verify + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.geoLocation != null && message.hasOwnProperty("geoLocation")) { + var error = $root.google.type.LatLng.verify(message.geoLocation); + if (error) + return "geoLocation." + error; + } + if (message.contexts != null && message.hasOwnProperty("contexts")) { + if (!Array.isArray(message.contexts)) + return "contexts: array expected"; + for (var i = 0; i < message.contexts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Context.verify(message.contexts[i]); + if (error) + return "contexts." + error; + } + } + if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) + if (typeof message.resetContexts !== "boolean") + return "resetContexts: boolean expected"; + if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { + if (!Array.isArray(message.sessionEntityTypes)) + return "sessionEntityTypes: array expected"; + for (var i = 0; i < message.sessionEntityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.SessionEntityType.verify(message.sessionEntityTypes[i]); + if (error) + return "sessionEntityTypes." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + if (message.sentimentAnalysisRequestConfig != null && message.hasOwnProperty("sentimentAnalysisRequestConfig")) { + var error = $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.verify(message.sentimentAnalysisRequestConfig); + if (error) + return "sentimentAnalysisRequestConfig." + error; + } + if (message.webhookHeaders != null && message.hasOwnProperty("webhookHeaders")) { + if (!$util.isObject(message.webhookHeaders)) + return "webhookHeaders: object expected"; + var key = Object.keys(message.webhookHeaders); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.webhookHeaders[key[i]])) + return "webhookHeaders: string{k:string} expected"; + } + return null; + }; - /** - * Converts this QuickReplies to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies - * @instance - * @returns {Object.} JSON object - */ - QuickReplies.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a QueryParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.QueryParameters} QueryParameters + */ + QueryParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.QueryParameters) + return object; + var message = new $root.google.cloud.dialogflow.v2.QueryParameters(); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.geoLocation != null) { + if (typeof object.geoLocation !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.geoLocation: object expected"); + message.geoLocation = $root.google.type.LatLng.fromObject(object.geoLocation); + } + if (object.contexts) { + if (!Array.isArray(object.contexts)) + throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.contexts: array expected"); + message.contexts = []; + for (var i = 0; i < object.contexts.length; ++i) { + if (typeof object.contexts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.contexts: object expected"); + message.contexts[i] = $root.google.cloud.dialogflow.v2.Context.fromObject(object.contexts[i]); + } + } + if (object.resetContexts != null) + message.resetContexts = Boolean(object.resetContexts); + if (object.sessionEntityTypes) { + if (!Array.isArray(object.sessionEntityTypes)) + throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.sessionEntityTypes: array expected"); + message.sessionEntityTypes = []; + for (var i = 0; i < object.sessionEntityTypes.length; ++i) { + if (typeof object.sessionEntityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.sessionEntityTypes: object expected"); + message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.v2.SessionEntityType.fromObject(object.sessionEntityTypes[i]); + } + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.sentimentAnalysisRequestConfig != null) { + if (typeof object.sentimentAnalysisRequestConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.sentimentAnalysisRequestConfig: object expected"); + message.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.fromObject(object.sentimentAnalysisRequestConfig); + } + if (object.webhookHeaders) { + if (typeof object.webhookHeaders !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.webhookHeaders: object expected"); + message.webhookHeaders = {}; + for (var keys = Object.keys(object.webhookHeaders), i = 0; i < keys.length; ++i) + message.webhookHeaders[keys[i]] = String(object.webhookHeaders[keys[i]]); + } + return message; + }; - return QuickReplies; - })(); + /** + * Creates a plain object from a QueryParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @static + * @param {google.cloud.dialogflow.v2.QueryParameters} message QueryParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.contexts = []; + object.sessionEntityTypes = []; + } + if (options.objects || options.defaults) + object.webhookHeaders = {}; + if (options.defaults) { + object.timeZone = ""; + object.geoLocation = null; + object.resetContexts = false; + object.payload = null; + object.sentimentAnalysisRequestConfig = null; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.geoLocation != null && message.hasOwnProperty("geoLocation")) + object.geoLocation = $root.google.type.LatLng.toObject(message.geoLocation, options); + if (message.contexts && message.contexts.length) { + object.contexts = []; + for (var j = 0; j < message.contexts.length; ++j) + object.contexts[j] = $root.google.cloud.dialogflow.v2.Context.toObject(message.contexts[j], options); + } + if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) + object.resetContexts = message.resetContexts; + if (message.sessionEntityTypes && message.sessionEntityTypes.length) { + object.sessionEntityTypes = []; + for (var j = 0; j < message.sessionEntityTypes.length; ++j) + object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.v2.SessionEntityType.toObject(message.sessionEntityTypes[j], options); + } + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.sentimentAnalysisRequestConfig != null && message.hasOwnProperty("sentimentAnalysisRequestConfig")) + object.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.toObject(message.sentimentAnalysisRequestConfig, options); + var keys2; + if (message.webhookHeaders && (keys2 = Object.keys(message.webhookHeaders)).length) { + object.webhookHeaders = {}; + for (var j = 0; j < keys2.length; ++j) + object.webhookHeaders[keys2[j]] = message.webhookHeaders[keys2[j]]; + } + return object; + }; - Message.Card = (function() { + /** + * Converts this QueryParameters to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.QueryParameters + * @instance + * @returns {Object.} JSON object + */ + QueryParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a Card. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface ICard - * @property {string|null} [title] Card title - * @property {string|null} [subtitle] Card subtitle - * @property {string|null} [imageUri] Card imageUri - * @property {Array.|null} [buttons] Card buttons - */ + return QueryParameters; + })(); - /** - * Constructs a new Card. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a Card. - * @implements ICard - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.ICard=} [properties] Properties to set - */ - function Card(properties) { - this.buttons = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v2.QueryInput = (function() { - /** - * Card title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @instance - */ - Card.prototype.title = ""; + /** + * Properties of a QueryInput. + * @memberof google.cloud.dialogflow.v2 + * @interface IQueryInput + * @property {google.cloud.dialogflow.v2.IInputAudioConfig|null} [audioConfig] QueryInput audioConfig + * @property {google.cloud.dialogflow.v2.ITextInput|null} [text] QueryInput text + * @property {google.cloud.dialogflow.v2.IEventInput|null} [event] QueryInput event + */ - /** - * Card subtitle. - * @member {string} subtitle - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @instance - */ - Card.prototype.subtitle = ""; + /** + * Constructs a new QueryInput. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a QueryInput. + * @implements IQueryInput + * @constructor + * @param {google.cloud.dialogflow.v2.IQueryInput=} [properties] Properties to set + */ + function QueryInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Card imageUri. - * @member {string} imageUri - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @instance - */ - Card.prototype.imageUri = ""; + /** + * QueryInput audioConfig. + * @member {google.cloud.dialogflow.v2.IInputAudioConfig|null|undefined} audioConfig + * @memberof google.cloud.dialogflow.v2.QueryInput + * @instance + */ + QueryInput.prototype.audioConfig = null; - /** - * Card buttons. - * @member {Array.} buttons - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @instance - */ - Card.prototype.buttons = $util.emptyArray; + /** + * QueryInput text. + * @member {google.cloud.dialogflow.v2.ITextInput|null|undefined} text + * @memberof google.cloud.dialogflow.v2.QueryInput + * @instance + */ + QueryInput.prototype.text = null; - /** - * Creates a new Card instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ICard=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.Card} Card instance - */ - Card.create = function create(properties) { - return new Card(properties); - }; + /** + * QueryInput event. + * @member {google.cloud.dialogflow.v2.IEventInput|null|undefined} event + * @memberof google.cloud.dialogflow.v2.QueryInput + * @instance + */ + QueryInput.prototype.event = null; - /** - * Encodes the specified Card message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ICard} message Card message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Card.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageUri); - if (message.buttons != null && message.buttons.length) - for (var i = 0; i < message.buttons.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button.encode(message.buttons[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Encodes the specified Card message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ICard} message Card message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Card.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * QueryInput input. + * @member {"audioConfig"|"text"|"event"|undefined} input + * @memberof google.cloud.dialogflow.v2.QueryInput + * @instance + */ + Object.defineProperty(QueryInput.prototype, "input", { + get: $util.oneOfGetter($oneOfFields = ["audioConfig", "text", "event"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Decodes a Card message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.Card} Card - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Card.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.Card(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.subtitle = reader.string(); - break; - case 3: - message.imageUri = reader.string(); - break; - case 4: - if (!(message.buttons && message.buttons.length)) - message.buttons = []; - message.buttons.push($root.google.cloud.dialogflow.v2.Intent.Message.Card.Button.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new QueryInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.QueryInput + * @static + * @param {google.cloud.dialogflow.v2.IQueryInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.QueryInput} QueryInput instance + */ + QueryInput.create = function create(properties) { + return new QueryInput(properties); + }; - /** - * Decodes a Card message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.Card} Card - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Card.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified QueryInput message. Does not implicitly {@link google.cloud.dialogflow.v2.QueryInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.QueryInput + * @static + * @param {google.cloud.dialogflow.v2.IQueryInput} message QueryInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioConfig != null && Object.hasOwnProperty.call(message, "audioConfig")) + $root.google.cloud.dialogflow.v2.InputAudioConfig.encode(message.audioConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.dialogflow.v2.TextInput.encode(message.text, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.dialogflow.v2.EventInput.encode(message.event, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Verifies a Card message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Card.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - if (!$util.isString(message.subtitle)) - return "subtitle: string expected"; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.buttons != null && message.hasOwnProperty("buttons")) { - if (!Array.isArray(message.buttons)) - return "buttons: array expected"; - for (var i = 0; i < message.buttons.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button.verify(message.buttons[i]); - if (error) - return "buttons." + error; - } - } - return null; - }; + /** + * Encodes the specified QueryInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.QueryInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.QueryInput + * @static + * @param {google.cloud.dialogflow.v2.IQueryInput} message QueryInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a Card message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.Card} Card - */ - Card.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.Card) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.Card(); - if (object.title != null) - message.title = String(object.title); - if (object.subtitle != null) - message.subtitle = String(object.subtitle); - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.buttons) { - if (!Array.isArray(object.buttons)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.Card.buttons: array expected"); - message.buttons = []; - for (var i = 0; i < object.buttons.length; ++i) { - if (typeof object.buttons[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.Card.buttons: object expected"); - message.buttons[i] = $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button.fromObject(object.buttons[i]); - } - } - return message; - }; + /** + * Decodes a QueryInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.QueryInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.QueryInput} QueryInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.QueryInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.audioConfig = $root.google.cloud.dialogflow.v2.InputAudioConfig.decode(reader, reader.uint32()); + break; + case 2: + message.text = $root.google.cloud.dialogflow.v2.TextInput.decode(reader, reader.uint32()); + break; + case 3: + message.event = $root.google.cloud.dialogflow.v2.EventInput.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a plain object from a Card message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.Card} message Card - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Card.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.buttons = []; - if (options.defaults) { - object.title = ""; - object.subtitle = ""; - object.imageUri = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - object.subtitle = message.subtitle; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.buttons && message.buttons.length) { - object.buttons = []; - for (var j = 0; j < message.buttons.length; ++j) - object.buttons[j] = $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button.toObject(message.buttons[j], options); - } - return object; - }; + /** + * Decodes a QueryInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.QueryInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.QueryInput} QueryInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this Card to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @instance - * @returns {Object.} JSON object - */ - Card.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a QueryInput message. + * @function verify + * @memberof google.cloud.dialogflow.v2.QueryInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2.InputAudioConfig.verify(message.audioConfig); + if (error) + return "audioConfig." + error; + } + } + if (message.text != null && message.hasOwnProperty("text")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2.TextInput.verify(message.text); + if (error) + return "text." + error; + } + } + if (message.event != null && message.hasOwnProperty("event")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2.EventInput.verify(message.event); + if (error) + return "event." + error; + } + } + return null; + }; - Card.Button = (function() { + /** + * Creates a QueryInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.QueryInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.QueryInput} QueryInput + */ + QueryInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.QueryInput) + return object; + var message = new $root.google.cloud.dialogflow.v2.QueryInput(); + if (object.audioConfig != null) { + if (typeof object.audioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryInput.audioConfig: object expected"); + message.audioConfig = $root.google.cloud.dialogflow.v2.InputAudioConfig.fromObject(object.audioConfig); + } + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryInput.text: object expected"); + message.text = $root.google.cloud.dialogflow.v2.TextInput.fromObject(object.text); + } + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryInput.event: object expected"); + message.event = $root.google.cloud.dialogflow.v2.EventInput.fromObject(object.event); + } + return message; + }; - /** - * Properties of a Button. - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @interface IButton - * @property {string|null} [text] Button text - * @property {string|null} [postback] Button postback - */ + /** + * Creates a plain object from a QueryInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.QueryInput + * @static + * @param {google.cloud.dialogflow.v2.QueryInput} message QueryInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { + object.audioConfig = $root.google.cloud.dialogflow.v2.InputAudioConfig.toObject(message.audioConfig, options); + if (options.oneofs) + object.input = "audioConfig"; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = $root.google.cloud.dialogflow.v2.TextInput.toObject(message.text, options); + if (options.oneofs) + object.input = "text"; + } + if (message.event != null && message.hasOwnProperty("event")) { + object.event = $root.google.cloud.dialogflow.v2.EventInput.toObject(message.event, options); + if (options.oneofs) + object.input = "event"; + } + return object; + }; - /** - * Constructs a new Button. - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card - * @classdesc Represents a Button. - * @implements IButton - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.Card.IButton=} [properties] Properties to set - */ - function Button(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Converts this QueryInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.QueryInput + * @instance + * @returns {Object.} JSON object + */ + QueryInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Button text. - * @member {string} text - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button - * @instance - */ - Button.prototype.text = ""; + return QueryInput; + })(); - /** - * Button postback. - * @member {string} postback - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button - * @instance - */ - Button.prototype.postback = ""; + v2.QueryResult = (function() { - /** - * Creates a new Button instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.Card.IButton=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.Card.Button} Button instance - */ - Button.create = function create(properties) { - return new Button(properties); - }; + /** + * Properties of a QueryResult. + * @memberof google.cloud.dialogflow.v2 + * @interface IQueryResult + * @property {string|null} [queryText] QueryResult queryText + * @property {string|null} [languageCode] QueryResult languageCode + * @property {number|null} [speechRecognitionConfidence] QueryResult speechRecognitionConfidence + * @property {string|null} [action] QueryResult action + * @property {google.protobuf.IStruct|null} [parameters] QueryResult parameters + * @property {boolean|null} [allRequiredParamsPresent] QueryResult allRequiredParamsPresent + * @property {string|null} [fulfillmentText] QueryResult fulfillmentText + * @property {Array.|null} [fulfillmentMessages] QueryResult fulfillmentMessages + * @property {string|null} [webhookSource] QueryResult webhookSource + * @property {google.protobuf.IStruct|null} [webhookPayload] QueryResult webhookPayload + * @property {Array.|null} [outputContexts] QueryResult outputContexts + * @property {google.cloud.dialogflow.v2.IIntent|null} [intent] QueryResult intent + * @property {number|null} [intentDetectionConfidence] QueryResult intentDetectionConfidence + * @property {google.protobuf.IStruct|null} [diagnosticInfo] QueryResult diagnosticInfo + * @property {google.cloud.dialogflow.v2.ISentimentAnalysisResult|null} [sentimentAnalysisResult] QueryResult sentimentAnalysisResult + */ - /** - * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.Button.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.Card.IButton} message Button message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Button.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.postback != null && Object.hasOwnProperty.call(message, "postback")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.postback); - return writer; - }; + /** + * Constructs a new QueryResult. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a QueryResult. + * @implements IQueryResult + * @constructor + * @param {google.cloud.dialogflow.v2.IQueryResult=} [properties] Properties to set + */ + function QueryResult(properties) { + this.fulfillmentMessages = []; + this.outputContexts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.Button.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.Card.IButton} message Button message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Button.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * QueryResult queryText. + * @member {string} queryText + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.queryText = ""; - /** - * Decodes a Button message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.Card.Button} Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Button.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = reader.string(); - break; - case 2: - message.postback = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * QueryResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.languageCode = ""; - /** - * Decodes a Button message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.Card.Button} Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Button.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * QueryResult speechRecognitionConfidence. + * @member {number} speechRecognitionConfidence + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.speechRecognitionConfidence = 0; - /** - * Verifies a Button message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Button.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.postback != null && message.hasOwnProperty("postback")) - if (!$util.isString(message.postback)) - return "postback: string expected"; - return null; - }; + /** + * QueryResult action. + * @member {string} action + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.action = ""; - /** - * Creates a Button message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.Card.Button} Button - */ - Button.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button(); - if (object.text != null) - message.text = String(object.text); - if (object.postback != null) - message.postback = String(object.postback); - return message; - }; + /** + * QueryResult parameters. + * @member {google.protobuf.IStruct|null|undefined} parameters + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.parameters = null; - /** - * Creates a plain object from a Button message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.Card.Button} message Button - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Button.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.postback = ""; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.postback != null && message.hasOwnProperty("postback")) - object.postback = message.postback; - return object; - }; + /** + * QueryResult allRequiredParamsPresent. + * @member {boolean} allRequiredParamsPresent + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.allRequiredParamsPresent = false; - /** - * Converts this Button to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button - * @instance - * @returns {Object.} JSON object - */ - Button.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * QueryResult fulfillmentText. + * @member {string} fulfillmentText + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.fulfillmentText = ""; - return Button; - })(); + /** + * QueryResult fulfillmentMessages. + * @member {Array.} fulfillmentMessages + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.fulfillmentMessages = $util.emptyArray; - return Card; - })(); - - Message.SimpleResponse = (function() { - - /** - * Properties of a SimpleResponse. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface ISimpleResponse - * @property {string|null} [textToSpeech] SimpleResponse textToSpeech - * @property {string|null} [ssml] SimpleResponse ssml - * @property {string|null} [displayText] SimpleResponse displayText - */ - - /** - * Constructs a new SimpleResponse. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a SimpleResponse. - * @implements ISimpleResponse - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse=} [properties] Properties to set - */ - function SimpleResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SimpleResponse textToSpeech. - * @member {string} textToSpeech - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse - * @instance - */ - SimpleResponse.prototype.textToSpeech = ""; - - /** - * SimpleResponse ssml. - * @member {string} ssml - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse - * @instance - */ - SimpleResponse.prototype.ssml = ""; - - /** - * SimpleResponse displayText. - * @member {string} displayText - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse - * @instance - */ - SimpleResponse.prototype.displayText = ""; - - /** - * Creates a new SimpleResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponse} SimpleResponse instance - */ - SimpleResponse.create = function create(properties) { - return new SimpleResponse(properties); - }; - - /** - * Encodes the specified SimpleResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse} message SimpleResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.textToSpeech != null && Object.hasOwnProperty.call(message, "textToSpeech")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.textToSpeech); - if (message.ssml != null && Object.hasOwnProperty.call(message, "ssml")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ssml); - if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayText); - return writer; - }; - - /** - * Encodes the specified SimpleResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse} message SimpleResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * QueryResult webhookSource. + * @member {string} webhookSource + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.webhookSource = ""; - /** - * Decodes a SimpleResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponse} SimpleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.textToSpeech = reader.string(); - break; - case 2: - message.ssml = reader.string(); - break; - case 3: - message.displayText = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * QueryResult webhookPayload. + * @member {google.protobuf.IStruct|null|undefined} webhookPayload + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.webhookPayload = null; - /** - * Decodes a SimpleResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponse} SimpleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * QueryResult outputContexts. + * @member {Array.} outputContexts + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.outputContexts = $util.emptyArray; - /** - * Verifies a SimpleResponse message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SimpleResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.textToSpeech != null && message.hasOwnProperty("textToSpeech")) - if (!$util.isString(message.textToSpeech)) - return "textToSpeech: string expected"; - if (message.ssml != null && message.hasOwnProperty("ssml")) - if (!$util.isString(message.ssml)) - return "ssml: string expected"; - if (message.displayText != null && message.hasOwnProperty("displayText")) - if (!$util.isString(message.displayText)) - return "displayText: string expected"; - return null; - }; + /** + * QueryResult intent. + * @member {google.cloud.dialogflow.v2.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.intent = null; - /** - * Creates a SimpleResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponse} SimpleResponse - */ - SimpleResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse(); - if (object.textToSpeech != null) - message.textToSpeech = String(object.textToSpeech); - if (object.ssml != null) - message.ssml = String(object.ssml); - if (object.displayText != null) - message.displayText = String(object.displayText); - return message; - }; + /** + * QueryResult intentDetectionConfidence. + * @member {number} intentDetectionConfidence + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.intentDetectionConfidence = 0; - /** - * Creates a plain object from a SimpleResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.SimpleResponse} message SimpleResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SimpleResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.textToSpeech = ""; - object.ssml = ""; - object.displayText = ""; - } - if (message.textToSpeech != null && message.hasOwnProperty("textToSpeech")) - object.textToSpeech = message.textToSpeech; - if (message.ssml != null && message.hasOwnProperty("ssml")) - object.ssml = message.ssml; - if (message.displayText != null && message.hasOwnProperty("displayText")) - object.displayText = message.displayText; - return object; - }; + /** + * QueryResult diagnosticInfo. + * @member {google.protobuf.IStruct|null|undefined} diagnosticInfo + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.diagnosticInfo = null; - /** - * Converts this SimpleResponse to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse - * @instance - * @returns {Object.} JSON object - */ - SimpleResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * QueryResult sentimentAnalysisResult. + * @member {google.cloud.dialogflow.v2.ISentimentAnalysisResult|null|undefined} sentimentAnalysisResult + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + */ + QueryResult.prototype.sentimentAnalysisResult = null; - return SimpleResponse; - })(); + /** + * Creates a new QueryResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.QueryResult + * @static + * @param {google.cloud.dialogflow.v2.IQueryResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.QueryResult} QueryResult instance + */ + QueryResult.create = function create(properties) { + return new QueryResult(properties); + }; - Message.SimpleResponses = (function() { + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.dialogflow.v2.QueryResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.QueryResult + * @static + * @param {google.cloud.dialogflow.v2.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryText != null && Object.hasOwnProperty.call(message, "queryText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryText); + if (message.speechRecognitionConfidence != null && Object.hasOwnProperty.call(message, "speechRecognitionConfidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.speechRecognitionConfidence); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.action); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allRequiredParamsPresent != null && Object.hasOwnProperty.call(message, "allRequiredParamsPresent")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allRequiredParamsPresent); + if (message.fulfillmentText != null && Object.hasOwnProperty.call(message, "fulfillmentText")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.fulfillmentText); + if (message.fulfillmentMessages != null && message.fulfillmentMessages.length) + for (var i = 0; i < message.fulfillmentMessages.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.encode(message.fulfillmentMessages[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.webhookSource != null && Object.hasOwnProperty.call(message, "webhookSource")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.webhookSource); + if (message.webhookPayload != null && Object.hasOwnProperty.call(message, "webhookPayload")) + $root.google.protobuf.Struct.encode(message.webhookPayload, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.outputContexts != null && message.outputContexts.length) + for (var i = 0; i < message.outputContexts.length; ++i) + $root.google.cloud.dialogflow.v2.Context.encode(message.outputContexts[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.v2.Intent.encode(message.intent, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.intentDetectionConfidence != null && Object.hasOwnProperty.call(message, "intentDetectionConfidence")) + writer.uint32(/* id 12, wireType 5 =*/101).float(message.intentDetectionConfidence); + if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) + $root.google.protobuf.Struct.encode(message.diagnosticInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.languageCode); + if (message.sentimentAnalysisResult != null && Object.hasOwnProperty.call(message, "sentimentAnalysisResult")) + $root.google.cloud.dialogflow.v2.SentimentAnalysisResult.encode(message.sentimentAnalysisResult, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + return writer; + }; - /** - * Properties of a SimpleResponses. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface ISimpleResponses - * @property {Array.|null} [simpleResponses] SimpleResponses simpleResponses - */ + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.QueryResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.QueryResult + * @static + * @param {google.cloud.dialogflow.v2.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new SimpleResponses. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a SimpleResponses. - * @implements ISimpleResponses - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses=} [properties] Properties to set - */ - function SimpleResponses(properties) { - this.simpleResponses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.QueryResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.queryText = reader.string(); + break; + case 15: + message.languageCode = reader.string(); + break; + case 2: + message.speechRecognitionConfidence = reader.float(); + break; + case 3: + message.action = reader.string(); + break; + case 4: + message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 5: + message.allRequiredParamsPresent = reader.bool(); + break; + case 6: + message.fulfillmentText = reader.string(); + break; + case 7: + if (!(message.fulfillmentMessages && message.fulfillmentMessages.length)) + message.fulfillmentMessages = []; + message.fulfillmentMessages.push($root.google.cloud.dialogflow.v2.Intent.Message.decode(reader, reader.uint32())); + break; + case 8: + message.webhookSource = reader.string(); + break; + case 9: + message.webhookPayload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.outputContexts && message.outputContexts.length)) + message.outputContexts = []; + message.outputContexts.push($root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32())); + break; + case 11: + message.intent = $root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32()); + break; + case 12: + message.intentDetectionConfidence = reader.float(); + break; + case 14: + message.diagnosticInfo = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 17: + message.sentimentAnalysisResult = $root.google.cloud.dialogflow.v2.SentimentAnalysisResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * SimpleResponses simpleResponses. - * @member {Array.} simpleResponses - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses - * @instance - */ - SimpleResponses.prototype.simpleResponses = $util.emptyArray; - - /** - * Creates a new SimpleResponses instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponses} SimpleResponses instance - */ - SimpleResponses.create = function create(properties) { - return new SimpleResponses(properties); - }; - - /** - * Encodes the specified SimpleResponses message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses} message SimpleResponses message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleResponses.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.simpleResponses != null && message.simpleResponses.length) - for (var i = 0; i < message.simpleResponses.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.encode(message.simpleResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SimpleResponses message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses} message SimpleResponses message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleResponses.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a SimpleResponses message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponses} SimpleResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleResponses.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.simpleResponses && message.simpleResponses.length)) - message.simpleResponses = []; - message.simpleResponses.push($root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a QueryResult message. + * @function verify + * @memberof google.cloud.dialogflow.v2.QueryResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryText != null && message.hasOwnProperty("queryText")) + if (!$util.isString(message.queryText)) + return "queryText: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.speechRecognitionConfidence != null && message.hasOwnProperty("speechRecognitionConfidence")) + if (typeof message.speechRecognitionConfidence !== "number") + return "speechRecognitionConfidence: number expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Struct.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.allRequiredParamsPresent != null && message.hasOwnProperty("allRequiredParamsPresent")) + if (typeof message.allRequiredParamsPresent !== "boolean") + return "allRequiredParamsPresent: boolean expected"; + if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) + if (!$util.isString(message.fulfillmentText)) + return "fulfillmentText: string expected"; + if (message.fulfillmentMessages != null && message.hasOwnProperty("fulfillmentMessages")) { + if (!Array.isArray(message.fulfillmentMessages)) + return "fulfillmentMessages: array expected"; + for (var i = 0; i < message.fulfillmentMessages.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.verify(message.fulfillmentMessages[i]); + if (error) + return "fulfillmentMessages." + error; + } + } + if (message.webhookSource != null && message.hasOwnProperty("webhookSource")) + if (!$util.isString(message.webhookSource)) + return "webhookSource: string expected"; + if (message.webhookPayload != null && message.hasOwnProperty("webhookPayload")) { + var error = $root.google.protobuf.Struct.verify(message.webhookPayload); + if (error) + return "webhookPayload." + error; + } + if (message.outputContexts != null && message.hasOwnProperty("outputContexts")) { + if (!Array.isArray(message.outputContexts)) + return "outputContexts: array expected"; + for (var i = 0; i < message.outputContexts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Context.verify(message.outputContexts[i]); + if (error) + return "outputContexts." + error; + } + } + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intent); + if (error) + return "intent." + error; + } + if (message.intentDetectionConfidence != null && message.hasOwnProperty("intentDetectionConfidence")) + if (typeof message.intentDetectionConfidence !== "number") + return "intentDetectionConfidence: number expected"; + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { + var error = $root.google.protobuf.Struct.verify(message.diagnosticInfo); + if (error) + return "diagnosticInfo." + error; + } + if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) { + var error = $root.google.cloud.dialogflow.v2.SentimentAnalysisResult.verify(message.sentimentAnalysisResult); + if (error) + return "sentimentAnalysisResult." + error; + } + return null; + }; - /** - * Decodes a SimpleResponses message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponses} SimpleResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleResponses.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.QueryResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.QueryResult} QueryResult + */ + QueryResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.QueryResult) + return object; + var message = new $root.google.cloud.dialogflow.v2.QueryResult(); + if (object.queryText != null) + message.queryText = String(object.queryText); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.speechRecognitionConfidence != null) + message.speechRecognitionConfidence = Number(object.speechRecognitionConfidence); + if (object.action != null) + message.action = String(object.action); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryResult.parameters: object expected"); + message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters); + } + if (object.allRequiredParamsPresent != null) + message.allRequiredParamsPresent = Boolean(object.allRequiredParamsPresent); + if (object.fulfillmentText != null) + message.fulfillmentText = String(object.fulfillmentText); + if (object.fulfillmentMessages) { + if (!Array.isArray(object.fulfillmentMessages)) + throw TypeError(".google.cloud.dialogflow.v2.QueryResult.fulfillmentMessages: array expected"); + message.fulfillmentMessages = []; + for (var i = 0; i < object.fulfillmentMessages.length; ++i) { + if (typeof object.fulfillmentMessages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryResult.fulfillmentMessages: object expected"); + message.fulfillmentMessages[i] = $root.google.cloud.dialogflow.v2.Intent.Message.fromObject(object.fulfillmentMessages[i]); + } + } + if (object.webhookSource != null) + message.webhookSource = String(object.webhookSource); + if (object.webhookPayload != null) { + if (typeof object.webhookPayload !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryResult.webhookPayload: object expected"); + message.webhookPayload = $root.google.protobuf.Struct.fromObject(object.webhookPayload); + } + if (object.outputContexts) { + if (!Array.isArray(object.outputContexts)) + throw TypeError(".google.cloud.dialogflow.v2.QueryResult.outputContexts: array expected"); + message.outputContexts = []; + for (var i = 0; i < object.outputContexts.length; ++i) { + if (typeof object.outputContexts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryResult.outputContexts: object expected"); + message.outputContexts[i] = $root.google.cloud.dialogflow.v2.Context.fromObject(object.outputContexts[i]); + } + } + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryResult.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intent); + } + if (object.intentDetectionConfidence != null) + message.intentDetectionConfidence = Number(object.intentDetectionConfidence); + if (object.diagnosticInfo != null) { + if (typeof object.diagnosticInfo !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryResult.diagnosticInfo: object expected"); + message.diagnosticInfo = $root.google.protobuf.Struct.fromObject(object.diagnosticInfo); + } + if (object.sentimentAnalysisResult != null) { + if (typeof object.sentimentAnalysisResult !== "object") + throw TypeError(".google.cloud.dialogflow.v2.QueryResult.sentimentAnalysisResult: object expected"); + message.sentimentAnalysisResult = $root.google.cloud.dialogflow.v2.SentimentAnalysisResult.fromObject(object.sentimentAnalysisResult); + } + return message; + }; - /** - * Verifies a SimpleResponses message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SimpleResponses.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.simpleResponses != null && message.hasOwnProperty("simpleResponses")) { - if (!Array.isArray(message.simpleResponses)) - return "simpleResponses: array expected"; - for (var i = 0; i < message.simpleResponses.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.verify(message.simpleResponses[i]); - if (error) - return "simpleResponses." + error; - } - } - return null; - }; + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.QueryResult + * @static + * @param {google.cloud.dialogflow.v2.QueryResult} message QueryResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fulfillmentMessages = []; + object.outputContexts = []; + } + if (options.defaults) { + object.queryText = ""; + object.speechRecognitionConfidence = 0; + object.action = ""; + object.parameters = null; + object.allRequiredParamsPresent = false; + object.fulfillmentText = ""; + object.webhookSource = ""; + object.webhookPayload = null; + object.intent = null; + object.intentDetectionConfidence = 0; + object.diagnosticInfo = null; + object.languageCode = ""; + object.sentimentAnalysisResult = null; + } + if (message.queryText != null && message.hasOwnProperty("queryText")) + object.queryText = message.queryText; + if (message.speechRecognitionConfidence != null && message.hasOwnProperty("speechRecognitionConfidence")) + object.speechRecognitionConfidence = options.json && !isFinite(message.speechRecognitionConfidence) ? String(message.speechRecognitionConfidence) : message.speechRecognitionConfidence; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + if (message.allRequiredParamsPresent != null && message.hasOwnProperty("allRequiredParamsPresent")) + object.allRequiredParamsPresent = message.allRequiredParamsPresent; + if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) + object.fulfillmentText = message.fulfillmentText; + if (message.fulfillmentMessages && message.fulfillmentMessages.length) { + object.fulfillmentMessages = []; + for (var j = 0; j < message.fulfillmentMessages.length; ++j) + object.fulfillmentMessages[j] = $root.google.cloud.dialogflow.v2.Intent.Message.toObject(message.fulfillmentMessages[j], options); + } + if (message.webhookSource != null && message.hasOwnProperty("webhookSource")) + object.webhookSource = message.webhookSource; + if (message.webhookPayload != null && message.hasOwnProperty("webhookPayload")) + object.webhookPayload = $root.google.protobuf.Struct.toObject(message.webhookPayload, options); + if (message.outputContexts && message.outputContexts.length) { + object.outputContexts = []; + for (var j = 0; j < message.outputContexts.length; ++j) + object.outputContexts[j] = $root.google.cloud.dialogflow.v2.Context.toObject(message.outputContexts[j], options); + } + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intent, options); + if (message.intentDetectionConfidence != null && message.hasOwnProperty("intentDetectionConfidence")) + object.intentDetectionConfidence = options.json && !isFinite(message.intentDetectionConfidence) ? String(message.intentDetectionConfidence) : message.intentDetectionConfidence; + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) + object.diagnosticInfo = $root.google.protobuf.Struct.toObject(message.diagnosticInfo, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) + object.sentimentAnalysisResult = $root.google.cloud.dialogflow.v2.SentimentAnalysisResult.toObject(message.sentimentAnalysisResult, options); + return object; + }; - /** - * Creates a SimpleResponses message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponses} SimpleResponses - */ - SimpleResponses.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses(); - if (object.simpleResponses) { - if (!Array.isArray(object.simpleResponses)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.simpleResponses: array expected"); - message.simpleResponses = []; - for (var i = 0; i < object.simpleResponses.length; ++i) { - if (typeof object.simpleResponses[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.simpleResponses: object expected"); - message.simpleResponses[i] = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.fromObject(object.simpleResponses[i]); - } - } - return message; - }; + /** + * Converts this QueryResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.QueryResult + * @instance + * @returns {Object.} JSON object + */ + QueryResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a SimpleResponses message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.SimpleResponses} message SimpleResponses - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SimpleResponses.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.simpleResponses = []; - if (message.simpleResponses && message.simpleResponses.length) { - object.simpleResponses = []; - for (var j = 0; j < message.simpleResponses.length; ++j) - object.simpleResponses[j] = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.toObject(message.simpleResponses[j], options); - } - return object; - }; + return QueryResult; + })(); - /** - * Converts this SimpleResponses to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses - * @instance - * @returns {Object.} JSON object - */ - SimpleResponses.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + v2.StreamingDetectIntentRequest = (function() { - return SimpleResponses; - })(); + /** + * Properties of a StreamingDetectIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IStreamingDetectIntentRequest + * @property {string|null} [session] StreamingDetectIntentRequest session + * @property {google.cloud.dialogflow.v2.IQueryParameters|null} [queryParams] StreamingDetectIntentRequest queryParams + * @property {google.cloud.dialogflow.v2.IQueryInput|null} [queryInput] StreamingDetectIntentRequest queryInput + * @property {boolean|null} [singleUtterance] StreamingDetectIntentRequest singleUtterance + * @property {google.cloud.dialogflow.v2.IOutputAudioConfig|null} [outputAudioConfig] StreamingDetectIntentRequest outputAudioConfig + * @property {google.protobuf.IFieldMask|null} [outputAudioConfigMask] StreamingDetectIntentRequest outputAudioConfigMask + * @property {Uint8Array|null} [inputAudio] StreamingDetectIntentRequest inputAudio + */ - Message.BasicCard = (function() { + /** + * Constructs a new StreamingDetectIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a StreamingDetectIntentRequest. + * @implements IStreamingDetectIntentRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentRequest=} [properties] Properties to set + */ + function StreamingDetectIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a BasicCard. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface IBasicCard - * @property {string|null} [title] BasicCard title - * @property {string|null} [subtitle] BasicCard subtitle - * @property {string|null} [formattedText] BasicCard formattedText - * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [image] BasicCard image - * @property {Array.|null} [buttons] BasicCard buttons - */ + /** + * StreamingDetectIntentRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.session = ""; - /** - * Constructs a new BasicCard. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a BasicCard. - * @implements IBasicCard - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.IBasicCard=} [properties] Properties to set - */ - function BasicCard(properties) { - this.buttons = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * StreamingDetectIntentRequest queryParams. + * @member {google.cloud.dialogflow.v2.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.queryParams = null; - /** - * BasicCard title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @instance - */ - BasicCard.prototype.title = ""; + /** + * StreamingDetectIntentRequest queryInput. + * @member {google.cloud.dialogflow.v2.IQueryInput|null|undefined} queryInput + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.queryInput = null; - /** - * BasicCard subtitle. - * @member {string} subtitle - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @instance - */ - BasicCard.prototype.subtitle = ""; + /** + * StreamingDetectIntentRequest singleUtterance. + * @member {boolean} singleUtterance + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.singleUtterance = false; - /** - * BasicCard formattedText. - * @member {string} formattedText - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @instance - */ - BasicCard.prototype.formattedText = ""; + /** + * StreamingDetectIntentRequest outputAudioConfig. + * @member {google.cloud.dialogflow.v2.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.outputAudioConfig = null; - /** - * BasicCard image. - * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} image - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @instance - */ - BasicCard.prototype.image = null; + /** + * StreamingDetectIntentRequest outputAudioConfigMask. + * @member {google.protobuf.IFieldMask|null|undefined} outputAudioConfigMask + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.outputAudioConfigMask = null; - /** - * BasicCard buttons. - * @member {Array.} buttons - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @instance - */ - BasicCard.prototype.buttons = $util.emptyArray; + /** + * StreamingDetectIntentRequest inputAudio. + * @member {Uint8Array} inputAudio + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.inputAudio = $util.newBuffer([]); - /** - * Creates a new BasicCard instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IBasicCard=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard} BasicCard instance - */ - BasicCard.create = function create(properties) { - return new BasicCard(properties); - }; + /** + * Creates a new StreamingDetectIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentRequest} StreamingDetectIntentRequest instance + */ + StreamingDetectIntentRequest.create = function create(properties) { + return new StreamingDetectIntentRequest(properties); + }; - /** - * Encodes the specified BasicCard message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IBasicCard} message BasicCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BasicCard.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); - if (message.formattedText != null && Object.hasOwnProperty.call(message, "formattedText")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.formattedText); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.buttons != null && message.buttons.length) - for (var i = 0; i < message.buttons.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.encode(message.buttons[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified StreamingDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentRequest} message StreamingDetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.v2.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) + $root.google.cloud.dialogflow.v2.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.singleUtterance); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.v2.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.inputAudio != null && Object.hasOwnProperty.call(message, "inputAudio")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.inputAudio); + if (message.outputAudioConfigMask != null && Object.hasOwnProperty.call(message, "outputAudioConfigMask")) + $root.google.protobuf.FieldMask.encode(message.outputAudioConfigMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified BasicCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IBasicCard} message BasicCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BasicCard.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified StreamingDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentRequest} message StreamingDetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a BasicCard message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard} BasicCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BasicCard.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.subtitle = reader.string(); - break; - case 3: - message.formattedText = reader.string(); - break; - case 4: - message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); - break; - case 5: - if (!(message.buttons && message.buttons.length)) - message.buttons = []; - message.buttons.push($root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentRequest} StreamingDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.StreamingDetectIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.session = reader.string(); + break; + case 2: + message.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.decode(reader, reader.uint32()); + break; + case 3: + message.queryInput = $root.google.cloud.dialogflow.v2.QueryInput.decode(reader, reader.uint32()); + break; + case 4: + message.singleUtterance = reader.bool(); + break; + case 5: + message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.decode(reader, reader.uint32()); + break; + case 7: + message.outputAudioConfigMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 6: + message.inputAudio = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a BasicCard message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard} BasicCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BasicCard.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentRequest} StreamingDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a BasicCard message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BasicCard.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - if (!$util.isString(message.subtitle)) - return "subtitle: string expected"; - if (message.formattedText != null && message.hasOwnProperty("formattedText")) - if (!$util.isString(message.formattedText)) - return "formattedText: string expected"; - if (message.image != null && message.hasOwnProperty("image")) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.image); - if (error) - return "image." + error; - } - if (message.buttons != null && message.hasOwnProperty("buttons")) { - if (!Array.isArray(message.buttons)) - return "buttons: array expected"; - for (var i = 0; i < message.buttons.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.verify(message.buttons[i]); - if (error) - return "buttons." + error; - } - } - return null; - }; + /** + * Verifies a StreamingDetectIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingDetectIntentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.v2.QueryParameters.verify(message.queryParams); + if (error) + return "queryParams." + error; + } + if (message.queryInput != null && message.hasOwnProperty("queryInput")) { + var error = $root.google.cloud.dialogflow.v2.QueryInput.verify(message.queryInput); + if (error) + return "queryInput." + error; + } + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (typeof message.singleUtterance !== "boolean") + return "singleUtterance: boolean expected"; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.v2.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.outputAudioConfigMask); + if (error) + return "outputAudioConfigMask." + error; + } + if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) + if (!(message.inputAudio && typeof message.inputAudio.length === "number" || $util.isString(message.inputAudio))) + return "inputAudio: buffer expected"; + return null; + }; - /** - * Creates a BasicCard message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard} BasicCard - */ - BasicCard.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard(); - if (object.title != null) - message.title = String(object.title); - if (object.subtitle != null) - message.subtitle = String(object.subtitle); - if (object.formattedText != null) - message.formattedText = String(object.formattedText); - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BasicCard.image: object expected"); - message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.image); - } - if (object.buttons) { - if (!Array.isArray(object.buttons)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BasicCard.buttons: array expected"); - message.buttons = []; - for (var i = 0; i < object.buttons.length; ++i) { - if (typeof object.buttons[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BasicCard.buttons: object expected"); - message.buttons[i] = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.fromObject(object.buttons[i]); - } - } - return message; - }; + /** + * Creates a StreamingDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentRequest} StreamingDetectIntentRequest + */ + StreamingDetectIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.StreamingDetectIntentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.StreamingDetectIntentRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.fromObject(object.queryParams); + } + if (object.queryInput != null) { + if (typeof object.queryInput !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentRequest.queryInput: object expected"); + message.queryInput = $root.google.cloud.dialogflow.v2.QueryInput.fromObject(object.queryInput); + } + if (object.singleUtterance != null) + message.singleUtterance = Boolean(object.singleUtterance); + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentRequest.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + if (object.outputAudioConfigMask != null) { + if (typeof object.outputAudioConfigMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentRequest.outputAudioConfigMask: object expected"); + message.outputAudioConfigMask = $root.google.protobuf.FieldMask.fromObject(object.outputAudioConfigMask); + } + if (object.inputAudio != null) + if (typeof object.inputAudio === "string") + $util.base64.decode(object.inputAudio, message.inputAudio = $util.newBuffer($util.base64.length(object.inputAudio)), 0); + else if (object.inputAudio.length) + message.inputAudio = object.inputAudio; + return message; + }; - /** - * Creates a plain object from a BasicCard message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard} message BasicCard - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BasicCard.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.buttons = []; - if (options.defaults) { - object.title = ""; - object.subtitle = ""; - object.formattedText = ""; - object.image = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - object.subtitle = message.subtitle; - if (message.formattedText != null && message.hasOwnProperty("formattedText")) - object.formattedText = message.formattedText; - if (message.image != null && message.hasOwnProperty("image")) - object.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.image, options); - if (message.buttons && message.buttons.length) { - object.buttons = []; - for (var j = 0; j < message.buttons.length; ++j) - object.buttons[j] = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.toObject(message.buttons[j], options); - } - return object; - }; + /** + * Creates a plain object from a StreamingDetectIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.StreamingDetectIntentRequest} message StreamingDetectIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingDetectIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.queryParams = null; + object.queryInput = null; + object.singleUtterance = false; + object.outputAudioConfig = null; + if (options.bytes === String) + object.inputAudio = ""; + else { + object.inputAudio = []; + if (options.bytes !== Array) + object.inputAudio = $util.newBuffer(object.inputAudio); + } + object.outputAudioConfigMask = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.toObject(message.queryParams, options); + if (message.queryInput != null && message.hasOwnProperty("queryInput")) + object.queryInput = $root.google.cloud.dialogflow.v2.QueryInput.toObject(message.queryInput, options); + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + object.singleUtterance = message.singleUtterance; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) + object.inputAudio = options.bytes === String ? $util.base64.encode(message.inputAudio, 0, message.inputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputAudio) : message.inputAudio; + if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) + object.outputAudioConfigMask = $root.google.protobuf.FieldMask.toObject(message.outputAudioConfigMask, options); + return object; + }; - /** - * Converts this BasicCard to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @instance - * @returns {Object.} JSON object - */ - BasicCard.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this StreamingDetectIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingDetectIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - BasicCard.Button = (function() { + return StreamingDetectIntentRequest; + })(); - /** - * Properties of a Button. - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @interface IButton - * @property {string|null} [title] Button title - * @property {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction|null} [openUriAction] Button openUriAction - */ + v2.StreamingDetectIntentResponse = (function() { - /** - * Constructs a new Button. - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard - * @classdesc Represents a Button. - * @implements IButton - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton=} [properties] Properties to set - */ - function Button(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a StreamingDetectIntentResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IStreamingDetectIntentResponse + * @property {string|null} [responseId] StreamingDetectIntentResponse responseId + * @property {google.cloud.dialogflow.v2.IStreamingRecognitionResult|null} [recognitionResult] StreamingDetectIntentResponse recognitionResult + * @property {google.cloud.dialogflow.v2.IQueryResult|null} [queryResult] StreamingDetectIntentResponse queryResult + * @property {google.rpc.IStatus|null} [webhookStatus] StreamingDetectIntentResponse webhookStatus + * @property {Uint8Array|null} [outputAudio] StreamingDetectIntentResponse outputAudio + * @property {google.cloud.dialogflow.v2.IOutputAudioConfig|null} [outputAudioConfig] StreamingDetectIntentResponse outputAudioConfig + */ - /** - * Button title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @instance - */ - Button.prototype.title = ""; + /** + * Constructs a new StreamingDetectIntentResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a StreamingDetectIntentResponse. + * @implements IStreamingDetectIntentResponse + * @constructor + * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentResponse=} [properties] Properties to set + */ + function StreamingDetectIntentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Button openUriAction. - * @member {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction|null|undefined} openUriAction - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @instance - */ - Button.prototype.openUriAction = null; + /** + * StreamingDetectIntentResponse responseId. + * @member {string} responseId + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.responseId = ""; - /** - * Creates a new Button instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button} Button instance - */ - Button.create = function create(properties) { - return new Button(properties); - }; + /** + * StreamingDetectIntentResponse recognitionResult. + * @member {google.cloud.dialogflow.v2.IStreamingRecognitionResult|null|undefined} recognitionResult + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.recognitionResult = null; - /** - * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton} message Button message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Button.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.openUriAction != null && Object.hasOwnProperty.call(message, "openUriAction")) - $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.encode(message.openUriAction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * StreamingDetectIntentResponse queryResult. + * @member {google.cloud.dialogflow.v2.IQueryResult|null|undefined} queryResult + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.queryResult = null; - /** - * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton} message Button message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Button.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * StreamingDetectIntentResponse webhookStatus. + * @member {google.rpc.IStatus|null|undefined} webhookStatus + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.webhookStatus = null; - /** - * Decodes a Button message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button} Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Button.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.openUriAction = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * StreamingDetectIntentResponse outputAudio. + * @member {Uint8Array} outputAudio + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.outputAudio = $util.newBuffer([]); - /** - * Decodes a Button message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button} Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Button.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * StreamingDetectIntentResponse outputAudioConfig. + * @member {google.cloud.dialogflow.v2.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.outputAudioConfig = null; - /** - * Verifies a Button message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Button.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.verify(message.openUriAction); - if (error) - return "openUriAction." + error; - } - return null; - }; + /** + * Creates a new StreamingDetectIntentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentResponse} StreamingDetectIntentResponse instance + */ + StreamingDetectIntentResponse.create = function create(properties) { + return new StreamingDetectIntentResponse(properties); + }; - /** - * Creates a Button message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button} Button - */ - Button.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button(); - if (object.title != null) - message.title = String(object.title); - if (object.openUriAction != null) { - if (typeof object.openUriAction !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.openUriAction: object expected"); - message.openUriAction = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.fromObject(object.openUriAction); - } - return message; - }; + /** + * Encodes the specified StreamingDetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentResponse} message StreamingDetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); + if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) + $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) + $root.google.cloud.dialogflow.v2.QueryResult.encode(message.queryResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.webhookStatus != null && Object.hasOwnProperty.call(message, "webhookStatus")) + $root.google.rpc.Status.encode(message.webhookStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outputAudio != null && Object.hasOwnProperty.call(message, "outputAudio")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.outputAudio); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.v2.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; - /** - * Creates a plain object from a Button message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button} message Button - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Button.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.openUriAction = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) - object.openUriAction = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.toObject(message.openUriAction, options); - return object; - }; + /** + * Encodes the specified StreamingDetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentResponse} message StreamingDetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Converts this Button to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @instance - * @returns {Object.} JSON object - */ - Button.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentResponse} StreamingDetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.StreamingDetectIntentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.responseId = reader.string(); + break; + case 2: + message.recognitionResult = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.decode(reader, reader.uint32()); + break; + case 3: + message.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.decode(reader, reader.uint32()); + break; + case 4: + message.webhookStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 5: + message.outputAudio = reader.bytes(); + break; + case 6: + message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - Button.OpenUriAction = (function() { + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentResponse} StreamingDetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of an OpenUriAction. - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @interface IOpenUriAction - * @property {string|null} [uri] OpenUriAction uri - */ + /** + * Verifies a StreamingDetectIntentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingDetectIntentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + var error = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.verify(message.recognitionResult); + if (error) + return "recognitionResult." + error; + } + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + var error = $root.google.cloud.dialogflow.v2.QueryResult.verify(message.queryResult); + if (error) + return "queryResult." + error; + } + if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) { + var error = $root.google.rpc.Status.verify(message.webhookStatus); + if (error) + return "webhookStatus." + error; + } + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + if (!(message.outputAudio && typeof message.outputAudio.length === "number" || $util.isString(message.outputAudio))) + return "outputAudio: buffer expected"; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.v2.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + return null; + }; - /** - * Constructs a new OpenUriAction. - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button - * @classdesc Represents an OpenUriAction. - * @implements IOpenUriAction - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction=} [properties] Properties to set - */ - function OpenUriAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a StreamingDetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentResponse} StreamingDetectIntentResponse + */ + StreamingDetectIntentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.StreamingDetectIntentResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2.StreamingDetectIntentResponse(); + if (object.responseId != null) + message.responseId = String(object.responseId); + if (object.recognitionResult != null) { + if (typeof object.recognitionResult !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentResponse.recognitionResult: object expected"); + message.recognitionResult = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.fromObject(object.recognitionResult); + } + if (object.queryResult != null) { + if (typeof object.queryResult !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentResponse.queryResult: object expected"); + message.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.fromObject(object.queryResult); + } + if (object.webhookStatus != null) { + if (typeof object.webhookStatus !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentResponse.webhookStatus: object expected"); + message.webhookStatus = $root.google.rpc.Status.fromObject(object.webhookStatus); + } + if (object.outputAudio != null) + if (typeof object.outputAudio === "string") + $util.base64.decode(object.outputAudio, message.outputAudio = $util.newBuffer($util.base64.length(object.outputAudio)), 0); + else if (object.outputAudio.length) + message.outputAudio = object.outputAudio; + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentResponse.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + return message; + }; - /** - * OpenUriAction uri. - * @member {string} uri - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction - * @instance - */ - OpenUriAction.prototype.uri = ""; + /** + * Creates a plain object from a StreamingDetectIntentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2.StreamingDetectIntentResponse} message StreamingDetectIntentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingDetectIntentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseId = ""; + object.recognitionResult = null; + object.queryResult = null; + object.webhookStatus = null; + if (options.bytes === String) + object.outputAudio = ""; + else { + object.outputAudio = []; + if (options.bytes !== Array) + object.outputAudio = $util.newBuffer(object.outputAudio); + } + object.outputAudioConfig = null; + } + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) + object.recognitionResult = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.toObject(message.recognitionResult, options); + if (message.queryResult != null && message.hasOwnProperty("queryResult")) + object.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.toObject(message.queryResult, options); + if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) + object.webhookStatus = $root.google.rpc.Status.toObject(message.webhookStatus, options); + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.toObject(message.outputAudioConfig, options); + return object; + }; - /** - * Creates a new OpenUriAction instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction instance - */ - OpenUriAction.create = function create(properties) { - return new OpenUriAction(properties); - }; + /** + * Converts this StreamingDetectIntentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingDetectIntentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified OpenUriAction message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction} message OpenUriAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenUriAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - return writer; - }; + return StreamingDetectIntentResponse; + })(); - /** - * Encodes the specified OpenUriAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction} message OpenUriAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenUriAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v2.StreamingRecognitionResult = (function() { - /** - * Decodes an OpenUriAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenUriAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.uri = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a StreamingRecognitionResult. + * @memberof google.cloud.dialogflow.v2 + * @interface IStreamingRecognitionResult + * @property {google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType|null} [messageType] StreamingRecognitionResult messageType + * @property {string|null} [transcript] StreamingRecognitionResult transcript + * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal + * @property {number|null} [confidence] StreamingRecognitionResult confidence + * @property {Array.|null} [speechWordInfo] StreamingRecognitionResult speechWordInfo + * @property {google.protobuf.IDuration|null} [speechEndOffset] StreamingRecognitionResult speechEndOffset + */ - /** - * Decodes an OpenUriAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenUriAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new StreamingRecognitionResult. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a StreamingRecognitionResult. + * @implements IStreamingRecognitionResult + * @constructor + * @param {google.cloud.dialogflow.v2.IStreamingRecognitionResult=} [properties] Properties to set + */ + function StreamingRecognitionResult(properties) { + this.speechWordInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Verifies an OpenUriAction message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OpenUriAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; + /** + * StreamingRecognitionResult messageType. + * @member {google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType} messageType + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.messageType = 0; - /** - * Creates an OpenUriAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction - */ - OpenUriAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction(); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; + /** + * StreamingRecognitionResult transcript. + * @member {string} transcript + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.transcript = ""; - /** - * Creates a plain object from an OpenUriAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction} message OpenUriAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OpenUriAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.uri = ""; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; + /** + * StreamingRecognitionResult isFinal. + * @member {boolean} isFinal + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.isFinal = false; - /** - * Converts this OpenUriAction to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction - * @instance - * @returns {Object.} JSON object - */ - OpenUriAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * StreamingRecognitionResult confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.confidence = 0; - return OpenUriAction; - })(); + /** + * StreamingRecognitionResult speechWordInfo. + * @member {Array.} speechWordInfo + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.speechWordInfo = $util.emptyArray; - return Button; - })(); + /** + * StreamingRecognitionResult speechEndOffset. + * @member {google.protobuf.IDuration|null|undefined} speechEndOffset + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.speechEndOffset = null; - return BasicCard; - })(); + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.v2.IStreamingRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.StreamingRecognitionResult} StreamingRecognitionResult instance + */ + StreamingRecognitionResult.create = function create(properties) { + return new StreamingRecognitionResult(properties); + }; - Message.Suggestion = (function() { + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingRecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.v2.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.messageType); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.transcript); + if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isFinal); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.speechWordInfo != null && message.speechWordInfo.length) + for (var i = 0; i < message.speechWordInfo.length; ++i) + $root.google.cloud.dialogflow.v2.SpeechWordInfo.encode(message.speechWordInfo[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.speechEndOffset != null && Object.hasOwnProperty.call(message, "speechEndOffset")) + $root.google.protobuf.Duration.encode(message.speechEndOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; - /** - * Properties of a Suggestion. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface ISuggestion - * @property {string|null} [title] Suggestion title - */ + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingRecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.v2.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new Suggestion. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a Suggestion. - * @implements ISuggestion - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestion=} [properties] Properties to set - */ - function Suggestion(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.StreamingRecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageType = reader.int32(); + break; + case 2: + message.transcript = reader.string(); + break; + case 3: + message.isFinal = reader.bool(); + break; + case 4: + message.confidence = reader.float(); + break; + case 7: + if (!(message.speechWordInfo && message.speechWordInfo.length)) + message.speechWordInfo = []; + message.speechWordInfo.push($root.google.cloud.dialogflow.v2.SpeechWordInfo.decode(reader, reader.uint32())); + break; + case 8: + message.speechEndOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * Suggestion title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion - * @instance - */ - Suggestion.prototype.title = ""; + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new Suggestion instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestion=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestion} Suggestion instance - */ - Suggestion.create = function create(properties) { - return new Suggestion(properties); - }; + /** + * Verifies a StreamingRecognitionResult message. + * @function verify + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageType != null && message.hasOwnProperty("messageType")) + switch (message.messageType) { + default: + return "messageType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + if (typeof message.isFinal !== "boolean") + return "isFinal: boolean expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.speechWordInfo != null && message.hasOwnProperty("speechWordInfo")) { + if (!Array.isArray(message.speechWordInfo)) + return "speechWordInfo: array expected"; + for (var i = 0; i < message.speechWordInfo.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.SpeechWordInfo.verify(message.speechWordInfo[i]); + if (error) + return "speechWordInfo." + error; + } + } + if (message.speechEndOffset != null && message.hasOwnProperty("speechEndOffset")) { + var error = $root.google.protobuf.Duration.verify(message.speechEndOffset); + if (error) + return "speechEndOffset." + error; + } + return null; + }; - /** - * Encodes the specified Suggestion message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestion.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestion} message Suggestion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Suggestion.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - return writer; - }; + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.StreamingRecognitionResult} StreamingRecognitionResult + */ + StreamingRecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.StreamingRecognitionResult) + return object; + var message = new $root.google.cloud.dialogflow.v2.StreamingRecognitionResult(); + switch (object.messageType) { + case "MESSAGE_TYPE_UNSPECIFIED": + case 0: + message.messageType = 0; + break; + case "TRANSCRIPT": + case 1: + message.messageType = 1; + break; + case "END_OF_SINGLE_UTTERANCE": + case 2: + message.messageType = 2; + break; + } + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.isFinal != null) + message.isFinal = Boolean(object.isFinal); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.speechWordInfo) { + if (!Array.isArray(object.speechWordInfo)) + throw TypeError(".google.cloud.dialogflow.v2.StreamingRecognitionResult.speechWordInfo: array expected"); + message.speechWordInfo = []; + for (var i = 0; i < object.speechWordInfo.length; ++i) { + if (typeof object.speechWordInfo[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingRecognitionResult.speechWordInfo: object expected"); + message.speechWordInfo[i] = $root.google.cloud.dialogflow.v2.SpeechWordInfo.fromObject(object.speechWordInfo[i]); + } + } + if (object.speechEndOffset != null) { + if (typeof object.speechEndOffset !== "object") + throw TypeError(".google.cloud.dialogflow.v2.StreamingRecognitionResult.speechEndOffset: object expected"); + message.speechEndOffset = $root.google.protobuf.Duration.fromObject(object.speechEndOffset); + } + return message; + }; - /** - * Encodes the specified Suggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestion.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestion} message Suggestion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Suggestion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.v2.StreamingRecognitionResult} message StreamingRecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.speechWordInfo = []; + if (options.defaults) { + object.messageType = options.enums === String ? "MESSAGE_TYPE_UNSPECIFIED" : 0; + object.transcript = ""; + object.isFinal = false; + object.confidence = 0; + object.speechEndOffset = null; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) + object.messageType = options.enums === String ? $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType[message.messageType] : message.messageType; + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + object.isFinal = message.isFinal; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.speechWordInfo && message.speechWordInfo.length) { + object.speechWordInfo = []; + for (var j = 0; j < message.speechWordInfo.length; ++j) + object.speechWordInfo[j] = $root.google.cloud.dialogflow.v2.SpeechWordInfo.toObject(message.speechWordInfo[j], options); + } + if (message.speechEndOffset != null && message.hasOwnProperty("speechEndOffset")) + object.speechEndOffset = $root.google.protobuf.Duration.toObject(message.speechEndOffset, options); + return object; + }; - /** - * Decodes a Suggestion message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestion} Suggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Suggestion.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Suggestion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestion} Suggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Suggestion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Suggestion message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Suggestion.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - return null; - }; + /** + * Converts this StreamingRecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a Suggestion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestion} Suggestion - */ - Suggestion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion(); - if (object.title != null) - message.title = String(object.title); - return message; - }; + /** + * MessageType enum. + * @name google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType + * @enum {number} + * @property {number} MESSAGE_TYPE_UNSPECIFIED=0 MESSAGE_TYPE_UNSPECIFIED value + * @property {number} TRANSCRIPT=1 TRANSCRIPT value + * @property {number} END_OF_SINGLE_UTTERANCE=2 END_OF_SINGLE_UTTERANCE value + */ + StreamingRecognitionResult.MessageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRANSCRIPT"] = 1; + values[valuesById[2] = "END_OF_SINGLE_UTTERANCE"] = 2; + return values; + })(); - /** - * Creates a plain object from a Suggestion message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.Suggestion} message Suggestion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Suggestion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.title = ""; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - return object; - }; + return StreamingRecognitionResult; + })(); - /** - * Converts this Suggestion to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion - * @instance - * @returns {Object.} JSON object - */ - Suggestion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + v2.TextInput = (function() { - return Suggestion; - })(); + /** + * Properties of a TextInput. + * @memberof google.cloud.dialogflow.v2 + * @interface ITextInput + * @property {string|null} [text] TextInput text + * @property {string|null} [languageCode] TextInput languageCode + */ - Message.Suggestions = (function() { + /** + * Constructs a new TextInput. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a TextInput. + * @implements ITextInput + * @constructor + * @param {google.cloud.dialogflow.v2.ITextInput=} [properties] Properties to set + */ + function TextInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a Suggestions. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface ISuggestions - * @property {Array.|null} [suggestions] Suggestions suggestions - */ + /** + * TextInput text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2.TextInput + * @instance + */ + TextInput.prototype.text = ""; - /** - * Constructs a new Suggestions. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a Suggestions. - * @implements ISuggestions - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestions=} [properties] Properties to set - */ - function Suggestions(properties) { - this.suggestions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * TextInput languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.TextInput + * @instance + */ + TextInput.prototype.languageCode = ""; - /** - * Suggestions suggestions. - * @member {Array.} suggestions - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions - * @instance - */ - Suggestions.prototype.suggestions = $util.emptyArray; + /** + * Creates a new TextInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.TextInput + * @static + * @param {google.cloud.dialogflow.v2.ITextInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.TextInput} TextInput instance + */ + TextInput.create = function create(properties) { + return new TextInput(properties); + }; - /** - * Creates a new Suggestions instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestions=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestions} Suggestions instance - */ - Suggestions.create = function create(properties) { - return new Suggestions(properties); - }; + /** + * Encodes the specified TextInput message. Does not implicitly {@link google.cloud.dialogflow.v2.TextInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.TextInput + * @static + * @param {google.cloud.dialogflow.v2.ITextInput} message TextInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; - /** - * Encodes the specified Suggestions message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestions.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestions} message Suggestions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Suggestions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.suggestions != null && message.suggestions.length) - for (var i = 0; i < message.suggestions.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion.encode(message.suggestions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.TextInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.TextInput + * @static + * @param {google.cloud.dialogflow.v2.ITextInput} message TextInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified Suggestions message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestions} message Suggestions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Suggestions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a TextInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.TextInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.TextInput} TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextInput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.TextInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a Suggestions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestions} Suggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Suggestions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.suggestions && message.suggestions.length)) - message.suggestions = []; - message.suggestions.push($root.google.cloud.dialogflow.v2.Intent.Message.Suggestion.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a TextInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.TextInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.TextInput} TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a Suggestions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestions} Suggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Suggestions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a TextInput message. + * @function verify + * @memberof google.cloud.dialogflow.v2.TextInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; - /** - * Verifies a Suggestions message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Suggestions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.suggestions != null && message.hasOwnProperty("suggestions")) { - if (!Array.isArray(message.suggestions)) - return "suggestions: array expected"; - for (var i = 0; i < message.suggestions.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion.verify(message.suggestions[i]); - if (error) - return "suggestions." + error; - } - } - return null; - }; + /** + * Creates a TextInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.TextInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.TextInput} TextInput + */ + TextInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.TextInput) + return object; + var message = new $root.google.cloud.dialogflow.v2.TextInput(); + if (object.text != null) + message.text = String(object.text); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; - /** - * Creates a Suggestions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestions} Suggestions - */ - Suggestions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions(); - if (object.suggestions) { - if (!Array.isArray(object.suggestions)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.Suggestions.suggestions: array expected"); - message.suggestions = []; - for (var i = 0; i < object.suggestions.length; ++i) { - if (typeof object.suggestions[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.Suggestions.suggestions: object expected"); - message.suggestions[i] = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion.fromObject(object.suggestions[i]); - } - } - return message; - }; + /** + * Creates a plain object from a TextInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.TextInput + * @static + * @param {google.cloud.dialogflow.v2.TextInput} message TextInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.languageCode = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; - /** - * Creates a plain object from a Suggestions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.Suggestions} message Suggestions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Suggestions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.suggestions = []; - if (message.suggestions && message.suggestions.length) { - object.suggestions = []; - for (var j = 0; j < message.suggestions.length; ++j) - object.suggestions[j] = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion.toObject(message.suggestions[j], options); - } - return object; - }; + /** + * Converts this TextInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.TextInput + * @instance + * @returns {Object.} JSON object + */ + TextInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Suggestions to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions - * @instance - * @returns {Object.} JSON object - */ - Suggestions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return TextInput; + })(); - return Suggestions; - })(); + v2.EventInput = (function() { - Message.LinkOutSuggestion = (function() { + /** + * Properties of an EventInput. + * @memberof google.cloud.dialogflow.v2 + * @interface IEventInput + * @property {string|null} [name] EventInput name + * @property {google.protobuf.IStruct|null} [parameters] EventInput parameters + * @property {string|null} [languageCode] EventInput languageCode + */ - /** - * Properties of a LinkOutSuggestion. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface ILinkOutSuggestion - * @property {string|null} [destinationName] LinkOutSuggestion destinationName - * @property {string|null} [uri] LinkOutSuggestion uri - */ + /** + * Constructs a new EventInput. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an EventInput. + * @implements IEventInput + * @constructor + * @param {google.cloud.dialogflow.v2.IEventInput=} [properties] Properties to set + */ + function EventInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new LinkOutSuggestion. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a LinkOutSuggestion. - * @implements ILinkOutSuggestion - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion=} [properties] Properties to set - */ - function LinkOutSuggestion(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * EventInput name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.EventInput + * @instance + */ + EventInput.prototype.name = ""; - /** - * LinkOutSuggestion destinationName. - * @member {string} destinationName - * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion - * @instance - */ - LinkOutSuggestion.prototype.destinationName = ""; + /** + * EventInput parameters. + * @member {google.protobuf.IStruct|null|undefined} parameters + * @memberof google.cloud.dialogflow.v2.EventInput + * @instance + */ + EventInput.prototype.parameters = null; - /** - * LinkOutSuggestion uri. - * @member {string} uri - * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion - * @instance - */ - LinkOutSuggestion.prototype.uri = ""; + /** + * EventInput languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.EventInput + * @instance + */ + EventInput.prototype.languageCode = ""; - /** - * Creates a new LinkOutSuggestion instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion} LinkOutSuggestion instance - */ - LinkOutSuggestion.create = function create(properties) { - return new LinkOutSuggestion(properties); - }; + /** + * Creates a new EventInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.EventInput + * @static + * @param {google.cloud.dialogflow.v2.IEventInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.EventInput} EventInput instance + */ + EventInput.create = function create(properties) { + return new EventInput(properties); + }; - /** - * Encodes the specified LinkOutSuggestion message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion} message LinkOutSuggestion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LinkOutSuggestion.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.destinationName != null && Object.hasOwnProperty.call(message, "destinationName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationName); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); - return writer; - }; + /** + * Encodes the specified EventInput message. Does not implicitly {@link google.cloud.dialogflow.v2.EventInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.EventInput + * @static + * @param {google.cloud.dialogflow.v2.IEventInput} message EventInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; - /** - * Encodes the specified LinkOutSuggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion} message LinkOutSuggestion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LinkOutSuggestion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified EventInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EventInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.EventInput + * @static + * @param {google.cloud.dialogflow.v2.IEventInput} message EventInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a LinkOutSuggestion message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion} LinkOutSuggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LinkOutSuggestion.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.destinationName = reader.string(); - break; - case 2: - message.uri = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes an EventInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.EventInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.EventInput} EventInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventInput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.EventInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 3: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a LinkOutSuggestion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion} LinkOutSuggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LinkOutSuggestion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an EventInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.EventInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.EventInput} EventInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a LinkOutSuggestion message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LinkOutSuggestion.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.destinationName != null && message.hasOwnProperty("destinationName")) - if (!$util.isString(message.destinationName)) - return "destinationName: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; + /** + * Verifies an EventInput message. + * @function verify + * @memberof google.cloud.dialogflow.v2.EventInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Struct.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; - /** - * Creates a LinkOutSuggestion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion} LinkOutSuggestion - */ - LinkOutSuggestion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion(); - if (object.destinationName != null) - message.destinationName = String(object.destinationName); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; + /** + * Creates an EventInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.EventInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.EventInput} EventInput + */ + EventInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.EventInput) + return object; + var message = new $root.google.cloud.dialogflow.v2.EventInput(); + if (object.name != null) + message.name = String(object.name); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.v2.EventInput.parameters: object expected"); + message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; - /** - * Creates a plain object from a LinkOutSuggestion message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion} message LinkOutSuggestion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LinkOutSuggestion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.destinationName = ""; - object.uri = ""; - } - if (message.destinationName != null && message.hasOwnProperty("destinationName")) - object.destinationName = message.destinationName; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; + /** + * Creates a plain object from an EventInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.EventInput + * @static + * @param {google.cloud.dialogflow.v2.EventInput} message EventInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.parameters = null; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; - /** - * Converts this LinkOutSuggestion to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion - * @instance - * @returns {Object.} JSON object - */ - LinkOutSuggestion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this EventInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.EventInput + * @instance + * @returns {Object.} JSON object + */ + EventInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return LinkOutSuggestion; - })(); + return EventInput; + })(); - Message.ListSelect = (function() { + v2.SentimentAnalysisRequestConfig = (function() { - /** - * Properties of a ListSelect. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface IListSelect - * @property {string|null} [title] ListSelect title - * @property {Array.|null} [items] ListSelect items - * @property {string|null} [subtitle] ListSelect subtitle - */ + /** + * Properties of a SentimentAnalysisRequestConfig. + * @memberof google.cloud.dialogflow.v2 + * @interface ISentimentAnalysisRequestConfig + * @property {boolean|null} [analyzeQueryTextSentiment] SentimentAnalysisRequestConfig analyzeQueryTextSentiment + */ - /** - * Constructs a new ListSelect. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a ListSelect. - * @implements IListSelect - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.IListSelect=} [properties] Properties to set - */ - function ListSelect(properties) { - this.items = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new SentimentAnalysisRequestConfig. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a SentimentAnalysisRequestConfig. + * @implements ISentimentAnalysisRequestConfig + * @constructor + * @param {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig=} [properties] Properties to set + */ + function SentimentAnalysisRequestConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ListSelect title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @instance - */ - ListSelect.prototype.title = ""; + /** + * SentimentAnalysisRequestConfig analyzeQueryTextSentiment. + * @member {boolean} analyzeQueryTextSentiment + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig + * @instance + */ + SentimentAnalysisRequestConfig.prototype.analyzeQueryTextSentiment = false; - /** - * ListSelect items. - * @member {Array.} items - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @instance - */ - ListSelect.prototype.items = $util.emptyArray; + /** + * Creates a new SentimentAnalysisRequestConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig + * @static + * @param {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig instance + */ + SentimentAnalysisRequestConfig.create = function create(properties) { + return new SentimentAnalysisRequestConfig(properties); + }; - /** - * ListSelect subtitle. - * @member {string} subtitle - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @instance - */ - ListSelect.prototype.subtitle = ""; + /** + * Encodes the specified SentimentAnalysisRequestConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig + * @static + * @param {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig} message SentimentAnalysisRequestConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisRequestConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analyzeQueryTextSentiment != null && Object.hasOwnProperty.call(message, "analyzeQueryTextSentiment")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.analyzeQueryTextSentiment); + return writer; + }; - /** - * Creates a new ListSelect instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IListSelect=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect} ListSelect instance - */ - ListSelect.create = function create(properties) { - return new ListSelect(properties); - }; - - /** - * Encodes the specified ListSelect message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IListSelect} message ListSelect message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSelect.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.items != null && message.items.length) - for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.subtitle); - return writer; - }; - - /** - * Encodes the specified ListSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IListSelect} message ListSelect message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSelect.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified SentimentAnalysisRequestConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig + * @static + * @param {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig} message SentimentAnalysisRequestConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisRequestConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a ListSelect message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect} ListSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSelect.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - if (!(message.items && message.items.length)) - message.items = []; - message.items.push($root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.decode(reader, reader.uint32())); - break; - case 3: - message.subtitle = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisRequestConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analyzeQueryTextSentiment = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a ListSelect message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect} ListSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSelect.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisRequestConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ListSelect message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSelect.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!Array.isArray(message.items)) - return "items: array expected"; - for (var i = 0; i < message.items.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.verify(message.items[i]); - if (error) - return "items." + error; - } - } - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - if (!$util.isString(message.subtitle)) - return "subtitle: string expected"; - return null; - }; + /** + * Verifies a SentimentAnalysisRequestConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SentimentAnalysisRequestConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analyzeQueryTextSentiment != null && message.hasOwnProperty("analyzeQueryTextSentiment")) + if (typeof message.analyzeQueryTextSentiment !== "boolean") + return "analyzeQueryTextSentiment: boolean expected"; + return null; + }; - /** - * Creates a ListSelect message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect} ListSelect - */ - ListSelect.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect(); - if (object.title != null) - message.title = String(object.title); - if (object.items) { - if (!Array.isArray(object.items)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.ListSelect.items: array expected"); - message.items = []; - for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.ListSelect.items: object expected"); - message.items[i] = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.fromObject(object.items[i]); - } - } - if (object.subtitle != null) - message.subtitle = String(object.subtitle); - return message; - }; + /** + * Creates a SentimentAnalysisRequestConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig + */ + SentimentAnalysisRequestConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig(); + if (object.analyzeQueryTextSentiment != null) + message.analyzeQueryTextSentiment = Boolean(object.analyzeQueryTextSentiment); + return message; + }; - /** - * Creates a plain object from a ListSelect message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ListSelect} message ListSelect - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSelect.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.items = []; - if (options.defaults) { - object.title = ""; - object.subtitle = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.items && message.items.length) { - object.items = []; - for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.toObject(message.items[j], options); - } - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - object.subtitle = message.subtitle; - return object; - }; + /** + * Creates a plain object from a SentimentAnalysisRequestConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig + * @static + * @param {google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig} message SentimentAnalysisRequestConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SentimentAnalysisRequestConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.analyzeQueryTextSentiment = false; + if (message.analyzeQueryTextSentiment != null && message.hasOwnProperty("analyzeQueryTextSentiment")) + object.analyzeQueryTextSentiment = message.analyzeQueryTextSentiment; + return object; + }; - /** - * Converts this ListSelect to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @instance - * @returns {Object.} JSON object - */ - ListSelect.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this SentimentAnalysisRequestConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig + * @instance + * @returns {Object.} JSON object + */ + SentimentAnalysisRequestConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - ListSelect.Item = (function() { + return SentimentAnalysisRequestConfig; + })(); - /** - * Properties of an Item. - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @interface IItem - * @property {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null} [info] Item info - * @property {string|null} [title] Item title - * @property {string|null} [description] Item description - * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [image] Item image - */ + v2.SentimentAnalysisResult = (function() { - /** - * Constructs a new Item. - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect - * @classdesc Represents an Item. - * @implements IItem - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem=} [properties] Properties to set - */ - function Item(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a SentimentAnalysisResult. + * @memberof google.cloud.dialogflow.v2 + * @interface ISentimentAnalysisResult + * @property {google.cloud.dialogflow.v2.ISentiment|null} [queryTextSentiment] SentimentAnalysisResult queryTextSentiment + */ - /** - * Item info. - * @member {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null|undefined} info - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @instance - */ - Item.prototype.info = null; + /** + * Constructs a new SentimentAnalysisResult. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a SentimentAnalysisResult. + * @implements ISentimentAnalysisResult + * @constructor + * @param {google.cloud.dialogflow.v2.ISentimentAnalysisResult=} [properties] Properties to set + */ + function SentimentAnalysisResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Item title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @instance - */ - Item.prototype.title = ""; + /** + * SentimentAnalysisResult queryTextSentiment. + * @member {google.cloud.dialogflow.v2.ISentiment|null|undefined} queryTextSentiment + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult + * @instance + */ + SentimentAnalysisResult.prototype.queryTextSentiment = null; - /** - * Item description. - * @member {string} description - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @instance - */ - Item.prototype.description = ""; + /** + * Creates a new SentimentAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.v2.ISentimentAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SentimentAnalysisResult} SentimentAnalysisResult instance + */ + SentimentAnalysisResult.create = function create(properties) { + return new SentimentAnalysisResult(properties); + }; - /** - * Item image. - * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} image - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @instance - */ - Item.prototype.image = null; + /** + * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.v2.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryTextSentiment != null && Object.hasOwnProperty.call(message, "queryTextSentiment")) + $root.google.cloud.dialogflow.v2.Sentiment.encode(message.queryTextSentiment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Creates a new Item instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item} Item instance - */ - Item.create = function create(properties) { - return new Item(properties); - }; + /** + * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.v2.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem} message Item message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Item.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.SentimentAnalysisResult} SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SentimentAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.queryTextSentiment = $root.google.cloud.dialogflow.v2.Sentiment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem} message Item message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Item.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.SentimentAnalysisResult} SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an Item message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item} Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Item.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.info = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.decode(reader, reader.uint32()); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a SentimentAnalysisResult message. + * @function verify + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SentimentAnalysisResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryTextSentiment != null && message.hasOwnProperty("queryTextSentiment")) { + var error = $root.google.cloud.dialogflow.v2.Sentiment.verify(message.queryTextSentiment); + if (error) + return "queryTextSentiment." + error; + } + return null; + }; - /** - * Decodes an Item message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item} Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Item.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.SentimentAnalysisResult} SentimentAnalysisResult + */ + SentimentAnalysisResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SentimentAnalysisResult) + return object; + var message = new $root.google.cloud.dialogflow.v2.SentimentAnalysisResult(); + if (object.queryTextSentiment != null) { + if (typeof object.queryTextSentiment !== "object") + throw TypeError(".google.cloud.dialogflow.v2.SentimentAnalysisResult.queryTextSentiment: object expected"); + message.queryTextSentiment = $root.google.cloud.dialogflow.v2.Sentiment.fromObject(object.queryTextSentiment); + } + return message; + }; - /** - * Verifies an Item message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Item.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.info != null && message.hasOwnProperty("info")) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.verify(message.info); - if (error) - return "info." + error; - } - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.image != null && message.hasOwnProperty("image")) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.image); - if (error) - return "image." + error; - } - return null; - }; + /** + * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.v2.SentimentAnalysisResult} message SentimentAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SentimentAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.queryTextSentiment = null; + if (message.queryTextSentiment != null && message.hasOwnProperty("queryTextSentiment")) + object.queryTextSentiment = $root.google.cloud.dialogflow.v2.Sentiment.toObject(message.queryTextSentiment, options); + return object; + }; - /** - * Creates an Item message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item} Item - */ - Item.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item(); - if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.info: object expected"); - message.info = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.fromObject(object.info); - } - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.image: object expected"); - message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.image); - } - return message; - }; + /** + * Converts this SentimentAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + SentimentAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from an Item message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item} message Item - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Item.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.info = null; - object.title = ""; - object.description = ""; - object.image = null; - } - if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.toObject(message.info, options); - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.image != null && message.hasOwnProperty("image")) - object.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.image, options); - return object; - }; + return SentimentAnalysisResult; + })(); - /** - * Converts this Item to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item - * @instance - * @returns {Object.} JSON object - */ - Item.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + v2.Sentiment = (function() { - return Item; - })(); + /** + * Properties of a Sentiment. + * @memberof google.cloud.dialogflow.v2 + * @interface ISentiment + * @property {number|null} [score] Sentiment score + * @property {number|null} [magnitude] Sentiment magnitude + */ - return ListSelect; - })(); + /** + * Constructs a new Sentiment. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a Sentiment. + * @implements ISentiment + * @constructor + * @param {google.cloud.dialogflow.v2.ISentiment=} [properties] Properties to set + */ + function Sentiment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - Message.CarouselSelect = (function() { + /** + * Sentiment score. + * @member {number} score + * @memberof google.cloud.dialogflow.v2.Sentiment + * @instance + */ + Sentiment.prototype.score = 0; - /** - * Properties of a CarouselSelect. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface ICarouselSelect - * @property {Array.|null} [items] CarouselSelect items - */ + /** + * Sentiment magnitude. + * @member {number} magnitude + * @memberof google.cloud.dialogflow.v2.Sentiment + * @instance + */ + Sentiment.prototype.magnitude = 0; - /** - * Constructs a new CarouselSelect. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a CarouselSelect. - * @implements ICarouselSelect - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect=} [properties] Properties to set - */ - function CarouselSelect(properties) { - this.items = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a new Sentiment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Sentiment + * @static + * @param {google.cloud.dialogflow.v2.ISentiment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Sentiment} Sentiment instance + */ + Sentiment.create = function create(properties) { + return new Sentiment(properties); + }; - /** - * CarouselSelect items. - * @member {Array.} items - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect - * @instance - */ - CarouselSelect.prototype.items = $util.emptyArray; + /** + * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.dialogflow.v2.Sentiment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Sentiment + * @static + * @param {google.cloud.dialogflow.v2.ISentiment} message Sentiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sentiment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.magnitude != null && Object.hasOwnProperty.call(message, "magnitude")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.magnitude); + return writer; + }; - /** - * Creates a new CarouselSelect instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect} CarouselSelect instance - */ - CarouselSelect.create = function create(properties) { - return new CarouselSelect(properties); - }; + /** + * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Sentiment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Sentiment + * @static + * @param {google.cloud.dialogflow.v2.ISentiment} message Sentiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sentiment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified CarouselSelect message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect} message CarouselSelect message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CarouselSelect.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.items != null && message.items.length) - for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Decodes a Sentiment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Sentiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Sentiment} Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sentiment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Sentiment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.score = reader.float(); + break; + case 2: + message.magnitude = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified CarouselSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect} message CarouselSelect message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CarouselSelect.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a Sentiment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Sentiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Sentiment} Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sentiment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a CarouselSelect message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect} CarouselSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CarouselSelect.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.items && message.items.length)) - message.items = []; - message.items.push($root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a Sentiment message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Sentiment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sentiment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + if (typeof message.magnitude !== "number") + return "magnitude: number expected"; + return null; + }; - /** - * Decodes a CarouselSelect message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect} CarouselSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CarouselSelect.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Sentiment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Sentiment} Sentiment + */ + Sentiment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Sentiment) + return object; + var message = new $root.google.cloud.dialogflow.v2.Sentiment(); + if (object.score != null) + message.score = Number(object.score); + if (object.magnitude != null) + message.magnitude = Number(object.magnitude); + return message; + }; - /** - * Verifies a CarouselSelect message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CarouselSelect.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!Array.isArray(message.items)) - return "items: array expected"; - for (var i = 0; i < message.items.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.verify(message.items[i]); - if (error) - return "items." + error; - } - } - return null; - }; - - /** - * Creates a CarouselSelect message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect} CarouselSelect - */ - CarouselSelect.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect(); - if (object.items) { - if (!Array.isArray(object.items)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.items: array expected"); - message.items = []; - for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.items: object expected"); - message.items[i] = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.fromObject(object.items[i]); - } - } - return message; - }; + /** + * Creates a plain object from a Sentiment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Sentiment + * @static + * @param {google.cloud.dialogflow.v2.Sentiment} message Sentiment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sentiment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.score = 0; + object.magnitude = 0; + } + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + object.magnitude = options.json && !isFinite(message.magnitude) ? String(message.magnitude) : message.magnitude; + return object; + }; - /** - * Creates a plain object from a CarouselSelect message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect} message CarouselSelect - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CarouselSelect.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.items = []; - if (message.items && message.items.length) { - object.items = []; - for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.toObject(message.items[j], options); - } - return object; - }; + /** + * Converts this Sentiment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Sentiment + * @instance + * @returns {Object.} JSON object + */ + Sentiment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this CarouselSelect to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect - * @instance - * @returns {Object.} JSON object - */ - CarouselSelect.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Sentiment; + })(); - CarouselSelect.Item = (function() { + v2.Contexts = (function() { - /** - * Properties of an Item. - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect - * @interface IItem - * @property {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null} [info] Item info - * @property {string|null} [title] Item title - * @property {string|null} [description] Item description - * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [image] Item image - */ + /** + * Constructs a new Contexts service. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a Contexts + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Contexts(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Constructs a new Item. - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect - * @classdesc Represents an Item. - * @implements IItem - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem=} [properties] Properties to set - */ - function Item(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + (Contexts.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Contexts; - /** - * Item info. - * @member {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null|undefined} info - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @instance - */ - Item.prototype.info = null; + /** + * Creates new Contexts service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2.Contexts + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Contexts} RPC service. Useful where requests and/or responses are streamed. + */ + Contexts.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Item title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @instance - */ - Item.prototype.title = ""; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#listContexts}. + * @memberof google.cloud.dialogflow.v2.Contexts + * @typedef ListContextsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.ListContextsResponse} [response] ListContextsResponse + */ - /** - * Item description. - * @member {string} description - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @instance - */ - Item.prototype.description = ""; + /** + * Calls ListContexts. + * @function listContexts + * @memberof google.cloud.dialogflow.v2.Contexts + * @instance + * @param {google.cloud.dialogflow.v2.IListContextsRequest} request ListContextsRequest message or plain object + * @param {google.cloud.dialogflow.v2.Contexts.ListContextsCallback} callback Node-style callback called with the error, if any, and ListContextsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Contexts.prototype.listContexts = function listContexts(request, callback) { + return this.rpcCall(listContexts, $root.google.cloud.dialogflow.v2.ListContextsRequest, $root.google.cloud.dialogflow.v2.ListContextsResponse, request, callback); + }, "name", { value: "ListContexts" }); - /** - * Item image. - * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} image - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @instance - */ - Item.prototype.image = null; + /** + * Calls ListContexts. + * @function listContexts + * @memberof google.cloud.dialogflow.v2.Contexts + * @instance + * @param {google.cloud.dialogflow.v2.IListContextsRequest} request ListContextsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a new Item instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item} Item instance - */ - Item.create = function create(properties) { - return new Item(properties); - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#getContext}. + * @memberof google.cloud.dialogflow.v2.Contexts + * @typedef GetContextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.Context} [response] Context + */ - /** - * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem} message Item message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Item.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Calls GetContext. + * @function getContext + * @memberof google.cloud.dialogflow.v2.Contexts + * @instance + * @param {google.cloud.dialogflow.v2.IGetContextRequest} request GetContextRequest message or plain object + * @param {google.cloud.dialogflow.v2.Contexts.GetContextCallback} callback Node-style callback called with the error, if any, and Context + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Contexts.prototype.getContext = function getContext(request, callback) { + return this.rpcCall(getContext, $root.google.cloud.dialogflow.v2.GetContextRequest, $root.google.cloud.dialogflow.v2.Context, request, callback); + }, "name", { value: "GetContext" }); - /** - * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem} message Item message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Item.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls GetContext. + * @function getContext + * @memberof google.cloud.dialogflow.v2.Contexts + * @instance + * @param {google.cloud.dialogflow.v2.IGetContextRequest} request GetContextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes an Item message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item} Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Item.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.info = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.decode(reader, reader.uint32()); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#createContext}. + * @memberof google.cloud.dialogflow.v2.Contexts + * @typedef CreateContextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.Context} [response] Context + */ - /** - * Decodes an Item message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item} Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Item.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls CreateContext. + * @function createContext + * @memberof google.cloud.dialogflow.v2.Contexts + * @instance + * @param {google.cloud.dialogflow.v2.ICreateContextRequest} request CreateContextRequest message or plain object + * @param {google.cloud.dialogflow.v2.Contexts.CreateContextCallback} callback Node-style callback called with the error, if any, and Context + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Contexts.prototype.createContext = function createContext(request, callback) { + return this.rpcCall(createContext, $root.google.cloud.dialogflow.v2.CreateContextRequest, $root.google.cloud.dialogflow.v2.Context, request, callback); + }, "name", { value: "CreateContext" }); - /** - * Verifies an Item message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Item.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.info != null && message.hasOwnProperty("info")) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.verify(message.info); - if (error) - return "info." + error; - } - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.image != null && message.hasOwnProperty("image")) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.image); - if (error) - return "image." + error; - } - return null; - }; + /** + * Calls CreateContext. + * @function createContext + * @memberof google.cloud.dialogflow.v2.Contexts + * @instance + * @param {google.cloud.dialogflow.v2.ICreateContextRequest} request CreateContextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates an Item message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item} Item - */ - Item.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item(); - if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.info: object expected"); - message.info = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.fromObject(object.info); - } - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.image: object expected"); - message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.image); - } - return message; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#updateContext}. + * @memberof google.cloud.dialogflow.v2.Contexts + * @typedef UpdateContextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.Context} [response] Context + */ - /** - * Creates a plain object from an Item message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item} message Item - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Item.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.info = null; - object.title = ""; - object.description = ""; - object.image = null; - } - if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.toObject(message.info, options); - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.image != null && message.hasOwnProperty("image")) - object.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.image, options); - return object; - }; + /** + * Calls UpdateContext. + * @function updateContext + * @memberof google.cloud.dialogflow.v2.Contexts + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateContextRequest} request UpdateContextRequest message or plain object + * @param {google.cloud.dialogflow.v2.Contexts.UpdateContextCallback} callback Node-style callback called with the error, if any, and Context + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Contexts.prototype.updateContext = function updateContext(request, callback) { + return this.rpcCall(updateContext, $root.google.cloud.dialogflow.v2.UpdateContextRequest, $root.google.cloud.dialogflow.v2.Context, request, callback); + }, "name", { value: "UpdateContext" }); - /** - * Converts this Item to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item - * @instance - * @returns {Object.} JSON object - */ - Item.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls UpdateContext. + * @function updateContext + * @memberof google.cloud.dialogflow.v2.Contexts + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateContextRequest} request UpdateContextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - return Item; - })(); + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#deleteContext}. + * @memberof google.cloud.dialogflow.v2.Contexts + * @typedef DeleteContextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - return CarouselSelect; - })(); + /** + * Calls DeleteContext. + * @function deleteContext + * @memberof google.cloud.dialogflow.v2.Contexts + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteContextRequest} request DeleteContextRequest message or plain object + * @param {google.cloud.dialogflow.v2.Contexts.DeleteContextCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Contexts.prototype.deleteContext = function deleteContext(request, callback) { + return this.rpcCall(deleteContext, $root.google.cloud.dialogflow.v2.DeleteContextRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteContext" }); - Message.SelectItemInfo = (function() { + /** + * Calls DeleteContext. + * @function deleteContext + * @memberof google.cloud.dialogflow.v2.Contexts + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteContextRequest} request DeleteContextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Properties of a SelectItemInfo. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface ISelectItemInfo - * @property {string|null} [key] SelectItemInfo key - * @property {Array.|null} [synonyms] SelectItemInfo synonyms - */ + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Contexts#deleteAllContexts}. + * @memberof google.cloud.dialogflow.v2.Contexts + * @typedef DeleteAllContextsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * Constructs a new SelectItemInfo. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a SelectItemInfo. - * @implements ISelectItemInfo - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo=} [properties] Properties to set - */ - function SelectItemInfo(properties) { - this.synonyms = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Calls DeleteAllContexts. + * @function deleteAllContexts + * @memberof google.cloud.dialogflow.v2.Contexts + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteAllContextsRequest} request DeleteAllContextsRequest message or plain object + * @param {google.cloud.dialogflow.v2.Contexts.DeleteAllContextsCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Contexts.prototype.deleteAllContexts = function deleteAllContexts(request, callback) { + return this.rpcCall(deleteAllContexts, $root.google.cloud.dialogflow.v2.DeleteAllContextsRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAllContexts" }); - /** - * SelectItemInfo key. - * @member {string} key - * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo - * @instance - */ - SelectItemInfo.prototype.key = ""; + /** + * Calls DeleteAllContexts. + * @function deleteAllContexts + * @memberof google.cloud.dialogflow.v2.Contexts + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteAllContextsRequest} request DeleteAllContextsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * SelectItemInfo synonyms. - * @member {Array.} synonyms - * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo - * @instance - */ - SelectItemInfo.prototype.synonyms = $util.emptyArray; + return Contexts; + })(); - /** - * Creates a new SelectItemInfo instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo} SelectItemInfo instance - */ - SelectItemInfo.create = function create(properties) { - return new SelectItemInfo(properties); - }; + v2.Context = (function() { - /** - * Encodes the specified SelectItemInfo message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo} message SelectItemInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SelectItemInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.synonyms != null && message.synonyms.length) - for (var i = 0; i < message.synonyms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.synonyms[i]); - return writer; - }; + /** + * Properties of a Context. + * @memberof google.cloud.dialogflow.v2 + * @interface IContext + * @property {string|null} [name] Context name + * @property {number|null} [lifespanCount] Context lifespanCount + * @property {google.protobuf.IStruct|null} [parameters] Context parameters + */ - /** - * Encodes the specified SelectItemInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo} message SelectItemInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SelectItemInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new Context. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a Context. + * @implements IContext + * @constructor + * @param {google.cloud.dialogflow.v2.IContext=} [properties] Properties to set + */ + function Context(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a SelectItemInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo} SelectItemInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SelectItemInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - if (!(message.synonyms && message.synonyms.length)) - message.synonyms = []; - message.synonyms.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Context name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.Context + * @instance + */ + Context.prototype.name = ""; - /** - * Decodes a SelectItemInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo} SelectItemInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SelectItemInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Context lifespanCount. + * @member {number} lifespanCount + * @memberof google.cloud.dialogflow.v2.Context + * @instance + */ + Context.prototype.lifespanCount = 0; - /** - * Verifies a SelectItemInfo message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SelectItemInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.synonyms != null && message.hasOwnProperty("synonyms")) { - if (!Array.isArray(message.synonyms)) - return "synonyms: array expected"; - for (var i = 0; i < message.synonyms.length; ++i) - if (!$util.isString(message.synonyms[i])) - return "synonyms: string[] expected"; - } - return null; - }; + /** + * Context parameters. + * @member {google.protobuf.IStruct|null|undefined} parameters + * @memberof google.cloud.dialogflow.v2.Context + * @instance + */ + Context.prototype.parameters = null; - /** - * Creates a SelectItemInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo} SelectItemInfo - */ - SelectItemInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo(); - if (object.key != null) - message.key = String(object.key); - if (object.synonyms) { - if (!Array.isArray(object.synonyms)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.synonyms: array expected"); - message.synonyms = []; - for (var i = 0; i < object.synonyms.length; ++i) - message.synonyms[i] = String(object.synonyms[i]); - } - return message; - }; + /** + * Creates a new Context instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Context + * @static + * @param {google.cloud.dialogflow.v2.IContext=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Context} Context instance + */ + Context.create = function create(properties) { + return new Context(properties); + }; - /** - * Creates a plain object from a SelectItemInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo} message SelectItemInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SelectItemInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.synonyms = []; - if (options.defaults) - object.key = ""; - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.synonyms && message.synonyms.length) { - object.synonyms = []; - for (var j = 0; j < message.synonyms.length; ++j) - object.synonyms[j] = message.synonyms[j]; - } - return object; - }; + /** + * Encodes the specified Context message. Does not implicitly {@link google.cloud.dialogflow.v2.Context.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Context + * @static + * @param {google.cloud.dialogflow.v2.IContext} message Context message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Context.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.lifespanCount != null && Object.hasOwnProperty.call(message, "lifespanCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.lifespanCount); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Converts this SelectItemInfo to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo - * @instance - * @returns {Object.} JSON object - */ - SelectItemInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified Context message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Context.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Context + * @static + * @param {google.cloud.dialogflow.v2.IContext} message Context message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Context.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return SelectItemInfo; - })(); + /** + * Decodes a Context message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Context + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Context} Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Context.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Context(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.lifespanCount = reader.int32(); + break; + case 3: + message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - Message.MediaContent = (function() { + /** + * Decodes a Context message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Context + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Context} Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Context.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of a MediaContent. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface IMediaContent - * @property {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType|null} [mediaType] MediaContent mediaType - * @property {Array.|null} [mediaObjects] MediaContent mediaObjects - */ + /** + * Verifies a Context message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Context + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Context.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.lifespanCount != null && message.hasOwnProperty("lifespanCount")) + if (!$util.isInteger(message.lifespanCount)) + return "lifespanCount: integer expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Struct.verify(message.parameters); + if (error) + return "parameters." + error; + } + return null; + }; - /** - * Constructs a new MediaContent. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a MediaContent. - * @implements IMediaContent - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.IMediaContent=} [properties] Properties to set - */ - function MediaContent(properties) { - this.mediaObjects = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a Context message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Context + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Context} Context + */ + Context.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Context) + return object; + var message = new $root.google.cloud.dialogflow.v2.Context(); + if (object.name != null) + message.name = String(object.name); + if (object.lifespanCount != null) + message.lifespanCount = object.lifespanCount | 0; + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Context.parameters: object expected"); + message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters); + } + return message; + }; - /** - * MediaContent mediaType. - * @member {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType} mediaType - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @instance - */ - MediaContent.prototype.mediaType = 0; + /** + * Creates a plain object from a Context message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Context + * @static + * @param {google.cloud.dialogflow.v2.Context} message Context + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Context.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.lifespanCount = 0; + object.parameters = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.lifespanCount != null && message.hasOwnProperty("lifespanCount")) + object.lifespanCount = message.lifespanCount; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + return object; + }; - /** - * MediaContent mediaObjects. - * @member {Array.} mediaObjects - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @instance - */ - MediaContent.prototype.mediaObjects = $util.emptyArray; + /** + * Converts this Context to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Context + * @instance + * @returns {Object.} JSON object + */ + Context.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new MediaContent instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IMediaContent=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent} MediaContent instance - */ - MediaContent.create = function create(properties) { - return new MediaContent(properties); - }; + return Context; + })(); - /** - * Encodes the specified MediaContent message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IMediaContent} message MediaContent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MediaContent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mediaType != null && Object.hasOwnProperty.call(message, "mediaType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mediaType); - if (message.mediaObjects != null && message.mediaObjects.length) - for (var i = 0; i < message.mediaObjects.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.encode(message.mediaObjects[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + v2.ListContextsRequest = (function() { - /** - * Encodes the specified MediaContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IMediaContent} message MediaContent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MediaContent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a ListContextsRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IListContextsRequest + * @property {string|null} [parent] ListContextsRequest parent + * @property {number|null} [pageSize] ListContextsRequest pageSize + * @property {string|null} [pageToken] ListContextsRequest pageToken + */ - /** - * Decodes a MediaContent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent} MediaContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MediaContent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.mediaType = reader.int32(); - break; - case 2: - if (!(message.mediaObjects && message.mediaObjects.length)) - message.mediaObjects = []; - message.mediaObjects.push($root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new ListContextsRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListContextsRequest. + * @implements IListContextsRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IListContextsRequest=} [properties] Properties to set + */ + function ListContextsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a MediaContent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent} MediaContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MediaContent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ListContextsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @instance + */ + ListContextsRequest.prototype.parent = ""; - /** - * Verifies a MediaContent message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MediaContent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mediaType != null && message.hasOwnProperty("mediaType")) - switch (message.mediaType) { - default: - return "mediaType: enum value expected"; - case 0: - case 1: - break; - } - if (message.mediaObjects != null && message.hasOwnProperty("mediaObjects")) { - if (!Array.isArray(message.mediaObjects)) - return "mediaObjects: array expected"; - for (var i = 0; i < message.mediaObjects.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.verify(message.mediaObjects[i]); - if (error) - return "mediaObjects." + error; - } - } - return null; - }; + /** + * ListContextsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @instance + */ + ListContextsRequest.prototype.pageSize = 0; - /** - * Creates a MediaContent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent} MediaContent - */ - MediaContent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent(); - switch (object.mediaType) { - case "RESPONSE_MEDIA_TYPE_UNSPECIFIED": - case 0: - message.mediaType = 0; - break; - case "AUDIO": - case 1: - message.mediaType = 1; - break; - } - if (object.mediaObjects) { - if (!Array.isArray(object.mediaObjects)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.MediaContent.mediaObjects: array expected"); - message.mediaObjects = []; - for (var i = 0; i < object.mediaObjects.length; ++i) { - if (typeof object.mediaObjects[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.MediaContent.mediaObjects: object expected"); - message.mediaObjects[i] = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.fromObject(object.mediaObjects[i]); - } - } - return message; - }; + /** + * ListContextsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @instance + */ + ListContextsRequest.prototype.pageToken = ""; - /** - * Creates a plain object from a MediaContent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.MediaContent} message MediaContent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MediaContent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mediaObjects = []; - if (options.defaults) - object.mediaType = options.enums === String ? "RESPONSE_MEDIA_TYPE_UNSPECIFIED" : 0; - if (message.mediaType != null && message.hasOwnProperty("mediaType")) - object.mediaType = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType[message.mediaType] : message.mediaType; - if (message.mediaObjects && message.mediaObjects.length) { - object.mediaObjects = []; - for (var j = 0; j < message.mediaObjects.length; ++j) - object.mediaObjects[j] = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.toObject(message.mediaObjects[j], options); - } - return object; - }; + /** + * Creates a new ListContextsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListContextsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListContextsRequest} ListContextsRequest instance + */ + ListContextsRequest.create = function create(properties) { + return new ListContextsRequest(properties); + }; - /** - * Converts this MediaContent to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @instance - * @returns {Object.} JSON object - */ - MediaContent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified ListContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListContextsRequest} message ListContextsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContextsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; - MediaContent.ResponseMediaObject = (function() { + /** + * Encodes the specified ListContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListContextsRequest} message ListContextsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContextsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Properties of a ResponseMediaObject. - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @interface IResponseMediaObject - * @property {string|null} [name] ResponseMediaObject name - * @property {string|null} [description] ResponseMediaObject description - * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [largeImage] ResponseMediaObject largeImage - * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [icon] ResponseMediaObject icon - * @property {string|null} [contentUrl] ResponseMediaObject contentUrl - */ + /** + * Decodes a ListContextsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.ListContextsRequest} ListContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContextsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListContextsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Constructs a new ResponseMediaObject. - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent - * @classdesc Represents a ResponseMediaObject. - * @implements IResponseMediaObject - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject=} [properties] Properties to set - */ - function ResponseMediaObject(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes a ListContextsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.ListContextsRequest} ListContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContextsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ResponseMediaObject name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @instance - */ - ResponseMediaObject.prototype.name = ""; + /** + * Verifies a ListContextsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContextsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; - /** - * ResponseMediaObject description. - * @member {string} description - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @instance - */ - ResponseMediaObject.prototype.description = ""; + /** + * Creates a ListContextsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.ListContextsRequest} ListContextsRequest + */ + ListContextsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListContextsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.ListContextsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; - /** - * ResponseMediaObject largeImage. - * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} largeImage - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @instance - */ - ResponseMediaObject.prototype.largeImage = null; + /** + * Creates a plain object from a ListContextsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @static + * @param {google.cloud.dialogflow.v2.ListContextsRequest} message ListContextsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContextsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; - /** - * ResponseMediaObject icon. - * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} icon - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @instance - */ - ResponseMediaObject.prototype.icon = null; + /** + * Converts this ListContextsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.ListContextsRequest + * @instance + * @returns {Object.} JSON object + */ + ListContextsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ResponseMediaObject contentUrl. - * @member {string} contentUrl - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @instance - */ - ResponseMediaObject.prototype.contentUrl = ""; + return ListContextsRequest; + })(); - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + v2.ListContextsResponse = (function() { - /** - * ResponseMediaObject image. - * @member {"largeImage"|"icon"|undefined} image - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @instance - */ - Object.defineProperty(ResponseMediaObject.prototype, "image", { - get: $util.oneOfGetter($oneOfFields = ["largeImage", "icon"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Properties of a ListContextsResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IListContextsResponse + * @property {Array.|null} [contexts] ListContextsResponse contexts + * @property {string|null} [nextPageToken] ListContextsResponse nextPageToken + */ - /** - * Creates a new ResponseMediaObject instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject instance - */ - ResponseMediaObject.create = function create(properties) { - return new ResponseMediaObject(properties); - }; + /** + * Constructs a new ListContextsResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListContextsResponse. + * @implements IListContextsResponse + * @constructor + * @param {google.cloud.dialogflow.v2.IListContextsResponse=} [properties] Properties to set + */ + function ListContextsResponse(properties) { + this.contexts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified ResponseMediaObject message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject} message ResponseMediaObject message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseMediaObject.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.largeImage != null && Object.hasOwnProperty.call(message, "largeImage")) - $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.largeImage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) - $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.icon, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.contentUrl != null && Object.hasOwnProperty.call(message, "contentUrl")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.contentUrl); - return writer; - }; + /** + * ListContextsResponse contexts. + * @member {Array.} contexts + * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @instance + */ + ListContextsResponse.prototype.contexts = $util.emptyArray; - /** - * Encodes the specified ResponseMediaObject message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject} message ResponseMediaObject message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseMediaObject.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ListContextsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @instance + */ + ListContextsResponse.prototype.nextPageToken = ""; - /** - * Decodes a ResponseMediaObject message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseMediaObject.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.largeImage = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); - break; - case 4: - message.icon = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); - break; - case 5: - message.contentUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a new ListContextsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListContextsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListContextsResponse} ListContextsResponse instance + */ + ListContextsResponse.create = function create(properties) { + return new ListContextsResponse(properties); + }; - /** - * Decodes a ResponseMediaObject message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseMediaObject.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified ListContextsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListContextsResponse} message ListContextsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContextsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contexts != null && message.contexts.length) + for (var i = 0; i < message.contexts.length; ++i) + $root.google.cloud.dialogflow.v2.Context.encode(message.contexts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; - /** - * Verifies a ResponseMediaObject message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseMediaObject.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.largeImage != null && message.hasOwnProperty("largeImage")) { - properties.image = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.largeImage); - if (error) - return "largeImage." + error; - } - } - if (message.icon != null && message.hasOwnProperty("icon")) { - if (properties.image === 1) - return "image: multiple values"; - properties.image = 1; - { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.icon); - if (error) - return "icon." + error; - } - } - if (message.contentUrl != null && message.hasOwnProperty("contentUrl")) - if (!$util.isString(message.contentUrl)) - return "contentUrl: string expected"; - return null; - }; + /** + * Encodes the specified ListContextsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListContextsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListContextsResponse} message ListContextsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContextsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a ResponseMediaObject message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject - */ - ResponseMediaObject.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.largeImage != null) { - if (typeof object.largeImage !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.largeImage: object expected"); - message.largeImage = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.largeImage); - } - if (object.icon != null) { - if (typeof object.icon !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.icon: object expected"); - message.icon = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.icon); - } - if (object.contentUrl != null) - message.contentUrl = String(object.contentUrl); - return message; - }; + /** + * Decodes a ListContextsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.ListContextsResponse} ListContextsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContextsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListContextsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contexts && message.contexts.length)) + message.contexts = []; + message.contexts.push($root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a plain object from a ResponseMediaObject message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject} message ResponseMediaObject - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseMediaObject.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.contentUrl = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.largeImage != null && message.hasOwnProperty("largeImage")) { - object.largeImage = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.largeImage, options); - if (options.oneofs) - object.image = "largeImage"; - } - if (message.icon != null && message.hasOwnProperty("icon")) { - object.icon = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.icon, options); - if (options.oneofs) - object.image = "icon"; - } - if (message.contentUrl != null && message.hasOwnProperty("contentUrl")) - object.contentUrl = message.contentUrl; - return object; - }; + /** + * Decodes a ListContextsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.ListContextsResponse} ListContextsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContextsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this ResponseMediaObject to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject - * @instance - * @returns {Object.} JSON object - */ - ResponseMediaObject.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a ListContextsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContextsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contexts != null && message.hasOwnProperty("contexts")) { + if (!Array.isArray(message.contexts)) + return "contexts: array expected"; + for (var i = 0; i < message.contexts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Context.verify(message.contexts[i]); + if (error) + return "contexts." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - return ResponseMediaObject; - })(); + /** + * Creates a ListContextsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.ListContextsResponse} ListContextsResponse + */ + ListContextsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListContextsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2.ListContextsResponse(); + if (object.contexts) { + if (!Array.isArray(object.contexts)) + throw TypeError(".google.cloud.dialogflow.v2.ListContextsResponse.contexts: array expected"); + message.contexts = []; + for (var i = 0; i < object.contexts.length; ++i) { + if (typeof object.contexts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListContextsResponse.contexts: object expected"); + message.contexts[i] = $root.google.cloud.dialogflow.v2.Context.fromObject(object.contexts[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * ResponseMediaType enum. - * @name google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType - * @enum {number} - * @property {number} RESPONSE_MEDIA_TYPE_UNSPECIFIED=0 RESPONSE_MEDIA_TYPE_UNSPECIFIED value - * @property {number} AUDIO=1 AUDIO value - */ - MediaContent.ResponseMediaType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESPONSE_MEDIA_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUDIO"] = 1; - return values; - })(); + /** + * Creates a plain object from a ListContextsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @static + * @param {google.cloud.dialogflow.v2.ListContextsResponse} message ListContextsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContextsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contexts = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.contexts && message.contexts.length) { + object.contexts = []; + for (var j = 0; j < message.contexts.length; ++j) + object.contexts[j] = $root.google.cloud.dialogflow.v2.Context.toObject(message.contexts[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - return MediaContent; - })(); + /** + * Converts this ListContextsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.ListContextsResponse + * @instance + * @returns {Object.} JSON object + */ + ListContextsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - Message.BrowseCarouselCard = (function() { + return ListContextsResponse; + })(); - /** - * Properties of a BrowseCarouselCard. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface IBrowseCarouselCard - * @property {Array.|null} [items] BrowseCarouselCard items - * @property {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|null} [imageDisplayOptions] BrowseCarouselCard imageDisplayOptions - */ + v2.GetContextRequest = (function() { - /** - * Constructs a new BrowseCarouselCard. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a BrowseCarouselCard. - * @implements IBrowseCarouselCard - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard=} [properties] Properties to set - */ - function BrowseCarouselCard(properties) { - this.items = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a GetContextRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IGetContextRequest + * @property {string|null} [name] GetContextRequest name + */ - /** - * BrowseCarouselCard items. - * @member {Array.} items - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @instance - */ - BrowseCarouselCard.prototype.items = $util.emptyArray; + /** + * Constructs a new GetContextRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a GetContextRequest. + * @implements IGetContextRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IGetContextRequest=} [properties] Properties to set + */ + function GetContextRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * BrowseCarouselCard imageDisplayOptions. - * @member {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions} imageDisplayOptions - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @instance - */ - BrowseCarouselCard.prototype.imageDisplayOptions = 0; + /** + * GetContextRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @instance + */ + GetContextRequest.prototype.name = ""; - /** - * Creates a new BrowseCarouselCard instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard} BrowseCarouselCard instance - */ - BrowseCarouselCard.create = function create(properties) { - return new BrowseCarouselCard(properties); - }; + /** + * Creates a new GetContextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @static + * @param {google.cloud.dialogflow.v2.IGetContextRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.GetContextRequest} GetContextRequest instance + */ + GetContextRequest.create = function create(properties) { + return new GetContextRequest(properties); + }; - /** - * Encodes the specified BrowseCarouselCard message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard} message BrowseCarouselCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BrowseCarouselCard.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.items != null && message.items.length) - for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.imageDisplayOptions != null && Object.hasOwnProperty.call(message, "imageDisplayOptions")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.imageDisplayOptions); - return writer; - }; - - /** - * Encodes the specified BrowseCarouselCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard} message BrowseCarouselCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BrowseCarouselCard.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BrowseCarouselCard message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard} BrowseCarouselCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BrowseCarouselCard.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.items && message.items.length)) - message.items = []; - message.items.push($root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.decode(reader, reader.uint32())); - break; - case 2: - message.imageDisplayOptions = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified GetContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetContextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @static + * @param {google.cloud.dialogflow.v2.IGetContextRequest} message GetContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * Decodes a BrowseCarouselCard message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard} BrowseCarouselCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BrowseCarouselCard.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified GetContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetContextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @static + * @param {google.cloud.dialogflow.v2.IGetContextRequest} message GetContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a BrowseCarouselCard message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BrowseCarouselCard.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!Array.isArray(message.items)) - return "items: array expected"; - for (var i = 0; i < message.items.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify(message.items[i]); - if (error) - return "items." + error; - } - } - if (message.imageDisplayOptions != null && message.hasOwnProperty("imageDisplayOptions")) - switch (message.imageDisplayOptions) { - default: - return "imageDisplayOptions: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; + /** + * Decodes a GetContextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.GetContextRequest} GetContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetContextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a BrowseCarouselCard message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard} BrowseCarouselCard - */ - BrowseCarouselCard.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard(); - if (object.items) { - if (!Array.isArray(object.items)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items: array expected"); - message.items = []; - for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items: object expected"); - message.items[i] = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.fromObject(object.items[i]); - } - } - switch (object.imageDisplayOptions) { - case "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED": - case 0: - message.imageDisplayOptions = 0; - break; - case "GRAY": - case 1: - message.imageDisplayOptions = 1; - break; - case "WHITE": - case 2: - message.imageDisplayOptions = 2; - break; - case "CROPPED": - case 3: - message.imageDisplayOptions = 3; - break; - case "BLURRED_BACKGROUND": - case 4: - message.imageDisplayOptions = 4; - break; - } - return message; - }; + /** + * Decodes a GetContextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.GetContextRequest} GetContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a BrowseCarouselCard message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard} message BrowseCarouselCard - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BrowseCarouselCard.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.items = []; - if (options.defaults) - object.imageDisplayOptions = options.enums === String ? "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED" : 0; - if (message.items && message.items.length) { - object.items = []; - for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.toObject(message.items[j], options); - } - if (message.imageDisplayOptions != null && message.hasOwnProperty("imageDisplayOptions")) - object.imageDisplayOptions = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions[message.imageDisplayOptions] : message.imageDisplayOptions; - return object; - }; + /** + * Verifies a GetContextRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Converts this BrowseCarouselCard to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @instance - * @returns {Object.} JSON object - */ - BrowseCarouselCard.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a GetContextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.GetContextRequest} GetContextRequest + */ + GetContextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.GetContextRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.GetContextRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - BrowseCarouselCard.BrowseCarouselCardItem = (function() { + /** + * Creates a plain object from a GetContextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @static + * @param {google.cloud.dialogflow.v2.GetContextRequest} message GetContextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Properties of a BrowseCarouselCardItem. - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @interface IBrowseCarouselCardItem - * @property {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null} [openUriAction] BrowseCarouselCardItem openUriAction - * @property {string|null} [title] BrowseCarouselCardItem title - * @property {string|null} [description] BrowseCarouselCardItem description - * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [image] BrowseCarouselCardItem image - * @property {string|null} [footer] BrowseCarouselCardItem footer - */ + /** + * Converts this GetContextRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.GetContextRequest + * @instance + * @returns {Object.} JSON object + */ + GetContextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new BrowseCarouselCardItem. - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard - * @classdesc Represents a BrowseCarouselCardItem. - * @implements IBrowseCarouselCardItem - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem=} [properties] Properties to set - */ - function BrowseCarouselCardItem(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return GetContextRequest; + })(); - /** - * BrowseCarouselCardItem openUriAction. - * @member {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null|undefined} openUriAction - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @instance - */ - BrowseCarouselCardItem.prototype.openUriAction = null; + v2.CreateContextRequest = (function() { - /** - * BrowseCarouselCardItem title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @instance - */ - BrowseCarouselCardItem.prototype.title = ""; + /** + * Properties of a CreateContextRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface ICreateContextRequest + * @property {string|null} [parent] CreateContextRequest parent + * @property {google.cloud.dialogflow.v2.IContext|null} [context] CreateContextRequest context + */ - /** - * BrowseCarouselCardItem description. - * @member {string} description - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @instance - */ - BrowseCarouselCardItem.prototype.description = ""; + /** + * Constructs a new CreateContextRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a CreateContextRequest. + * @implements ICreateContextRequest + * @constructor + * @param {google.cloud.dialogflow.v2.ICreateContextRequest=} [properties] Properties to set + */ + function CreateContextRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * BrowseCarouselCardItem image. - * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} image - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @instance - */ - BrowseCarouselCardItem.prototype.image = null; + /** + * CreateContextRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @instance + */ + CreateContextRequest.prototype.parent = ""; - /** - * BrowseCarouselCardItem footer. - * @member {string} footer - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @instance - */ - BrowseCarouselCardItem.prototype.footer = ""; + /** + * CreateContextRequest context. + * @member {google.cloud.dialogflow.v2.IContext|null|undefined} context + * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @instance + */ + CreateContextRequest.prototype.context = null; - /** - * Creates a new BrowseCarouselCardItem instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem instance - */ - BrowseCarouselCardItem.create = function create(properties) { - return new BrowseCarouselCardItem(properties); - }; + /** + * Creates a new CreateContextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @static + * @param {google.cloud.dialogflow.v2.ICreateContextRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CreateContextRequest} CreateContextRequest instance + */ + CreateContextRequest.create = function create(properties) { + return new CreateContextRequest(properties); + }; - /** - * Encodes the specified BrowseCarouselCardItem message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem} message BrowseCarouselCardItem message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BrowseCarouselCardItem.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.openUriAction != null && Object.hasOwnProperty.call(message, "openUriAction")) - $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.encode(message.openUriAction, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.footer != null && Object.hasOwnProperty.call(message, "footer")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.footer); - return writer; - }; + /** + * Encodes the specified CreateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateContextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @static + * @param {google.cloud.dialogflow.v2.ICreateContextRequest} message CreateContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateContextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.google.cloud.dialogflow.v2.Context.encode(message.context, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified BrowseCarouselCardItem message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem} message BrowseCarouselCardItem message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BrowseCarouselCardItem.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified CreateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateContextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @static + * @param {google.cloud.dialogflow.v2.ICreateContextRequest} message CreateContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a BrowseCarouselCardItem message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BrowseCarouselCardItem.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.openUriAction = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.decode(reader, reader.uint32()); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); - break; - case 5: - message.footer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a CreateContextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.CreateContextRequest} CreateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateContextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateContextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.context = $root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a BrowseCarouselCardItem message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BrowseCarouselCardItem.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a CreateContextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.CreateContextRequest} CreateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateContextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a BrowseCarouselCardItem message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BrowseCarouselCardItem.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify(message.openUriAction); - if (error) - return "openUriAction." + error; - } - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.image != null && message.hasOwnProperty("image")) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.image); - if (error) - return "image." + error; - } - if (message.footer != null && message.hasOwnProperty("footer")) - if (!$util.isString(message.footer)) - return "footer: string expected"; - return null; - }; + /** + * Verifies a CreateContextRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateContextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.google.cloud.dialogflow.v2.Context.verify(message.context); + if (error) + return "context." + error; + } + return null; + }; - /** - * Creates a BrowseCarouselCardItem message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem - */ - BrowseCarouselCardItem.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem(); - if (object.openUriAction != null) { - if (typeof object.openUriAction !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.openUriAction: object expected"); - message.openUriAction = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.fromObject(object.openUriAction); - } - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.image: object expected"); - message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.image); - } - if (object.footer != null) - message.footer = String(object.footer); - return message; - }; + /** + * Creates a CreateContextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.CreateContextRequest} CreateContextRequest + */ + CreateContextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CreateContextRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.CreateContextRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".google.cloud.dialogflow.v2.CreateContextRequest.context: object expected"); + message.context = $root.google.cloud.dialogflow.v2.Context.fromObject(object.context); + } + return message; + }; - /** - * Creates a plain object from a BrowseCarouselCardItem message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} message BrowseCarouselCardItem - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BrowseCarouselCardItem.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.openUriAction = null; - object.title = ""; - object.description = ""; - object.image = null; - object.footer = ""; - } - if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) - object.openUriAction = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.toObject(message.openUriAction, options); - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.image != null && message.hasOwnProperty("image")) - object.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.image, options); - if (message.footer != null && message.hasOwnProperty("footer")) - object.footer = message.footer; - return object; - }; + /** + * Creates a plain object from a CreateContextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @static + * @param {google.cloud.dialogflow.v2.CreateContextRequest} message CreateContextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateContextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.context = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.google.cloud.dialogflow.v2.Context.toObject(message.context, options); + return object; + }; - /** - * Converts this BrowseCarouselCardItem to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @instance - * @returns {Object.} JSON object - */ - BrowseCarouselCardItem.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this CreateContextRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.CreateContextRequest + * @instance + * @returns {Object.} JSON object + */ + CreateContextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - BrowseCarouselCardItem.OpenUrlAction = (function() { + return CreateContextRequest; + })(); - /** - * Properties of an OpenUrlAction. - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @interface IOpenUrlAction - * @property {string|null} [url] OpenUrlAction url - * @property {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|null} [urlTypeHint] OpenUrlAction urlTypeHint - */ + v2.UpdateContextRequest = (function() { - /** - * Constructs a new OpenUrlAction. - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @classdesc Represents an OpenUrlAction. - * @implements IOpenUrlAction - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction=} [properties] Properties to set - */ - function OpenUrlAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an UpdateContextRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IUpdateContextRequest + * @property {google.cloud.dialogflow.v2.IContext|null} [context] UpdateContextRequest context + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateContextRequest updateMask + */ - /** - * OpenUrlAction url. - * @member {string} url - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @instance - */ - OpenUrlAction.prototype.url = ""; + /** + * Constructs a new UpdateContextRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an UpdateContextRequest. + * @implements IUpdateContextRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IUpdateContextRequest=} [properties] Properties to set + */ + function UpdateContextRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * OpenUrlAction urlTypeHint. - * @member {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint} urlTypeHint - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @instance - */ - OpenUrlAction.prototype.urlTypeHint = 0; + /** + * UpdateContextRequest context. + * @member {google.cloud.dialogflow.v2.IContext|null|undefined} context + * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @instance + */ + UpdateContextRequest.prototype.context = null; - /** - * Creates a new OpenUrlAction instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction instance - */ - OpenUrlAction.create = function create(properties) { - return new OpenUrlAction(properties); - }; + /** + * UpdateContextRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @instance + */ + UpdateContextRequest.prototype.updateMask = null; - /** - * Encodes the specified OpenUrlAction message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction} message OpenUrlAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenUrlAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); - if (message.urlTypeHint != null && Object.hasOwnProperty.call(message, "urlTypeHint")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.urlTypeHint); - return writer; - }; + /** + * Creates a new UpdateContextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @static + * @param {google.cloud.dialogflow.v2.IUpdateContextRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.UpdateContextRequest} UpdateContextRequest instance + */ + UpdateContextRequest.create = function create(properties) { + return new UpdateContextRequest(properties); + }; - /** - * Encodes the specified OpenUrlAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction} message OpenUrlAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenUrlAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified UpdateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateContextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @static + * @param {google.cloud.dialogflow.v2.IUpdateContextRequest} message UpdateContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateContextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.google.cloud.dialogflow.v2.Context.encode(message.context, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Decodes an OpenUrlAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenUrlAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.url = reader.string(); - break; - case 3: - message.urlTypeHint = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified UpdateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateContextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @static + * @param {google.cloud.dialogflow.v2.IUpdateContextRequest} message UpdateContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes an OpenUrlAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenUrlAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an UpdateContextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.UpdateContextRequest} UpdateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateContextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateContextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.context = $root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Verifies an OpenUrlAction message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OpenUrlAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.urlTypeHint != null && message.hasOwnProperty("urlTypeHint")) - switch (message.urlTypeHint) { - default: - return "urlTypeHint: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; + /** + * Decodes an UpdateContextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.UpdateContextRequest} UpdateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateContextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates an OpenUrlAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction - */ - OpenUrlAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction(); - if (object.url != null) - message.url = String(object.url); - switch (object.urlTypeHint) { - case "URL_TYPE_HINT_UNSPECIFIED": - case 0: - message.urlTypeHint = 0; - break; - case "AMP_ACTION": - case 1: - message.urlTypeHint = 1; - break; - case "AMP_CONTENT": - case 2: - message.urlTypeHint = 2; - break; - } - return message; - }; + /** + * Verifies an UpdateContextRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateContextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.google.cloud.dialogflow.v2.Context.verify(message.context); + if (error) + return "context." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; - /** - * Creates a plain object from an OpenUrlAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} message OpenUrlAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OpenUrlAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.url = ""; - object.urlTypeHint = options.enums === String ? "URL_TYPE_HINT_UNSPECIFIED" : 0; - } - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.urlTypeHint != null && message.hasOwnProperty("urlTypeHint")) - object.urlTypeHint = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint[message.urlTypeHint] : message.urlTypeHint; - return object; - }; + /** + * Creates an UpdateContextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.UpdateContextRequest} UpdateContextRequest + */ + UpdateContextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.UpdateContextRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.UpdateContextRequest(); + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateContextRequest.context: object expected"); + message.context = $root.google.cloud.dialogflow.v2.Context.fromObject(object.context); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateContextRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; - /** - * Converts this OpenUrlAction to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @instance - * @returns {Object.} JSON object - */ - OpenUrlAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an UpdateContextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @static + * @param {google.cloud.dialogflow.v2.UpdateContextRequest} message UpdateContextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateContextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.context = null; + object.updateMask = null; + } + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.google.cloud.dialogflow.v2.Context.toObject(message.context, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; - /** - * UrlTypeHint enum. - * @name google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint - * @enum {number} - * @property {number} URL_TYPE_HINT_UNSPECIFIED=0 URL_TYPE_HINT_UNSPECIFIED value - * @property {number} AMP_ACTION=1 AMP_ACTION value - * @property {number} AMP_CONTENT=2 AMP_CONTENT value - */ - OpenUrlAction.UrlTypeHint = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "URL_TYPE_HINT_UNSPECIFIED"] = 0; - values[valuesById[1] = "AMP_ACTION"] = 1; - values[valuesById[2] = "AMP_CONTENT"] = 2; - return values; - })(); + /** + * Converts this UpdateContextRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.UpdateContextRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateContextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return OpenUrlAction; - })(); + return UpdateContextRequest; + })(); - return BrowseCarouselCardItem; - })(); + v2.DeleteContextRequest = (function() { - /** - * ImageDisplayOptions enum. - * @name google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions - * @enum {number} - * @property {number} IMAGE_DISPLAY_OPTIONS_UNSPECIFIED=0 IMAGE_DISPLAY_OPTIONS_UNSPECIFIED value - * @property {number} GRAY=1 GRAY value - * @property {number} WHITE=2 WHITE value - * @property {number} CROPPED=3 CROPPED value - * @property {number} BLURRED_BACKGROUND=4 BLURRED_BACKGROUND value - */ - BrowseCarouselCard.ImageDisplayOptions = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED"] = 0; - values[valuesById[1] = "GRAY"] = 1; - values[valuesById[2] = "WHITE"] = 2; - values[valuesById[3] = "CROPPED"] = 3; - values[valuesById[4] = "BLURRED_BACKGROUND"] = 4; - return values; - })(); + /** + * Properties of a DeleteContextRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IDeleteContextRequest + * @property {string|null} [name] DeleteContextRequest name + */ - return BrowseCarouselCard; - })(); + /** + * Constructs a new DeleteContextRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a DeleteContextRequest. + * @implements IDeleteContextRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IDeleteContextRequest=} [properties] Properties to set + */ + function DeleteContextRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - Message.TableCard = (function() { + /** + * DeleteContextRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @instance + */ + DeleteContextRequest.prototype.name = ""; - /** - * Properties of a TableCard. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface ITableCard - * @property {string|null} [title] TableCard title - * @property {string|null} [subtitle] TableCard subtitle - * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [image] TableCard image - * @property {Array.|null} [columnProperties] TableCard columnProperties - * @property {Array.|null} [rows] TableCard rows - * @property {Array.|null} [buttons] TableCard buttons - */ + /** + * Creates a new DeleteContextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteContextRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.DeleteContextRequest} DeleteContextRequest instance + */ + DeleteContextRequest.create = function create(properties) { + return new DeleteContextRequest(properties); + }; - /** - * Constructs a new TableCard. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a TableCard. - * @implements ITableCard - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCard=} [properties] Properties to set - */ - function TableCard(properties) { - this.columnProperties = []; - this.rows = []; - this.buttons = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Encodes the specified DeleteContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteContextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteContextRequest} message DeleteContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteContextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteContextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteContextRequest} message DeleteContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteContextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.DeleteContextRequest} DeleteContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteContextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteContextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * TableCard title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @instance - */ - TableCard.prototype.title = ""; + /** + * Decodes a DeleteContextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.DeleteContextRequest} DeleteContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteContextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * TableCard subtitle. - * @member {string} subtitle - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @instance - */ - TableCard.prototype.subtitle = ""; + /** + * Verifies a DeleteContextRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteContextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * TableCard image. - * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} image - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @instance - */ - TableCard.prototype.image = null; + /** + * Creates a DeleteContextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.DeleteContextRequest} DeleteContextRequest + */ + DeleteContextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.DeleteContextRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.DeleteContextRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * TableCard columnProperties. - * @member {Array.} columnProperties - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @instance - */ - TableCard.prototype.columnProperties = $util.emptyArray; + /** + * Creates a plain object from a DeleteContextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @static + * @param {google.cloud.dialogflow.v2.DeleteContextRequest} message DeleteContextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteContextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * TableCard rows. - * @member {Array.} rows - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @instance - */ - TableCard.prototype.rows = $util.emptyArray; + /** + * Converts this DeleteContextRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.DeleteContextRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteContextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * TableCard buttons. - * @member {Array.} buttons - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @instance - */ - TableCard.prototype.buttons = $util.emptyArray; + return DeleteContextRequest; + })(); - /** - * Creates a new TableCard instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCard=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCard} TableCard instance - */ - TableCard.create = function create(properties) { - return new TableCard(properties); - }; + v2.DeleteAllContextsRequest = (function() { - /** - * Encodes the specified TableCard message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCard.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCard} message TableCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCard.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.image, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.columnProperties != null && message.columnProperties.length) - for (var i = 0; i < message.columnProperties.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.encode(message.columnProperties[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.rows != null && message.rows.length) - for (var i = 0; i < message.rows.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow.encode(message.rows[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.buttons != null && message.buttons.length) - for (var i = 0; i < message.buttons.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.encode(message.buttons[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; + /** + * Properties of a DeleteAllContextsRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IDeleteAllContextsRequest + * @property {string|null} [parent] DeleteAllContextsRequest parent + */ - /** - * Encodes the specified TableCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCard.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCard} message TableCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCard.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new DeleteAllContextsRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a DeleteAllContextsRequest. + * @implements IDeleteAllContextsRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IDeleteAllContextsRequest=} [properties] Properties to set + */ + function DeleteAllContextsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a TableCard message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCard} TableCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCard.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.TableCard(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.subtitle = reader.string(); - break; - case 3: - message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.columnProperties && message.columnProperties.length)) - message.columnProperties = []; - message.columnProperties.push($root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.rows && message.rows.length)) - message.rows = []; - message.rows.push($root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.buttons && message.buttons.length)) - message.buttons = []; - message.buttons.push($root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * DeleteAllContextsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @instance + */ + DeleteAllContextsRequest.prototype.parent = ""; - /** - * Decodes a TableCard message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCard} TableCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCard.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new DeleteAllContextsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteAllContextsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.DeleteAllContextsRequest} DeleteAllContextsRequest instance + */ + DeleteAllContextsRequest.create = function create(properties) { + return new DeleteAllContextsRequest(properties); + }; - /** - * Verifies a TableCard message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TableCard.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - if (!$util.isString(message.subtitle)) - return "subtitle: string expected"; - if (message.image != null && message.hasOwnProperty("image")) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.image); - if (error) - return "image." + error; - } - if (message.columnProperties != null && message.hasOwnProperty("columnProperties")) { - if (!Array.isArray(message.columnProperties)) - return "columnProperties: array expected"; - for (var i = 0; i < message.columnProperties.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.verify(message.columnProperties[i]); - if (error) - return "columnProperties." + error; - } - } - if (message.rows != null && message.hasOwnProperty("rows")) { - if (!Array.isArray(message.rows)) - return "rows: array expected"; - for (var i = 0; i < message.rows.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow.verify(message.rows[i]); - if (error) - return "rows." + error; - } - } - if (message.buttons != null && message.hasOwnProperty("buttons")) { - if (!Array.isArray(message.buttons)) - return "buttons: array expected"; - for (var i = 0; i < message.buttons.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.verify(message.buttons[i]); - if (error) - return "buttons." + error; - } - } - return null; - }; + /** + * Encodes the specified DeleteAllContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteAllContextsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteAllContextsRequest} message DeleteAllContextsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAllContextsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; - /** - * Creates a TableCard message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCard} TableCard - */ - TableCard.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.TableCard) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.TableCard(); - if (object.title != null) - message.title = String(object.title); - if (object.subtitle != null) - message.subtitle = String(object.subtitle); - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.image: object expected"); - message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.image); - } - if (object.columnProperties) { - if (!Array.isArray(object.columnProperties)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.columnProperties: array expected"); - message.columnProperties = []; - for (var i = 0; i < object.columnProperties.length; ++i) { - if (typeof object.columnProperties[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.columnProperties: object expected"); - message.columnProperties[i] = $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.fromObject(object.columnProperties[i]); - } - } - if (object.rows) { - if (!Array.isArray(object.rows)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.rows: array expected"); - message.rows = []; - for (var i = 0; i < object.rows.length; ++i) { - if (typeof object.rows[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.rows: object expected"); - message.rows[i] = $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow.fromObject(object.rows[i]); - } - } - if (object.buttons) { - if (!Array.isArray(object.buttons)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.buttons: array expected"); - message.buttons = []; - for (var i = 0; i < object.buttons.length; ++i) { - if (typeof object.buttons[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.buttons: object expected"); - message.buttons[i] = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.fromObject(object.buttons[i]); - } - } - return message; - }; + /** + * Encodes the specified DeleteAllContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteAllContextsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteAllContextsRequest} message DeleteAllContextsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAllContextsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a TableCard message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.TableCard} message TableCard - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TableCard.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.columnProperties = []; - object.rows = []; - object.buttons = []; - } - if (options.defaults) { - object.title = ""; - object.subtitle = ""; - object.image = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - object.subtitle = message.subtitle; - if (message.image != null && message.hasOwnProperty("image")) - object.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.image, options); - if (message.columnProperties && message.columnProperties.length) { - object.columnProperties = []; - for (var j = 0; j < message.columnProperties.length; ++j) - object.columnProperties[j] = $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.toObject(message.columnProperties[j], options); - } - if (message.rows && message.rows.length) { - object.rows = []; - for (var j = 0; j < message.rows.length; ++j) - object.rows[j] = $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow.toObject(message.rows[j], options); - } - if (message.buttons && message.buttons.length) { - object.buttons = []; - for (var j = 0; j < message.buttons.length; ++j) - object.buttons[j] = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.toObject(message.buttons[j], options); - } - return object; - }; + /** + * Decodes a DeleteAllContextsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.DeleteAllContextsRequest} DeleteAllContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAllContextsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteAllContextsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this TableCard to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard - * @instance - * @returns {Object.} JSON object - */ - TableCard.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a DeleteAllContextsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.DeleteAllContextsRequest} DeleteAllContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAllContextsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return TableCard; - })(); + /** + * Verifies a DeleteAllContextsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAllContextsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; - Message.ColumnProperties = (function() { + /** + * Creates a DeleteAllContextsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.DeleteAllContextsRequest} DeleteAllContextsRequest + */ + DeleteAllContextsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.DeleteAllContextsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.DeleteAllContextsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; - /** - * Properties of a ColumnProperties. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface IColumnProperties - * @property {string|null} [header] ColumnProperties header - * @property {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment|null} [horizontalAlignment] ColumnProperties horizontalAlignment - */ + /** + * Creates a plain object from a DeleteAllContextsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @static + * @param {google.cloud.dialogflow.v2.DeleteAllContextsRequest} message DeleteAllContextsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAllContextsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; - /** - * Constructs a new ColumnProperties. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a ColumnProperties. - * @implements IColumnProperties - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.IColumnProperties=} [properties] Properties to set - */ - function ColumnProperties(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Converts this DeleteAllContextsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.DeleteAllContextsRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAllContextsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * ColumnProperties header. - * @member {string} header - * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties - * @instance - */ - ColumnProperties.prototype.header = ""; + return DeleteAllContextsRequest; + })(); - /** - * ColumnProperties horizontalAlignment. - * @member {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment} horizontalAlignment - * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties - * @instance - */ - ColumnProperties.prototype.horizontalAlignment = 0; + v2.Intents = (function() { - /** - * Creates a new ColumnProperties instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IColumnProperties=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties} ColumnProperties instance - */ - ColumnProperties.create = function create(properties) { - return new ColumnProperties(properties); - }; + /** + * Constructs a new Intents service. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an Intents + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Intents(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Encodes the specified ColumnProperties message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IColumnProperties} message ColumnProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ColumnProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.header); - if (message.horizontalAlignment != null && Object.hasOwnProperty.call(message, "horizontalAlignment")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.horizontalAlignment); - return writer; - }; + (Intents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Intents; - /** - * Encodes the specified ColumnProperties message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.IColumnProperties} message ColumnProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ColumnProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates new Intents service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2.Intents + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Intents} RPC service. Useful where requests and/or responses are streamed. + */ + Intents.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Decodes a ColumnProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties} ColumnProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ColumnProperties.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.header = reader.string(); - break; - case 2: - message.horizontalAlignment = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#listIntents}. + * @memberof google.cloud.dialogflow.v2.Intents + * @typedef ListIntentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.ListIntentsResponse} [response] ListIntentsResponse + */ - /** - * Decodes a ColumnProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties} ColumnProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ColumnProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls ListIntents. + * @function listIntents + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.IListIntentsRequest} request ListIntentsRequest message or plain object + * @param {google.cloud.dialogflow.v2.Intents.ListIntentsCallback} callback Node-style callback called with the error, if any, and ListIntentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.listIntents = function listIntents(request, callback) { + return this.rpcCall(listIntents, $root.google.cloud.dialogflow.v2.ListIntentsRequest, $root.google.cloud.dialogflow.v2.ListIntentsResponse, request, callback); + }, "name", { value: "ListIntents" }); - /** - * Verifies a ColumnProperties message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ColumnProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.header != null && message.hasOwnProperty("header")) - if (!$util.isString(message.header)) - return "header: string expected"; - if (message.horizontalAlignment != null && message.hasOwnProperty("horizontalAlignment")) - switch (message.horizontalAlignment) { - default: - return "horizontalAlignment: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; + /** + * Calls ListIntents. + * @function listIntents + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.IListIntentsRequest} request ListIntentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a ColumnProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties} ColumnProperties - */ - ColumnProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties(); - if (object.header != null) - message.header = String(object.header); - switch (object.horizontalAlignment) { - case "HORIZONTAL_ALIGNMENT_UNSPECIFIED": - case 0: - message.horizontalAlignment = 0; - break; - case "LEADING": - case 1: - message.horizontalAlignment = 1; - break; - case "CENTER": - case 2: - message.horizontalAlignment = 2; - break; - case "TRAILING": - case 3: - message.horizontalAlignment = 3; - break; - } - return message; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#getIntent}. + * @memberof google.cloud.dialogflow.v2.Intents + * @typedef GetIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.Intent} [response] Intent + */ - /** - * Creates a plain object from a ColumnProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties} message ColumnProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ColumnProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.header = ""; - object.horizontalAlignment = options.enums === String ? "HORIZONTAL_ALIGNMENT_UNSPECIFIED" : 0; - } - if (message.header != null && message.hasOwnProperty("header")) - object.header = message.header; - if (message.horizontalAlignment != null && message.hasOwnProperty("horizontalAlignment")) - object.horizontalAlignment = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment[message.horizontalAlignment] : message.horizontalAlignment; - return object; - }; + /** + * Calls GetIntent. + * @function getIntent + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.IGetIntentRequest} request GetIntentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Intents.GetIntentCallback} callback Node-style callback called with the error, if any, and Intent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.getIntent = function getIntent(request, callback) { + return this.rpcCall(getIntent, $root.google.cloud.dialogflow.v2.GetIntentRequest, $root.google.cloud.dialogflow.v2.Intent, request, callback); + }, "name", { value: "GetIntent" }); - /** - * Converts this ColumnProperties to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties - * @instance - * @returns {Object.} JSON object - */ - ColumnProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls GetIntent. + * @function getIntent + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.IGetIntentRequest} request GetIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * HorizontalAlignment enum. - * @name google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment - * @enum {number} - * @property {number} HORIZONTAL_ALIGNMENT_UNSPECIFIED=0 HORIZONTAL_ALIGNMENT_UNSPECIFIED value - * @property {number} LEADING=1 LEADING value - * @property {number} CENTER=2 CENTER value - * @property {number} TRAILING=3 TRAILING value - */ - ColumnProperties.HorizontalAlignment = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HORIZONTAL_ALIGNMENT_UNSPECIFIED"] = 0; - values[valuesById[1] = "LEADING"] = 1; - values[valuesById[2] = "CENTER"] = 2; - values[valuesById[3] = "TRAILING"] = 3; - return values; - })(); + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#createIntent}. + * @memberof google.cloud.dialogflow.v2.Intents + * @typedef CreateIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.Intent} [response] Intent + */ - return ColumnProperties; - })(); + /** + * Calls CreateIntent. + * @function createIntent + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.ICreateIntentRequest} request CreateIntentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Intents.CreateIntentCallback} callback Node-style callback called with the error, if any, and Intent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.createIntent = function createIntent(request, callback) { + return this.rpcCall(createIntent, $root.google.cloud.dialogflow.v2.CreateIntentRequest, $root.google.cloud.dialogflow.v2.Intent, request, callback); + }, "name", { value: "CreateIntent" }); - Message.TableCardRow = (function() { + /** + * Calls CreateIntent. + * @function createIntent + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.ICreateIntentRequest} request CreateIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Properties of a TableCardRow. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface ITableCardRow - * @property {Array.|null} [cells] TableCardRow cells - * @property {boolean|null} [dividerAfter] TableCardRow dividerAfter - */ + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#updateIntent}. + * @memberof google.cloud.dialogflow.v2.Intents + * @typedef UpdateIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.Intent} [response] Intent + */ - /** - * Constructs a new TableCardRow. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a TableCardRow. - * @implements ITableCardRow - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardRow=} [properties] Properties to set - */ - function TableCardRow(properties) { - this.cells = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Calls UpdateIntent. + * @function updateIntent + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateIntentRequest} request UpdateIntentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Intents.UpdateIntentCallback} callback Node-style callback called with the error, if any, and Intent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.updateIntent = function updateIntent(request, callback) { + return this.rpcCall(updateIntent, $root.google.cloud.dialogflow.v2.UpdateIntentRequest, $root.google.cloud.dialogflow.v2.Intent, request, callback); + }, "name", { value: "UpdateIntent" }); - /** - * TableCardRow cells. - * @member {Array.} cells - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow - * @instance - */ - TableCardRow.prototype.cells = $util.emptyArray; + /** + * Calls UpdateIntent. + * @function updateIntent + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateIntentRequest} request UpdateIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * TableCardRow dividerAfter. - * @member {boolean} dividerAfter - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow - * @instance - */ - TableCardRow.prototype.dividerAfter = false; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#deleteIntent}. + * @memberof google.cloud.dialogflow.v2.Intents + * @typedef DeleteIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * Creates a new TableCardRow instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardRow=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardRow} TableCardRow instance - */ - TableCardRow.create = function create(properties) { - return new TableCardRow(properties); - }; + /** + * Calls DeleteIntent. + * @function deleteIntent + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteIntentRequest} request DeleteIntentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Intents.DeleteIntentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.deleteIntent = function deleteIntent(request, callback) { + return this.rpcCall(deleteIntent, $root.google.cloud.dialogflow.v2.DeleteIntentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteIntent" }); - /** - * Encodes the specified TableCardRow message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardRow.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardRow} message TableCardRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCardRow.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cells != null && message.cells.length) - for (var i = 0; i < message.cells.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell.encode(message.cells[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.dividerAfter != null && Object.hasOwnProperty.call(message, "dividerAfter")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.dividerAfter); - return writer; - }; + /** + * Calls DeleteIntent. + * @function deleteIntent + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteIntentRequest} request DeleteIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Encodes the specified TableCardRow message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardRow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardRow} message TableCardRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCardRow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#batchUpdateIntents}. + * @memberof google.cloud.dialogflow.v2.Intents + * @typedef BatchUpdateIntentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Decodes a TableCardRow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardRow} TableCardRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCardRow.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.cells && message.cells.length)) - message.cells = []; - message.cells.push($root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell.decode(reader, reader.uint32())); - break; - case 2: - message.dividerAfter = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Calls BatchUpdateIntents. + * @function batchUpdateIntents + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest} request BatchUpdateIntentsRequest message or plain object + * @param {google.cloud.dialogflow.v2.Intents.BatchUpdateIntentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.batchUpdateIntents = function batchUpdateIntents(request, callback) { + return this.rpcCall(batchUpdateIntents, $root.google.cloud.dialogflow.v2.BatchUpdateIntentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchUpdateIntents" }); - /** - * Decodes a TableCardRow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardRow} TableCardRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCardRow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls BatchUpdateIntents. + * @function batchUpdateIntents + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest} request BatchUpdateIntentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Verifies a TableCardRow message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TableCardRow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cells != null && message.hasOwnProperty("cells")) { - if (!Array.isArray(message.cells)) - return "cells: array expected"; - for (var i = 0; i < message.cells.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell.verify(message.cells[i]); - if (error) - return "cells." + error; - } - } - if (message.dividerAfter != null && message.hasOwnProperty("dividerAfter")) - if (typeof message.dividerAfter !== "boolean") - return "dividerAfter: boolean expected"; - return null; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Intents#batchDeleteIntents}. + * @memberof google.cloud.dialogflow.v2.Intents + * @typedef BatchDeleteIntentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Creates a TableCardRow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardRow} TableCardRow - */ - TableCardRow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow(); - if (object.cells) { - if (!Array.isArray(object.cells)) - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCardRow.cells: array expected"); - message.cells = []; - for (var i = 0; i < object.cells.length; ++i) { - if (typeof object.cells[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCardRow.cells: object expected"); - message.cells[i] = $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell.fromObject(object.cells[i]); - } - } - if (object.dividerAfter != null) - message.dividerAfter = Boolean(object.dividerAfter); - return message; - }; + /** + * Calls BatchDeleteIntents. + * @function batchDeleteIntents + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest} request BatchDeleteIntentsRequest message or plain object + * @param {google.cloud.dialogflow.v2.Intents.BatchDeleteIntentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.batchDeleteIntents = function batchDeleteIntents(request, callback) { + return this.rpcCall(batchDeleteIntents, $root.google.cloud.dialogflow.v2.BatchDeleteIntentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchDeleteIntents" }); - /** - * Creates a plain object from a TableCardRow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.TableCardRow} message TableCardRow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TableCardRow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.cells = []; - if (options.defaults) - object.dividerAfter = false; - if (message.cells && message.cells.length) { - object.cells = []; - for (var j = 0; j < message.cells.length; ++j) - object.cells[j] = $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell.toObject(message.cells[j], options); - } - if (message.dividerAfter != null && message.hasOwnProperty("dividerAfter")) - object.dividerAfter = message.dividerAfter; - return object; - }; + /** + * Calls BatchDeleteIntents. + * @function batchDeleteIntents + * @memberof google.cloud.dialogflow.v2.Intents + * @instance + * @param {google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest} request BatchDeleteIntentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Converts this TableCardRow to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow - * @instance - * @returns {Object.} JSON object - */ - TableCardRow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Intents; + })(); - return TableCardRow; - })(); + v2.Intent = (function() { - Message.TableCardCell = (function() { + /** + * Properties of an Intent. + * @memberof google.cloud.dialogflow.v2 + * @interface IIntent + * @property {string|null} [name] Intent name + * @property {string|null} [displayName] Intent displayName + * @property {google.cloud.dialogflow.v2.Intent.WebhookState|null} [webhookState] Intent webhookState + * @property {number|null} [priority] Intent priority + * @property {boolean|null} [isFallback] Intent isFallback + * @property {boolean|null} [mlDisabled] Intent mlDisabled + * @property {boolean|null} [liveAgentHandoff] Intent liveAgentHandoff + * @property {boolean|null} [endInteraction] Intent endInteraction + * @property {Array.|null} [inputContextNames] Intent inputContextNames + * @property {Array.|null} [events] Intent events + * @property {Array.|null} [trainingPhrases] Intent trainingPhrases + * @property {string|null} [action] Intent action + * @property {Array.|null} [outputContexts] Intent outputContexts + * @property {boolean|null} [resetContexts] Intent resetContexts + * @property {Array.|null} [parameters] Intent parameters + * @property {Array.|null} [messages] Intent messages + * @property {Array.|null} [defaultResponsePlatforms] Intent defaultResponsePlatforms + * @property {string|null} [rootFollowupIntentName] Intent rootFollowupIntentName + * @property {string|null} [parentFollowupIntentName] Intent parentFollowupIntentName + * @property {Array.|null} [followupIntentInfo] Intent followupIntentInfo + */ - /** - * Properties of a TableCardCell. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @interface ITableCardCell - * @property {string|null} [text] TableCardCell text - */ + /** + * Constructs a new Intent. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an Intent. + * @implements IIntent + * @constructor + * @param {google.cloud.dialogflow.v2.IIntent=} [properties] Properties to set + */ + function Intent(properties) { + this.inputContextNames = []; + this.events = []; + this.trainingPhrases = []; + this.outputContexts = []; + this.parameters = []; + this.messages = []; + this.defaultResponsePlatforms = []; + this.followupIntentInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new TableCardCell. - * @memberof google.cloud.dialogflow.v2.Intent.Message - * @classdesc Represents a TableCardCell. - * @implements ITableCardCell - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardCell=} [properties] Properties to set - */ - function TableCardCell(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Intent name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.name = ""; - /** - * TableCardCell text. - * @member {string} text - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell - * @instance - */ - TableCardCell.prototype.text = ""; + /** + * Intent displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.displayName = ""; - /** - * Creates a new TableCardCell instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardCell=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardCell} TableCardCell instance - */ - TableCardCell.create = function create(properties) { - return new TableCardCell(properties); - }; + /** + * Intent webhookState. + * @member {google.cloud.dialogflow.v2.Intent.WebhookState} webhookState + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.webhookState = 0; - /** - * Encodes the specified TableCardCell message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardCell.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardCell} message TableCardCell message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCardCell.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - return writer; - }; + /** + * Intent priority. + * @member {number} priority + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.priority = 0; - /** - * Encodes the specified TableCardCell message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardCell.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardCell} message TableCardCell message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCardCell.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Intent isFallback. + * @member {boolean} isFallback + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.isFallback = false; - /** - * Decodes a TableCardCell message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardCell} TableCardCell - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCardCell.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Intent mlDisabled. + * @member {boolean} mlDisabled + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.mlDisabled = false; - /** - * Decodes a TableCardCell message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardCell} TableCardCell - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCardCell.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Intent liveAgentHandoff. + * @member {boolean} liveAgentHandoff + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.liveAgentHandoff = false; - /** - * Verifies a TableCardCell message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TableCardCell.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - return null; - }; + /** + * Intent endInteraction. + * @member {boolean} endInteraction + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.endInteraction = false; - /** - * Creates a TableCardCell message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardCell} TableCardCell - */ - TableCardCell.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell(); - if (object.text != null) - message.text = String(object.text); - return message; - }; + /** + * Intent inputContextNames. + * @member {Array.} inputContextNames + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.inputContextNames = $util.emptyArray; - /** - * Creates a plain object from a TableCardCell message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell - * @static - * @param {google.cloud.dialogflow.v2.Intent.Message.TableCardCell} message TableCardCell - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TableCardCell.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.text = ""; - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - return object; - }; + /** + * Intent events. + * @member {Array.} events + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.events = $util.emptyArray; - /** - * Converts this TableCardCell to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell - * @instance - * @returns {Object.} JSON object - */ - TableCardCell.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Intent trainingPhrases. + * @member {Array.} trainingPhrases + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.trainingPhrases = $util.emptyArray; - return TableCardCell; - })(); + /** + * Intent action. + * @member {string} action + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.action = ""; - /** - * Platform enum. - * @name google.cloud.dialogflow.v2.Intent.Message.Platform - * @enum {number} - * @property {number} PLATFORM_UNSPECIFIED=0 PLATFORM_UNSPECIFIED value - * @property {number} FACEBOOK=1 FACEBOOK value - * @property {number} SLACK=2 SLACK value - * @property {number} TELEGRAM=3 TELEGRAM value - * @property {number} KIK=4 KIK value - * @property {number} SKYPE=5 SKYPE value - * @property {number} LINE=6 LINE value - * @property {number} VIBER=7 VIBER value - * @property {number} ACTIONS_ON_GOOGLE=8 ACTIONS_ON_GOOGLE value - * @property {number} GOOGLE_HANGOUTS=11 GOOGLE_HANGOUTS value - */ - Message.Platform = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PLATFORM_UNSPECIFIED"] = 0; - values[valuesById[1] = "FACEBOOK"] = 1; - values[valuesById[2] = "SLACK"] = 2; - values[valuesById[3] = "TELEGRAM"] = 3; - values[valuesById[4] = "KIK"] = 4; - values[valuesById[5] = "SKYPE"] = 5; - values[valuesById[6] = "LINE"] = 6; - values[valuesById[7] = "VIBER"] = 7; - values[valuesById[8] = "ACTIONS_ON_GOOGLE"] = 8; - values[valuesById[11] = "GOOGLE_HANGOUTS"] = 11; - return values; - })(); + /** + * Intent outputContexts. + * @member {Array.} outputContexts + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.outputContexts = $util.emptyArray; - return Message; - })(); + /** + * Intent resetContexts. + * @member {boolean} resetContexts + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.resetContexts = false; - Intent.FollowupIntentInfo = (function() { + /** + * Intent parameters. + * @member {Array.} parameters + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.parameters = $util.emptyArray; - /** - * Properties of a FollowupIntentInfo. - * @memberof google.cloud.dialogflow.v2.Intent - * @interface IFollowupIntentInfo - * @property {string|null} [followupIntentName] FollowupIntentInfo followupIntentName - * @property {string|null} [parentFollowupIntentName] FollowupIntentInfo parentFollowupIntentName - */ + /** + * Intent messages. + * @member {Array.} messages + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.messages = $util.emptyArray; - /** - * Constructs a new FollowupIntentInfo. - * @memberof google.cloud.dialogflow.v2.Intent - * @classdesc Represents a FollowupIntentInfo. - * @implements IFollowupIntentInfo - * @constructor - * @param {google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo=} [properties] Properties to set - */ - function FollowupIntentInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Intent defaultResponsePlatforms. + * @member {Array.} defaultResponsePlatforms + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.defaultResponsePlatforms = $util.emptyArray; - /** - * FollowupIntentInfo followupIntentName. - * @member {string} followupIntentName - * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo - * @instance - */ - FollowupIntentInfo.prototype.followupIntentName = ""; + /** + * Intent rootFollowupIntentName. + * @member {string} rootFollowupIntentName + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.rootFollowupIntentName = ""; - /** - * FollowupIntentInfo parentFollowupIntentName. - * @member {string} parentFollowupIntentName - * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo - * @instance - */ - FollowupIntentInfo.prototype.parentFollowupIntentName = ""; + /** + * Intent parentFollowupIntentName. + * @member {string} parentFollowupIntentName + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.parentFollowupIntentName = ""; - /** - * Creates a new FollowupIntentInfo instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo - * @static - * @param {google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Intent.FollowupIntentInfo} FollowupIntentInfo instance - */ - FollowupIntentInfo.create = function create(properties) { - return new FollowupIntentInfo(properties); - }; - - /** - * Encodes the specified FollowupIntentInfo message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo - * @static - * @param {google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo} message FollowupIntentInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FollowupIntentInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.followupIntentName != null && Object.hasOwnProperty.call(message, "followupIntentName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.followupIntentName); - if (message.parentFollowupIntentName != null && Object.hasOwnProperty.call(message, "parentFollowupIntentName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.parentFollowupIntentName); - return writer; - }; - - /** - * Encodes the specified FollowupIntentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo - * @static - * @param {google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo} message FollowupIntentInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FollowupIntentInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FollowupIntentInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Intent.FollowupIntentInfo} FollowupIntentInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FollowupIntentInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.followupIntentName = reader.string(); - break; - case 2: - message.parentFollowupIntentName = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FollowupIntentInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Intent.FollowupIntentInfo} FollowupIntentInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FollowupIntentInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FollowupIntentInfo message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FollowupIntentInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.followupIntentName != null && message.hasOwnProperty("followupIntentName")) - if (!$util.isString(message.followupIntentName)) - return "followupIntentName: string expected"; - if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) - if (!$util.isString(message.parentFollowupIntentName)) - return "parentFollowupIntentName: string expected"; - return null; - }; - - /** - * Creates a FollowupIntentInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Intent.FollowupIntentInfo} FollowupIntentInfo - */ - FollowupIntentInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo) - return object; - var message = new $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo(); - if (object.followupIntentName != null) - message.followupIntentName = String(object.followupIntentName); - if (object.parentFollowupIntentName != null) - message.parentFollowupIntentName = String(object.parentFollowupIntentName); - return message; - }; - - /** - * Creates a plain object from a FollowupIntentInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo - * @static - * @param {google.cloud.dialogflow.v2.Intent.FollowupIntentInfo} message FollowupIntentInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FollowupIntentInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.followupIntentName = ""; - object.parentFollowupIntentName = ""; - } - if (message.followupIntentName != null && message.hasOwnProperty("followupIntentName")) - object.followupIntentName = message.followupIntentName; - if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) - object.parentFollowupIntentName = message.parentFollowupIntentName; - return object; - }; - - /** - * Converts this FollowupIntentInfo to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo - * @instance - * @returns {Object.} JSON object - */ - FollowupIntentInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FollowupIntentInfo; - })(); - - /** - * WebhookState enum. - * @name google.cloud.dialogflow.v2.Intent.WebhookState - * @enum {number} - * @property {number} WEBHOOK_STATE_UNSPECIFIED=0 WEBHOOK_STATE_UNSPECIFIED value - * @property {number} WEBHOOK_STATE_ENABLED=1 WEBHOOK_STATE_ENABLED value - * @property {number} WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING=2 WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING value - */ - Intent.WebhookState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "WEBHOOK_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "WEBHOOK_STATE_ENABLED"] = 1; - values[valuesById[2] = "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING"] = 2; - return values; - })(); - - return Intent; - })(); - - v2.ListIntentsRequest = (function() { - - /** - * Properties of a ListIntentsRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IListIntentsRequest - * @property {string|null} [parent] ListIntentsRequest parent - * @property {string|null} [languageCode] ListIntentsRequest languageCode - * @property {google.cloud.dialogflow.v2.IntentView|null} [intentView] ListIntentsRequest intentView - * @property {number|null} [pageSize] ListIntentsRequest pageSize - * @property {string|null} [pageToken] ListIntentsRequest pageToken - */ - - /** - * Constructs a new ListIntentsRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a ListIntentsRequest. - * @implements IListIntentsRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IListIntentsRequest=} [properties] Properties to set - */ - function ListIntentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListIntentsRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest - * @instance - */ - ListIntentsRequest.prototype.parent = ""; - - /** - * ListIntentsRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest - * @instance - */ - ListIntentsRequest.prototype.languageCode = ""; - - /** - * ListIntentsRequest intentView. - * @member {google.cloud.dialogflow.v2.IntentView} intentView - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest - * @instance - */ - ListIntentsRequest.prototype.intentView = 0; - - /** - * ListIntentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest - * @instance - */ - ListIntentsRequest.prototype.pageSize = 0; - - /** - * ListIntentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest - * @instance - */ - ListIntentsRequest.prototype.pageToken = ""; + /** + * Intent followupIntentInfo. + * @member {Array.} followupIntentInfo + * @memberof google.cloud.dialogflow.v2.Intent + * @instance + */ + Intent.prototype.followupIntentInfo = $util.emptyArray; /** - * Creates a new ListIntentsRequest instance using the specified properties. + * Creates a new Intent instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @memberof google.cloud.dialogflow.v2.Intent * @static - * @param {google.cloud.dialogflow.v2.IListIntentsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.ListIntentsRequest} ListIntentsRequest instance + * @param {google.cloud.dialogflow.v2.IIntent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent} Intent instance */ - ListIntentsRequest.create = function create(properties) { - return new ListIntentsRequest(properties); + Intent.create = function create(properties) { + return new Intent(properties); }; /** - * Encodes the specified ListIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsRequest.verify|verify} messages. + * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @memberof google.cloud.dialogflow.v2.Intent * @static - * @param {google.cloud.dialogflow.v2.IListIntentsRequest} message ListIntentsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IIntent} message Intent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListIntentsRequest.encode = function encode(message, writer) { + Intent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); - if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.intentView); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.priority); + if (message.isFallback != null && Object.hasOwnProperty.call(message, "isFallback")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isFallback); + if (message.webhookState != null && Object.hasOwnProperty.call(message, "webhookState")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.webhookState); + if (message.inputContextNames != null && message.inputContextNames.length) + for (var i = 0; i < message.inputContextNames.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.inputContextNames[i]); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.events[i]); + if (message.trainingPhrases != null && message.trainingPhrases.length) + for (var i = 0; i < message.trainingPhrases.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.encode(message.trainingPhrases[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.action); + if (message.outputContexts != null && message.outputContexts.length) + for (var i = 0; i < message.outputContexts.length; ++i) + $root.google.cloud.dialogflow.v2.Context.encode(message.outputContexts[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.resetContexts != null && Object.hasOwnProperty.call(message, "resetContexts")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.resetContexts); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Parameter.encode(message.parameters[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.encode(message.messages[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.defaultResponsePlatforms != null && message.defaultResponsePlatforms.length) { + writer.uint32(/* id 15, wireType 2 =*/122).fork(); + for (var i = 0; i < message.defaultResponsePlatforms.length; ++i) + writer.int32(message.defaultResponsePlatforms[i]); + writer.ldelim(); + } + if (message.rootFollowupIntentName != null && Object.hasOwnProperty.call(message, "rootFollowupIntentName")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.rootFollowupIntentName); + if (message.parentFollowupIntentName != null && Object.hasOwnProperty.call(message, "parentFollowupIntentName")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.parentFollowupIntentName); + if (message.followupIntentInfo != null && message.followupIntentInfo.length) + for (var i = 0; i < message.followupIntentInfo.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.encode(message.followupIntentInfo[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.mlDisabled != null && Object.hasOwnProperty.call(message, "mlDisabled")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.mlDisabled); + if (message.liveAgentHandoff != null && Object.hasOwnProperty.call(message, "liveAgentHandoff")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.liveAgentHandoff); + if (message.endInteraction != null && Object.hasOwnProperty.call(message, "endInteraction")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.endInteraction); return writer; }; /** - * Encodes the specified ListIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsRequest.verify|verify} messages. + * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @memberof google.cloud.dialogflow.v2.Intent * @static - * @param {google.cloud.dialogflow.v2.IListIntentsRequest} message ListIntentsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IIntent} message Intent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + Intent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListIntentsRequest message from the specified reader or buffer. + * Decodes an Intent message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @memberof google.cloud.dialogflow.v2.Intent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.ListIntentsRequest} ListIntentsRequest + * @returns {google.cloud.dialogflow.v2.Intent} Intent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListIntentsRequest.decode = function decode(reader, length) { + Intent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListIntentsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); break; case 2: - message.languageCode = reader.string(); + message.displayName = reader.string(); + break; + case 6: + message.webhookState = reader.int32(); break; case 3: - message.intentView = reader.int32(); + message.priority = reader.int32(); break; case 4: - message.pageSize = reader.int32(); + message.isFallback = reader.bool(); break; - case 5: - message.pageToken = reader.string(); + case 19: + message.mlDisabled = reader.bool(); + break; + case 20: + message.liveAgentHandoff = reader.bool(); + break; + case 21: + message.endInteraction = reader.bool(); + break; + case 7: + if (!(message.inputContextNames && message.inputContextNames.length)) + message.inputContextNames = []; + message.inputContextNames.push(reader.string()); + break; + case 8: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push(reader.string()); + break; + case 9: + if (!(message.trainingPhrases && message.trainingPhrases.length)) + message.trainingPhrases = []; + message.trainingPhrases.push($root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.decode(reader, reader.uint32())); + break; + case 10: + message.action = reader.string(); + break; + case 11: + if (!(message.outputContexts && message.outputContexts.length)) + message.outputContexts = []; + message.outputContexts.push($root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32())); + break; + case 12: + message.resetContexts = reader.bool(); + break; + case 13: + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.dialogflow.v2.Intent.Parameter.decode(reader, reader.uint32())); + break; + case 14: + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.dialogflow.v2.Intent.Message.decode(reader, reader.uint32())); + break; + case 15: + if (!(message.defaultResponsePlatforms && message.defaultResponsePlatforms.length)) + message.defaultResponsePlatforms = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.defaultResponsePlatforms.push(reader.int32()); + } else + message.defaultResponsePlatforms.push(reader.int32()); + break; + case 16: + message.rootFollowupIntentName = reader.string(); + break; + case 17: + message.parentFollowupIntentName = reader.string(); + break; + case 18: + if (!(message.followupIntentInfo && message.followupIntentInfo.length)) + message.followupIntentInfo = []; + message.followupIntentInfo.push($root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -22214,8649 +22024,9004 @@ }; /** - * Decodes a ListIntentsRequest message from the specified reader or buffer, length delimited. + * Decodes an Intent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @memberof google.cloud.dialogflow.v2.Intent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.ListIntentsRequest} ListIntentsRequest + * @returns {google.cloud.dialogflow.v2.Intent} Intent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListIntentsRequest.decodeDelimited = function decodeDelimited(reader) { + Intent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListIntentsRequest message. + * Verifies an Intent message. * @function verify - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @memberof google.cloud.dialogflow.v2.Intent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListIntentsRequest.verify = function verify(message) { + Intent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.intentView != null && message.hasOwnProperty("intentView")) - switch (message.intentView) { + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.webhookState != null && message.hasOwnProperty("webhookState")) + switch (message.webhookState) { default: - return "intentView: enum value expected"; + return "webhookState: enum value expected"; case 0: case 1: + case 2: break; } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; - - /** - * Creates a ListIntentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.ListIntentsRequest} ListIntentsRequest - */ - ListIntentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.ListIntentsRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.ListIntentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - switch (object.intentView) { - case "INTENT_VIEW_UNSPECIFIED": - case 0: - message.intentView = 0; - break; - case "INTENT_VIEW_FULL": - case 1: - message.intentView = 1; - break; + if (message.priority != null && message.hasOwnProperty("priority")) + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + if (message.isFallback != null && message.hasOwnProperty("isFallback")) + if (typeof message.isFallback !== "boolean") + return "isFallback: boolean expected"; + if (message.mlDisabled != null && message.hasOwnProperty("mlDisabled")) + if (typeof message.mlDisabled !== "boolean") + return "mlDisabled: boolean expected"; + if (message.liveAgentHandoff != null && message.hasOwnProperty("liveAgentHandoff")) + if (typeof message.liveAgentHandoff !== "boolean") + return "liveAgentHandoff: boolean expected"; + if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) + if (typeof message.endInteraction !== "boolean") + return "endInteraction: boolean expected"; + if (message.inputContextNames != null && message.hasOwnProperty("inputContextNames")) { + if (!Array.isArray(message.inputContextNames)) + return "inputContextNames: array expected"; + for (var i = 0; i < message.inputContextNames.length; ++i) + if (!$util.isString(message.inputContextNames[i])) + return "inputContextNames: string[] expected"; } - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; - - /** - * Creates a plain object from a ListIntentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2.ListIntentsRequest} message ListIntentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListIntentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.languageCode = ""; - object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; - object.pageSize = 0; - object.pageToken = ""; + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) + if (!$util.isString(message.events[i])) + return "events: string[] expected"; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.intentView != null && message.hasOwnProperty("intentView")) - object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2.IntentView[message.intentView] : message.intentView; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; - - /** - * Converts this ListIntentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.ListIntentsRequest - * @instance - * @returns {Object.} JSON object - */ - ListIntentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListIntentsRequest; - })(); - - v2.ListIntentsResponse = (function() { - - /** - * Properties of a ListIntentsResponse. - * @memberof google.cloud.dialogflow.v2 - * @interface IListIntentsResponse - * @property {Array.|null} [intents] ListIntentsResponse intents - * @property {string|null} [nextPageToken] ListIntentsResponse nextPageToken - */ - - /** - * Constructs a new ListIntentsResponse. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a ListIntentsResponse. - * @implements IListIntentsResponse - * @constructor - * @param {google.cloud.dialogflow.v2.IListIntentsResponse=} [properties] Properties to set - */ - function ListIntentsResponse(properties) { - this.intents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListIntentsResponse intents. - * @member {Array.} intents - * @memberof google.cloud.dialogflow.v2.ListIntentsResponse - * @instance - */ - ListIntentsResponse.prototype.intents = $util.emptyArray; - - /** - * ListIntentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2.ListIntentsResponse - * @instance - */ - ListIntentsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListIntentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.ListIntentsResponse - * @static - * @param {google.cloud.dialogflow.v2.IListIntentsResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.ListIntentsResponse} ListIntentsResponse instance - */ - ListIntentsResponse.create = function create(properties) { - return new ListIntentsResponse(properties); - }; - - /** - * Encodes the specified ListIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.ListIntentsResponse - * @static - * @param {google.cloud.dialogflow.v2.IListIntentsResponse} message ListIntentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListIntentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.intents != null && message.intents.length) - for (var i = 0; i < message.intents.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; - - /** - * Encodes the specified ListIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.ListIntentsResponse - * @static - * @param {google.cloud.dialogflow.v2.IListIntentsResponse} message ListIntentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListIntentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.ListIntentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.ListIntentsResponse} ListIntentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListIntentsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListIntentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.intents && message.intents.length)) - message.intents = []; - message.intents.push($root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + if (message.trainingPhrases != null && message.hasOwnProperty("trainingPhrases")) { + if (!Array.isArray(message.trainingPhrases)) + return "trainingPhrases: array expected"; + for (var i = 0; i < message.trainingPhrases.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.verify(message.trainingPhrases[i]); + if (error) + return "trainingPhrases." + error; } } - return message; - }; - - /** - * Decodes a ListIntentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.ListIntentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.ListIntentsResponse} ListIntentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListIntentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListIntentsResponse message. - * @function verify - * @memberof google.cloud.dialogflow.v2.ListIntentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListIntentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.intents != null && message.hasOwnProperty("intents")) { - if (!Array.isArray(message.intents)) - return "intents: array expected"; - for (var i = 0; i < message.intents.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intents[i]); + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.outputContexts != null && message.hasOwnProperty("outputContexts")) { + if (!Array.isArray(message.outputContexts)) + return "outputContexts: array expected"; + for (var i = 0; i < message.outputContexts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Context.verify(message.outputContexts[i]); if (error) - return "intents." + error; + return "outputContexts." + error; + } + } + if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) + if (typeof message.resetContexts !== "boolean") + return "resetContexts: boolean expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Parameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.defaultResponsePlatforms != null && message.hasOwnProperty("defaultResponsePlatforms")) { + if (!Array.isArray(message.defaultResponsePlatforms)) + return "defaultResponsePlatforms: array expected"; + for (var i = 0; i < message.defaultResponsePlatforms.length; ++i) + switch (message.defaultResponsePlatforms[i]) { + default: + return "defaultResponsePlatforms: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 11: + break; + } + } + if (message.rootFollowupIntentName != null && message.hasOwnProperty("rootFollowupIntentName")) + if (!$util.isString(message.rootFollowupIntentName)) + return "rootFollowupIntentName: string expected"; + if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) + if (!$util.isString(message.parentFollowupIntentName)) + return "parentFollowupIntentName: string expected"; + if (message.followupIntentInfo != null && message.hasOwnProperty("followupIntentInfo")) { + if (!Array.isArray(message.followupIntentInfo)) + return "followupIntentInfo: array expected"; + for (var i = 0; i < message.followupIntentInfo.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.verify(message.followupIntentInfo[i]); + if (error) + return "followupIntentInfo." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a ListIntentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an Intent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.ListIntentsResponse + * @memberof google.cloud.dialogflow.v2.Intent * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.ListIntentsResponse} ListIntentsResponse + * @returns {google.cloud.dialogflow.v2.Intent} Intent */ - ListIntentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.ListIntentsResponse) + Intent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent) return object; - var message = new $root.google.cloud.dialogflow.v2.ListIntentsResponse(); - if (object.intents) { - if (!Array.isArray(object.intents)) - throw TypeError(".google.cloud.dialogflow.v2.ListIntentsResponse.intents: array expected"); - message.intents = []; - for (var i = 0; i < object.intents.length; ++i) { - if (typeof object.intents[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.ListIntentsResponse.intents: object expected"); - message.intents[i] = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intents[i]); + var message = new $root.google.cloud.dialogflow.v2.Intent(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.webhookState) { + case "WEBHOOK_STATE_UNSPECIFIED": + case 0: + message.webhookState = 0; + break; + case "WEBHOOK_STATE_ENABLED": + case 1: + message.webhookState = 1; + break; + case "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING": + case 2: + message.webhookState = 2; + break; + } + if (object.priority != null) + message.priority = object.priority | 0; + if (object.isFallback != null) + message.isFallback = Boolean(object.isFallback); + if (object.mlDisabled != null) + message.mlDisabled = Boolean(object.mlDisabled); + if (object.liveAgentHandoff != null) + message.liveAgentHandoff = Boolean(object.liveAgentHandoff); + if (object.endInteraction != null) + message.endInteraction = Boolean(object.endInteraction); + if (object.inputContextNames) { + if (!Array.isArray(object.inputContextNames)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.inputContextNames: array expected"); + message.inputContextNames = []; + for (var i = 0; i < object.inputContextNames.length; ++i) + message.inputContextNames[i] = String(object.inputContextNames[i]); + } + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) + message.events[i] = String(object.events[i]); + } + if (object.trainingPhrases) { + if (!Array.isArray(object.trainingPhrases)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.trainingPhrases: array expected"); + message.trainingPhrases = []; + for (var i = 0; i < object.trainingPhrases.length; ++i) { + if (typeof object.trainingPhrases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.trainingPhrases: object expected"); + message.trainingPhrases[i] = $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.fromObject(object.trainingPhrases[i]); + } + } + if (object.action != null) + message.action = String(object.action); + if (object.outputContexts) { + if (!Array.isArray(object.outputContexts)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.outputContexts: array expected"); + message.outputContexts = []; + for (var i = 0; i < object.outputContexts.length; ++i) { + if (typeof object.outputContexts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.outputContexts: object expected"); + message.outputContexts[i] = $root.google.cloud.dialogflow.v2.Context.fromObject(object.outputContexts[i]); + } + } + if (object.resetContexts != null) + message.resetContexts = Boolean(object.resetContexts); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.parameters: object expected"); + message.parameters[i] = $root.google.cloud.dialogflow.v2.Intent.Parameter.fromObject(object.parameters[i]); + } + } + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.messages: object expected"); + message.messages[i] = $root.google.cloud.dialogflow.v2.Intent.Message.fromObject(object.messages[i]); + } + } + if (object.defaultResponsePlatforms) { + if (!Array.isArray(object.defaultResponsePlatforms)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.defaultResponsePlatforms: array expected"); + message.defaultResponsePlatforms = []; + for (var i = 0; i < object.defaultResponsePlatforms.length; ++i) + switch (object.defaultResponsePlatforms[i]) { + default: + case "PLATFORM_UNSPECIFIED": + case 0: + message.defaultResponsePlatforms[i] = 0; + break; + case "FACEBOOK": + case 1: + message.defaultResponsePlatforms[i] = 1; + break; + case "SLACK": + case 2: + message.defaultResponsePlatforms[i] = 2; + break; + case "TELEGRAM": + case 3: + message.defaultResponsePlatforms[i] = 3; + break; + case "KIK": + case 4: + message.defaultResponsePlatforms[i] = 4; + break; + case "SKYPE": + case 5: + message.defaultResponsePlatforms[i] = 5; + break; + case "LINE": + case 6: + message.defaultResponsePlatforms[i] = 6; + break; + case "VIBER": + case 7: + message.defaultResponsePlatforms[i] = 7; + break; + case "ACTIONS_ON_GOOGLE": + case 8: + message.defaultResponsePlatforms[i] = 8; + break; + case "GOOGLE_HANGOUTS": + case 11: + message.defaultResponsePlatforms[i] = 11; + break; + } + } + if (object.rootFollowupIntentName != null) + message.rootFollowupIntentName = String(object.rootFollowupIntentName); + if (object.parentFollowupIntentName != null) + message.parentFollowupIntentName = String(object.parentFollowupIntentName); + if (object.followupIntentInfo) { + if (!Array.isArray(object.followupIntentInfo)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.followupIntentInfo: array expected"); + message.followupIntentInfo = []; + for (var i = 0; i < object.followupIntentInfo.length; ++i) { + if (typeof object.followupIntentInfo[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.followupIntentInfo: object expected"); + message.followupIntentInfo[i] = $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.fromObject(object.followupIntentInfo[i]); } } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a ListIntentsResponse message. Also converts values to other types if specified. + * Creates a plain object from an Intent message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.ListIntentsResponse + * @memberof google.cloud.dialogflow.v2.Intent * @static - * @param {google.cloud.dialogflow.v2.ListIntentsResponse} message ListIntentsResponse + * @param {google.cloud.dialogflow.v2.Intent} message Intent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListIntentsResponse.toObject = function toObject(message, options) { + Intent.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.intents = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.intents && message.intents.length) { - object.intents = []; - for (var j = 0; j < message.intents.length; ++j) - object.intents[j] = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intents[j], options); + if (options.arrays || options.defaults) { + object.inputContextNames = []; + object.events = []; + object.trainingPhrases = []; + object.outputContexts = []; + object.parameters = []; + object.messages = []; + object.defaultResponsePlatforms = []; + object.followupIntentInfo = []; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListIntentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.ListIntentsResponse - * @instance - * @returns {Object.} JSON object - */ - ListIntentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListIntentsResponse; - })(); - - v2.GetIntentRequest = (function() { - - /** - * Properties of a GetIntentRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IGetIntentRequest - * @property {string|null} [name] GetIntentRequest name - * @property {string|null} [languageCode] GetIntentRequest languageCode - * @property {google.cloud.dialogflow.v2.IntentView|null} [intentView] GetIntentRequest intentView - */ - - /** - * Constructs a new GetIntentRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a GetIntentRequest. - * @implements IGetIntentRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IGetIntentRequest=} [properties] Properties to set - */ - function GetIntentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetIntentRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.GetIntentRequest - * @instance - */ - GetIntentRequest.prototype.name = ""; - - /** - * GetIntentRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.GetIntentRequest - * @instance - */ - GetIntentRequest.prototype.languageCode = ""; - - /** - * GetIntentRequest intentView. - * @member {google.cloud.dialogflow.v2.IntentView} intentView - * @memberof google.cloud.dialogflow.v2.GetIntentRequest - * @instance - */ - GetIntentRequest.prototype.intentView = 0; - - /** - * Creates a new GetIntentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.GetIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IGetIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.GetIntentRequest} GetIntentRequest instance - */ - GetIntentRequest.create = function create(properties) { - return new GetIntentRequest(properties); - }; - - /** - * Encodes the specified GetIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetIntentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.GetIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IGetIntentRequest} message GetIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIntentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); - if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.intentView); - return writer; - }; - - /** - * Encodes the specified GetIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetIntentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.GetIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IGetIntentRequest} message GetIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetIntentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.GetIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.GetIntentRequest} GetIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIntentRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetIntentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.languageCode = reader.string(); - break; - case 3: - message.intentView = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetIntentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.GetIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.GetIntentRequest} GetIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetIntentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetIntentRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.GetIntentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetIntentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.intentView != null && message.hasOwnProperty("intentView")) - switch (message.intentView) { - default: - return "intentView: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a GetIntentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.GetIntentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.GetIntentRequest} GetIntentRequest - */ - GetIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.GetIntentRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.GetIntentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - switch (object.intentView) { - case "INTENT_VIEW_UNSPECIFIED": - case 0: - message.intentView = 0; - break; - case "INTENT_VIEW_FULL": - case 1: - message.intentView = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetIntentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.GetIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.GetIntentRequest} message GetIntentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetIntentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; if (options.defaults) { object.name = ""; - object.languageCode = ""; - object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; + object.displayName = ""; + object.priority = 0; + object.isFallback = false; + object.webhookState = options.enums === String ? "WEBHOOK_STATE_UNSPECIFIED" : 0; + object.action = ""; + object.resetContexts = false; + object.rootFollowupIntentName = ""; + object.parentFollowupIntentName = ""; + object.mlDisabled = false; + object.liveAgentHandoff = false; + object.endInteraction = false; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.intentView != null && message.hasOwnProperty("intentView")) - object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2.IntentView[message.intentView] : message.intentView; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = message.priority; + if (message.isFallback != null && message.hasOwnProperty("isFallback")) + object.isFallback = message.isFallback; + if (message.webhookState != null && message.hasOwnProperty("webhookState")) + object.webhookState = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.WebhookState[message.webhookState] : message.webhookState; + if (message.inputContextNames && message.inputContextNames.length) { + object.inputContextNames = []; + for (var j = 0; j < message.inputContextNames.length; ++j) + object.inputContextNames[j] = message.inputContextNames[j]; + } + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = message.events[j]; + } + if (message.trainingPhrases && message.trainingPhrases.length) { + object.trainingPhrases = []; + for (var j = 0; j < message.trainingPhrases.length; ++j) + object.trainingPhrases[j] = $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.toObject(message.trainingPhrases[j], options); + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.outputContexts && message.outputContexts.length) { + object.outputContexts = []; + for (var j = 0; j < message.outputContexts.length; ++j) + object.outputContexts[j] = $root.google.cloud.dialogflow.v2.Context.toObject(message.outputContexts[j], options); + } + if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) + object.resetContexts = message.resetContexts; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.dialogflow.v2.Intent.Parameter.toObject(message.parameters[j], options); + } + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.dialogflow.v2.Intent.Message.toObject(message.messages[j], options); + } + if (message.defaultResponsePlatforms && message.defaultResponsePlatforms.length) { + object.defaultResponsePlatforms = []; + for (var j = 0; j < message.defaultResponsePlatforms.length; ++j) + object.defaultResponsePlatforms[j] = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.Message.Platform[message.defaultResponsePlatforms[j]] : message.defaultResponsePlatforms[j]; + } + if (message.rootFollowupIntentName != null && message.hasOwnProperty("rootFollowupIntentName")) + object.rootFollowupIntentName = message.rootFollowupIntentName; + if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) + object.parentFollowupIntentName = message.parentFollowupIntentName; + if (message.followupIntentInfo && message.followupIntentInfo.length) { + object.followupIntentInfo = []; + for (var j = 0; j < message.followupIntentInfo.length; ++j) + object.followupIntentInfo[j] = $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.toObject(message.followupIntentInfo[j], options); + } + if (message.mlDisabled != null && message.hasOwnProperty("mlDisabled")) + object.mlDisabled = message.mlDisabled; + if (message.liveAgentHandoff != null && message.hasOwnProperty("liveAgentHandoff")) + object.liveAgentHandoff = message.liveAgentHandoff; + if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) + object.endInteraction = message.endInteraction; return object; }; /** - * Converts this GetIntentRequest to JSON. + * Converts this Intent to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.GetIntentRequest + * @memberof google.cloud.dialogflow.v2.Intent * @instance * @returns {Object.} JSON object */ - GetIntentRequest.prototype.toJSON = function toJSON() { + Intent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetIntentRequest; - })(); + Intent.TrainingPhrase = (function() { - v2.CreateIntentRequest = (function() { + /** + * Properties of a TrainingPhrase. + * @memberof google.cloud.dialogflow.v2.Intent + * @interface ITrainingPhrase + * @property {string|null} [name] TrainingPhrase name + * @property {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type|null} [type] TrainingPhrase type + * @property {Array.|null} [parts] TrainingPhrase parts + * @property {number|null} [timesAddedCount] TrainingPhrase timesAddedCount + */ - /** - * Properties of a CreateIntentRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface ICreateIntentRequest - * @property {string|null} [parent] CreateIntentRequest parent - * @property {google.cloud.dialogflow.v2.IIntent|null} [intent] CreateIntentRequest intent - * @property {string|null} [languageCode] CreateIntentRequest languageCode - * @property {google.cloud.dialogflow.v2.IntentView|null} [intentView] CreateIntentRequest intentView - */ + /** + * Constructs a new TrainingPhrase. + * @memberof google.cloud.dialogflow.v2.Intent + * @classdesc Represents a TrainingPhrase. + * @implements ITrainingPhrase + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.ITrainingPhrase=} [properties] Properties to set + */ + function TrainingPhrase(properties) { + this.parts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new CreateIntentRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a CreateIntentRequest. - * @implements ICreateIntentRequest - * @constructor - * @param {google.cloud.dialogflow.v2.ICreateIntentRequest=} [properties] Properties to set - */ - function CreateIntentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * TrainingPhrase name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.name = ""; - /** - * CreateIntentRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @instance - */ - CreateIntentRequest.prototype.parent = ""; + /** + * TrainingPhrase type. + * @member {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type} type + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.type = 0; - /** - * CreateIntentRequest intent. - * @member {google.cloud.dialogflow.v2.IIntent|null|undefined} intent - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @instance - */ - CreateIntentRequest.prototype.intent = null; + /** + * TrainingPhrase parts. + * @member {Array.} parts + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.parts = $util.emptyArray; - /** - * CreateIntentRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @instance - */ - CreateIntentRequest.prototype.languageCode = ""; + /** + * TrainingPhrase timesAddedCount. + * @member {number} timesAddedCount + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.timesAddedCount = 0; - /** - * CreateIntentRequest intentView. - * @member {google.cloud.dialogflow.v2.IntentView} intentView - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @instance - */ - CreateIntentRequest.prototype.intentView = 0; + /** + * Creates a new TrainingPhrase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.v2.Intent.ITrainingPhrase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase} TrainingPhrase instance + */ + TrainingPhrase.create = function create(properties) { + return new TrainingPhrase(properties); + }; - /** - * Creates a new CreateIntentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.ICreateIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.CreateIntentRequest} CreateIntentRequest instance - */ - CreateIntentRequest.create = function create(properties) { - return new CreateIntentRequest(properties); - }; + /** + * Encodes the specified TrainingPhrase message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.v2.Intent.ITrainingPhrase} message TrainingPhrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainingPhrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.parts != null && message.parts.length) + for (var i = 0; i < message.parts.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.encode(message.parts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timesAddedCount != null && Object.hasOwnProperty.call(message, "timesAddedCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.timesAddedCount); + return writer; + }; - /** - * Encodes the specified CreateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateIntentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.ICreateIntentRequest} message CreateIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateIntentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) - $root.google.cloud.dialogflow.v2.Intent.encode(message.intent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); - if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.intentView); - return writer; - }; + /** + * Encodes the specified TrainingPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.v2.Intent.ITrainingPhrase} message TrainingPhrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainingPhrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified CreateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateIntentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.ICreateIntentRequest} message CreateIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a TrainingPhrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase} TrainingPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainingPhrase.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.type = reader.int32(); + break; + case 3: + if (!(message.parts && message.parts.length)) + message.parts = []; + message.parts.push($root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.decode(reader, reader.uint32())); + break; + case 4: + message.timesAddedCount = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a CreateIntentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.CreateIntentRequest} CreateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateIntentRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateIntentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.intent = $root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32()); - break; - case 3: - message.languageCode = reader.string(); - break; - case 4: - message.intentView = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a TrainingPhrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase} TrainingPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainingPhrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a CreateIntentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.CreateIntentRequest} CreateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateIntentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a TrainingPhrase message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainingPhrase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.parts != null && message.hasOwnProperty("parts")) { + if (!Array.isArray(message.parts)) + return "parts: array expected"; + for (var i = 0; i < message.parts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.verify(message.parts[i]); + if (error) + return "parts." + error; + } + } + if (message.timesAddedCount != null && message.hasOwnProperty("timesAddedCount")) + if (!$util.isInteger(message.timesAddedCount)) + return "timesAddedCount: integer expected"; + return null; + }; - /** - * Verifies a CreateIntentRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateIntentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.intent != null && message.hasOwnProperty("intent")) { - var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intent); - if (error) - return "intent." + error; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.intentView != null && message.hasOwnProperty("intentView")) - switch (message.intentView) { - default: - return "intentView: enum value expected"; + /** + * Creates a TrainingPhrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase} TrainingPhrase + */ + TrainingPhrase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + case "TYPE_UNSPECIFIED": case 0: + message.type = 0; + break; + case "EXAMPLE": case 1: + message.type = 1; + break; + case "TEMPLATE": + case 2: + message.type = 2; break; } - return null; - }; + if (object.parts) { + if (!Array.isArray(object.parts)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.TrainingPhrase.parts: array expected"); + message.parts = []; + for (var i = 0; i < object.parts.length; ++i) { + if (typeof object.parts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.TrainingPhrase.parts: object expected"); + message.parts[i] = $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.fromObject(object.parts[i]); + } + } + if (object.timesAddedCount != null) + message.timesAddedCount = object.timesAddedCount | 0; + return message; + }; - /** - * Creates a CreateIntentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.CreateIntentRequest} CreateIntentRequest - */ - CreateIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.CreateIntentRequest) + /** + * Creates a plain object from a TrainingPhrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.v2.Intent.TrainingPhrase} message TrainingPhrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainingPhrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parts = []; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.timesAddedCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type[message.type] : message.type; + if (message.parts && message.parts.length) { + object.parts = []; + for (var j = 0; j < message.parts.length; ++j) + object.parts[j] = $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.toObject(message.parts[j], options); + } + if (message.timesAddedCount != null && message.hasOwnProperty("timesAddedCount")) + object.timesAddedCount = message.timesAddedCount; return object; - var message = new $root.google.cloud.dialogflow.v2.CreateIntentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.intent != null) { - if (typeof object.intent !== "object") - throw TypeError(".google.cloud.dialogflow.v2.CreateIntentRequest.intent: object expected"); - message.intent = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intent); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - switch (object.intentView) { - case "INTENT_VIEW_UNSPECIFIED": - case 0: - message.intentView = 0; - break; - case "INTENT_VIEW_FULL": - case 1: - message.intentView = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a CreateIntentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.CreateIntentRequest} message CreateIntentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateIntentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.intent = null; - object.languageCode = ""; - object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.intent != null && message.hasOwnProperty("intent")) - object.intent = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intent, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.intentView != null && message.hasOwnProperty("intentView")) - object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2.IntentView[message.intentView] : message.intentView; - return object; - }; + }; - /** - * Converts this CreateIntentRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.CreateIntentRequest - * @instance - * @returns {Object.} JSON object - */ - CreateIntentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this TrainingPhrase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @instance + * @returns {Object.} JSON object + */ + TrainingPhrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return CreateIntentRequest; - })(); + TrainingPhrase.Part = (function() { - v2.UpdateIntentRequest = (function() { + /** + * Properties of a Part. + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @interface IPart + * @property {string|null} [text] Part text + * @property {string|null} [entityType] Part entityType + * @property {string|null} [alias] Part alias + * @property {boolean|null} [userDefined] Part userDefined + */ - /** - * Properties of an UpdateIntentRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IUpdateIntentRequest - * @property {google.cloud.dialogflow.v2.IIntent|null} [intent] UpdateIntentRequest intent - * @property {string|null} [languageCode] UpdateIntentRequest languageCode - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateIntentRequest updateMask - * @property {google.cloud.dialogflow.v2.IntentView|null} [intentView] UpdateIntentRequest intentView - */ + /** + * Constructs a new Part. + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase + * @classdesc Represents a Part. + * @implements IPart + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart=} [properties] Properties to set + */ + function Part(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new UpdateIntentRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an UpdateIntentRequest. - * @implements IUpdateIntentRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IUpdateIntentRequest=} [properties] Properties to set - */ - function UpdateIntentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Part text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @instance + */ + Part.prototype.text = ""; - /** - * UpdateIntentRequest intent. - * @member {google.cloud.dialogflow.v2.IIntent|null|undefined} intent - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @instance - */ - UpdateIntentRequest.prototype.intent = null; + /** + * Part entityType. + * @member {string} entityType + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @instance + */ + Part.prototype.entityType = ""; - /** - * UpdateIntentRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @instance - */ - UpdateIntentRequest.prototype.languageCode = ""; + /** + * Part alias. + * @member {string} alias + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @instance + */ + Part.prototype.alias = ""; - /** - * UpdateIntentRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @instance - */ - UpdateIntentRequest.prototype.updateMask = null; + /** + * Part userDefined. + * @member {boolean} userDefined + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @instance + */ + Part.prototype.userDefined = false; - /** - * UpdateIntentRequest intentView. - * @member {google.cloud.dialogflow.v2.IntentView} intentView - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @instance - */ - UpdateIntentRequest.prototype.intentView = 0; + /** + * Creates a new Part instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part} Part instance + */ + Part.create = function create(properties) { + return new Part(properties); + }; - /** - * Creates a new UpdateIntentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IUpdateIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.UpdateIntentRequest} UpdateIntentRequest instance - */ - UpdateIntentRequest.create = function create(properties) { - return new UpdateIntentRequest(properties); - }; + /** + * Encodes the specified Part message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityType); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.alias); + if (message.userDefined != null && Object.hasOwnProperty.call(message, "userDefined")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.userDefined); + return writer; + }; - /** - * Encodes the specified UpdateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateIntentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IUpdateIntentRequest} message UpdateIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateIntentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) - $root.google.cloud.dialogflow.v2.Intent.encode(message.intent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.intentView); - return writer; - }; + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.v2.Intent.TrainingPhrase.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified UpdateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateIntentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IUpdateIntentRequest} message UpdateIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a Part message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.entityType = reader.string(); + break; + case 3: + message.alias = reader.string(); + break; + case 4: + message.userDefined = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an UpdateIntentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.UpdateIntentRequest} UpdateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateIntentRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateIntentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.intent = $root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32()); - break; - case 2: - message.languageCode = reader.string(); - break; - case 3: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 4: - message.intentView = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an UpdateIntentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.UpdateIntentRequest} UpdateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateIntentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a Part message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Part.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) + if (!$util.isString(message.entityType)) + return "entityType: string expected"; + if (message.alias != null && message.hasOwnProperty("alias")) + if (!$util.isString(message.alias)) + return "alias: string expected"; + if (message.userDefined != null && message.hasOwnProperty("userDefined")) + if (typeof message.userDefined !== "boolean") + return "userDefined: boolean expected"; + return null; + }; - /** - * Verifies an UpdateIntentRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateIntentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.intent != null && message.hasOwnProperty("intent")) { - var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intent); - if (error) - return "intent." + error; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.intentView != null && message.hasOwnProperty("intentView")) - switch (message.intentView) { - default: - return "intentView: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part} Part + */ + Part.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part(); + if (object.text != null) + message.text = String(object.text); + if (object.entityType != null) + message.entityType = String(object.entityType); + if (object.alias != null) + message.alias = String(object.alias); + if (object.userDefined != null) + message.userDefined = Boolean(object.userDefined); + return message; + }; - /** - * Creates an UpdateIntentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.UpdateIntentRequest} UpdateIntentRequest - */ - UpdateIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.UpdateIntentRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.UpdateIntentRequest(); - if (object.intent != null) { - if (typeof object.intent !== "object") - throw TypeError(".google.cloud.dialogflow.v2.UpdateIntentRequest.intent: object expected"); - message.intent = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intent); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2.UpdateIntentRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - switch (object.intentView) { - case "INTENT_VIEW_UNSPECIFIED": - case 0: - message.intentView = 0; - break; - case "INTENT_VIEW_FULL": - case 1: - message.intentView = 1; - break; - } - return message; - }; + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part} message Part + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Part.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.entityType = ""; + object.alias = ""; + object.userDefined = false; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = message.entityType; + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = message.alias; + if (message.userDefined != null && message.hasOwnProperty("userDefined")) + object.userDefined = message.userDefined; + return object; + }; - /** - * Creates a plain object from an UpdateIntentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.UpdateIntentRequest} message UpdateIntentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateIntentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.intent = null; - object.languageCode = ""; - object.updateMask = null; - object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; - } - if (message.intent != null && message.hasOwnProperty("intent")) - object.intent = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intent, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.intentView != null && message.hasOwnProperty("intentView")) - object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2.IntentView[message.intentView] : message.intentView; - return object; - }; + /** + * Converts this Part to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.TrainingPhrase.Part + * @instance + * @returns {Object.} JSON object + */ + Part.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this UpdateIntentRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateIntentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return Part; + })(); - return UpdateIntentRequest; - })(); + /** + * Type enum. + * @name google.cloud.dialogflow.v2.Intent.TrainingPhrase.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} EXAMPLE=1 EXAMPLE value + * @property {number} TEMPLATE=2 TEMPLATE value + */ + TrainingPhrase.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXAMPLE"] = 1; + values[valuesById[2] = "TEMPLATE"] = 2; + return values; + })(); - v2.DeleteIntentRequest = (function() { + return TrainingPhrase; + })(); - /** - * Properties of a DeleteIntentRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IDeleteIntentRequest - * @property {string|null} [name] DeleteIntentRequest name - */ + Intent.Parameter = (function() { - /** - * Constructs a new DeleteIntentRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a DeleteIntentRequest. - * @implements IDeleteIntentRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IDeleteIntentRequest=} [properties] Properties to set - */ - function DeleteIntentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a Parameter. + * @memberof google.cloud.dialogflow.v2.Intent + * @interface IParameter + * @property {string|null} [name] Parameter name + * @property {string|null} [displayName] Parameter displayName + * @property {string|null} [value] Parameter value + * @property {string|null} [defaultValue] Parameter defaultValue + * @property {string|null} [entityTypeDisplayName] Parameter entityTypeDisplayName + * @property {boolean|null} [mandatory] Parameter mandatory + * @property {Array.|null} [prompts] Parameter prompts + * @property {boolean|null} [isList] Parameter isList + */ - /** - * DeleteIntentRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest - * @instance - */ - DeleteIntentRequest.prototype.name = ""; + /** + * Constructs a new Parameter. + * @memberof google.cloud.dialogflow.v2.Intent + * @classdesc Represents a Parameter. + * @implements IParameter + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.IParameter=} [properties] Properties to set + */ + function Parameter(properties) { + this.prompts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new DeleteIntentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IDeleteIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.DeleteIntentRequest} DeleteIntentRequest instance - */ - DeleteIntentRequest.create = function create(properties) { - return new DeleteIntentRequest(properties); - }; + /** + * Parameter name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @instance + */ + Parameter.prototype.name = ""; - /** - * Encodes the specified DeleteIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteIntentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IDeleteIntentRequest} message DeleteIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteIntentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + /** + * Parameter displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @instance + */ + Parameter.prototype.displayName = ""; - /** - * Encodes the specified DeleteIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteIntentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IDeleteIntentRequest} message DeleteIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Parameter value. + * @member {string} value + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @instance + */ + Parameter.prototype.value = ""; - /** - * Decodes a DeleteIntentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.DeleteIntentRequest} DeleteIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteIntentRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteIntentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Parameter defaultValue. + * @member {string} defaultValue + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @instance + */ + Parameter.prototype.defaultValue = ""; - /** - * Decodes a DeleteIntentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.DeleteIntentRequest} DeleteIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteIntentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Parameter entityTypeDisplayName. + * @member {string} entityTypeDisplayName + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @instance + */ + Parameter.prototype.entityTypeDisplayName = ""; - /** - * Verifies a DeleteIntentRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteIntentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + /** + * Parameter mandatory. + * @member {boolean} mandatory + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @instance + */ + Parameter.prototype.mandatory = false; - /** - * Creates a DeleteIntentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.DeleteIntentRequest} DeleteIntentRequest - */ - DeleteIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.DeleteIntentRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.DeleteIntentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * Parameter prompts. + * @member {Array.} prompts + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @instance + */ + Parameter.prototype.prompts = $util.emptyArray; - /** - * Creates a plain object from a DeleteIntentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.DeleteIntentRequest} message DeleteIntentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteIntentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; - - /** - * Converts this DeleteIntentRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteIntentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Parameter isList. + * @member {boolean} isList + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @instance + */ + Parameter.prototype.isList = false; - return DeleteIntentRequest; - })(); + /** + * Creates a new Parameter instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.v2.Intent.IParameter=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Parameter} Parameter instance + */ + Parameter.create = function create(properties) { + return new Parameter(properties); + }; - v2.BatchUpdateIntentsRequest = (function() { + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Parameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.v2.Intent.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.value); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.defaultValue); + if (message.entityTypeDisplayName != null && Object.hasOwnProperty.call(message, "entityTypeDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.entityTypeDisplayName); + if (message.mandatory != null && Object.hasOwnProperty.call(message, "mandatory")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.mandatory); + if (message.prompts != null && message.prompts.length) + for (var i = 0; i < message.prompts.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.prompts[i]); + if (message.isList != null && Object.hasOwnProperty.call(message, "isList")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.isList); + return writer; + }; - /** - * Properties of a BatchUpdateIntentsRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IBatchUpdateIntentsRequest - * @property {string|null} [parent] BatchUpdateIntentsRequest parent - * @property {string|null} [intentBatchUri] BatchUpdateIntentsRequest intentBatchUri - * @property {google.cloud.dialogflow.v2.IIntentBatch|null} [intentBatchInline] BatchUpdateIntentsRequest intentBatchInline - * @property {string|null} [languageCode] BatchUpdateIntentsRequest languageCode - * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateIntentsRequest updateMask - * @property {google.cloud.dialogflow.v2.IntentView|null} [intentView] BatchUpdateIntentsRequest intentView - */ + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Parameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.v2.Intent.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new BatchUpdateIntentsRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a BatchUpdateIntentsRequest. - * @implements IBatchUpdateIntentsRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest=} [properties] Properties to set - */ - function BatchUpdateIntentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes a Parameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Parameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.value = reader.string(); + break; + case 4: + message.defaultValue = reader.string(); + break; + case 5: + message.entityTypeDisplayName = reader.string(); + break; + case 6: + message.mandatory = reader.bool(); + break; + case 7: + if (!(message.prompts && message.prompts.length)) + message.prompts = []; + message.prompts.push(reader.string()); + break; + case 8: + message.isList = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * BatchUpdateIntentsRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @instance - */ - BatchUpdateIntentsRequest.prototype.parent = ""; + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * BatchUpdateIntentsRequest intentBatchUri. - * @member {string} intentBatchUri - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @instance - */ - BatchUpdateIntentsRequest.prototype.intentBatchUri = ""; + /** + * Verifies a Parameter message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.entityTypeDisplayName != null && message.hasOwnProperty("entityTypeDisplayName")) + if (!$util.isString(message.entityTypeDisplayName)) + return "entityTypeDisplayName: string expected"; + if (message.mandatory != null && message.hasOwnProperty("mandatory")) + if (typeof message.mandatory !== "boolean") + return "mandatory: boolean expected"; + if (message.prompts != null && message.hasOwnProperty("prompts")) { + if (!Array.isArray(message.prompts)) + return "prompts: array expected"; + for (var i = 0; i < message.prompts.length; ++i) + if (!$util.isString(message.prompts[i])) + return "prompts: string[] expected"; + } + if (message.isList != null && message.hasOwnProperty("isList")) + if (typeof message.isList !== "boolean") + return "isList: boolean expected"; + return null; + }; - /** - * BatchUpdateIntentsRequest intentBatchInline. - * @member {google.cloud.dialogflow.v2.IIntentBatch|null|undefined} intentBatchInline - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @instance - */ - BatchUpdateIntentsRequest.prototype.intentBatchInline = null; + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Parameter} Parameter + */ + Parameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Parameter) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Parameter(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.value != null) + message.value = String(object.value); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.entityTypeDisplayName != null) + message.entityTypeDisplayName = String(object.entityTypeDisplayName); + if (object.mandatory != null) + message.mandatory = Boolean(object.mandatory); + if (object.prompts) { + if (!Array.isArray(object.prompts)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Parameter.prompts: array expected"); + message.prompts = []; + for (var i = 0; i < object.prompts.length; ++i) + message.prompts[i] = String(object.prompts[i]); + } + if (object.isList != null) + message.isList = Boolean(object.isList); + return message; + }; - /** - * BatchUpdateIntentsRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @instance - */ - BatchUpdateIntentsRequest.prototype.languageCode = ""; + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.v2.Intent.Parameter} message Parameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.prompts = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.value = ""; + object.defaultValue = ""; + object.entityTypeDisplayName = ""; + object.mandatory = false; + object.isList = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.entityTypeDisplayName != null && message.hasOwnProperty("entityTypeDisplayName")) + object.entityTypeDisplayName = message.entityTypeDisplayName; + if (message.mandatory != null && message.hasOwnProperty("mandatory")) + object.mandatory = message.mandatory; + if (message.prompts && message.prompts.length) { + object.prompts = []; + for (var j = 0; j < message.prompts.length; ++j) + object.prompts[j] = message.prompts[j]; + } + if (message.isList != null && message.hasOwnProperty("isList")) + object.isList = message.isList; + return object; + }; - /** - * BatchUpdateIntentsRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @instance - */ - BatchUpdateIntentsRequest.prototype.updateMask = null; + /** + * Converts this Parameter to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Parameter + * @instance + * @returns {Object.} JSON object + */ + Parameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * BatchUpdateIntentsRequest intentView. - * @member {google.cloud.dialogflow.v2.IntentView} intentView - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @instance - */ - BatchUpdateIntentsRequest.prototype.intentView = 0; + return Parameter; + })(); - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + Intent.Message = (function() { - /** - * BatchUpdateIntentsRequest intentBatch. - * @member {"intentBatchUri"|"intentBatchInline"|undefined} intentBatch - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @instance - */ - Object.defineProperty(BatchUpdateIntentsRequest.prototype, "intentBatch", { - get: $util.oneOfGetter($oneOfFields = ["intentBatchUri", "intentBatchInline"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Properties of a Message. + * @memberof google.cloud.dialogflow.v2.Intent + * @interface IMessage + * @property {google.cloud.dialogflow.v2.Intent.Message.IText|null} [text] Message text + * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [image] Message image + * @property {google.cloud.dialogflow.v2.Intent.Message.IQuickReplies|null} [quickReplies] Message quickReplies + * @property {google.cloud.dialogflow.v2.Intent.Message.ICard|null} [card] Message card + * @property {google.protobuf.IStruct|null} [payload] Message payload + * @property {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses|null} [simpleResponses] Message simpleResponses + * @property {google.cloud.dialogflow.v2.Intent.Message.IBasicCard|null} [basicCard] Message basicCard + * @property {google.cloud.dialogflow.v2.Intent.Message.ISuggestions|null} [suggestions] Message suggestions + * @property {google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion|null} [linkOutSuggestion] Message linkOutSuggestion + * @property {google.cloud.dialogflow.v2.Intent.Message.IListSelect|null} [listSelect] Message listSelect + * @property {google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect|null} [carouselSelect] Message carouselSelect + * @property {google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard|null} [browseCarouselCard] Message browseCarouselCard + * @property {google.cloud.dialogflow.v2.Intent.Message.ITableCard|null} [tableCard] Message tableCard + * @property {google.cloud.dialogflow.v2.Intent.Message.IMediaContent|null} [mediaContent] Message mediaContent + * @property {google.cloud.dialogflow.v2.Intent.Message.Platform|null} [platform] Message platform + */ - /** - * Creates a new BatchUpdateIntentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest instance - */ - BatchUpdateIntentsRequest.create = function create(properties) { - return new BatchUpdateIntentsRequest(properties); - }; + /** + * Constructs a new Message. + * @memberof google.cloud.dialogflow.v2.Intent + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.IMessage=} [properties] Properties to set + */ + function Message(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified BatchUpdateIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest} message BatchUpdateIntentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchUpdateIntentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.intentBatchUri != null && Object.hasOwnProperty.call(message, "intentBatchUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.intentBatchUri); - if (message.intentBatchInline != null && Object.hasOwnProperty.call(message, "intentBatchInline")) - $root.google.cloud.dialogflow.v2.IntentBatch.encode(message.intentBatchInline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.intentView); - return writer; - }; + /** + * Message text. + * @member {google.cloud.dialogflow.v2.Intent.Message.IText|null|undefined} text + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.text = null; - /** - * Encodes the specified BatchUpdateIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest} message BatchUpdateIntentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchUpdateIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Message image. + * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} image + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.image = null; - /** - * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchUpdateIntentsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchUpdateIntentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.intentBatchUri = reader.string(); - break; - case 3: - message.intentBatchInline = $root.google.cloud.dialogflow.v2.IntentBatch.decode(reader, reader.uint32()); - break; - case 4: - message.languageCode = reader.string(); - break; - case 5: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 6: - message.intentView = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Message quickReplies. + * @member {google.cloud.dialogflow.v2.Intent.Message.IQuickReplies|null|undefined} quickReplies + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.quickReplies = null; - /** - * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchUpdateIntentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BatchUpdateIntentsRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchUpdateIntentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.intentBatchUri != null && message.hasOwnProperty("intentBatchUri")) { - properties.intentBatch = 1; - if (!$util.isString(message.intentBatchUri)) - return "intentBatchUri: string expected"; - } - if (message.intentBatchInline != null && message.hasOwnProperty("intentBatchInline")) { - if (properties.intentBatch === 1) - return "intentBatch: multiple values"; - properties.intentBatch = 1; - { - var error = $root.google.cloud.dialogflow.v2.IntentBatch.verify(message.intentBatchInline); - if (error) - return "intentBatchInline." + error; - } - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.intentView != null && message.hasOwnProperty("intentView")) - switch (message.intentView) { - default: - return "intentView: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a BatchUpdateIntentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest - */ - BatchUpdateIntentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.BatchUpdateIntentsRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.BatchUpdateIntentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.intentBatchUri != null) - message.intentBatchUri = String(object.intentBatchUri); - if (object.intentBatchInline != null) { - if (typeof object.intentBatchInline !== "object") - throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.intentBatchInline: object expected"); - message.intentBatchInline = $root.google.cloud.dialogflow.v2.IntentBatch.fromObject(object.intentBatchInline); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - switch (object.intentView) { - case "INTENT_VIEW_UNSPECIFIED": - case 0: - message.intentView = 0; - break; - case "INTENT_VIEW_FULL": - case 1: - message.intentView = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a BatchUpdateIntentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2.BatchUpdateIntentsRequest} message BatchUpdateIntentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchUpdateIntentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.languageCode = ""; - object.updateMask = null; - object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.intentBatchUri != null && message.hasOwnProperty("intentBatchUri")) { - object.intentBatchUri = message.intentBatchUri; - if (options.oneofs) - object.intentBatch = "intentBatchUri"; - } - if (message.intentBatchInline != null && message.hasOwnProperty("intentBatchInline")) { - object.intentBatchInline = $root.google.cloud.dialogflow.v2.IntentBatch.toObject(message.intentBatchInline, options); - if (options.oneofs) - object.intentBatch = "intentBatchInline"; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.intentView != null && message.hasOwnProperty("intentView")) - object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2.IntentView[message.intentView] : message.intentView; - return object; - }; - - /** - * Converts this BatchUpdateIntentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest - * @instance - * @returns {Object.} JSON object - */ - BatchUpdateIntentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Message card. + * @member {google.cloud.dialogflow.v2.Intent.Message.ICard|null|undefined} card + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.card = null; - return BatchUpdateIntentsRequest; - })(); + /** + * Message payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.payload = null; - v2.BatchUpdateIntentsResponse = (function() { + /** + * Message simpleResponses. + * @member {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses|null|undefined} simpleResponses + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.simpleResponses = null; - /** - * Properties of a BatchUpdateIntentsResponse. - * @memberof google.cloud.dialogflow.v2 - * @interface IBatchUpdateIntentsResponse - * @property {Array.|null} [intents] BatchUpdateIntentsResponse intents - */ + /** + * Message basicCard. + * @member {google.cloud.dialogflow.v2.Intent.Message.IBasicCard|null|undefined} basicCard + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.basicCard = null; - /** - * Constructs a new BatchUpdateIntentsResponse. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a BatchUpdateIntentsResponse. - * @implements IBatchUpdateIntentsResponse - * @constructor - * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse=} [properties] Properties to set - */ - function BatchUpdateIntentsResponse(properties) { - this.intents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Message suggestions. + * @member {google.cloud.dialogflow.v2.Intent.Message.ISuggestions|null|undefined} suggestions + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.suggestions = null; - /** - * BatchUpdateIntentsResponse intents. - * @member {Array.} intents - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse - * @instance - */ - BatchUpdateIntentsResponse.prototype.intents = $util.emptyArray; + /** + * Message linkOutSuggestion. + * @member {google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion|null|undefined} linkOutSuggestion + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.linkOutSuggestion = null; - /** - * Creates a new BatchUpdateIntentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse - * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse instance - */ - BatchUpdateIntentsResponse.create = function create(properties) { - return new BatchUpdateIntentsResponse(properties); - }; + /** + * Message listSelect. + * @member {google.cloud.dialogflow.v2.Intent.Message.IListSelect|null|undefined} listSelect + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.listSelect = null; - /** - * Encodes the specified BatchUpdateIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse - * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse} message BatchUpdateIntentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchUpdateIntentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.intents != null && message.intents.length) - for (var i = 0; i < message.intents.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Message carouselSelect. + * @member {google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect|null|undefined} carouselSelect + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.carouselSelect = null; - /** - * Encodes the specified BatchUpdateIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse - * @static - * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse} message BatchUpdateIntentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchUpdateIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Message browseCarouselCard. + * @member {google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard|null|undefined} browseCarouselCard + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.browseCarouselCard = null; - /** - * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchUpdateIntentsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchUpdateIntentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.intents && message.intents.length)) - message.intents = []; - message.intents.push($root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Message tableCard. + * @member {google.cloud.dialogflow.v2.Intent.Message.ITableCard|null|undefined} tableCard + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.tableCard = null; - /** - * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchUpdateIntentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Message mediaContent. + * @member {google.cloud.dialogflow.v2.Intent.Message.IMediaContent|null|undefined} mediaContent + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.mediaContent = null; - /** - * Verifies a BatchUpdateIntentsResponse message. - * @function verify - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchUpdateIntentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.intents != null && message.hasOwnProperty("intents")) { - if (!Array.isArray(message.intents)) - return "intents: array expected"; - for (var i = 0; i < message.intents.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intents[i]); - if (error) - return "intents." + error; - } - } - return null; - }; + /** + * Message platform. + * @member {google.cloud.dialogflow.v2.Intent.Message.Platform} platform + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Message.prototype.platform = 0; - /** - * Creates a BatchUpdateIntentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse - */ - BatchUpdateIntentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.BatchUpdateIntentsResponse) - return object; - var message = new $root.google.cloud.dialogflow.v2.BatchUpdateIntentsResponse(); - if (object.intents) { - if (!Array.isArray(object.intents)) - throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.intents: array expected"); - message.intents = []; - for (var i = 0; i < object.intents.length; ++i) { - if (typeof object.intents[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.intents: object expected"); - message.intents[i] = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intents[i]); - } - } - return message; - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Creates a plain object from a BatchUpdateIntentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse - * @static - * @param {google.cloud.dialogflow.v2.BatchUpdateIntentsResponse} message BatchUpdateIntentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchUpdateIntentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.intents = []; - if (message.intents && message.intents.length) { - object.intents = []; - for (var j = 0; j < message.intents.length; ++j) - object.intents[j] = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intents[j], options); - } - return object; - }; + /** + * Message message. + * @member {"text"|"image"|"quickReplies"|"card"|"payload"|"simpleResponses"|"basicCard"|"suggestions"|"linkOutSuggestion"|"listSelect"|"carouselSelect"|"browseCarouselCard"|"tableCard"|"mediaContent"|undefined} message + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + */ + Object.defineProperty(Message.prototype, "message", { + get: $util.oneOfGetter($oneOfFields = ["text", "image", "quickReplies", "card", "payload", "simpleResponses", "basicCard", "suggestions", "linkOutSuggestion", "listSelect", "carouselSelect", "browseCarouselCard", "tableCard", "mediaContent"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Converts this BatchUpdateIntentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse - * @instance - * @returns {Object.} JSON object - */ - BatchUpdateIntentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @static + * @param {google.cloud.dialogflow.v2.Intent.IMessage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; - return BatchUpdateIntentsResponse; - })(); + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @static + * @param {google.cloud.dialogflow.v2.Intent.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.dialogflow.v2.Intent.Message.Text.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.image, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.quickReplies != null && Object.hasOwnProperty.call(message, "quickReplies")) + $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies.encode(message.quickReplies, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.card != null && Object.hasOwnProperty.call(message, "card")) + $root.google.cloud.dialogflow.v2.Intent.Message.Card.encode(message.card, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.platform != null && Object.hasOwnProperty.call(message, "platform")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.platform); + if (message.simpleResponses != null && Object.hasOwnProperty.call(message, "simpleResponses")) + $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.encode(message.simpleResponses, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.basicCard != null && Object.hasOwnProperty.call(message, "basicCard")) + $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.encode(message.basicCard, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.suggestions != null && Object.hasOwnProperty.call(message, "suggestions")) + $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions.encode(message.suggestions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.linkOutSuggestion != null && Object.hasOwnProperty.call(message, "linkOutSuggestion")) + $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.encode(message.linkOutSuggestion, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.listSelect != null && Object.hasOwnProperty.call(message, "listSelect")) + $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.encode(message.listSelect, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.carouselSelect != null && Object.hasOwnProperty.call(message, "carouselSelect")) + $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.encode(message.carouselSelect, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.browseCarouselCard != null && Object.hasOwnProperty.call(message, "browseCarouselCard")) + $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.encode(message.browseCarouselCard, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.tableCard != null && Object.hasOwnProperty.call(message, "tableCard")) + $root.google.cloud.dialogflow.v2.Intent.Message.TableCard.encode(message.tableCard, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.mediaContent != null && Object.hasOwnProperty.call(message, "mediaContent")) + $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.encode(message.mediaContent, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; - v2.BatchDeleteIntentsRequest = (function() { + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @static + * @param {google.cloud.dialogflow.v2.Intent.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Properties of a BatchDeleteIntentsRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IBatchDeleteIntentsRequest - * @property {string|null} [parent] BatchDeleteIntentsRequest parent - * @property {Array.|null} [intents] BatchDeleteIntentsRequest intents - */ - - /** - * Constructs a new BatchDeleteIntentsRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a BatchDeleteIntentsRequest. - * @implements IBatchDeleteIntentsRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest=} [properties] Properties to set - */ - function BatchDeleteIntentsRequest(properties) { - this.intents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDeleteIntentsRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest - * @instance - */ - BatchDeleteIntentsRequest.prototype.parent = ""; - - /** - * BatchDeleteIntentsRequest intents. - * @member {Array.} intents - * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest - * @instance - */ - BatchDeleteIntentsRequest.prototype.intents = $util.emptyArray; - - /** - * Creates a new BatchDeleteIntentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest instance - */ - BatchDeleteIntentsRequest.create = function create(properties) { - return new BatchDeleteIntentsRequest(properties); - }; + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = $root.google.cloud.dialogflow.v2.Intent.Message.Text.decode(reader, reader.uint32()); + break; + case 2: + message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); + break; + case 3: + message.quickReplies = $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies.decode(reader, reader.uint32()); + break; + case 4: + message.card = $root.google.cloud.dialogflow.v2.Intent.Message.Card.decode(reader, reader.uint32()); + break; + case 5: + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 7: + message.simpleResponses = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.decode(reader, reader.uint32()); + break; + case 8: + message.basicCard = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.decode(reader, reader.uint32()); + break; + case 9: + message.suggestions = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions.decode(reader, reader.uint32()); + break; + case 10: + message.linkOutSuggestion = $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.decode(reader, reader.uint32()); + break; + case 11: + message.listSelect = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.decode(reader, reader.uint32()); + break; + case 12: + message.carouselSelect = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.decode(reader, reader.uint32()); + break; + case 22: + message.browseCarouselCard = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.decode(reader, reader.uint32()); + break; + case 23: + message.tableCard = $root.google.cloud.dialogflow.v2.Intent.Message.TableCard.decode(reader, reader.uint32()); + break; + case 24: + message.mediaContent = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.decode(reader, reader.uint32()); + break; + case 6: + message.platform = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified BatchDeleteIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest} message BatchDeleteIntentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteIntentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.intents != null && message.intents.length) - for (var i = 0; i < message.intents.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.encode(message.intents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified BatchDeleteIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest} message BatchDeleteIntentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a Message message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Text.verify(message.text); + if (error) + return "text." + error; + } + } + if (message.image != null && message.hasOwnProperty("image")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.quickReplies != null && message.hasOwnProperty("quickReplies")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies.verify(message.quickReplies); + if (error) + return "quickReplies." + error; + } + } + if (message.card != null && message.hasOwnProperty("card")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Card.verify(message.card); + if (error) + return "card." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + } + if (message.simpleResponses != null && message.hasOwnProperty("simpleResponses")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.verify(message.simpleResponses); + if (error) + return "simpleResponses." + error; + } + } + if (message.basicCard != null && message.hasOwnProperty("basicCard")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.verify(message.basicCard); + if (error) + return "basicCard." + error; + } + } + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions.verify(message.suggestions); + if (error) + return "suggestions." + error; + } + } + if (message.linkOutSuggestion != null && message.hasOwnProperty("linkOutSuggestion")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.verify(message.linkOutSuggestion); + if (error) + return "linkOutSuggestion." + error; + } + } + if (message.listSelect != null && message.hasOwnProperty("listSelect")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.verify(message.listSelect); + if (error) + return "listSelect." + error; + } + } + if (message.carouselSelect != null && message.hasOwnProperty("carouselSelect")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.verify(message.carouselSelect); + if (error) + return "carouselSelect." + error; + } + } + if (message.browseCarouselCard != null && message.hasOwnProperty("browseCarouselCard")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.verify(message.browseCarouselCard); + if (error) + return "browseCarouselCard." + error; + } + } + if (message.tableCard != null && message.hasOwnProperty("tableCard")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.TableCard.verify(message.tableCard); + if (error) + return "tableCard." + error; + } + } + if (message.mediaContent != null && message.hasOwnProperty("mediaContent")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.verify(message.mediaContent); + if (error) + return "mediaContent." + error; + } + } + if (message.platform != null && message.hasOwnProperty("platform")) + switch (message.platform) { + default: + return "platform: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 11: + break; + } + return null; + }; - /** - * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteIntentsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchDeleteIntentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.text: object expected"); + message.text = $root.google.cloud.dialogflow.v2.Intent.Message.Text.fromObject(object.text); + } + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.image: object expected"); + message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.image); + } + if (object.quickReplies != null) { + if (typeof object.quickReplies !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.quickReplies: object expected"); + message.quickReplies = $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies.fromObject(object.quickReplies); + } + if (object.card != null) { + if (typeof object.card !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.card: object expected"); + message.card = $root.google.cloud.dialogflow.v2.Intent.Message.Card.fromObject(object.card); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.simpleResponses != null) { + if (typeof object.simpleResponses !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.simpleResponses: object expected"); + message.simpleResponses = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.fromObject(object.simpleResponses); + } + if (object.basicCard != null) { + if (typeof object.basicCard !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.basicCard: object expected"); + message.basicCard = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.fromObject(object.basicCard); + } + if (object.suggestions != null) { + if (typeof object.suggestions !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.suggestions: object expected"); + message.suggestions = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions.fromObject(object.suggestions); + } + if (object.linkOutSuggestion != null) { + if (typeof object.linkOutSuggestion !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.linkOutSuggestion: object expected"); + message.linkOutSuggestion = $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.fromObject(object.linkOutSuggestion); + } + if (object.listSelect != null) { + if (typeof object.listSelect !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.listSelect: object expected"); + message.listSelect = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.fromObject(object.listSelect); + } + if (object.carouselSelect != null) { + if (typeof object.carouselSelect !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.carouselSelect: object expected"); + message.carouselSelect = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.fromObject(object.carouselSelect); + } + if (object.browseCarouselCard != null) { + if (typeof object.browseCarouselCard !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.browseCarouselCard: object expected"); + message.browseCarouselCard = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.fromObject(object.browseCarouselCard); + } + if (object.tableCard != null) { + if (typeof object.tableCard !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.tableCard: object expected"); + message.tableCard = $root.google.cloud.dialogflow.v2.Intent.Message.TableCard.fromObject(object.tableCard); + } + if (object.mediaContent != null) { + if (typeof object.mediaContent !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.mediaContent: object expected"); + message.mediaContent = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.fromObject(object.mediaContent); + } + switch (object.platform) { + case "PLATFORM_UNSPECIFIED": + case 0: + message.platform = 0; + break; + case "FACEBOOK": case 1: - message.parent = reader.string(); + message.platform = 1; break; + case "SLACK": case 2: - if (!(message.intents && message.intents.length)) - message.intents = []; - message.intents.push($root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32())); + message.platform = 2; break; - default: - reader.skipType(tag & 7); + case "TELEGRAM": + case 3: + message.platform = 3; + break; + case "KIK": + case 4: + message.platform = 4; + break; + case "SKYPE": + case 5: + message.platform = 5; + break; + case "LINE": + case 6: + message.platform = 6; + break; + case "VIBER": + case 7: + message.platform = 7; + break; + case "ACTIONS_ON_GOOGLE": + case 8: + message.platform = 8; + break; + case "GOOGLE_HANGOUTS": + case 11: + message.platform = 11; break; } - } - return message; - }; - - /** - * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteIntentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return message; + }; - /** - * Verifies a BatchDeleteIntentsRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDeleteIntentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.intents != null && message.hasOwnProperty("intents")) { - if (!Array.isArray(message.intents)) - return "intents: array expected"; - for (var i = 0; i < message.intents.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intents[i]); - if (error) - return "intents." + error; + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.platform = options.enums === String ? "PLATFORM_UNSPECIFIED" : 0; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = $root.google.cloud.dialogflow.v2.Intent.Message.Text.toObject(message.text, options); + if (options.oneofs) + object.message = "text"; + } + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.image, options); + if (options.oneofs) + object.message = "image"; + } + if (message.quickReplies != null && message.hasOwnProperty("quickReplies")) { + object.quickReplies = $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies.toObject(message.quickReplies, options); + if (options.oneofs) + object.message = "quickReplies"; + } + if (message.card != null && message.hasOwnProperty("card")) { + object.card = $root.google.cloud.dialogflow.v2.Intent.Message.Card.toObject(message.card, options); + if (options.oneofs) + object.message = "card"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (options.oneofs) + object.message = "payload"; + } + if (message.platform != null && message.hasOwnProperty("platform")) + object.platform = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.Message.Platform[message.platform] : message.platform; + if (message.simpleResponses != null && message.hasOwnProperty("simpleResponses")) { + object.simpleResponses = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.toObject(message.simpleResponses, options); + if (options.oneofs) + object.message = "simpleResponses"; + } + if (message.basicCard != null && message.hasOwnProperty("basicCard")) { + object.basicCard = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.toObject(message.basicCard, options); + if (options.oneofs) + object.message = "basicCard"; + } + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + object.suggestions = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions.toObject(message.suggestions, options); + if (options.oneofs) + object.message = "suggestions"; + } + if (message.linkOutSuggestion != null && message.hasOwnProperty("linkOutSuggestion")) { + object.linkOutSuggestion = $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.toObject(message.linkOutSuggestion, options); + if (options.oneofs) + object.message = "linkOutSuggestion"; + } + if (message.listSelect != null && message.hasOwnProperty("listSelect")) { + object.listSelect = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.toObject(message.listSelect, options); + if (options.oneofs) + object.message = "listSelect"; + } + if (message.carouselSelect != null && message.hasOwnProperty("carouselSelect")) { + object.carouselSelect = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.toObject(message.carouselSelect, options); + if (options.oneofs) + object.message = "carouselSelect"; + } + if (message.browseCarouselCard != null && message.hasOwnProperty("browseCarouselCard")) { + object.browseCarouselCard = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.toObject(message.browseCarouselCard, options); + if (options.oneofs) + object.message = "browseCarouselCard"; + } + if (message.tableCard != null && message.hasOwnProperty("tableCard")) { + object.tableCard = $root.google.cloud.dialogflow.v2.Intent.Message.TableCard.toObject(message.tableCard, options); + if (options.oneofs) + object.message = "tableCard"; + } + if (message.mediaContent != null && message.hasOwnProperty("mediaContent")) { + object.mediaContent = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.toObject(message.mediaContent, options); + if (options.oneofs) + object.message = "mediaContent"; } - } - return null; - }; - - /** - * Creates a BatchDeleteIntentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest - */ - BatchDeleteIntentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.BatchDeleteIntentsRequest) return object; - var message = new $root.google.cloud.dialogflow.v2.BatchDeleteIntentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.intents) { - if (!Array.isArray(object.intents)) - throw TypeError(".google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.intents: array expected"); - message.intents = []; - for (var i = 0; i < object.intents.length; ++i) { - if (typeof object.intents[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.intents: object expected"); - message.intents[i] = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intents[i]); + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Message.Text = (function() { + + /** + * Properties of a Text. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface IText + * @property {Array.|null} [text] Text text + */ + + /** + * Constructs a new Text. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a Text. + * @implements IText + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.IText=} [properties] Properties to set + */ + function Text(properties) { + this.text = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - /** - * Creates a plain object from a BatchDeleteIntentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2.BatchDeleteIntentsRequest} message BatchDeleteIntentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDeleteIntentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.intents = []; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.intents && message.intents.length) { - object.intents = []; - for (var j = 0; j < message.intents.length; ++j) - object.intents[j] = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intents[j], options); - } - return object; - }; + /** + * Text text. + * @member {Array.} text + * @memberof google.cloud.dialogflow.v2.Intent.Message.Text + * @instance + */ + Text.prototype.text = $util.emptyArray; - /** - * Converts this BatchDeleteIntentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest - * @instance - * @returns {Object.} JSON object - */ - BatchDeleteIntentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new Text instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.Text + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IText=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.Text} Text instance + */ + Text.create = function create(properties) { + return new Text(properties); + }; - return BatchDeleteIntentsRequest; - })(); + /** + * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Text.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.Text + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IText} message Text message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Text.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && message.text.length) + for (var i = 0; i < message.text.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text[i]); + return writer; + }; - v2.IntentBatch = (function() { + /** + * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Text.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.Text + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IText} message Text message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Text.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Properties of an IntentBatch. - * @memberof google.cloud.dialogflow.v2 - * @interface IIntentBatch - * @property {Array.|null} [intents] IntentBatch intents - */ + /** + * Decodes a Text message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.Text + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.Text} Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Text.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.Text(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.text && message.text.length)) + message.text = []; + message.text.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Constructs a new IntentBatch. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an IntentBatch. - * @implements IIntentBatch - * @constructor - * @param {google.cloud.dialogflow.v2.IIntentBatch=} [properties] Properties to set - */ - function IntentBatch(properties) { - this.intents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes a Text message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.Text + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.Text} Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Text.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * IntentBatch intents. - * @member {Array.} intents - * @memberof google.cloud.dialogflow.v2.IntentBatch - * @instance - */ - IntentBatch.prototype.intents = $util.emptyArray; + /** + * Verifies a Text message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.Text + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Text.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) { + if (!Array.isArray(message.text)) + return "text: array expected"; + for (var i = 0; i < message.text.length; ++i) + if (!$util.isString(message.text[i])) + return "text: string[] expected"; + } + return null; + }; - /** - * Creates a new IntentBatch instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.IntentBatch - * @static - * @param {google.cloud.dialogflow.v2.IIntentBatch=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.IntentBatch} IntentBatch instance - */ - IntentBatch.create = function create(properties) { - return new IntentBatch(properties); - }; + /** + * Creates a Text message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.Text + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.Text} Text + */ + Text.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.Text) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.Text(); + if (object.text) { + if (!Array.isArray(object.text)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.Text.text: array expected"); + message.text = []; + for (var i = 0; i < object.text.length; ++i) + message.text[i] = String(object.text[i]); + } + return message; + }; - /** - * Encodes the specified IntentBatch message. Does not implicitly {@link google.cloud.dialogflow.v2.IntentBatch.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.IntentBatch - * @static - * @param {google.cloud.dialogflow.v2.IIntentBatch} message IntentBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntentBatch.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.intents != null && message.intents.length) - for (var i = 0; i < message.intents.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Creates a plain object from a Text message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.Text + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.Text} message Text + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Text.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.text = []; + if (message.text && message.text.length) { + object.text = []; + for (var j = 0; j < message.text.length; ++j) + object.text[j] = message.text[j]; + } + return object; + }; - /** - * Encodes the specified IntentBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.IntentBatch.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.IntentBatch - * @static - * @param {google.cloud.dialogflow.v2.IIntentBatch} message IntentBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntentBatch.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this Text to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.Text + * @instance + * @returns {Object.} JSON object + */ + Text.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes an IntentBatch message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.IntentBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.IntentBatch} IntentBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntentBatch.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.IntentBatch(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.intents && message.intents.length)) - message.intents = []; - message.intents.push($root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return Text; + })(); - /** - * Decodes an IntentBatch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.IntentBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.IntentBatch} IntentBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntentBatch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Message.Image = (function() { - /** - * Verifies an IntentBatch message. - * @function verify - * @memberof google.cloud.dialogflow.v2.IntentBatch - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntentBatch.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.intents != null && message.hasOwnProperty("intents")) { - if (!Array.isArray(message.intents)) - return "intents: array expected"; - for (var i = 0; i < message.intents.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intents[i]); - if (error) - return "intents." + error; - } - } - return null; - }; + /** + * Properties of an Image. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface IImage + * @property {string|null} [imageUri] Image imageUri + * @property {string|null} [accessibilityText] Image accessibilityText + */ - /** - * Creates an IntentBatch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.IntentBatch - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.IntentBatch} IntentBatch - */ - IntentBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.IntentBatch) - return object; - var message = new $root.google.cloud.dialogflow.v2.IntentBatch(); - if (object.intents) { - if (!Array.isArray(object.intents)) - throw TypeError(".google.cloud.dialogflow.v2.IntentBatch.intents: array expected"); - message.intents = []; - for (var i = 0; i < object.intents.length; ++i) { - if (typeof object.intents[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.IntentBatch.intents: object expected"); - message.intents[i] = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intents[i]); + /** + * Constructs a new Image. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - - /** - * Creates a plain object from an IntentBatch message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.IntentBatch - * @static - * @param {google.cloud.dialogflow.v2.IntentBatch} message IntentBatch - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntentBatch.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.intents = []; - if (message.intents && message.intents.length) { - object.intents = []; - for (var j = 0; j < message.intents.length; ++j) - object.intents[j] = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intents[j], options); - } - return object; - }; - /** - * Converts this IntentBatch to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.IntentBatch - * @instance - * @returns {Object.} JSON object - */ - IntentBatch.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Image imageUri. + * @member {string} imageUri + * @memberof google.cloud.dialogflow.v2.Intent.Message.Image + * @instance + */ + Image.prototype.imageUri = ""; - return IntentBatch; - })(); + /** + * Image accessibilityText. + * @member {string} accessibilityText + * @memberof google.cloud.dialogflow.v2.Intent.Message.Image + * @instance + */ + Image.prototype.accessibilityText = ""; - /** - * IntentView enum. - * @name google.cloud.dialogflow.v2.IntentView - * @enum {number} - * @property {number} INTENT_VIEW_UNSPECIFIED=0 INTENT_VIEW_UNSPECIFIED value - * @property {number} INTENT_VIEW_FULL=1 INTENT_VIEW_FULL value - */ - v2.IntentView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INTENT_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "INTENT_VIEW_FULL"] = 1; - return values; - })(); + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.Image + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IImage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; - v2.Sessions = (function() { + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.Image + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); + if (message.accessibilityText != null && Object.hasOwnProperty.call(message, "accessibilityText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.accessibilityText); + return writer; + }; - /** - * Constructs a new Sessions service. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a Sessions - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Sessions(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.Image + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - (Sessions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Sessions; + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.imageUri = reader.string(); + break; + case 2: + message.accessibilityText = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates new Sessions service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dialogflow.v2.Sessions - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Sessions} RPC service. Useful where requests and/or responses are streamed. - */ - Sessions.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2.Sessions#detectIntent}. - * @memberof google.cloud.dialogflow.v2.Sessions - * @typedef DetectIntentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.DetectIntentResponse} [response] DetectIntentResponse - */ + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.accessibilityText != null && message.hasOwnProperty("accessibilityText")) + if (!$util.isString(message.accessibilityText)) + return "accessibilityText: string expected"; + return null; + }; - /** - * Calls DetectIntent. - * @function detectIntent - * @memberof google.cloud.dialogflow.v2.Sessions - * @instance - * @param {google.cloud.dialogflow.v2.IDetectIntentRequest} request DetectIntentRequest message or plain object - * @param {google.cloud.dialogflow.v2.Sessions.DetectIntentCallback} callback Node-style callback called with the error, if any, and DetectIntentResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Sessions.prototype.detectIntent = function detectIntent(request, callback) { - return this.rpcCall(detectIntent, $root.google.cloud.dialogflow.v2.DetectIntentRequest, $root.google.cloud.dialogflow.v2.DetectIntentResponse, request, callback); - }, "name", { value: "DetectIntent" }); + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.Image) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.Image(); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.accessibilityText != null) + message.accessibilityText = String(object.accessibilityText); + return message; + }; - /** - * Calls DetectIntent. - * @function detectIntent - * @memberof google.cloud.dialogflow.v2.Sessions - * @instance - * @param {google.cloud.dialogflow.v2.IDetectIntentRequest} request DetectIntentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.Image + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.imageUri = ""; + object.accessibilityText = ""; + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.accessibilityText != null && message.hasOwnProperty("accessibilityText")) + object.accessibilityText = message.accessibilityText; + return object; + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2.Sessions#streamingDetectIntent}. - * @memberof google.cloud.dialogflow.v2.Sessions - * @typedef StreamingDetectIntentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.StreamingDetectIntentResponse} [response] StreamingDetectIntentResponse - */ + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls StreamingDetectIntent. - * @function streamingDetectIntent - * @memberof google.cloud.dialogflow.v2.Sessions - * @instance - * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentRequest} request StreamingDetectIntentRequest message or plain object - * @param {google.cloud.dialogflow.v2.Sessions.StreamingDetectIntentCallback} callback Node-style callback called with the error, if any, and StreamingDetectIntentResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Sessions.prototype.streamingDetectIntent = function streamingDetectIntent(request, callback) { - return this.rpcCall(streamingDetectIntent, $root.google.cloud.dialogflow.v2.StreamingDetectIntentRequest, $root.google.cloud.dialogflow.v2.StreamingDetectIntentResponse, request, callback); - }, "name", { value: "StreamingDetectIntent" }); + return Image; + })(); - /** - * Calls StreamingDetectIntent. - * @function streamingDetectIntent - * @memberof google.cloud.dialogflow.v2.Sessions - * @instance - * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentRequest} request StreamingDetectIntentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + Message.QuickReplies = (function() { - return Sessions; - })(); + /** + * Properties of a QuickReplies. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface IQuickReplies + * @property {string|null} [title] QuickReplies title + * @property {Array.|null} [quickReplies] QuickReplies quickReplies + */ - v2.DetectIntentRequest = (function() { + /** + * Constructs a new QuickReplies. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a QuickReplies. + * @implements IQuickReplies + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.IQuickReplies=} [properties] Properties to set + */ + function QuickReplies(properties) { + this.quickReplies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a DetectIntentRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IDetectIntentRequest - * @property {string|null} [session] DetectIntentRequest session - * @property {google.cloud.dialogflow.v2.IQueryParameters|null} [queryParams] DetectIntentRequest queryParams - * @property {google.cloud.dialogflow.v2.IQueryInput|null} [queryInput] DetectIntentRequest queryInput - * @property {google.cloud.dialogflow.v2.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentRequest outputAudioConfig - * @property {google.protobuf.IFieldMask|null} [outputAudioConfigMask] DetectIntentRequest outputAudioConfigMask - * @property {Uint8Array|null} [inputAudio] DetectIntentRequest inputAudio - */ + /** + * QuickReplies title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies + * @instance + */ + QuickReplies.prototype.title = ""; - /** - * Constructs a new DetectIntentRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a DetectIntentRequest. - * @implements IDetectIntentRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IDetectIntentRequest=} [properties] Properties to set - */ - function DetectIntentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * QuickReplies quickReplies. + * @member {Array.} quickReplies + * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies + * @instance + */ + QuickReplies.prototype.quickReplies = $util.emptyArray; - /** - * DetectIntentRequest session. - * @member {string} session - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @instance - */ - DetectIntentRequest.prototype.session = ""; + /** + * Creates a new QuickReplies instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IQuickReplies=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.QuickReplies} QuickReplies instance + */ + QuickReplies.create = function create(properties) { + return new QuickReplies(properties); + }; - /** - * DetectIntentRequest queryParams. - * @member {google.cloud.dialogflow.v2.IQueryParameters|null|undefined} queryParams - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @instance - */ - DetectIntentRequest.prototype.queryParams = null; + /** + * Encodes the specified QuickReplies message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.QuickReplies.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IQuickReplies} message QuickReplies message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuickReplies.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.quickReplies != null && message.quickReplies.length) + for (var i = 0; i < message.quickReplies.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.quickReplies[i]); + return writer; + }; - /** - * DetectIntentRequest queryInput. - * @member {google.cloud.dialogflow.v2.IQueryInput|null|undefined} queryInput - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @instance - */ - DetectIntentRequest.prototype.queryInput = null; + /** + * Encodes the specified QuickReplies message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.QuickReplies.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IQuickReplies} message QuickReplies message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuickReplies.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * DetectIntentRequest outputAudioConfig. - * @member {google.cloud.dialogflow.v2.IOutputAudioConfig|null|undefined} outputAudioConfig - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @instance - */ - DetectIntentRequest.prototype.outputAudioConfig = null; + /** + * Decodes a QuickReplies message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.QuickReplies} QuickReplies + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuickReplies.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + if (!(message.quickReplies && message.quickReplies.length)) + message.quickReplies = []; + message.quickReplies.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * DetectIntentRequest outputAudioConfigMask. - * @member {google.protobuf.IFieldMask|null|undefined} outputAudioConfigMask - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @instance - */ - DetectIntentRequest.prototype.outputAudioConfigMask = null; - - /** - * DetectIntentRequest inputAudio. - * @member {Uint8Array} inputAudio - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @instance - */ - DetectIntentRequest.prototype.inputAudio = $util.newBuffer([]); + /** + * Decodes a QuickReplies message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.QuickReplies} QuickReplies + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuickReplies.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new DetectIntentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IDetectIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.DetectIntentRequest} DetectIntentRequest instance - */ - DetectIntentRequest.create = function create(properties) { - return new DetectIntentRequest(properties); - }; + /** + * Verifies a QuickReplies message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuickReplies.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.quickReplies != null && message.hasOwnProperty("quickReplies")) { + if (!Array.isArray(message.quickReplies)) + return "quickReplies: array expected"; + for (var i = 0; i < message.quickReplies.length; ++i) + if (!$util.isString(message.quickReplies[i])) + return "quickReplies: string[] expected"; + } + return null; + }; - /** - * Encodes the specified DetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IDetectIntentRequest} message DetectIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetectIntentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) - $root.google.cloud.dialogflow.v2.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) - $root.google.cloud.dialogflow.v2.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) - $root.google.cloud.dialogflow.v2.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.inputAudio != null && Object.hasOwnProperty.call(message, "inputAudio")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.inputAudio); - if (message.outputAudioConfigMask != null && Object.hasOwnProperty.call(message, "outputAudioConfigMask")) - $root.google.protobuf.FieldMask.encode(message.outputAudioConfigMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; + /** + * Creates a QuickReplies message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.QuickReplies} QuickReplies + */ + QuickReplies.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.QuickReplies(); + if (object.title != null) + message.title = String(object.title); + if (object.quickReplies) { + if (!Array.isArray(object.quickReplies)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.QuickReplies.quickReplies: array expected"); + message.quickReplies = []; + for (var i = 0; i < object.quickReplies.length; ++i) + message.quickReplies[i] = String(object.quickReplies[i]); + } + return message; + }; - /** - * Encodes the specified DetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IDetectIntentRequest} message DetectIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a QuickReplies message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.QuickReplies} message QuickReplies + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuickReplies.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quickReplies = []; + if (options.defaults) + object.title = ""; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.quickReplies && message.quickReplies.length) { + object.quickReplies = []; + for (var j = 0; j < message.quickReplies.length; ++j) + object.quickReplies[j] = message.quickReplies[j]; + } + return object; + }; - /** - * Decodes a DetectIntentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.DetectIntentRequest} DetectIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetectIntentRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DetectIntentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.session = reader.string(); - break; - case 2: - message.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.decode(reader, reader.uint32()); - break; - case 3: - message.queryInput = $root.google.cloud.dialogflow.v2.QueryInput.decode(reader, reader.uint32()); - break; - case 4: - message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.decode(reader, reader.uint32()); - break; - case 7: - message.outputAudioConfigMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 5: - message.inputAudio = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this QuickReplies to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.QuickReplies + * @instance + * @returns {Object.} JSON object + */ + QuickReplies.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a DetectIntentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.DetectIntentRequest} DetectIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return QuickReplies; + })(); - /** - * Verifies a DetectIntentRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DetectIntentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.queryParams != null && message.hasOwnProperty("queryParams")) { - var error = $root.google.cloud.dialogflow.v2.QueryParameters.verify(message.queryParams); - if (error) - return "queryParams." + error; - } - if (message.queryInput != null && message.hasOwnProperty("queryInput")) { - var error = $root.google.cloud.dialogflow.v2.QueryInput.verify(message.queryInput); - if (error) - return "queryInput." + error; - } - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { - var error = $root.google.cloud.dialogflow.v2.OutputAudioConfig.verify(message.outputAudioConfig); - if (error) - return "outputAudioConfig." + error; - } - if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.outputAudioConfigMask); - if (error) - return "outputAudioConfigMask." + error; - } - if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) - if (!(message.inputAudio && typeof message.inputAudio.length === "number" || $util.isString(message.inputAudio))) - return "inputAudio: buffer expected"; - return null; - }; + Message.Card = (function() { - /** - * Creates a DetectIntentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.DetectIntentRequest} DetectIntentRequest - */ - DetectIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.DetectIntentRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.DetectIntentRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.queryParams != null) { - if (typeof object.queryParams !== "object") - throw TypeError(".google.cloud.dialogflow.v2.DetectIntentRequest.queryParams: object expected"); - message.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.fromObject(object.queryParams); - } - if (object.queryInput != null) { - if (typeof object.queryInput !== "object") - throw TypeError(".google.cloud.dialogflow.v2.DetectIntentRequest.queryInput: object expected"); - message.queryInput = $root.google.cloud.dialogflow.v2.QueryInput.fromObject(object.queryInput); - } - if (object.outputAudioConfig != null) { - if (typeof object.outputAudioConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2.DetectIntentRequest.outputAudioConfig: object expected"); - message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.fromObject(object.outputAudioConfig); - } - if (object.outputAudioConfigMask != null) { - if (typeof object.outputAudioConfigMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2.DetectIntentRequest.outputAudioConfigMask: object expected"); - message.outputAudioConfigMask = $root.google.protobuf.FieldMask.fromObject(object.outputAudioConfigMask); - } - if (object.inputAudio != null) - if (typeof object.inputAudio === "string") - $util.base64.decode(object.inputAudio, message.inputAudio = $util.newBuffer($util.base64.length(object.inputAudio)), 0); - else if (object.inputAudio.length) - message.inputAudio = object.inputAudio; - return message; - }; + /** + * Properties of a Card. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface ICard + * @property {string|null} [title] Card title + * @property {string|null} [subtitle] Card subtitle + * @property {string|null} [imageUri] Card imageUri + * @property {Array.|null} [buttons] Card buttons + */ - /** - * Creates a plain object from a DetectIntentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.DetectIntentRequest} message DetectIntentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DetectIntentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.session = ""; - object.queryParams = null; - object.queryInput = null; - object.outputAudioConfig = null; - if (options.bytes === String) - object.inputAudio = ""; - else { - object.inputAudio = []; - if (options.bytes !== Array) - object.inputAudio = $util.newBuffer(object.inputAudio); + /** + * Constructs a new Card. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a Card. + * @implements ICard + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.ICard=} [properties] Properties to set + */ + function Card(properties) { + this.buttons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - object.outputAudioConfigMask = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.queryParams != null && message.hasOwnProperty("queryParams")) - object.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.toObject(message.queryParams, options); - if (message.queryInput != null && message.hasOwnProperty("queryInput")) - object.queryInput = $root.google.cloud.dialogflow.v2.QueryInput.toObject(message.queryInput, options); - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) - object.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.toObject(message.outputAudioConfig, options); - if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) - object.inputAudio = options.bytes === String ? $util.base64.encode(message.inputAudio, 0, message.inputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputAudio) : message.inputAudio; - if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) - object.outputAudioConfigMask = $root.google.protobuf.FieldMask.toObject(message.outputAudioConfigMask, options); - return object; - }; - - /** - * Converts this DetectIntentRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.DetectIntentRequest - * @instance - * @returns {Object.} JSON object - */ - DetectIntentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DetectIntentRequest; - })(); - - v2.DetectIntentResponse = (function() { - /** - * Properties of a DetectIntentResponse. - * @memberof google.cloud.dialogflow.v2 - * @interface IDetectIntentResponse - * @property {string|null} [responseId] DetectIntentResponse responseId - * @property {google.cloud.dialogflow.v2.IQueryResult|null} [queryResult] DetectIntentResponse queryResult - * @property {google.rpc.IStatus|null} [webhookStatus] DetectIntentResponse webhookStatus - * @property {Uint8Array|null} [outputAudio] DetectIntentResponse outputAudio - * @property {google.cloud.dialogflow.v2.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentResponse outputAudioConfig - */ + /** + * Card title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @instance + */ + Card.prototype.title = ""; - /** - * Constructs a new DetectIntentResponse. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a DetectIntentResponse. - * @implements IDetectIntentResponse - * @constructor - * @param {google.cloud.dialogflow.v2.IDetectIntentResponse=} [properties] Properties to set - */ - function DetectIntentResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Card subtitle. + * @member {string} subtitle + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @instance + */ + Card.prototype.subtitle = ""; - /** - * DetectIntentResponse responseId. - * @member {string} responseId - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @instance - */ - DetectIntentResponse.prototype.responseId = ""; + /** + * Card imageUri. + * @member {string} imageUri + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @instance + */ + Card.prototype.imageUri = ""; - /** - * DetectIntentResponse queryResult. - * @member {google.cloud.dialogflow.v2.IQueryResult|null|undefined} queryResult - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @instance - */ - DetectIntentResponse.prototype.queryResult = null; + /** + * Card buttons. + * @member {Array.} buttons + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @instance + */ + Card.prototype.buttons = $util.emptyArray; - /** - * DetectIntentResponse webhookStatus. - * @member {google.rpc.IStatus|null|undefined} webhookStatus - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @instance - */ - DetectIntentResponse.prototype.webhookStatus = null; + /** + * Creates a new Card instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ICard=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.Card} Card instance + */ + Card.create = function create(properties) { + return new Card(properties); + }; - /** - * DetectIntentResponse outputAudio. - * @member {Uint8Array} outputAudio - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @instance - */ - DetectIntentResponse.prototype.outputAudio = $util.newBuffer([]); + /** + * Encodes the specified Card message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ICard} message Card message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Card.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageUri); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button.encode(message.buttons[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * DetectIntentResponse outputAudioConfig. - * @member {google.cloud.dialogflow.v2.IOutputAudioConfig|null|undefined} outputAudioConfig - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @instance - */ - DetectIntentResponse.prototype.outputAudioConfig = null; + /** + * Encodes the specified Card message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ICard} message Card message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Card.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new DetectIntentResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @static - * @param {google.cloud.dialogflow.v2.IDetectIntentResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.DetectIntentResponse} DetectIntentResponse instance - */ - DetectIntentResponse.create = function create(properties) { - return new DetectIntentResponse(properties); - }; - - /** - * Encodes the specified DetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @static - * @param {google.cloud.dialogflow.v2.IDetectIntentResponse} message DetectIntentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetectIntentResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); - if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) - $root.google.cloud.dialogflow.v2.QueryResult.encode(message.queryResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.webhookStatus != null && Object.hasOwnProperty.call(message, "webhookStatus")) - $root.google.rpc.Status.encode(message.webhookStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outputAudio != null && Object.hasOwnProperty.call(message, "outputAudio")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.outputAudio); - if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) - $root.google.cloud.dialogflow.v2.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DetectIntentResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @static - * @param {google.cloud.dialogflow.v2.IDetectIntentResponse} message DetectIntentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DetectIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a Card message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.Card} Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Card.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.Card(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.subtitle = reader.string(); + break; + case 3: + message.imageUri = reader.string(); + break; + case 4: + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.google.cloud.dialogflow.v2.Intent.Message.Card.Button.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a DetectIntentResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.DetectIntentResponse} DetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetectIntentResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DetectIntentResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.responseId = reader.string(); - break; - case 2: - message.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.decode(reader, reader.uint32()); - break; - case 3: - message.webhookStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 4: - message.outputAudio = reader.bytes(); - break; - case 6: - message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a Card message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.Card} Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Card.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a DetectIntentResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.DetectIntentResponse} DetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DetectIntentResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a Card message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Card.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } + } + return null; + }; - /** - * Verifies a DetectIntentResponse message. - * @function verify - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DetectIntentResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseId != null && message.hasOwnProperty("responseId")) - if (!$util.isString(message.responseId)) - return "responseId: string expected"; - if (message.queryResult != null && message.hasOwnProperty("queryResult")) { - var error = $root.google.cloud.dialogflow.v2.QueryResult.verify(message.queryResult); - if (error) - return "queryResult." + error; - } - if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) { - var error = $root.google.rpc.Status.verify(message.webhookStatus); - if (error) - return "webhookStatus." + error; - } - if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) - if (!(message.outputAudio && typeof message.outputAudio.length === "number" || $util.isString(message.outputAudio))) - return "outputAudio: buffer expected"; - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { - var error = $root.google.cloud.dialogflow.v2.OutputAudioConfig.verify(message.outputAudioConfig); - if (error) - return "outputAudioConfig." + error; - } - return null; - }; + /** + * Creates a Card message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.Card} Card + */ + Card.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.Card) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.Card(); + if (object.title != null) + message.title = String(object.title); + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.Card.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.Card.buttons: object expected"); + message.buttons[i] = $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button.fromObject(object.buttons[i]); + } + } + return message; + }; - /** - * Creates a DetectIntentResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.DetectIntentResponse} DetectIntentResponse - */ - DetectIntentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.DetectIntentResponse) - return object; - var message = new $root.google.cloud.dialogflow.v2.DetectIntentResponse(); - if (object.responseId != null) - message.responseId = String(object.responseId); - if (object.queryResult != null) { - if (typeof object.queryResult !== "object") - throw TypeError(".google.cloud.dialogflow.v2.DetectIntentResponse.queryResult: object expected"); - message.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.fromObject(object.queryResult); - } - if (object.webhookStatus != null) { - if (typeof object.webhookStatus !== "object") - throw TypeError(".google.cloud.dialogflow.v2.DetectIntentResponse.webhookStatus: object expected"); - message.webhookStatus = $root.google.rpc.Status.fromObject(object.webhookStatus); - } - if (object.outputAudio != null) - if (typeof object.outputAudio === "string") - $util.base64.decode(object.outputAudio, message.outputAudio = $util.newBuffer($util.base64.length(object.outputAudio)), 0); - else if (object.outputAudio.length) - message.outputAudio = object.outputAudio; - if (object.outputAudioConfig != null) { - if (typeof object.outputAudioConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2.DetectIntentResponse.outputAudioConfig: object expected"); - message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.fromObject(object.outputAudioConfig); - } - return message; - }; + /** + * Creates a plain object from a Card message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.Card} message Card + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Card.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buttons = []; + if (options.defaults) { + object.title = ""; + object.subtitle = ""; + object.imageUri = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button.toObject(message.buttons[j], options); + } + return object; + }; - /** - * Creates a plain object from a DetectIntentResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @static - * @param {google.cloud.dialogflow.v2.DetectIntentResponse} message DetectIntentResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DetectIntentResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseId = ""; - object.queryResult = null; - object.webhookStatus = null; - if (options.bytes === String) - object.outputAudio = ""; - else { - object.outputAudio = []; - if (options.bytes !== Array) - object.outputAudio = $util.newBuffer(object.outputAudio); - } - object.outputAudioConfig = null; - } - if (message.responseId != null && message.hasOwnProperty("responseId")) - object.responseId = message.responseId; - if (message.queryResult != null && message.hasOwnProperty("queryResult")) - object.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.toObject(message.queryResult, options); - if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) - object.webhookStatus = $root.google.rpc.Status.toObject(message.webhookStatus, options); - if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) - object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) - object.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.toObject(message.outputAudioConfig, options); - return object; - }; + /** + * Converts this Card to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @instance + * @returns {Object.} JSON object + */ + Card.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this DetectIntentResponse to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.DetectIntentResponse - * @instance - * @returns {Object.} JSON object - */ - DetectIntentResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Card.Button = (function() { - return DetectIntentResponse; - })(); + /** + * Properties of a Button. + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @interface IButton + * @property {string|null} [text] Button text + * @property {string|null} [postback] Button postback + */ - v2.QueryParameters = (function() { + /** + * Constructs a new Button. + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card + * @classdesc Represents a Button. + * @implements IButton + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.Card.IButton=} [properties] Properties to set + */ + function Button(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a QueryParameters. - * @memberof google.cloud.dialogflow.v2 - * @interface IQueryParameters - * @property {string|null} [timeZone] QueryParameters timeZone - * @property {google.type.ILatLng|null} [geoLocation] QueryParameters geoLocation - * @property {Array.|null} [contexts] QueryParameters contexts - * @property {boolean|null} [resetContexts] QueryParameters resetContexts - * @property {Array.|null} [sessionEntityTypes] QueryParameters sessionEntityTypes - * @property {google.protobuf.IStruct|null} [payload] QueryParameters payload - * @property {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig|null} [sentimentAnalysisRequestConfig] QueryParameters sentimentAnalysisRequestConfig - * @property {Object.|null} [webhookHeaders] QueryParameters webhookHeaders - */ + /** + * Button text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button + * @instance + */ + Button.prototype.text = ""; - /** - * Constructs a new QueryParameters. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a QueryParameters. - * @implements IQueryParameters - * @constructor - * @param {google.cloud.dialogflow.v2.IQueryParameters=} [properties] Properties to set - */ - function QueryParameters(properties) { - this.contexts = []; - this.sessionEntityTypes = []; - this.webhookHeaders = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Button postback. + * @member {string} postback + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button + * @instance + */ + Button.prototype.postback = ""; - /** - * QueryParameters timeZone. - * @member {string} timeZone - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @instance - */ - QueryParameters.prototype.timeZone = ""; + /** + * Creates a new Button instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.Card.IButton=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.Card.Button} Button instance + */ + Button.create = function create(properties) { + return new Button(properties); + }; - /** - * QueryParameters geoLocation. - * @member {google.type.ILatLng|null|undefined} geoLocation - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @instance - */ - QueryParameters.prototype.geoLocation = null; + /** + * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.Button.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.Card.IButton} message Button message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Button.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.postback != null && Object.hasOwnProperty.call(message, "postback")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.postback); + return writer; + }; - /** - * QueryParameters contexts. - * @member {Array.} contexts - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @instance - */ - QueryParameters.prototype.contexts = $util.emptyArray; + /** + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Card.Button.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.Card.IButton} message Button message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Button.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * QueryParameters resetContexts. - * @member {boolean} resetContexts - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @instance - */ - QueryParameters.prototype.resetContexts = false; + /** + * Decodes a Button message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.Card.Button} Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Button.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.postback = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * QueryParameters sessionEntityTypes. - * @member {Array.} sessionEntityTypes - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @instance - */ - QueryParameters.prototype.sessionEntityTypes = $util.emptyArray; + /** + * Decodes a Button message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.Card.Button} Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Button.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * QueryParameters payload. - * @member {google.protobuf.IStruct|null|undefined} payload - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @instance - */ - QueryParameters.prototype.payload = null; + /** + * Verifies a Button message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Button.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.postback != null && message.hasOwnProperty("postback")) + if (!$util.isString(message.postback)) + return "postback: string expected"; + return null; + }; - /** - * QueryParameters sentimentAnalysisRequestConfig. - * @member {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig|null|undefined} sentimentAnalysisRequestConfig - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @instance - */ - QueryParameters.prototype.sentimentAnalysisRequestConfig = null; + /** + * Creates a Button message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.Card.Button} Button + */ + Button.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.Card.Button(); + if (object.text != null) + message.text = String(object.text); + if (object.postback != null) + message.postback = String(object.postback); + return message; + }; - /** - * QueryParameters webhookHeaders. - * @member {Object.} webhookHeaders - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @instance - */ - QueryParameters.prototype.webhookHeaders = $util.emptyObject; + /** + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.Card.Button} message Button + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Button.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.postback = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.postback != null && message.hasOwnProperty("postback")) + object.postback = message.postback; + return object; + }; - /** - * Creates a new QueryParameters instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @static - * @param {google.cloud.dialogflow.v2.IQueryParameters=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.QueryParameters} QueryParameters instance - */ - QueryParameters.create = function create(properties) { - return new QueryParameters(properties); - }; + /** + * Converts this Button to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.Card.Button + * @instance + * @returns {Object.} JSON object + */ + Button.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified QueryParameters message. Does not implicitly {@link google.cloud.dialogflow.v2.QueryParameters.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @static - * @param {google.cloud.dialogflow.v2.IQueryParameters} message QueryParameters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParameters.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeZone); - if (message.geoLocation != null && Object.hasOwnProperty.call(message, "geoLocation")) - $root.google.type.LatLng.encode(message.geoLocation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.contexts != null && message.contexts.length) - for (var i = 0; i < message.contexts.length; ++i) - $root.google.cloud.dialogflow.v2.Context.encode(message.contexts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.resetContexts != null && Object.hasOwnProperty.call(message, "resetContexts")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.resetContexts); - if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) - for (var i = 0; i < message.sessionEntityTypes.length; ++i) - $root.google.cloud.dialogflow.v2.SessionEntityType.encode(message.sessionEntityTypes[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.sentimentAnalysisRequestConfig != null && Object.hasOwnProperty.call(message, "sentimentAnalysisRequestConfig")) - $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.encode(message.sentimentAnalysisRequestConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.webhookHeaders != null && Object.hasOwnProperty.call(message, "webhookHeaders")) - for (var keys = Object.keys(message.webhookHeaders), i = 0; i < keys.length; ++i) - writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.webhookHeaders[keys[i]]).ldelim(); - return writer; - }; + return Button; + })(); - /** - * Encodes the specified QueryParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.QueryParameters.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @static - * @param {google.cloud.dialogflow.v2.IQueryParameters} message QueryParameters message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryParameters.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return Card; + })(); - /** - * Decodes a QueryParameters message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.QueryParameters} QueryParameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParameters.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.QueryParameters(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.timeZone = reader.string(); - break; - case 2: - message.geoLocation = $root.google.type.LatLng.decode(reader, reader.uint32()); - break; - case 3: - if (!(message.contexts && message.contexts.length)) - message.contexts = []; - message.contexts.push($root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32())); - break; - case 4: - message.resetContexts = reader.bool(); - break; - case 5: - if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) - message.sessionEntityTypes = []; - message.sessionEntityTypes.push($root.google.cloud.dialogflow.v2.SessionEntityType.decode(reader, reader.uint32())); - break; - case 6: - message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 10: - message.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.decode(reader, reader.uint32()); - break; - case 14: - if (message.webhookHeaders === $util.emptyObject) - message.webhookHeaders = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { + Message.SimpleResponse = (function() { + + /** + * Properties of a SimpleResponse. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface ISimpleResponse + * @property {string|null} [textToSpeech] SimpleResponse textToSpeech + * @property {string|null} [ssml] SimpleResponse ssml + * @property {string|null} [displayText] SimpleResponse displayText + */ + + /** + * Constructs a new SimpleResponse. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a SimpleResponse. + * @implements ISimpleResponse + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse=} [properties] Properties to set + */ + function SimpleResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimpleResponse textToSpeech. + * @member {string} textToSpeech + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + * @instance + */ + SimpleResponse.prototype.textToSpeech = ""; + + /** + * SimpleResponse ssml. + * @member {string} ssml + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + * @instance + */ + SimpleResponse.prototype.ssml = ""; + + /** + * SimpleResponse displayText. + * @member {string} displayText + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + * @instance + */ + SimpleResponse.prototype.displayText = ""; + + /** + * Creates a new SimpleResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponse} SimpleResponse instance + */ + SimpleResponse.create = function create(properties) { + return new SimpleResponse(properties); + }; + + /** + * Encodes the specified SimpleResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse} message SimpleResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textToSpeech != null && Object.hasOwnProperty.call(message, "textToSpeech")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textToSpeech); + if (message.ssml != null && Object.hasOwnProperty.call(message, "ssml")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ssml); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayText); + return writer; + }; + + /** + * Encodes the specified SimpleResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponse} message SimpleResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimpleResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponse} SimpleResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - key = reader.string(); + message.textToSpeech = reader.string(); break; case 2: - value = reader.string(); + message.ssml = reader.string(); + break; + case 3: + message.displayText = reader.string(); break; default: - reader.skipType(tag2 & 7); + reader.skipType(tag & 7); break; } } - message.webhookHeaders[key] = value; - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return message; + }; - /** - * Decodes a QueryParameters message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.QueryParameters} QueryParameters - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryParameters.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SimpleResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponse} SimpleResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a QueryParameters message. - * @function verify - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryParameters.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - if (message.geoLocation != null && message.hasOwnProperty("geoLocation")) { - var error = $root.google.type.LatLng.verify(message.geoLocation); - if (error) - return "geoLocation." + error; - } - if (message.contexts != null && message.hasOwnProperty("contexts")) { - if (!Array.isArray(message.contexts)) - return "contexts: array expected"; - for (var i = 0; i < message.contexts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Context.verify(message.contexts[i]); - if (error) - return "contexts." + error; - } - } - if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) - if (typeof message.resetContexts !== "boolean") - return "resetContexts: boolean expected"; - if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { - if (!Array.isArray(message.sessionEntityTypes)) - return "sessionEntityTypes: array expected"; - for (var i = 0; i < message.sessionEntityTypes.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.SessionEntityType.verify(message.sessionEntityTypes[i]); - if (error) - return "sessionEntityTypes." + error; - } - } - if (message.payload != null && message.hasOwnProperty("payload")) { - var error = $root.google.protobuf.Struct.verify(message.payload); - if (error) - return "payload." + error; - } - if (message.sentimentAnalysisRequestConfig != null && message.hasOwnProperty("sentimentAnalysisRequestConfig")) { - var error = $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.verify(message.sentimentAnalysisRequestConfig); - if (error) - return "sentimentAnalysisRequestConfig." + error; - } - if (message.webhookHeaders != null && message.hasOwnProperty("webhookHeaders")) { - if (!$util.isObject(message.webhookHeaders)) - return "webhookHeaders: object expected"; - var key = Object.keys(message.webhookHeaders); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.webhookHeaders[key[i]])) - return "webhookHeaders: string{k:string} expected"; - } - return null; - }; + /** + * Verifies a SimpleResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimpleResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textToSpeech != null && message.hasOwnProperty("textToSpeech")) + if (!$util.isString(message.textToSpeech)) + return "textToSpeech: string expected"; + if (message.ssml != null && message.hasOwnProperty("ssml")) + if (!$util.isString(message.ssml)) + return "ssml: string expected"; + if (message.displayText != null && message.hasOwnProperty("displayText")) + if (!$util.isString(message.displayText)) + return "displayText: string expected"; + return null; + }; - /** - * Creates a QueryParameters message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.QueryParameters} QueryParameters - */ - QueryParameters.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.QueryParameters) - return object; - var message = new $root.google.cloud.dialogflow.v2.QueryParameters(); - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - if (object.geoLocation != null) { - if (typeof object.geoLocation !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.geoLocation: object expected"); - message.geoLocation = $root.google.type.LatLng.fromObject(object.geoLocation); - } - if (object.contexts) { - if (!Array.isArray(object.contexts)) - throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.contexts: array expected"); - message.contexts = []; - for (var i = 0; i < object.contexts.length; ++i) { - if (typeof object.contexts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.contexts: object expected"); - message.contexts[i] = $root.google.cloud.dialogflow.v2.Context.fromObject(object.contexts[i]); - } - } - if (object.resetContexts != null) - message.resetContexts = Boolean(object.resetContexts); - if (object.sessionEntityTypes) { - if (!Array.isArray(object.sessionEntityTypes)) - throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.sessionEntityTypes: array expected"); - message.sessionEntityTypes = []; - for (var i = 0; i < object.sessionEntityTypes.length; ++i) { - if (typeof object.sessionEntityTypes[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.sessionEntityTypes: object expected"); - message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.v2.SessionEntityType.fromObject(object.sessionEntityTypes[i]); - } - } - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.payload: object expected"); - message.payload = $root.google.protobuf.Struct.fromObject(object.payload); - } - if (object.sentimentAnalysisRequestConfig != null) { - if (typeof object.sentimentAnalysisRequestConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.sentimentAnalysisRequestConfig: object expected"); - message.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.fromObject(object.sentimentAnalysisRequestConfig); - } - if (object.webhookHeaders) { - if (typeof object.webhookHeaders !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryParameters.webhookHeaders: object expected"); - message.webhookHeaders = {}; - for (var keys = Object.keys(object.webhookHeaders), i = 0; i < keys.length; ++i) - message.webhookHeaders[keys[i]] = String(object.webhookHeaders[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a QueryParameters message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @static - * @param {google.cloud.dialogflow.v2.QueryParameters} message QueryParameters - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParameters.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.contexts = []; - object.sessionEntityTypes = []; - } - if (options.objects || options.defaults) - object.webhookHeaders = {}; - if (options.defaults) { - object.timeZone = ""; - object.geoLocation = null; - object.resetContexts = false; - object.payload = null; - object.sentimentAnalysisRequestConfig = null; - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - if (message.geoLocation != null && message.hasOwnProperty("geoLocation")) - object.geoLocation = $root.google.type.LatLng.toObject(message.geoLocation, options); - if (message.contexts && message.contexts.length) { - object.contexts = []; - for (var j = 0; j < message.contexts.length; ++j) - object.contexts[j] = $root.google.cloud.dialogflow.v2.Context.toObject(message.contexts[j], options); - } - if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) - object.resetContexts = message.resetContexts; - if (message.sessionEntityTypes && message.sessionEntityTypes.length) { - object.sessionEntityTypes = []; - for (var j = 0; j < message.sessionEntityTypes.length; ++j) - object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.v2.SessionEntityType.toObject(message.sessionEntityTypes[j], options); - } - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); - if (message.sentimentAnalysisRequestConfig != null && message.hasOwnProperty("sentimentAnalysisRequestConfig")) - object.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.toObject(message.sentimentAnalysisRequestConfig, options); - var keys2; - if (message.webhookHeaders && (keys2 = Object.keys(message.webhookHeaders)).length) { - object.webhookHeaders = {}; - for (var j = 0; j < keys2.length; ++j) - object.webhookHeaders[keys2[j]] = message.webhookHeaders[keys2[j]]; - } - return object; - }; + /** + * Creates a SimpleResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponse} SimpleResponse + */ + SimpleResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse(); + if (object.textToSpeech != null) + message.textToSpeech = String(object.textToSpeech); + if (object.ssml != null) + message.ssml = String(object.ssml); + if (object.displayText != null) + message.displayText = String(object.displayText); + return message; + }; - /** - * Converts this QueryParameters to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.QueryParameters - * @instance - * @returns {Object.} JSON object - */ - QueryParameters.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a SimpleResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.SimpleResponse} message SimpleResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimpleResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textToSpeech = ""; + object.ssml = ""; + object.displayText = ""; + } + if (message.textToSpeech != null && message.hasOwnProperty("textToSpeech")) + object.textToSpeech = message.textToSpeech; + if (message.ssml != null && message.hasOwnProperty("ssml")) + object.ssml = message.ssml; + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = message.displayText; + return object; + }; - return QueryParameters; - })(); + /** + * Converts this SimpleResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponse + * @instance + * @returns {Object.} JSON object + */ + SimpleResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v2.QueryInput = (function() { + return SimpleResponse; + })(); - /** - * Properties of a QueryInput. - * @memberof google.cloud.dialogflow.v2 - * @interface IQueryInput - * @property {google.cloud.dialogflow.v2.IInputAudioConfig|null} [audioConfig] QueryInput audioConfig - * @property {google.cloud.dialogflow.v2.ITextInput|null} [text] QueryInput text - * @property {google.cloud.dialogflow.v2.IEventInput|null} [event] QueryInput event - */ + Message.SimpleResponses = (function() { - /** - * Constructs a new QueryInput. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a QueryInput. - * @implements IQueryInput - * @constructor - * @param {google.cloud.dialogflow.v2.IQueryInput=} [properties] Properties to set - */ - function QueryInput(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a SimpleResponses. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface ISimpleResponses + * @property {Array.|null} [simpleResponses] SimpleResponses simpleResponses + */ - /** - * QueryInput audioConfig. - * @member {google.cloud.dialogflow.v2.IInputAudioConfig|null|undefined} audioConfig - * @memberof google.cloud.dialogflow.v2.QueryInput - * @instance - */ - QueryInput.prototype.audioConfig = null; + /** + * Constructs a new SimpleResponses. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a SimpleResponses. + * @implements ISimpleResponses + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses=} [properties] Properties to set + */ + function SimpleResponses(properties) { + this.simpleResponses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * QueryInput text. - * @member {google.cloud.dialogflow.v2.ITextInput|null|undefined} text - * @memberof google.cloud.dialogflow.v2.QueryInput - * @instance - */ - QueryInput.prototype.text = null; + /** + * SimpleResponses simpleResponses. + * @member {Array.} simpleResponses + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses + * @instance + */ + SimpleResponses.prototype.simpleResponses = $util.emptyArray; - /** - * QueryInput event. - * @member {google.cloud.dialogflow.v2.IEventInput|null|undefined} event - * @memberof google.cloud.dialogflow.v2.QueryInput - * @instance - */ - QueryInput.prototype.event = null; + /** + * Creates a new SimpleResponses instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponses} SimpleResponses instance + */ + SimpleResponses.create = function create(properties) { + return new SimpleResponses(properties); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Encodes the specified SimpleResponses message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses} message SimpleResponses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleResponses.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.simpleResponses != null && message.simpleResponses.length) + for (var i = 0; i < message.simpleResponses.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.encode(message.simpleResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * QueryInput input. - * @member {"audioConfig"|"text"|"event"|undefined} input - * @memberof google.cloud.dialogflow.v2.QueryInput - * @instance - */ - Object.defineProperty(QueryInput.prototype, "input", { - get: $util.oneOfGetter($oneOfFields = ["audioConfig", "text", "event"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Encodes the specified SimpleResponses message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISimpleResponses} message SimpleResponses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleResponses.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new QueryInput instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.QueryInput - * @static - * @param {google.cloud.dialogflow.v2.IQueryInput=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.QueryInput} QueryInput instance - */ - QueryInput.create = function create(properties) { - return new QueryInput(properties); - }; + /** + * Decodes a SimpleResponses message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponses} SimpleResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleResponses.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.simpleResponses && message.simpleResponses.length)) + message.simpleResponses = []; + message.simpleResponses.push($root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified QueryInput message. Does not implicitly {@link google.cloud.dialogflow.v2.QueryInput.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.QueryInput - * @static - * @param {google.cloud.dialogflow.v2.IQueryInput} message QueryInput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInput.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.audioConfig != null && Object.hasOwnProperty.call(message, "audioConfig")) - $root.google.cloud.dialogflow.v2.InputAudioConfig.encode(message.audioConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - $root.google.cloud.dialogflow.v2.TextInput.encode(message.text, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.event != null && Object.hasOwnProperty.call(message, "event")) - $root.google.cloud.dialogflow.v2.EventInput.encode(message.event, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Decodes a SimpleResponses message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponses} SimpleResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleResponses.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified QueryInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.QueryInput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.QueryInput - * @static - * @param {google.cloud.dialogflow.v2.IQueryInput} message QueryInput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryInput.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a SimpleResponses message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimpleResponses.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.simpleResponses != null && message.hasOwnProperty("simpleResponses")) { + if (!Array.isArray(message.simpleResponses)) + return "simpleResponses: array expected"; + for (var i = 0; i < message.simpleResponses.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.verify(message.simpleResponses[i]); + if (error) + return "simpleResponses." + error; + } + } + return null; + }; - /** - * Decodes a QueryInput message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.QueryInput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.QueryInput} QueryInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInput.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.QueryInput(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.audioConfig = $root.google.cloud.dialogflow.v2.InputAudioConfig.decode(reader, reader.uint32()); - break; - case 2: - message.text = $root.google.cloud.dialogflow.v2.TextInput.decode(reader, reader.uint32()); - break; - case 3: - message.event = $root.google.cloud.dialogflow.v2.EventInput.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a SimpleResponses message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.SimpleResponses} SimpleResponses + */ + SimpleResponses.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponses(); + if (object.simpleResponses) { + if (!Array.isArray(object.simpleResponses)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.simpleResponses: array expected"); + message.simpleResponses = []; + for (var i = 0; i < object.simpleResponses.length; ++i) { + if (typeof object.simpleResponses[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.SimpleResponses.simpleResponses: object expected"); + message.simpleResponses[i] = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.fromObject(object.simpleResponses[i]); + } + } + return message; + }; - /** - * Decodes a QueryInput message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.QueryInput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.QueryInput} QueryInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryInput.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a SimpleResponses message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.SimpleResponses} message SimpleResponses + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimpleResponses.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.simpleResponses = []; + if (message.simpleResponses && message.simpleResponses.length) { + object.simpleResponses = []; + for (var j = 0; j < message.simpleResponses.length; ++j) + object.simpleResponses[j] = $root.google.cloud.dialogflow.v2.Intent.Message.SimpleResponse.toObject(message.simpleResponses[j], options); + } + return object; + }; - /** - * Verifies a QueryInput message. - * @function verify - * @memberof google.cloud.dialogflow.v2.QueryInput - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryInput.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { - properties.input = 1; - { - var error = $root.google.cloud.dialogflow.v2.InputAudioConfig.verify(message.audioConfig); - if (error) - return "audioConfig." + error; - } - } - if (message.text != null && message.hasOwnProperty("text")) { - if (properties.input === 1) - return "input: multiple values"; - properties.input = 1; - { - var error = $root.google.cloud.dialogflow.v2.TextInput.verify(message.text); - if (error) - return "text." + error; - } - } - if (message.event != null && message.hasOwnProperty("event")) { - if (properties.input === 1) - return "input: multiple values"; - properties.input = 1; - { - var error = $root.google.cloud.dialogflow.v2.EventInput.verify(message.event); - if (error) - return "event." + error; - } - } - return null; - }; - - /** - * Creates a QueryInput message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.QueryInput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.QueryInput} QueryInput - */ - QueryInput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.QueryInput) - return object; - var message = new $root.google.cloud.dialogflow.v2.QueryInput(); - if (object.audioConfig != null) { - if (typeof object.audioConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryInput.audioConfig: object expected"); - message.audioConfig = $root.google.cloud.dialogflow.v2.InputAudioConfig.fromObject(object.audioConfig); - } - if (object.text != null) { - if (typeof object.text !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryInput.text: object expected"); - message.text = $root.google.cloud.dialogflow.v2.TextInput.fromObject(object.text); - } - if (object.event != null) { - if (typeof object.event !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryInput.event: object expected"); - message.event = $root.google.cloud.dialogflow.v2.EventInput.fromObject(object.event); - } - return message; - }; + /** + * Converts this SimpleResponses to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.SimpleResponses + * @instance + * @returns {Object.} JSON object + */ + SimpleResponses.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a QueryInput message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.QueryInput - * @static - * @param {google.cloud.dialogflow.v2.QueryInput} message QueryInput - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryInput.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { - object.audioConfig = $root.google.cloud.dialogflow.v2.InputAudioConfig.toObject(message.audioConfig, options); - if (options.oneofs) - object.input = "audioConfig"; - } - if (message.text != null && message.hasOwnProperty("text")) { - object.text = $root.google.cloud.dialogflow.v2.TextInput.toObject(message.text, options); - if (options.oneofs) - object.input = "text"; - } - if (message.event != null && message.hasOwnProperty("event")) { - object.event = $root.google.cloud.dialogflow.v2.EventInput.toObject(message.event, options); - if (options.oneofs) - object.input = "event"; - } - return object; - }; + return SimpleResponses; + })(); - /** - * Converts this QueryInput to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.QueryInput - * @instance - * @returns {Object.} JSON object - */ - QueryInput.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Message.BasicCard = (function() { - return QueryInput; - })(); + /** + * Properties of a BasicCard. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface IBasicCard + * @property {string|null} [title] BasicCard title + * @property {string|null} [subtitle] BasicCard subtitle + * @property {string|null} [formattedText] BasicCard formattedText + * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [image] BasicCard image + * @property {Array.|null} [buttons] BasicCard buttons + */ - v2.QueryResult = (function() { + /** + * Constructs a new BasicCard. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a BasicCard. + * @implements IBasicCard + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.IBasicCard=} [properties] Properties to set + */ + function BasicCard(properties) { + this.buttons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a QueryResult. - * @memberof google.cloud.dialogflow.v2 - * @interface IQueryResult - * @property {string|null} [queryText] QueryResult queryText - * @property {string|null} [languageCode] QueryResult languageCode - * @property {number|null} [speechRecognitionConfidence] QueryResult speechRecognitionConfidence - * @property {string|null} [action] QueryResult action - * @property {google.protobuf.IStruct|null} [parameters] QueryResult parameters - * @property {boolean|null} [allRequiredParamsPresent] QueryResult allRequiredParamsPresent - * @property {string|null} [fulfillmentText] QueryResult fulfillmentText - * @property {Array.|null} [fulfillmentMessages] QueryResult fulfillmentMessages - * @property {string|null} [webhookSource] QueryResult webhookSource - * @property {google.protobuf.IStruct|null} [webhookPayload] QueryResult webhookPayload - * @property {Array.|null} [outputContexts] QueryResult outputContexts - * @property {google.cloud.dialogflow.v2.IIntent|null} [intent] QueryResult intent - * @property {number|null} [intentDetectionConfidence] QueryResult intentDetectionConfidence - * @property {google.protobuf.IStruct|null} [diagnosticInfo] QueryResult diagnosticInfo - * @property {google.cloud.dialogflow.v2.ISentimentAnalysisResult|null} [sentimentAnalysisResult] QueryResult sentimentAnalysisResult - */ + /** + * BasicCard title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @instance + */ + BasicCard.prototype.title = ""; - /** - * Constructs a new QueryResult. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a QueryResult. - * @implements IQueryResult - * @constructor - * @param {google.cloud.dialogflow.v2.IQueryResult=} [properties] Properties to set - */ - function QueryResult(properties) { - this.fulfillmentMessages = []; - this.outputContexts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * BasicCard subtitle. + * @member {string} subtitle + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @instance + */ + BasicCard.prototype.subtitle = ""; - /** - * QueryResult queryText. - * @member {string} queryText - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.queryText = ""; + /** + * BasicCard formattedText. + * @member {string} formattedText + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @instance + */ + BasicCard.prototype.formattedText = ""; - /** - * QueryResult languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.languageCode = ""; + /** + * BasicCard image. + * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} image + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @instance + */ + BasicCard.prototype.image = null; - /** - * QueryResult speechRecognitionConfidence. - * @member {number} speechRecognitionConfidence - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.speechRecognitionConfidence = 0; + /** + * BasicCard buttons. + * @member {Array.} buttons + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @instance + */ + BasicCard.prototype.buttons = $util.emptyArray; - /** - * QueryResult action. - * @member {string} action - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.action = ""; + /** + * Creates a new BasicCard instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IBasicCard=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard} BasicCard instance + */ + BasicCard.create = function create(properties) { + return new BasicCard(properties); + }; - /** - * QueryResult parameters. - * @member {google.protobuf.IStruct|null|undefined} parameters - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.parameters = null; + /** + * Encodes the specified BasicCard message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IBasicCard} message BasicCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicCard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); + if (message.formattedText != null && Object.hasOwnProperty.call(message, "formattedText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.formattedText); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.encode(message.buttons[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; - /** - * QueryResult allRequiredParamsPresent. - * @member {boolean} allRequiredParamsPresent - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.allRequiredParamsPresent = false; + /** + * Encodes the specified BasicCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IBasicCard} message BasicCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicCard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * QueryResult fulfillmentText. - * @member {string} fulfillmentText - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.fulfillmentText = ""; + /** + * Decodes a BasicCard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard} BasicCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicCard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.subtitle = reader.string(); + break; + case 3: + message.formattedText = reader.string(); + break; + case 4: + message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * QueryResult fulfillmentMessages. - * @member {Array.} fulfillmentMessages - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.fulfillmentMessages = $util.emptyArray; + /** + * Decodes a BasicCard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard} BasicCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicCard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * QueryResult webhookSource. - * @member {string} webhookSource - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.webhookSource = ""; + /** + * Verifies a BasicCard message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BasicCard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + if (message.formattedText != null && message.hasOwnProperty("formattedText")) + if (!$util.isString(message.formattedText)) + return "formattedText: string expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } + } + return null; + }; - /** - * QueryResult webhookPayload. - * @member {google.protobuf.IStruct|null|undefined} webhookPayload - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.webhookPayload = null; + /** + * Creates a BasicCard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard} BasicCard + */ + BasicCard.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard(); + if (object.title != null) + message.title = String(object.title); + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + if (object.formattedText != null) + message.formattedText = String(object.formattedText); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BasicCard.image: object expected"); + message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.image); + } + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BasicCard.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BasicCard.buttons: object expected"); + message.buttons[i] = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.fromObject(object.buttons[i]); + } + } + return message; + }; - /** - * QueryResult outputContexts. - * @member {Array.} outputContexts - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.outputContexts = $util.emptyArray; + /** + * Creates a plain object from a BasicCard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard} message BasicCard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BasicCard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buttons = []; + if (options.defaults) { + object.title = ""; + object.subtitle = ""; + object.formattedText = ""; + object.image = null; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + if (message.formattedText != null && message.hasOwnProperty("formattedText")) + object.formattedText = message.formattedText; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.image, options); + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.toObject(message.buttons[j], options); + } + return object; + }; - /** - * QueryResult intent. - * @member {google.cloud.dialogflow.v2.IIntent|null|undefined} intent - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.intent = null; + /** + * Converts this BasicCard to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @instance + * @returns {Object.} JSON object + */ + BasicCard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * QueryResult intentDetectionConfidence. - * @member {number} intentDetectionConfidence - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.intentDetectionConfidence = 0; + BasicCard.Button = (function() { - /** - * QueryResult diagnosticInfo. - * @member {google.protobuf.IStruct|null|undefined} diagnosticInfo - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.diagnosticInfo = null; + /** + * Properties of a Button. + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @interface IButton + * @property {string|null} [title] Button title + * @property {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction|null} [openUriAction] Button openUriAction + */ - /** - * QueryResult sentimentAnalysisResult. - * @member {google.cloud.dialogflow.v2.ISentimentAnalysisResult|null|undefined} sentimentAnalysisResult - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - */ - QueryResult.prototype.sentimentAnalysisResult = null; + /** + * Constructs a new Button. + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard + * @classdesc Represents a Button. + * @implements IButton + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton=} [properties] Properties to set + */ + function Button(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new QueryResult instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.QueryResult - * @static - * @param {google.cloud.dialogflow.v2.IQueryResult=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.QueryResult} QueryResult instance - */ - QueryResult.create = function create(properties) { - return new QueryResult(properties); - }; + /** + * Button title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @instance + */ + Button.prototype.title = ""; - /** - * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.dialogflow.v2.QueryResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.QueryResult - * @static - * @param {google.cloud.dialogflow.v2.IQueryResult} message QueryResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queryText != null && Object.hasOwnProperty.call(message, "queryText")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryText); - if (message.speechRecognitionConfidence != null && Object.hasOwnProperty.call(message, "speechRecognitionConfidence")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.speechRecognitionConfidence); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.action); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.allRequiredParamsPresent != null && Object.hasOwnProperty.call(message, "allRequiredParamsPresent")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allRequiredParamsPresent); - if (message.fulfillmentText != null && Object.hasOwnProperty.call(message, "fulfillmentText")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.fulfillmentText); - if (message.fulfillmentMessages != null && message.fulfillmentMessages.length) - for (var i = 0; i < message.fulfillmentMessages.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.encode(message.fulfillmentMessages[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.webhookSource != null && Object.hasOwnProperty.call(message, "webhookSource")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.webhookSource); - if (message.webhookPayload != null && Object.hasOwnProperty.call(message, "webhookPayload")) - $root.google.protobuf.Struct.encode(message.webhookPayload, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.outputContexts != null && message.outputContexts.length) - for (var i = 0; i < message.outputContexts.length; ++i) - $root.google.cloud.dialogflow.v2.Context.encode(message.outputContexts[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) - $root.google.cloud.dialogflow.v2.Intent.encode(message.intent, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.intentDetectionConfidence != null && Object.hasOwnProperty.call(message, "intentDetectionConfidence")) - writer.uint32(/* id 12, wireType 5 =*/101).float(message.intentDetectionConfidence); - if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) - $root.google.protobuf.Struct.encode(message.diagnosticInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.languageCode); - if (message.sentimentAnalysisResult != null && Object.hasOwnProperty.call(message, "sentimentAnalysisResult")) - $root.google.cloud.dialogflow.v2.SentimentAnalysisResult.encode(message.sentimentAnalysisResult, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - return writer; - }; + /** + * Button openUriAction. + * @member {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction|null|undefined} openUriAction + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @instance + */ + Button.prototype.openUriAction = null; - /** - * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.QueryResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.QueryResult - * @static - * @param {google.cloud.dialogflow.v2.IQueryResult} message QueryResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QueryResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new Button instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button} Button instance + */ + Button.create = function create(properties) { + return new Button(properties); + }; - /** - * Decodes a QueryResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.QueryResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.QueryResult} QueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.QueryResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.queryText = reader.string(); - break; - case 15: - message.languageCode = reader.string(); - break; - case 2: - message.speechRecognitionConfidence = reader.float(); - break; - case 3: - message.action = reader.string(); - break; - case 4: - message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 5: - message.allRequiredParamsPresent = reader.bool(); - break; - case 6: - message.fulfillmentText = reader.string(); - break; - case 7: - if (!(message.fulfillmentMessages && message.fulfillmentMessages.length)) - message.fulfillmentMessages = []; - message.fulfillmentMessages.push($root.google.cloud.dialogflow.v2.Intent.Message.decode(reader, reader.uint32())); - break; - case 8: - message.webhookSource = reader.string(); - break; - case 9: - message.webhookPayload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.outputContexts && message.outputContexts.length)) - message.outputContexts = []; - message.outputContexts.push($root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32())); - break; - case 11: - message.intent = $root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32()); - break; - case 12: - message.intentDetectionConfidence = reader.float(); - break; - case 14: - message.diagnosticInfo = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 17: - message.sentimentAnalysisResult = $root.google.cloud.dialogflow.v2.SentimentAnalysisResult.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton} message Button message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Button.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.openUriAction != null && Object.hasOwnProperty.call(message, "openUriAction")) + $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.encode(message.openUriAction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Decodes a QueryResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.QueryResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.QueryResult} QueryResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QueryResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.IButton} message Button message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Button.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a QueryResult message. - * @function verify - * @memberof google.cloud.dialogflow.v2.QueryResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QueryResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queryText != null && message.hasOwnProperty("queryText")) - if (!$util.isString(message.queryText)) - return "queryText: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.speechRecognitionConfidence != null && message.hasOwnProperty("speechRecognitionConfidence")) - if (typeof message.speechRecognitionConfidence !== "number") - return "speechRecognitionConfidence: number expected"; - if (message.action != null && message.hasOwnProperty("action")) - if (!$util.isString(message.action)) - return "action: string expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - var error = $root.google.protobuf.Struct.verify(message.parameters); - if (error) - return "parameters." + error; - } - if (message.allRequiredParamsPresent != null && message.hasOwnProperty("allRequiredParamsPresent")) - if (typeof message.allRequiredParamsPresent !== "boolean") - return "allRequiredParamsPresent: boolean expected"; - if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) - if (!$util.isString(message.fulfillmentText)) - return "fulfillmentText: string expected"; - if (message.fulfillmentMessages != null && message.hasOwnProperty("fulfillmentMessages")) { - if (!Array.isArray(message.fulfillmentMessages)) - return "fulfillmentMessages: array expected"; - for (var i = 0; i < message.fulfillmentMessages.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.verify(message.fulfillmentMessages[i]); - if (error) - return "fulfillmentMessages." + error; - } - } - if (message.webhookSource != null && message.hasOwnProperty("webhookSource")) - if (!$util.isString(message.webhookSource)) - return "webhookSource: string expected"; - if (message.webhookPayload != null && message.hasOwnProperty("webhookPayload")) { - var error = $root.google.protobuf.Struct.verify(message.webhookPayload); - if (error) - return "webhookPayload." + error; - } - if (message.outputContexts != null && message.hasOwnProperty("outputContexts")) { - if (!Array.isArray(message.outputContexts)) - return "outputContexts: array expected"; - for (var i = 0; i < message.outputContexts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Context.verify(message.outputContexts[i]); - if (error) - return "outputContexts." + error; - } - } - if (message.intent != null && message.hasOwnProperty("intent")) { - var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intent); - if (error) - return "intent." + error; - } - if (message.intentDetectionConfidence != null && message.hasOwnProperty("intentDetectionConfidence")) - if (typeof message.intentDetectionConfidence !== "number") - return "intentDetectionConfidence: number expected"; - if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { - var error = $root.google.protobuf.Struct.verify(message.diagnosticInfo); - if (error) - return "diagnosticInfo." + error; - } - if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) { - var error = $root.google.cloud.dialogflow.v2.SentimentAnalysisResult.verify(message.sentimentAnalysisResult); - if (error) - return "sentimentAnalysisResult." + error; - } - return null; - }; + /** + * Decodes a Button message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button} Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Button.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.openUriAction = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.QueryResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.QueryResult} QueryResult - */ - QueryResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.QueryResult) - return object; - var message = new $root.google.cloud.dialogflow.v2.QueryResult(); - if (object.queryText != null) - message.queryText = String(object.queryText); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.speechRecognitionConfidence != null) - message.speechRecognitionConfidence = Number(object.speechRecognitionConfidence); - if (object.action != null) - message.action = String(object.action); - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryResult.parameters: object expected"); - message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters); - } - if (object.allRequiredParamsPresent != null) - message.allRequiredParamsPresent = Boolean(object.allRequiredParamsPresent); - if (object.fulfillmentText != null) - message.fulfillmentText = String(object.fulfillmentText); - if (object.fulfillmentMessages) { - if (!Array.isArray(object.fulfillmentMessages)) - throw TypeError(".google.cloud.dialogflow.v2.QueryResult.fulfillmentMessages: array expected"); - message.fulfillmentMessages = []; - for (var i = 0; i < object.fulfillmentMessages.length; ++i) { - if (typeof object.fulfillmentMessages[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryResult.fulfillmentMessages: object expected"); - message.fulfillmentMessages[i] = $root.google.cloud.dialogflow.v2.Intent.Message.fromObject(object.fulfillmentMessages[i]); - } - } - if (object.webhookSource != null) - message.webhookSource = String(object.webhookSource); - if (object.webhookPayload != null) { - if (typeof object.webhookPayload !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryResult.webhookPayload: object expected"); - message.webhookPayload = $root.google.protobuf.Struct.fromObject(object.webhookPayload); - } - if (object.outputContexts) { - if (!Array.isArray(object.outputContexts)) - throw TypeError(".google.cloud.dialogflow.v2.QueryResult.outputContexts: array expected"); - message.outputContexts = []; - for (var i = 0; i < object.outputContexts.length; ++i) { - if (typeof object.outputContexts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryResult.outputContexts: object expected"); - message.outputContexts[i] = $root.google.cloud.dialogflow.v2.Context.fromObject(object.outputContexts[i]); - } - } - if (object.intent != null) { - if (typeof object.intent !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryResult.intent: object expected"); - message.intent = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intent); - } - if (object.intentDetectionConfidence != null) - message.intentDetectionConfidence = Number(object.intentDetectionConfidence); - if (object.diagnosticInfo != null) { - if (typeof object.diagnosticInfo !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryResult.diagnosticInfo: object expected"); - message.diagnosticInfo = $root.google.protobuf.Struct.fromObject(object.diagnosticInfo); - } - if (object.sentimentAnalysisResult != null) { - if (typeof object.sentimentAnalysisResult !== "object") - throw TypeError(".google.cloud.dialogflow.v2.QueryResult.sentimentAnalysisResult: object expected"); - message.sentimentAnalysisResult = $root.google.cloud.dialogflow.v2.SentimentAnalysisResult.fromObject(object.sentimentAnalysisResult); - } - return message; - }; + /** + * Decodes a Button message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button} Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Button.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a QueryResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.QueryResult - * @static - * @param {google.cloud.dialogflow.v2.QueryResult} message QueryResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.fulfillmentMessages = []; - object.outputContexts = []; - } - if (options.defaults) { - object.queryText = ""; - object.speechRecognitionConfidence = 0; - object.action = ""; - object.parameters = null; - object.allRequiredParamsPresent = false; - object.fulfillmentText = ""; - object.webhookSource = ""; - object.webhookPayload = null; - object.intent = null; - object.intentDetectionConfidence = 0; - object.diagnosticInfo = null; - object.languageCode = ""; - object.sentimentAnalysisResult = null; - } - if (message.queryText != null && message.hasOwnProperty("queryText")) - object.queryText = message.queryText; - if (message.speechRecognitionConfidence != null && message.hasOwnProperty("speechRecognitionConfidence")) - object.speechRecognitionConfidence = options.json && !isFinite(message.speechRecognitionConfidence) ? String(message.speechRecognitionConfidence) : message.speechRecognitionConfidence; - if (message.action != null && message.hasOwnProperty("action")) - object.action = message.action; - if (message.parameters != null && message.hasOwnProperty("parameters")) - object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); - if (message.allRequiredParamsPresent != null && message.hasOwnProperty("allRequiredParamsPresent")) - object.allRequiredParamsPresent = message.allRequiredParamsPresent; - if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) - object.fulfillmentText = message.fulfillmentText; - if (message.fulfillmentMessages && message.fulfillmentMessages.length) { - object.fulfillmentMessages = []; - for (var j = 0; j < message.fulfillmentMessages.length; ++j) - object.fulfillmentMessages[j] = $root.google.cloud.dialogflow.v2.Intent.Message.toObject(message.fulfillmentMessages[j], options); - } - if (message.webhookSource != null && message.hasOwnProperty("webhookSource")) - object.webhookSource = message.webhookSource; - if (message.webhookPayload != null && message.hasOwnProperty("webhookPayload")) - object.webhookPayload = $root.google.protobuf.Struct.toObject(message.webhookPayload, options); - if (message.outputContexts && message.outputContexts.length) { - object.outputContexts = []; - for (var j = 0; j < message.outputContexts.length; ++j) - object.outputContexts[j] = $root.google.cloud.dialogflow.v2.Context.toObject(message.outputContexts[j], options); - } - if (message.intent != null && message.hasOwnProperty("intent")) - object.intent = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intent, options); - if (message.intentDetectionConfidence != null && message.hasOwnProperty("intentDetectionConfidence")) - object.intentDetectionConfidence = options.json && !isFinite(message.intentDetectionConfidence) ? String(message.intentDetectionConfidence) : message.intentDetectionConfidence; - if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) - object.diagnosticInfo = $root.google.protobuf.Struct.toObject(message.diagnosticInfo, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) - object.sentimentAnalysisResult = $root.google.cloud.dialogflow.v2.SentimentAnalysisResult.toObject(message.sentimentAnalysisResult, options); - return object; - }; + /** + * Verifies a Button message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Button.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.verify(message.openUriAction); + if (error) + return "openUriAction." + error; + } + return null; + }; - /** - * Converts this QueryResult to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.QueryResult - * @instance - * @returns {Object.} JSON object - */ - QueryResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a Button message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button} Button + */ + Button.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button(); + if (object.title != null) + message.title = String(object.title); + if (object.openUriAction != null) { + if (typeof object.openUriAction !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.openUriAction: object expected"); + message.openUriAction = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.fromObject(object.openUriAction); + } + return message; + }; - return QueryResult; - })(); + /** + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button} message Button + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Button.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.title = ""; + object.openUriAction = null; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) + object.openUriAction = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.toObject(message.openUriAction, options); + return object; + }; - v2.StreamingDetectIntentRequest = (function() { + /** + * Converts this Button to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @instance + * @returns {Object.} JSON object + */ + Button.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a StreamingDetectIntentRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IStreamingDetectIntentRequest - * @property {string|null} [session] StreamingDetectIntentRequest session - * @property {google.cloud.dialogflow.v2.IQueryParameters|null} [queryParams] StreamingDetectIntentRequest queryParams - * @property {google.cloud.dialogflow.v2.IQueryInput|null} [queryInput] StreamingDetectIntentRequest queryInput - * @property {boolean|null} [singleUtterance] StreamingDetectIntentRequest singleUtterance - * @property {google.cloud.dialogflow.v2.IOutputAudioConfig|null} [outputAudioConfig] StreamingDetectIntentRequest outputAudioConfig - * @property {google.protobuf.IFieldMask|null} [outputAudioConfigMask] StreamingDetectIntentRequest outputAudioConfigMask - * @property {Uint8Array|null} [inputAudio] StreamingDetectIntentRequest inputAudio - */ + Button.OpenUriAction = (function() { - /** - * Constructs a new StreamingDetectIntentRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a StreamingDetectIntentRequest. - * @implements IStreamingDetectIntentRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentRequest=} [properties] Properties to set - */ - function StreamingDetectIntentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an OpenUriAction. + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @interface IOpenUriAction + * @property {string|null} [uri] OpenUriAction uri + */ - /** - * StreamingDetectIntentRequest session. - * @member {string} session - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @instance - */ - StreamingDetectIntentRequest.prototype.session = ""; + /** + * Constructs a new OpenUriAction. + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button + * @classdesc Represents an OpenUriAction. + * @implements IOpenUriAction + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction=} [properties] Properties to set + */ + function OpenUriAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * StreamingDetectIntentRequest queryParams. - * @member {google.cloud.dialogflow.v2.IQueryParameters|null|undefined} queryParams - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @instance - */ - StreamingDetectIntentRequest.prototype.queryParams = null; + /** + * OpenUriAction uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction + * @instance + */ + OpenUriAction.prototype.uri = ""; - /** - * StreamingDetectIntentRequest queryInput. - * @member {google.cloud.dialogflow.v2.IQueryInput|null|undefined} queryInput - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @instance - */ - StreamingDetectIntentRequest.prototype.queryInput = null; + /** + * Creates a new OpenUriAction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction instance + */ + OpenUriAction.create = function create(properties) { + return new OpenUriAction(properties); + }; - /** - * StreamingDetectIntentRequest singleUtterance. - * @member {boolean} singleUtterance - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @instance - */ - StreamingDetectIntentRequest.prototype.singleUtterance = false; + /** + * Encodes the specified OpenUriAction message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction} message OpenUriAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenUriAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; - /** - * StreamingDetectIntentRequest outputAudioConfig. - * @member {google.cloud.dialogflow.v2.IOutputAudioConfig|null|undefined} outputAudioConfig - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @instance - */ - StreamingDetectIntentRequest.prototype.outputAudioConfig = null; + /** + * Encodes the specified OpenUriAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.IOpenUriAction} message OpenUriAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenUriAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * StreamingDetectIntentRequest outputAudioConfigMask. - * @member {google.protobuf.IFieldMask|null|undefined} outputAudioConfigMask - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @instance - */ - StreamingDetectIntentRequest.prototype.outputAudioConfigMask = null; + /** + * Decodes an OpenUriAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenUriAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * StreamingDetectIntentRequest inputAudio. - * @member {Uint8Array} inputAudio - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @instance - */ - StreamingDetectIntentRequest.prototype.inputAudio = $util.newBuffer([]); + /** + * Decodes an OpenUriAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenUriAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new StreamingDetectIntentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentRequest} StreamingDetectIntentRequest instance - */ - StreamingDetectIntentRequest.create = function create(properties) { - return new StreamingDetectIntentRequest(properties); - }; + /** + * Verifies an OpenUriAction message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenUriAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; - /** - * Encodes the specified StreamingDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentRequest} message StreamingDetectIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingDetectIntentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) - $root.google.cloud.dialogflow.v2.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) - $root.google.cloud.dialogflow.v2.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.singleUtterance); - if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) - $root.google.cloud.dialogflow.v2.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.inputAudio != null && Object.hasOwnProperty.call(message, "inputAudio")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.inputAudio); - if (message.outputAudioConfigMask != null && Object.hasOwnProperty.call(message, "outputAudioConfigMask")) - $root.google.protobuf.FieldMask.encode(message.outputAudioConfigMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; + /** + * Creates an OpenUriAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction + */ + OpenUriAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; - /** - * Encodes the specified StreamingDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentRequest} message StreamingDetectIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingDetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from an OpenUriAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction} message OpenUriAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenUriAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; - /** - * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentRequest} StreamingDetectIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingDetectIntentRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.StreamingDetectIntentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.session = reader.string(); - break; - case 2: - message.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.decode(reader, reader.uint32()); - break; - case 3: - message.queryInput = $root.google.cloud.dialogflow.v2.QueryInput.decode(reader, reader.uint32()); - break; - case 4: - message.singleUtterance = reader.bool(); - break; - case 5: - message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.decode(reader, reader.uint32()); - break; - case 7: - message.outputAudioConfigMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 6: - message.inputAudio = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Converts this OpenUriAction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.OpenUriAction + * @instance + * @returns {Object.} JSON object + */ + OpenUriAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OpenUriAction; + })(); + + return Button; + })(); + + return BasicCard; + })(); + + Message.Suggestion = (function() { + + /** + * Properties of a Suggestion. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface ISuggestion + * @property {string|null} [title] Suggestion title + */ + + /** + * Constructs a new Suggestion. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a Suggestion. + * @implements ISuggestion + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestion=} [properties] Properties to set + */ + function Suggestion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - /** - * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentRequest} StreamingDetectIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingDetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Suggestion title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion + * @instance + */ + Suggestion.prototype.title = ""; - /** - * Verifies a StreamingDetectIntentRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StreamingDetectIntentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.queryParams != null && message.hasOwnProperty("queryParams")) { - var error = $root.google.cloud.dialogflow.v2.QueryParameters.verify(message.queryParams); - if (error) - return "queryParams." + error; - } - if (message.queryInput != null && message.hasOwnProperty("queryInput")) { - var error = $root.google.cloud.dialogflow.v2.QueryInput.verify(message.queryInput); - if (error) - return "queryInput." + error; - } - if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) - if (typeof message.singleUtterance !== "boolean") - return "singleUtterance: boolean expected"; - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { - var error = $root.google.cloud.dialogflow.v2.OutputAudioConfig.verify(message.outputAudioConfig); - if (error) - return "outputAudioConfig." + error; - } - if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.outputAudioConfigMask); - if (error) - return "outputAudioConfigMask." + error; - } - if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) - if (!(message.inputAudio && typeof message.inputAudio.length === "number" || $util.isString(message.inputAudio))) - return "inputAudio: buffer expected"; - return null; - }; + /** + * Creates a new Suggestion instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestion=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestion} Suggestion instance + */ + Suggestion.create = function create(properties) { + return new Suggestion(properties); + }; - /** - * Creates a StreamingDetectIntentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentRequest} StreamingDetectIntentRequest - */ - StreamingDetectIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.StreamingDetectIntentRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.StreamingDetectIntentRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.queryParams != null) { - if (typeof object.queryParams !== "object") - throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentRequest.queryParams: object expected"); - message.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.fromObject(object.queryParams); - } - if (object.queryInput != null) { - if (typeof object.queryInput !== "object") - throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentRequest.queryInput: object expected"); - message.queryInput = $root.google.cloud.dialogflow.v2.QueryInput.fromObject(object.queryInput); - } - if (object.singleUtterance != null) - message.singleUtterance = Boolean(object.singleUtterance); - if (object.outputAudioConfig != null) { - if (typeof object.outputAudioConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentRequest.outputAudioConfig: object expected"); - message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.fromObject(object.outputAudioConfig); - } - if (object.outputAudioConfigMask != null) { - if (typeof object.outputAudioConfigMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentRequest.outputAudioConfigMask: object expected"); - message.outputAudioConfigMask = $root.google.protobuf.FieldMask.fromObject(object.outputAudioConfigMask); - } - if (object.inputAudio != null) - if (typeof object.inputAudio === "string") - $util.base64.decode(object.inputAudio, message.inputAudio = $util.newBuffer($util.base64.length(object.inputAudio)), 0); - else if (object.inputAudio.length) - message.inputAudio = object.inputAudio; - return message; - }; + /** + * Encodes the specified Suggestion message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestion.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestion} message Suggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + return writer; + }; - /** - * Creates a plain object from a StreamingDetectIntentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @static - * @param {google.cloud.dialogflow.v2.StreamingDetectIntentRequest} message StreamingDetectIntentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StreamingDetectIntentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.session = ""; - object.queryParams = null; - object.queryInput = null; - object.singleUtterance = false; - object.outputAudioConfig = null; - if (options.bytes === String) - object.inputAudio = ""; - else { - object.inputAudio = []; - if (options.bytes !== Array) - object.inputAudio = $util.newBuffer(object.inputAudio); - } - object.outputAudioConfigMask = null; - } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.queryParams != null && message.hasOwnProperty("queryParams")) - object.queryParams = $root.google.cloud.dialogflow.v2.QueryParameters.toObject(message.queryParams, options); - if (message.queryInput != null && message.hasOwnProperty("queryInput")) - object.queryInput = $root.google.cloud.dialogflow.v2.QueryInput.toObject(message.queryInput, options); - if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) - object.singleUtterance = message.singleUtterance; - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) - object.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.toObject(message.outputAudioConfig, options); - if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) - object.inputAudio = options.bytes === String ? $util.base64.encode(message.inputAudio, 0, message.inputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputAudio) : message.inputAudio; - if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) - object.outputAudioConfigMask = $root.google.protobuf.FieldMask.toObject(message.outputAudioConfigMask, options); - return object; - }; + /** + * Encodes the specified Suggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestion} message Suggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Converts this StreamingDetectIntentRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentRequest - * @instance - * @returns {Object.} JSON object - */ - StreamingDetectIntentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a Suggestion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestion} Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return StreamingDetectIntentRequest; - })(); + /** + * Decodes a Suggestion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestion} Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - v2.StreamingDetectIntentResponse = (function() { + /** + * Verifies a Suggestion message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Suggestion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + return null; + }; - /** - * Properties of a StreamingDetectIntentResponse. - * @memberof google.cloud.dialogflow.v2 - * @interface IStreamingDetectIntentResponse - * @property {string|null} [responseId] StreamingDetectIntentResponse responseId - * @property {google.cloud.dialogflow.v2.IStreamingRecognitionResult|null} [recognitionResult] StreamingDetectIntentResponse recognitionResult - * @property {google.cloud.dialogflow.v2.IQueryResult|null} [queryResult] StreamingDetectIntentResponse queryResult - * @property {google.rpc.IStatus|null} [webhookStatus] StreamingDetectIntentResponse webhookStatus - * @property {Uint8Array|null} [outputAudio] StreamingDetectIntentResponse outputAudio - * @property {google.cloud.dialogflow.v2.IOutputAudioConfig|null} [outputAudioConfig] StreamingDetectIntentResponse outputAudioConfig - */ + /** + * Creates a Suggestion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestion} Suggestion + */ + Suggestion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion(); + if (object.title != null) + message.title = String(object.title); + return message; + }; - /** - * Constructs a new StreamingDetectIntentResponse. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a StreamingDetectIntentResponse. - * @implements IStreamingDetectIntentResponse - * @constructor - * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentResponse=} [properties] Properties to set - */ - function StreamingDetectIntentResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a plain object from a Suggestion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.Suggestion} message Suggestion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Suggestion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.title = ""; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + return object; + }; - /** - * StreamingDetectIntentResponse responseId. - * @member {string} responseId - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @instance - */ - StreamingDetectIntentResponse.prototype.responseId = ""; + /** + * Converts this Suggestion to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestion + * @instance + * @returns {Object.} JSON object + */ + Suggestion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * StreamingDetectIntentResponse recognitionResult. - * @member {google.cloud.dialogflow.v2.IStreamingRecognitionResult|null|undefined} recognitionResult - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @instance - */ - StreamingDetectIntentResponse.prototype.recognitionResult = null; + return Suggestion; + })(); - /** - * StreamingDetectIntentResponse queryResult. - * @member {google.cloud.dialogflow.v2.IQueryResult|null|undefined} queryResult - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @instance - */ - StreamingDetectIntentResponse.prototype.queryResult = null; + Message.Suggestions = (function() { - /** - * StreamingDetectIntentResponse webhookStatus. - * @member {google.rpc.IStatus|null|undefined} webhookStatus - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @instance - */ - StreamingDetectIntentResponse.prototype.webhookStatus = null; + /** + * Properties of a Suggestions. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface ISuggestions + * @property {Array.|null} [suggestions] Suggestions suggestions + */ - /** - * StreamingDetectIntentResponse outputAudio. - * @member {Uint8Array} outputAudio - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @instance - */ - StreamingDetectIntentResponse.prototype.outputAudio = $util.newBuffer([]); + /** + * Constructs a new Suggestions. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a Suggestions. + * @implements ISuggestions + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestions=} [properties] Properties to set + */ + function Suggestions(properties) { + this.suggestions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * StreamingDetectIntentResponse outputAudioConfig. - * @member {google.cloud.dialogflow.v2.IOutputAudioConfig|null|undefined} outputAudioConfig - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @instance - */ - StreamingDetectIntentResponse.prototype.outputAudioConfig = null; + /** + * Suggestions suggestions. + * @member {Array.} suggestions + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions + * @instance + */ + Suggestions.prototype.suggestions = $util.emptyArray; - /** - * Creates a new StreamingDetectIntentResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @static - * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentResponse} StreamingDetectIntentResponse instance - */ - StreamingDetectIntentResponse.create = function create(properties) { - return new StreamingDetectIntentResponse(properties); - }; + /** + * Creates a new Suggestions instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestions=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestions} Suggestions instance + */ + Suggestions.create = function create(properties) { + return new Suggestions(properties); + }; - /** - * Encodes the specified StreamingDetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @static - * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentResponse} message StreamingDetectIntentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingDetectIntentResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); - if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) - $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) - $root.google.cloud.dialogflow.v2.QueryResult.encode(message.queryResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.webhookStatus != null && Object.hasOwnProperty.call(message, "webhookStatus")) - $root.google.rpc.Status.encode(message.webhookStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.outputAudio != null && Object.hasOwnProperty.call(message, "outputAudio")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.outputAudio); - if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) - $root.google.cloud.dialogflow.v2.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified Suggestions message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestions.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestions} message Suggestions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestions != null && message.suggestions.length) + for (var i = 0; i < message.suggestions.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion.encode(message.suggestions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified StreamingDetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingDetectIntentResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @static - * @param {google.cloud.dialogflow.v2.IStreamingDetectIntentResponse} message StreamingDetectIntentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingDetectIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Suggestions message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.Suggestions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISuggestions} message Suggestions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentResponse} StreamingDetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingDetectIntentResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.StreamingDetectIntentResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.responseId = reader.string(); - break; - case 2: - message.recognitionResult = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.decode(reader, reader.uint32()); - break; - case 3: - message.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.decode(reader, reader.uint32()); - break; - case 4: - message.webhookStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 5: - message.outputAudio = reader.bytes(); - break; - case 6: - message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentResponse} StreamingDetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingDetectIntentResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a Suggestions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestions} Suggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.suggestions && message.suggestions.length)) + message.suggestions = []; + message.suggestions.push($root.google.cloud.dialogflow.v2.Intent.Message.Suggestion.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Verifies a StreamingDetectIntentResponse message. - * @function verify - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StreamingDetectIntentResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseId != null && message.hasOwnProperty("responseId")) - if (!$util.isString(message.responseId)) - return "responseId: string expected"; - if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { - var error = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.verify(message.recognitionResult); - if (error) - return "recognitionResult." + error; - } - if (message.queryResult != null && message.hasOwnProperty("queryResult")) { - var error = $root.google.cloud.dialogflow.v2.QueryResult.verify(message.queryResult); - if (error) - return "queryResult." + error; - } - if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) { - var error = $root.google.rpc.Status.verify(message.webhookStatus); - if (error) - return "webhookStatus." + error; - } - if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) - if (!(message.outputAudio && typeof message.outputAudio.length === "number" || $util.isString(message.outputAudio))) - return "outputAudio: buffer expected"; - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { - var error = $root.google.cloud.dialogflow.v2.OutputAudioConfig.verify(message.outputAudioConfig); - if (error) - return "outputAudioConfig." + error; - } - return null; - }; + /** + * Decodes a Suggestions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestions} Suggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a StreamingDetectIntentResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.StreamingDetectIntentResponse} StreamingDetectIntentResponse - */ - StreamingDetectIntentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.StreamingDetectIntentResponse) - return object; - var message = new $root.google.cloud.dialogflow.v2.StreamingDetectIntentResponse(); - if (object.responseId != null) - message.responseId = String(object.responseId); - if (object.recognitionResult != null) { - if (typeof object.recognitionResult !== "object") - throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentResponse.recognitionResult: object expected"); - message.recognitionResult = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.fromObject(object.recognitionResult); - } - if (object.queryResult != null) { - if (typeof object.queryResult !== "object") - throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentResponse.queryResult: object expected"); - message.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.fromObject(object.queryResult); - } - if (object.webhookStatus != null) { - if (typeof object.webhookStatus !== "object") - throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentResponse.webhookStatus: object expected"); - message.webhookStatus = $root.google.rpc.Status.fromObject(object.webhookStatus); - } - if (object.outputAudio != null) - if (typeof object.outputAudio === "string") - $util.base64.decode(object.outputAudio, message.outputAudio = $util.newBuffer($util.base64.length(object.outputAudio)), 0); - else if (object.outputAudio.length) - message.outputAudio = object.outputAudio; - if (object.outputAudioConfig != null) { - if (typeof object.outputAudioConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2.StreamingDetectIntentResponse.outputAudioConfig: object expected"); - message.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.fromObject(object.outputAudioConfig); - } - return message; - }; + /** + * Verifies a Suggestions message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Suggestions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + if (!Array.isArray(message.suggestions)) + return "suggestions: array expected"; + for (var i = 0; i < message.suggestions.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion.verify(message.suggestions[i]); + if (error) + return "suggestions." + error; + } + } + return null; + }; - /** - * Creates a plain object from a StreamingDetectIntentResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @static - * @param {google.cloud.dialogflow.v2.StreamingDetectIntentResponse} message StreamingDetectIntentResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StreamingDetectIntentResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseId = ""; - object.recognitionResult = null; - object.queryResult = null; - object.webhookStatus = null; - if (options.bytes === String) - object.outputAudio = ""; - else { - object.outputAudio = []; - if (options.bytes !== Array) - object.outputAudio = $util.newBuffer(object.outputAudio); - } - object.outputAudioConfig = null; - } - if (message.responseId != null && message.hasOwnProperty("responseId")) - object.responseId = message.responseId; - if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) - object.recognitionResult = $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.toObject(message.recognitionResult, options); - if (message.queryResult != null && message.hasOwnProperty("queryResult")) - object.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.toObject(message.queryResult, options); - if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) - object.webhookStatus = $root.google.rpc.Status.toObject(message.webhookStatus, options); - if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) - object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) - object.outputAudioConfig = $root.google.cloud.dialogflow.v2.OutputAudioConfig.toObject(message.outputAudioConfig, options); - return object; - }; + /** + * Creates a Suggestions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.Suggestions} Suggestions + */ + Suggestions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.Suggestions(); + if (object.suggestions) { + if (!Array.isArray(object.suggestions)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.Suggestions.suggestions: array expected"); + message.suggestions = []; + for (var i = 0; i < object.suggestions.length; ++i) { + if (typeof object.suggestions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.Suggestions.suggestions: object expected"); + message.suggestions[i] = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion.fromObject(object.suggestions[i]); + } + } + return message; + }; - /** - * Converts this StreamingDetectIntentResponse to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.StreamingDetectIntentResponse - * @instance - * @returns {Object.} JSON object - */ - StreamingDetectIntentResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a Suggestions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.Suggestions} message Suggestions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Suggestions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.suggestions = []; + if (message.suggestions && message.suggestions.length) { + object.suggestions = []; + for (var j = 0; j < message.suggestions.length; ++j) + object.suggestions[j] = $root.google.cloud.dialogflow.v2.Intent.Message.Suggestion.toObject(message.suggestions[j], options); + } + return object; + }; - return StreamingDetectIntentResponse; - })(); + /** + * Converts this Suggestions to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.Suggestions + * @instance + * @returns {Object.} JSON object + */ + Suggestions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v2.StreamingRecognitionResult = (function() { + return Suggestions; + })(); - /** - * Properties of a StreamingRecognitionResult. - * @memberof google.cloud.dialogflow.v2 - * @interface IStreamingRecognitionResult - * @property {google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType|null} [messageType] StreamingRecognitionResult messageType - * @property {string|null} [transcript] StreamingRecognitionResult transcript - * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal - * @property {number|null} [confidence] StreamingRecognitionResult confidence - * @property {Array.|null} [speechWordInfo] StreamingRecognitionResult speechWordInfo - * @property {google.protobuf.IDuration|null} [speechEndOffset] StreamingRecognitionResult speechEndOffset - */ + Message.LinkOutSuggestion = (function() { - /** - * Constructs a new StreamingRecognitionResult. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a StreamingRecognitionResult. - * @implements IStreamingRecognitionResult - * @constructor - * @param {google.cloud.dialogflow.v2.IStreamingRecognitionResult=} [properties] Properties to set - */ - function StreamingRecognitionResult(properties) { - this.speechWordInfo = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a LinkOutSuggestion. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface ILinkOutSuggestion + * @property {string|null} [destinationName] LinkOutSuggestion destinationName + * @property {string|null} [uri] LinkOutSuggestion uri + */ - /** - * StreamingRecognitionResult messageType. - * @member {google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType} messageType - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.messageType = 0; + /** + * Constructs a new LinkOutSuggestion. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a LinkOutSuggestion. + * @implements ILinkOutSuggestion + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion=} [properties] Properties to set + */ + function LinkOutSuggestion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * StreamingRecognitionResult transcript. - * @member {string} transcript - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.transcript = ""; + /** + * LinkOutSuggestion destinationName. + * @member {string} destinationName + * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + * @instance + */ + LinkOutSuggestion.prototype.destinationName = ""; - /** - * StreamingRecognitionResult isFinal. - * @member {boolean} isFinal - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.isFinal = false; + /** + * LinkOutSuggestion uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + * @instance + */ + LinkOutSuggestion.prototype.uri = ""; - /** - * StreamingRecognitionResult confidence. - * @member {number} confidence - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.confidence = 0; + /** + * Creates a new LinkOutSuggestion instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion} LinkOutSuggestion instance + */ + LinkOutSuggestion.create = function create(properties) { + return new LinkOutSuggestion(properties); + }; - /** - * StreamingRecognitionResult speechWordInfo. - * @member {Array.} speechWordInfo - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.speechWordInfo = $util.emptyArray; + /** + * Encodes the specified LinkOutSuggestion message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion} message LinkOutSuggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkOutSuggestion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destinationName != null && Object.hasOwnProperty.call(message, "destinationName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationName); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + return writer; + }; - /** - * StreamingRecognitionResult speechEndOffset. - * @member {google.protobuf.IDuration|null|undefined} speechEndOffset - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.speechEndOffset = null; + /** + * Encodes the specified LinkOutSuggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ILinkOutSuggestion} message LinkOutSuggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkOutSuggestion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new StreamingRecognitionResult instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @static - * @param {google.cloud.dialogflow.v2.IStreamingRecognitionResult=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.StreamingRecognitionResult} StreamingRecognitionResult instance - */ - StreamingRecognitionResult.create = function create(properties) { - return new StreamingRecognitionResult(properties); - }; + /** + * Decodes a LinkOutSuggestion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion} LinkOutSuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkOutSuggestion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.destinationName = reader.string(); + break; + case 2: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingRecognitionResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @static - * @param {google.cloud.dialogflow.v2.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingRecognitionResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.messageType); - if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.transcript); - if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isFinal); - if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); - if (message.speechWordInfo != null && message.speechWordInfo.length) - for (var i = 0; i < message.speechWordInfo.length; ++i) - $root.google.cloud.dialogflow.v2.SpeechWordInfo.encode(message.speechWordInfo[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.speechEndOffset != null && Object.hasOwnProperty.call(message, "speechEndOffset")) - $root.google.protobuf.Duration.encode(message.speechEndOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; + /** + * Decodes a LinkOutSuggestion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion} LinkOutSuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkOutSuggestion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.StreamingRecognitionResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @static - * @param {google.cloud.dialogflow.v2.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a LinkOutSuggestion message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LinkOutSuggestion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destinationName != null && message.hasOwnProperty("destinationName")) + if (!$util.isString(message.destinationName)) + return "destinationName: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; - /** - * Decodes a StreamingRecognitionResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.StreamingRecognitionResult} StreamingRecognitionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingRecognitionResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.StreamingRecognitionResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.messageType = reader.int32(); - break; - case 2: - message.transcript = reader.string(); - break; - case 3: - message.isFinal = reader.bool(); - break; - case 4: - message.confidence = reader.float(); - break; - case 7: - if (!(message.speechWordInfo && message.speechWordInfo.length)) - message.speechWordInfo = []; - message.speechWordInfo.push($root.google.cloud.dialogflow.v2.SpeechWordInfo.decode(reader, reader.uint32())); - break; - case 8: - message.speechEndOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a LinkOutSuggestion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion} LinkOutSuggestion + */ + LinkOutSuggestion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion(); + if (object.destinationName != null) + message.destinationName = String(object.destinationName); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; - /** - * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.StreamingRecognitionResult} StreamingRecognitionResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a LinkOutSuggestion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion} message LinkOutSuggestion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LinkOutSuggestion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.destinationName = ""; + object.uri = ""; + } + if (message.destinationName != null && message.hasOwnProperty("destinationName")) + object.destinationName = message.destinationName; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; - /** - * Verifies a StreamingRecognitionResult message. - * @function verify - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StreamingRecognitionResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageType != null && message.hasOwnProperty("messageType")) - switch (message.messageType) { - default: - return "messageType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.transcript != null && message.hasOwnProperty("transcript")) - if (!$util.isString(message.transcript)) - return "transcript: string expected"; - if (message.isFinal != null && message.hasOwnProperty("isFinal")) - if (typeof message.isFinal !== "boolean") - return "isFinal: boolean expected"; - if (message.confidence != null && message.hasOwnProperty("confidence")) - if (typeof message.confidence !== "number") - return "confidence: number expected"; - if (message.speechWordInfo != null && message.hasOwnProperty("speechWordInfo")) { - if (!Array.isArray(message.speechWordInfo)) - return "speechWordInfo: array expected"; - for (var i = 0; i < message.speechWordInfo.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.SpeechWordInfo.verify(message.speechWordInfo[i]); - if (error) - return "speechWordInfo." + error; - } - } - if (message.speechEndOffset != null && message.hasOwnProperty("speechEndOffset")) { - var error = $root.google.protobuf.Duration.verify(message.speechEndOffset); - if (error) - return "speechEndOffset." + error; - } - return null; - }; + /** + * Converts this LinkOutSuggestion to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.LinkOutSuggestion + * @instance + * @returns {Object.} JSON object + */ + LinkOutSuggestion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.StreamingRecognitionResult} StreamingRecognitionResult - */ - StreamingRecognitionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.StreamingRecognitionResult) - return object; - var message = new $root.google.cloud.dialogflow.v2.StreamingRecognitionResult(); - switch (object.messageType) { - case "MESSAGE_TYPE_UNSPECIFIED": - case 0: - message.messageType = 0; - break; - case "TRANSCRIPT": - case 1: - message.messageType = 1; - break; - case "END_OF_SINGLE_UTTERANCE": - case 2: - message.messageType = 2; - break; - } - if (object.transcript != null) - message.transcript = String(object.transcript); - if (object.isFinal != null) - message.isFinal = Boolean(object.isFinal); - if (object.confidence != null) - message.confidence = Number(object.confidence); - if (object.speechWordInfo) { - if (!Array.isArray(object.speechWordInfo)) - throw TypeError(".google.cloud.dialogflow.v2.StreamingRecognitionResult.speechWordInfo: array expected"); - message.speechWordInfo = []; - for (var i = 0; i < object.speechWordInfo.length; ++i) { - if (typeof object.speechWordInfo[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.StreamingRecognitionResult.speechWordInfo: object expected"); - message.speechWordInfo[i] = $root.google.cloud.dialogflow.v2.SpeechWordInfo.fromObject(object.speechWordInfo[i]); - } - } - if (object.speechEndOffset != null) { - if (typeof object.speechEndOffset !== "object") - throw TypeError(".google.cloud.dialogflow.v2.StreamingRecognitionResult.speechEndOffset: object expected"); - message.speechEndOffset = $root.google.protobuf.Duration.fromObject(object.speechEndOffset); - } - return message; - }; + return LinkOutSuggestion; + })(); - /** - * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @static - * @param {google.cloud.dialogflow.v2.StreamingRecognitionResult} message StreamingRecognitionResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StreamingRecognitionResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.speechWordInfo = []; - if (options.defaults) { - object.messageType = options.enums === String ? "MESSAGE_TYPE_UNSPECIFIED" : 0; - object.transcript = ""; - object.isFinal = false; - object.confidence = 0; - object.speechEndOffset = null; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) - object.messageType = options.enums === String ? $root.google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType[message.messageType] : message.messageType; - if (message.transcript != null && message.hasOwnProperty("transcript")) - object.transcript = message.transcript; - if (message.isFinal != null && message.hasOwnProperty("isFinal")) - object.isFinal = message.isFinal; - if (message.confidence != null && message.hasOwnProperty("confidence")) - object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; - if (message.speechWordInfo && message.speechWordInfo.length) { - object.speechWordInfo = []; - for (var j = 0; j < message.speechWordInfo.length; ++j) - object.speechWordInfo[j] = $root.google.cloud.dialogflow.v2.SpeechWordInfo.toObject(message.speechWordInfo[j], options); - } - if (message.speechEndOffset != null && message.hasOwnProperty("speechEndOffset")) - object.speechEndOffset = $root.google.protobuf.Duration.toObject(message.speechEndOffset, options); - return object; - }; + Message.ListSelect = (function() { - /** - * Converts this StreamingRecognitionResult to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.StreamingRecognitionResult - * @instance - * @returns {Object.} JSON object - */ - StreamingRecognitionResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of a ListSelect. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface IListSelect + * @property {string|null} [title] ListSelect title + * @property {Array.|null} [items] ListSelect items + * @property {string|null} [subtitle] ListSelect subtitle + */ - /** - * MessageType enum. - * @name google.cloud.dialogflow.v2.StreamingRecognitionResult.MessageType - * @enum {number} - * @property {number} MESSAGE_TYPE_UNSPECIFIED=0 MESSAGE_TYPE_UNSPECIFIED value - * @property {number} TRANSCRIPT=1 TRANSCRIPT value - * @property {number} END_OF_SINGLE_UTTERANCE=2 END_OF_SINGLE_UTTERANCE value - */ - StreamingRecognitionResult.MessageType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TRANSCRIPT"] = 1; - values[valuesById[2] = "END_OF_SINGLE_UTTERANCE"] = 2; - return values; - })(); + /** + * Constructs a new ListSelect. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a ListSelect. + * @implements IListSelect + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.IListSelect=} [properties] Properties to set + */ + function ListSelect(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return StreamingRecognitionResult; - })(); + /** + * ListSelect title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @instance + */ + ListSelect.prototype.title = ""; - v2.TextInput = (function() { + /** + * ListSelect items. + * @member {Array.} items + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @instance + */ + ListSelect.prototype.items = $util.emptyArray; - /** - * Properties of a TextInput. - * @memberof google.cloud.dialogflow.v2 - * @interface ITextInput - * @property {string|null} [text] TextInput text - * @property {string|null} [languageCode] TextInput languageCode - */ + /** + * ListSelect subtitle. + * @member {string} subtitle + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @instance + */ + ListSelect.prototype.subtitle = ""; - /** - * Constructs a new TextInput. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a TextInput. - * @implements ITextInput - * @constructor - * @param {google.cloud.dialogflow.v2.ITextInput=} [properties] Properties to set - */ - function TextInput(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a new ListSelect instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IListSelect=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect} ListSelect instance + */ + ListSelect.create = function create(properties) { + return new ListSelect(properties); + }; - /** - * TextInput text. - * @member {string} text - * @memberof google.cloud.dialogflow.v2.TextInput - * @instance - */ - TextInput.prototype.text = ""; + /** + * Encodes the specified ListSelect message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IListSelect} message ListSelect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSelect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.subtitle); + return writer; + }; - /** - * TextInput languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.TextInput - * @instance - */ - TextInput.prototype.languageCode = ""; + /** + * Encodes the specified ListSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IListSelect} message ListSelect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSelect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new TextInput instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.TextInput - * @static - * @param {google.cloud.dialogflow.v2.ITextInput=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.TextInput} TextInput instance - */ - TextInput.create = function create(properties) { - return new TextInput(properties); - }; + /** + * Decodes a ListSelect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect} ListSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSelect.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.decode(reader, reader.uint32())); + break; + case 3: + message.subtitle = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified TextInput message. Does not implicitly {@link google.cloud.dialogflow.v2.TextInput.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.TextInput - * @static - * @param {google.cloud.dialogflow.v2.ITextInput} message TextInput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextInput.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); - return writer; - }; + /** + * Decodes a ListSelect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect} ListSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSelect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.TextInput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.TextInput - * @static - * @param {google.cloud.dialogflow.v2.ITextInput} message TextInput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TextInput.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a ListSelect message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSelect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + return null; + }; - /** - * Decodes a TextInput message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.TextInput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.TextInput} TextInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextInput.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.TextInput(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = reader.string(); - break; - case 2: - message.languageCode = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a ListSelect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect} ListSelect + */ + ListSelect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect(); + if (object.title != null) + message.title = String(object.title); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.ListSelect.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.ListSelect.items: object expected"); + message.items[i] = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.fromObject(object.items[i]); + } + } + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + return message; + }; - /** - * Decodes a TextInput message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.TextInput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.TextInput} TextInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TextInput.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a ListSelect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ListSelect} message ListSelect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSelect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) { + object.title = ""; + object.subtitle = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.toObject(message.items[j], options); + } + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + return object; + }; - /** - * Verifies a TextInput message. - * @function verify - * @memberof google.cloud.dialogflow.v2.TextInput - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TextInput.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - return null; - }; + /** + * Converts this ListSelect to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @instance + * @returns {Object.} JSON object + */ + ListSelect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a TextInput message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.TextInput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.TextInput} TextInput - */ - TextInput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.TextInput) - return object; - var message = new $root.google.cloud.dialogflow.v2.TextInput(); - if (object.text != null) - message.text = String(object.text); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - return message; - }; + ListSelect.Item = (function() { - /** - * Creates a plain object from a TextInput message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.TextInput - * @static - * @param {google.cloud.dialogflow.v2.TextInput} message TextInput - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TextInput.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.languageCode = ""; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - return object; - }; + /** + * Properties of an Item. + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @interface IItem + * @property {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null} [info] Item info + * @property {string|null} [title] Item title + * @property {string|null} [description] Item description + * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [image] Item image + */ - /** - * Converts this TextInput to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.TextInput - * @instance - * @returns {Object.} JSON object - */ - TextInput.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new Item. + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem=} [properties] Properties to set + */ + function Item(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return TextInput; - })(); + /** + * Item info. + * @member {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null|undefined} info + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @instance + */ + Item.prototype.info = null; - v2.EventInput = (function() { + /** + * Item title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @instance + */ + Item.prototype.title = ""; - /** - * Properties of an EventInput. - * @memberof google.cloud.dialogflow.v2 - * @interface IEventInput - * @property {string|null} [name] EventInput name - * @property {google.protobuf.IStruct|null} [parameters] EventInput parameters - * @property {string|null} [languageCode] EventInput languageCode - */ + /** + * Item description. + * @member {string} description + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @instance + */ + Item.prototype.description = ""; - /** - * Constructs a new EventInput. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an EventInput. - * @implements IEventInput - * @constructor - * @param {google.cloud.dialogflow.v2.IEventInput=} [properties] Properties to set - */ - function EventInput(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Item image. + * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} image + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @instance + */ + Item.prototype.image = null; - /** - * EventInput name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.EventInput - * @instance - */ - EventInput.prototype.name = ""; + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; - /** - * EventInput parameters. - * @member {google.protobuf.IStruct|null|undefined} parameters - * @memberof google.cloud.dialogflow.v2.EventInput - * @instance - */ - EventInput.prototype.parameters = null; + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * EventInput languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2.EventInput - * @instance - */ - EventInput.prototype.languageCode = ""; + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ListSelect.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new EventInput instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.EventInput - * @static - * @param {google.cloud.dialogflow.v2.IEventInput=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.EventInput} EventInput instance - */ - EventInput.create = function create(properties) { - return new EventInput(properties); - }; + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.decode(reader, reader.uint32()); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified EventInput message. Does not implicitly {@link google.cloud.dialogflow.v2.EventInput.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.EventInput - * @static - * @param {google.cloud.dialogflow.v2.IEventInput} message EventInput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EventInput.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); - return writer; - }; + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified EventInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EventInput.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.EventInput - * @static - * @param {google.cloud.dialogflow.v2.IEventInput} message EventInput message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EventInput.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.info != null && message.hasOwnProperty("info")) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.verify(message.info); + if (error) + return "info." + error; + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + return null; + }; - /** - * Decodes an EventInput message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.EventInput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.EventInput} EventInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EventInput.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.EventInput(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 3: - message.languageCode = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item(); + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.info: object expected"); + message.info = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.fromObject(object.info); + } + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item.image: object expected"); + message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.image); + } + return message; + }; - /** - * Decodes an EventInput message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.EventInput - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.EventInput} EventInput - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EventInput.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.info = null; + object.title = ""; + object.description = ""; + object.image = null; + } + if (message.info != null && message.hasOwnProperty("info")) + object.info = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.toObject(message.info, options); + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.image, options); + return object; + }; - /** - * Verifies an EventInput message. - * @function verify - * @memberof google.cloud.dialogflow.v2.EventInput - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EventInput.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - var error = $root.google.protobuf.Struct.verify(message.parameters); - if (error) - return "parameters." + error; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - return null; - }; + /** + * Converts this Item to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.ListSelect.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates an EventInput message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.EventInput - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.EventInput} EventInput - */ - EventInput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.EventInput) - return object; - var message = new $root.google.cloud.dialogflow.v2.EventInput(); - if (object.name != null) - message.name = String(object.name); - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.dialogflow.v2.EventInput.parameters: object expected"); - message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - return message; - }; + return Item; + })(); - /** - * Creates a plain object from an EventInput message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.EventInput - * @static - * @param {google.cloud.dialogflow.v2.EventInput} message EventInput - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EventInput.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.parameters = null; - object.languageCode = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.parameters != null && message.hasOwnProperty("parameters")) - object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - return object; - }; + return ListSelect; + })(); - /** - * Converts this EventInput to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.EventInput - * @instance - * @returns {Object.} JSON object - */ - EventInput.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Message.CarouselSelect = (function() { - return EventInput; - })(); + /** + * Properties of a CarouselSelect. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface ICarouselSelect + * @property {Array.|null} [items] CarouselSelect items + */ - v2.SentimentAnalysisRequestConfig = (function() { + /** + * Constructs a new CarouselSelect. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a CarouselSelect. + * @implements ICarouselSelect + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect=} [properties] Properties to set + */ + function CarouselSelect(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a SentimentAnalysisRequestConfig. - * @memberof google.cloud.dialogflow.v2 - * @interface ISentimentAnalysisRequestConfig - * @property {boolean|null} [analyzeQueryTextSentiment] SentimentAnalysisRequestConfig analyzeQueryTextSentiment - */ + /** + * CarouselSelect items. + * @member {Array.} items + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + * @instance + */ + CarouselSelect.prototype.items = $util.emptyArray; - /** - * Constructs a new SentimentAnalysisRequestConfig. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a SentimentAnalysisRequestConfig. - * @implements ISentimentAnalysisRequestConfig - * @constructor - * @param {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig=} [properties] Properties to set - */ - function SentimentAnalysisRequestConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a new CarouselSelect instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect} CarouselSelect instance + */ + CarouselSelect.create = function create(properties) { + return new CarouselSelect(properties); + }; - /** - * SentimentAnalysisRequestConfig analyzeQueryTextSentiment. - * @member {boolean} analyzeQueryTextSentiment - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig - * @instance - */ - SentimentAnalysisRequestConfig.prototype.analyzeQueryTextSentiment = false; + /** + * Encodes the specified CarouselSelect message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect} message CarouselSelect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CarouselSelect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * Creates a new SentimentAnalysisRequestConfig instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig - * @static - * @param {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig instance - */ - SentimentAnalysisRequestConfig.create = function create(properties) { - return new SentimentAnalysisRequestConfig(properties); - }; + /** + * Encodes the specified CarouselSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ICarouselSelect} message CarouselSelect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CarouselSelect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified SentimentAnalysisRequestConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig - * @static - * @param {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig} message SentimentAnalysisRequestConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SentimentAnalysisRequestConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.analyzeQueryTextSentiment != null && Object.hasOwnProperty.call(message, "analyzeQueryTextSentiment")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.analyzeQueryTextSentiment); - return writer; - }; + /** + * Decodes a CarouselSelect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect} CarouselSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CarouselSelect.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified SentimentAnalysisRequestConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig - * @static - * @param {google.cloud.dialogflow.v2.ISentimentAnalysisRequestConfig} message SentimentAnalysisRequestConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SentimentAnalysisRequestConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a CarouselSelect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect} CarouselSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CarouselSelect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SentimentAnalysisRequestConfig.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.analyzeQueryTextSentiment = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a CarouselSelect message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CarouselSelect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; - /** - * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SentimentAnalysisRequestConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a CarouselSelect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect} CarouselSelect + */ + CarouselSelect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.items: object expected"); + message.items[i] = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.fromObject(object.items[i]); + } + } + return message; + }; - /** - * Verifies a SentimentAnalysisRequestConfig message. - * @function verify - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SentimentAnalysisRequestConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.analyzeQueryTextSentiment != null && message.hasOwnProperty("analyzeQueryTextSentiment")) - if (typeof message.analyzeQueryTextSentiment !== "boolean") - return "analyzeQueryTextSentiment: boolean expected"; - return null; - }; + /** + * Creates a plain object from a CarouselSelect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect} message CarouselSelect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CarouselSelect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.toObject(message.items[j], options); + } + return object; + }; - /** - * Creates a SentimentAnalysisRequestConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig - */ - SentimentAnalysisRequestConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig) - return object; - var message = new $root.google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig(); - if (object.analyzeQueryTextSentiment != null) - message.analyzeQueryTextSentiment = Boolean(object.analyzeQueryTextSentiment); - return message; - }; + /** + * Converts this CarouselSelect to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + * @instance + * @returns {Object.} JSON object + */ + CarouselSelect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a SentimentAnalysisRequestConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig - * @static - * @param {google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig} message SentimentAnalysisRequestConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SentimentAnalysisRequestConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.analyzeQueryTextSentiment = false; - if (message.analyzeQueryTextSentiment != null && message.hasOwnProperty("analyzeQueryTextSentiment")) - object.analyzeQueryTextSentiment = message.analyzeQueryTextSentiment; - return object; - }; + CarouselSelect.Item = (function() { - /** - * Converts this SentimentAnalysisRequestConfig to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisRequestConfig - * @instance - * @returns {Object.} JSON object - */ - SentimentAnalysisRequestConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of an Item. + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + * @interface IItem + * @property {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null} [info] Item info + * @property {string|null} [title] Item title + * @property {string|null} [description] Item description + * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [image] Item image + */ - return SentimentAnalysisRequestConfig; - })(); + /** + * Constructs a new Item. + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem=} [properties] Properties to set + */ + function Item(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - v2.SentimentAnalysisResult = (function() { + /** + * Item info. + * @member {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo|null|undefined} info + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @instance + */ + Item.prototype.info = null; - /** - * Properties of a SentimentAnalysisResult. - * @memberof google.cloud.dialogflow.v2 - * @interface ISentimentAnalysisResult - * @property {google.cloud.dialogflow.v2.ISentiment|null} [queryTextSentiment] SentimentAnalysisResult queryTextSentiment - */ + /** + * Item title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @instance + */ + Item.prototype.title = ""; - /** - * Constructs a new SentimentAnalysisResult. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a SentimentAnalysisResult. - * @implements ISentimentAnalysisResult - * @constructor - * @param {google.cloud.dialogflow.v2.ISentimentAnalysisResult=} [properties] Properties to set - */ - function SentimentAnalysisResult(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Item description. + * @member {string} description + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @instance + */ + Item.prototype.description = ""; - /** - * SentimentAnalysisResult queryTextSentiment. - * @member {google.cloud.dialogflow.v2.ISentiment|null|undefined} queryTextSentiment - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult - * @instance - */ - SentimentAnalysisResult.prototype.queryTextSentiment = null; + /** + * Item image. + * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} image + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @instance + */ + Item.prototype.image = null; - /** - * Creates a new SentimentAnalysisResult instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult - * @static - * @param {google.cloud.dialogflow.v2.ISentimentAnalysisResult=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.SentimentAnalysisResult} SentimentAnalysisResult instance - */ - SentimentAnalysisResult.create = function create(properties) { - return new SentimentAnalysisResult(properties); - }; + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; - /** - * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisResult.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult - * @static - * @param {google.cloud.dialogflow.v2.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SentimentAnalysisResult.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.queryTextSentiment != null && Object.hasOwnProperty.call(message, "queryTextSentiment")) - $root.google.cloud.dialogflow.v2.Sentiment.encode(message.queryTextSentiment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SentimentAnalysisResult.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult - * @static - * @param {google.cloud.dialogflow.v2.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SentimentAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a SentimentAnalysisResult message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.SentimentAnalysisResult} SentimentAnalysisResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SentimentAnalysisResult.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SentimentAnalysisResult(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.queryTextSentiment = $root.google.cloud.dialogflow.v2.Sentiment.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.decode(reader, reader.uint32()); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.SentimentAnalysisResult} SentimentAnalysisResult - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SentimentAnalysisResult.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a SentimentAnalysisResult message. - * @function verify - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SentimentAnalysisResult.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.queryTextSentiment != null && message.hasOwnProperty("queryTextSentiment")) { - var error = $root.google.cloud.dialogflow.v2.Sentiment.verify(message.queryTextSentiment); - if (error) - return "queryTextSentiment." + error; - } - return null; - }; + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.info != null && message.hasOwnProperty("info")) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.verify(message.info); + if (error) + return "info." + error; + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + return null; + }; - /** - * Creates a SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.SentimentAnalysisResult} SentimentAnalysisResult - */ - SentimentAnalysisResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.SentimentAnalysisResult) - return object; - var message = new $root.google.cloud.dialogflow.v2.SentimentAnalysisResult(); - if (object.queryTextSentiment != null) { - if (typeof object.queryTextSentiment !== "object") - throw TypeError(".google.cloud.dialogflow.v2.SentimentAnalysisResult.queryTextSentiment: object expected"); - message.queryTextSentiment = $root.google.cloud.dialogflow.v2.Sentiment.fromObject(object.queryTextSentiment); - } - return message; - }; + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item(); + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.info: object expected"); + message.info = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.fromObject(object.info); + } + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item.image: object expected"); + message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.image); + } + return message; + }; - /** - * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult - * @static - * @param {google.cloud.dialogflow.v2.SentimentAnalysisResult} message SentimentAnalysisResult - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SentimentAnalysisResult.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.queryTextSentiment = null; - if (message.queryTextSentiment != null && message.hasOwnProperty("queryTextSentiment")) - object.queryTextSentiment = $root.google.cloud.dialogflow.v2.Sentiment.toObject(message.queryTextSentiment, options); - return object; - }; + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.info = null; + object.title = ""; + object.description = ""; + object.image = null; + } + if (message.info != null && message.hasOwnProperty("info")) + object.info = $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.toObject(message.info, options); + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.image, options); + return object; + }; - /** - * Converts this SentimentAnalysisResult to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.SentimentAnalysisResult - * @instance - * @returns {Object.} JSON object - */ - SentimentAnalysisResult.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this Item to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.CarouselSelect.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return SentimentAnalysisResult; - })(); + return Item; + })(); - v2.Sentiment = (function() { + return CarouselSelect; + })(); - /** - * Properties of a Sentiment. - * @memberof google.cloud.dialogflow.v2 - * @interface ISentiment - * @property {number|null} [score] Sentiment score - * @property {number|null} [magnitude] Sentiment magnitude - */ + Message.SelectItemInfo = (function() { - /** - * Constructs a new Sentiment. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a Sentiment. - * @implements ISentiment - * @constructor - * @param {google.cloud.dialogflow.v2.ISentiment=} [properties] Properties to set - */ - function Sentiment(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a SelectItemInfo. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface ISelectItemInfo + * @property {string|null} [key] SelectItemInfo key + * @property {Array.|null} [synonyms] SelectItemInfo synonyms + */ - /** - * Sentiment score. - * @member {number} score - * @memberof google.cloud.dialogflow.v2.Sentiment - * @instance - */ - Sentiment.prototype.score = 0; + /** + * Constructs a new SelectItemInfo. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a SelectItemInfo. + * @implements ISelectItemInfo + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo=} [properties] Properties to set + */ + function SelectItemInfo(properties) { + this.synonyms = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Sentiment magnitude. - * @member {number} magnitude - * @memberof google.cloud.dialogflow.v2.Sentiment - * @instance - */ - Sentiment.prototype.magnitude = 0; + /** + * SelectItemInfo key. + * @member {string} key + * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + * @instance + */ + SelectItemInfo.prototype.key = ""; - /** - * Creates a new Sentiment instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.Sentiment - * @static - * @param {google.cloud.dialogflow.v2.ISentiment=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.Sentiment} Sentiment instance - */ - Sentiment.create = function create(properties) { - return new Sentiment(properties); - }; + /** + * SelectItemInfo synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + * @instance + */ + SelectItemInfo.prototype.synonyms = $util.emptyArray; - /** - * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.dialogflow.v2.Sentiment.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.Sentiment - * @static - * @param {google.cloud.dialogflow.v2.ISentiment} message Sentiment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Sentiment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); - if (message.magnitude != null && Object.hasOwnProperty.call(message, "magnitude")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.magnitude); - return writer; - }; + /** + * Creates a new SelectItemInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo} SelectItemInfo instance + */ + SelectItemInfo.create = function create(properties) { + return new SelectItemInfo(properties); + }; - /** - * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Sentiment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.Sentiment - * @static - * @param {google.cloud.dialogflow.v2.ISentiment} message Sentiment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Sentiment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified SelectItemInfo message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo} message SelectItemInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectItemInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.synonyms[i]); + return writer; + }; - /** - * Decodes a Sentiment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.Sentiment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.Sentiment} Sentiment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Sentiment.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Sentiment(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.score = reader.float(); - break; - case 2: - message.magnitude = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified SelectItemInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ISelectItemInfo} message SelectItemInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectItemInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Sentiment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.Sentiment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.Sentiment} Sentiment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Sentiment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SelectItemInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo} SelectItemInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectItemInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Verifies a Sentiment message. - * @function verify - * @memberof google.cloud.dialogflow.v2.Sentiment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Sentiment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.score != null && message.hasOwnProperty("score")) - if (typeof message.score !== "number") - return "score: number expected"; - if (message.magnitude != null && message.hasOwnProperty("magnitude")) - if (typeof message.magnitude !== "number") - return "magnitude: number expected"; - return null; - }; + /** + * Decodes a SelectItemInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo} SelectItemInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectItemInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.Sentiment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.Sentiment} Sentiment - */ - Sentiment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.Sentiment) - return object; - var message = new $root.google.cloud.dialogflow.v2.Sentiment(); - if (object.score != null) - message.score = Number(object.score); - if (object.magnitude != null) - message.magnitude = Number(object.magnitude); - return message; - }; + /** + * Verifies a SelectItemInfo message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectItemInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) + if (!$util.isString(message.synonyms[i])) + return "synonyms: string[] expected"; + } + return null; + }; - /** - * Creates a plain object from a Sentiment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.Sentiment - * @static - * @param {google.cloud.dialogflow.v2.Sentiment} message Sentiment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Sentiment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.score = 0; - object.magnitude = 0; - } - if (message.score != null && message.hasOwnProperty("score")) - object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; - if (message.magnitude != null && message.hasOwnProperty("magnitude")) - object.magnitude = options.json && !isFinite(message.magnitude) ? String(message.magnitude) : message.magnitude; - return object; - }; + /** + * Creates a SelectItemInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo} SelectItemInfo + */ + SelectItemInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo(); + if (object.key != null) + message.key = String(object.key); + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) + message.synonyms[i] = String(object.synonyms[i]); + } + return message; + }; - /** - * Converts this Sentiment to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.Sentiment - * @instance - * @returns {Object.} JSON object - */ - Sentiment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a SelectItemInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo} message SelectItemInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectItemInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.synonyms = []; + if (options.defaults) + object.key = ""; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = message.synonyms[j]; + } + return object; + }; - return Sentiment; - })(); + /** + * Converts this SelectItemInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.SelectItemInfo + * @instance + * @returns {Object.} JSON object + */ + SelectItemInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v2.SessionEntityTypes = (function() { + return SelectItemInfo; + })(); - /** - * Constructs a new SessionEntityTypes service. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a SessionEntityTypes - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function SessionEntityTypes(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + Message.MediaContent = (function() { - (SessionEntityTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionEntityTypes; + /** + * Properties of a MediaContent. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface IMediaContent + * @property {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType|null} [mediaType] MediaContent mediaType + * @property {Array.|null} [mediaObjects] MediaContent mediaObjects + */ - /** - * Creates new SessionEntityTypes service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {SessionEntityTypes} RPC service. Useful where requests and/or responses are streamed. - */ - SessionEntityTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * Constructs a new MediaContent. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a MediaContent. + * @implements IMediaContent + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.IMediaContent=} [properties] Properties to set + */ + function MediaContent(properties) { + this.mediaObjects = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#listSessionEntityTypes}. - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @typedef ListSessionEntityTypesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.ListSessionEntityTypesResponse} [response] ListSessionEntityTypesResponse - */ + /** + * MediaContent mediaType. + * @member {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType} mediaType + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @instance + */ + MediaContent.prototype.mediaType = 0; - /** - * Calls ListSessionEntityTypes. - * @function listSessionEntityTypes - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesRequest} request ListSessionEntityTypesRequest message or plain object - * @param {google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypesCallback} callback Node-style callback called with the error, if any, and ListSessionEntityTypesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionEntityTypes.prototype.listSessionEntityTypes = function listSessionEntityTypes(request, callback) { - return this.rpcCall(listSessionEntityTypes, $root.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest, $root.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse, request, callback); - }, "name", { value: "ListSessionEntityTypes" }); + /** + * MediaContent mediaObjects. + * @member {Array.} mediaObjects + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @instance + */ + MediaContent.prototype.mediaObjects = $util.emptyArray; - /** - * Calls ListSessionEntityTypes. - * @function listSessionEntityTypes - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesRequest} request ListSessionEntityTypesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a new MediaContent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IMediaContent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent} MediaContent instance + */ + MediaContent.create = function create(properties) { + return new MediaContent(properties); + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#getSessionEntityType}. - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @typedef GetSessionEntityTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.SessionEntityType} [response] SessionEntityType - */ + /** + * Encodes the specified MediaContent message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IMediaContent} message MediaContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MediaContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mediaType != null && Object.hasOwnProperty.call(message, "mediaType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mediaType); + if (message.mediaObjects != null && message.mediaObjects.length) + for (var i = 0; i < message.mediaObjects.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.encode(message.mediaObjects[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Calls GetSessionEntityType. - * @function getSessionEntityType - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest} request GetSessionEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2.SessionEntityTypes.GetSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionEntityTypes.prototype.getSessionEntityType = function getSessionEntityType(request, callback) { - return this.rpcCall(getSessionEntityType, $root.google.cloud.dialogflow.v2.GetSessionEntityTypeRequest, $root.google.cloud.dialogflow.v2.SessionEntityType, request, callback); - }, "name", { value: "GetSessionEntityType" }); + /** + * Encodes the specified MediaContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IMediaContent} message MediaContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MediaContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls GetSessionEntityType. - * @function getSessionEntityType - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest} request GetSessionEntityTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a MediaContent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent} MediaContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MediaContent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mediaType = reader.int32(); + break; + case 2: + if (!(message.mediaObjects && message.mediaObjects.length)) + message.mediaObjects = []; + message.mediaObjects.push($root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#createSessionEntityType}. - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @typedef CreateSessionEntityTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.SessionEntityType} [response] SessionEntityType - */ + /** + * Decodes a MediaContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent} MediaContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MediaContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls CreateSessionEntityType. - * @function createSessionEntityType - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest} request CreateSessionEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2.SessionEntityTypes.CreateSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionEntityTypes.prototype.createSessionEntityType = function createSessionEntityType(request, callback) { - return this.rpcCall(createSessionEntityType, $root.google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest, $root.google.cloud.dialogflow.v2.SessionEntityType, request, callback); - }, "name", { value: "CreateSessionEntityType" }); + /** + * Verifies a MediaContent message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MediaContent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mediaType != null && message.hasOwnProperty("mediaType")) + switch (message.mediaType) { + default: + return "mediaType: enum value expected"; + case 0: + case 1: + break; + } + if (message.mediaObjects != null && message.hasOwnProperty("mediaObjects")) { + if (!Array.isArray(message.mediaObjects)) + return "mediaObjects: array expected"; + for (var i = 0; i < message.mediaObjects.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.verify(message.mediaObjects[i]); + if (error) + return "mediaObjects." + error; + } + } + return null; + }; - /** - * Calls CreateSessionEntityType. - * @function createSessionEntityType - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest} request CreateSessionEntityTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a MediaContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent} MediaContent + */ + MediaContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent(); + switch (object.mediaType) { + case "RESPONSE_MEDIA_TYPE_UNSPECIFIED": + case 0: + message.mediaType = 0; + break; + case "AUDIO": + case 1: + message.mediaType = 1; + break; + } + if (object.mediaObjects) { + if (!Array.isArray(object.mediaObjects)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.MediaContent.mediaObjects: array expected"); + message.mediaObjects = []; + for (var i = 0; i < object.mediaObjects.length; ++i) { + if (typeof object.mediaObjects[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.MediaContent.mediaObjects: object expected"); + message.mediaObjects[i] = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.fromObject(object.mediaObjects[i]); + } + } + return message; + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#updateSessionEntityType}. - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @typedef UpdateSessionEntityTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2.SessionEntityType} [response] SessionEntityType - */ + /** + * Creates a plain object from a MediaContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.MediaContent} message MediaContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MediaContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mediaObjects = []; + if (options.defaults) + object.mediaType = options.enums === String ? "RESPONSE_MEDIA_TYPE_UNSPECIFIED" : 0; + if (message.mediaType != null && message.hasOwnProperty("mediaType")) + object.mediaType = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType[message.mediaType] : message.mediaType; + if (message.mediaObjects && message.mediaObjects.length) { + object.mediaObjects = []; + for (var j = 0; j < message.mediaObjects.length; ++j) + object.mediaObjects[j] = $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.toObject(message.mediaObjects[j], options); + } + return object; + }; - /** - * Calls UpdateSessionEntityType. - * @function updateSessionEntityType - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest} request UpdateSessionEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2.SessionEntityTypes.UpdateSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionEntityTypes.prototype.updateSessionEntityType = function updateSessionEntityType(request, callback) { - return this.rpcCall(updateSessionEntityType, $root.google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest, $root.google.cloud.dialogflow.v2.SessionEntityType, request, callback); - }, "name", { value: "UpdateSessionEntityType" }); + /** + * Converts this MediaContent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @instance + * @returns {Object.} JSON object + */ + MediaContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls UpdateSessionEntityType. - * @function updateSessionEntityType - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest} request UpdateSessionEntityTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + MediaContent.ResponseMediaObject = (function() { - /** - * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#deleteSessionEntityType}. - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @typedef DeleteSessionEntityTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ + /** + * Properties of a ResponseMediaObject. + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @interface IResponseMediaObject + * @property {string|null} [name] ResponseMediaObject name + * @property {string|null} [description] ResponseMediaObject description + * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [largeImage] ResponseMediaObject largeImage + * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [icon] ResponseMediaObject icon + * @property {string|null} [contentUrl] ResponseMediaObject contentUrl + */ - /** - * Calls DeleteSessionEntityType. - * @function deleteSessionEntityType - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest} request DeleteSessionEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2.SessionEntityTypes.DeleteSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(SessionEntityTypes.prototype.deleteSessionEntityType = function deleteSessionEntityType(request, callback) { - return this.rpcCall(deleteSessionEntityType, $root.google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSessionEntityType" }); + /** + * Constructs a new ResponseMediaObject. + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent + * @classdesc Represents a ResponseMediaObject. + * @implements IResponseMediaObject + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject=} [properties] Properties to set + */ + function ResponseMediaObject(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Calls DeleteSessionEntityType. - * @function deleteSessionEntityType - * @memberof google.cloud.dialogflow.v2.SessionEntityTypes - * @instance - * @param {google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest} request DeleteSessionEntityTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * ResponseMediaObject name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @instance + */ + ResponseMediaObject.prototype.name = ""; - return SessionEntityTypes; - })(); + /** + * ResponseMediaObject description. + * @member {string} description + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @instance + */ + ResponseMediaObject.prototype.description = ""; - v2.SessionEntityType = (function() { + /** + * ResponseMediaObject largeImage. + * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} largeImage + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @instance + */ + ResponseMediaObject.prototype.largeImage = null; - /** - * Properties of a SessionEntityType. - * @memberof google.cloud.dialogflow.v2 - * @interface ISessionEntityType - * @property {string|null} [name] SessionEntityType name - * @property {google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode|null} [entityOverrideMode] SessionEntityType entityOverrideMode - * @property {Array.|null} [entities] SessionEntityType entities - */ + /** + * ResponseMediaObject icon. + * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} icon + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @instance + */ + ResponseMediaObject.prototype.icon = null; - /** - * Constructs a new SessionEntityType. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a SessionEntityType. - * @implements ISessionEntityType - * @constructor - * @param {google.cloud.dialogflow.v2.ISessionEntityType=} [properties] Properties to set - */ - function SessionEntityType(properties) { - this.entities = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ResponseMediaObject contentUrl. + * @member {string} contentUrl + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @instance + */ + ResponseMediaObject.prototype.contentUrl = ""; - /** - * SessionEntityType name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.SessionEntityType - * @instance - */ - SessionEntityType.prototype.name = ""; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * SessionEntityType entityOverrideMode. - * @member {google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode} entityOverrideMode - * @memberof google.cloud.dialogflow.v2.SessionEntityType - * @instance - */ - SessionEntityType.prototype.entityOverrideMode = 0; + /** + * ResponseMediaObject image. + * @member {"largeImage"|"icon"|undefined} image + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @instance + */ + Object.defineProperty(ResponseMediaObject.prototype, "image", { + get: $util.oneOfGetter($oneOfFields = ["largeImage", "icon"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * SessionEntityType entities. - * @member {Array.} entities - * @memberof google.cloud.dialogflow.v2.SessionEntityType - * @instance - */ - SessionEntityType.prototype.entities = $util.emptyArray; + /** + * Creates a new ResponseMediaObject instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject instance + */ + ResponseMediaObject.create = function create(properties) { + return new ResponseMediaObject(properties); + }; - /** - * Creates a new SessionEntityType instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.SessionEntityType - * @static - * @param {google.cloud.dialogflow.v2.ISessionEntityType=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.SessionEntityType} SessionEntityType instance - */ - SessionEntityType.create = function create(properties) { - return new SessionEntityType(properties); - }; + /** + * Encodes the specified ResponseMediaObject message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject} message ResponseMediaObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMediaObject.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.largeImage != null && Object.hasOwnProperty.call(message, "largeImage")) + $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.largeImage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) + $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.icon, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.contentUrl != null && Object.hasOwnProperty.call(message, "contentUrl")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.contentUrl); + return writer; + }; - /** - * Encodes the specified SessionEntityType message. Does not implicitly {@link google.cloud.dialogflow.v2.SessionEntityType.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.SessionEntityType - * @static - * @param {google.cloud.dialogflow.v2.ISessionEntityType} message SessionEntityType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionEntityType.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.entityOverrideMode != null && Object.hasOwnProperty.call(message, "entityOverrideMode")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.entityOverrideMode); - if (message.entities != null && message.entities.length) - for (var i = 0; i < message.entities.length; ++i) - $root.google.cloud.dialogflow.v2.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified ResponseMediaObject message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.MediaContent.IResponseMediaObject} message ResponseMediaObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMediaObject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified SessionEntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SessionEntityType.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.SessionEntityType - * @static - * @param {google.cloud.dialogflow.v2.ISessionEntityType} message SessionEntityType message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SessionEntityType.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a ResponseMediaObject message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMediaObject.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.largeImage = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); + break; + case 4: + message.icon = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); + break; + case 5: + message.contentUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a SessionEntityType message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.SessionEntityType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.SessionEntityType} SessionEntityType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionEntityType.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SessionEntityType(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.entityOverrideMode = reader.int32(); - break; - case 3: - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.dialogflow.v2.EntityType.Entity.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a ResponseMediaObject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMediaObject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a SessionEntityType message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.SessionEntityType - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.SessionEntityType} SessionEntityType - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SessionEntityType.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a ResponseMediaObject message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseMediaObject.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.largeImage != null && message.hasOwnProperty("largeImage")) { + properties.image = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.largeImage); + if (error) + return "largeImage." + error; + } + } + if (message.icon != null && message.hasOwnProperty("icon")) { + if (properties.image === 1) + return "image: multiple values"; + properties.image = 1; + { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.icon); + if (error) + return "icon." + error; + } + } + if (message.contentUrl != null && message.hasOwnProperty("contentUrl")) + if (!$util.isString(message.contentUrl)) + return "contentUrl: string expected"; + return null; + }; - /** - * Verifies a SessionEntityType message. - * @function verify - * @memberof google.cloud.dialogflow.v2.SessionEntityType - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SessionEntityType.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.entityOverrideMode != null && message.hasOwnProperty("entityOverrideMode")) - switch (message.entityOverrideMode) { - default: - return "entityOverrideMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.entities != null && message.hasOwnProperty("entities")) { - if (!Array.isArray(message.entities)) - return "entities: array expected"; - for (var i = 0; i < message.entities.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.EntityType.Entity.verify(message.entities[i]); - if (error) - return "entities." + error; - } - } - return null; - }; + /** + * Creates a ResponseMediaObject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject + */ + ResponseMediaObject.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.largeImage != null) { + if (typeof object.largeImage !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.largeImage: object expected"); + message.largeImage = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.largeImage); + } + if (object.icon != null) { + if (typeof object.icon !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject.icon: object expected"); + message.icon = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.icon); + } + if (object.contentUrl != null) + message.contentUrl = String(object.contentUrl); + return message; + }; - /** - * Creates a SessionEntityType message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.SessionEntityType - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.SessionEntityType} SessionEntityType - */ - SessionEntityType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.SessionEntityType) - return object; - var message = new $root.google.cloud.dialogflow.v2.SessionEntityType(); - if (object.name != null) - message.name = String(object.name); - switch (object.entityOverrideMode) { - case "ENTITY_OVERRIDE_MODE_UNSPECIFIED": - case 0: - message.entityOverrideMode = 0; - break; - case "ENTITY_OVERRIDE_MODE_OVERRIDE": - case 1: - message.entityOverrideMode = 1; - break; - case "ENTITY_OVERRIDE_MODE_SUPPLEMENT": - case 2: - message.entityOverrideMode = 2; - break; - } - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.dialogflow.v2.SessionEntityType.entities: array expected"); - message.entities = []; - for (var i = 0; i < object.entities.length; ++i) { - if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.SessionEntityType.entities: object expected"); - message.entities[i] = $root.google.cloud.dialogflow.v2.EntityType.Entity.fromObject(object.entities[i]); - } - } - return message; - }; + /** + * Creates a plain object from a ResponseMediaObject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject} message ResponseMediaObject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseMediaObject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.contentUrl = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.largeImage != null && message.hasOwnProperty("largeImage")) { + object.largeImage = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.largeImage, options); + if (options.oneofs) + object.image = "largeImage"; + } + if (message.icon != null && message.hasOwnProperty("icon")) { + object.icon = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.icon, options); + if (options.oneofs) + object.image = "icon"; + } + if (message.contentUrl != null && message.hasOwnProperty("contentUrl")) + object.contentUrl = message.contentUrl; + return object; + }; - /** - * Creates a plain object from a SessionEntityType message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.SessionEntityType - * @static - * @param {google.cloud.dialogflow.v2.SessionEntityType} message SessionEntityType - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SessionEntityType.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entities = []; - if (options.defaults) { - object.name = ""; - object.entityOverrideMode = options.enums === String ? "ENTITY_OVERRIDE_MODE_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.entityOverrideMode != null && message.hasOwnProperty("entityOverrideMode")) - object.entityOverrideMode = options.enums === String ? $root.google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode[message.entityOverrideMode] : message.entityOverrideMode; - if (message.entities && message.entities.length) { - object.entities = []; - for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = $root.google.cloud.dialogflow.v2.EntityType.Entity.toObject(message.entities[j], options); - } - return object; - }; + /** + * Converts this ResponseMediaObject to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaObject + * @instance + * @returns {Object.} JSON object + */ + ResponseMediaObject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this SessionEntityType to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.SessionEntityType - * @instance - * @returns {Object.} JSON object - */ - SessionEntityType.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return ResponseMediaObject; + })(); - /** - * EntityOverrideMode enum. - * @name google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode - * @enum {number} - * @property {number} ENTITY_OVERRIDE_MODE_UNSPECIFIED=0 ENTITY_OVERRIDE_MODE_UNSPECIFIED value - * @property {number} ENTITY_OVERRIDE_MODE_OVERRIDE=1 ENTITY_OVERRIDE_MODE_OVERRIDE value - * @property {number} ENTITY_OVERRIDE_MODE_SUPPLEMENT=2 ENTITY_OVERRIDE_MODE_SUPPLEMENT value - */ - SessionEntityType.EntityOverrideMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENTITY_OVERRIDE_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENTITY_OVERRIDE_MODE_OVERRIDE"] = 1; - values[valuesById[2] = "ENTITY_OVERRIDE_MODE_SUPPLEMENT"] = 2; - return values; - })(); + /** + * ResponseMediaType enum. + * @name google.cloud.dialogflow.v2.Intent.Message.MediaContent.ResponseMediaType + * @enum {number} + * @property {number} RESPONSE_MEDIA_TYPE_UNSPECIFIED=0 RESPONSE_MEDIA_TYPE_UNSPECIFIED value + * @property {number} AUDIO=1 AUDIO value + */ + MediaContent.ResponseMediaType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESPONSE_MEDIA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUDIO"] = 1; + return values; + })(); - return SessionEntityType; - })(); + return MediaContent; + })(); - v2.ListSessionEntityTypesRequest = (function() { + Message.BrowseCarouselCard = (function() { - /** - * Properties of a ListSessionEntityTypesRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IListSessionEntityTypesRequest - * @property {string|null} [parent] ListSessionEntityTypesRequest parent - * @property {number|null} [pageSize] ListSessionEntityTypesRequest pageSize - * @property {string|null} [pageToken] ListSessionEntityTypesRequest pageToken - */ + /** + * Properties of a BrowseCarouselCard. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface IBrowseCarouselCard + * @property {Array.|null} [items] BrowseCarouselCard items + * @property {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|null} [imageDisplayOptions] BrowseCarouselCard imageDisplayOptions + */ - /** - * Constructs a new ListSessionEntityTypesRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a ListSessionEntityTypesRequest. - * @implements IListSessionEntityTypesRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesRequest=} [properties] Properties to set - */ - function ListSessionEntityTypesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new BrowseCarouselCard. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a BrowseCarouselCard. + * @implements IBrowseCarouselCard + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard=} [properties] Properties to set + */ + function BrowseCarouselCard(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * ListSessionEntityTypesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest - * @instance - */ - ListSessionEntityTypesRequest.prototype.parent = ""; + /** + * BrowseCarouselCard items. + * @member {Array.} items + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @instance + */ + BrowseCarouselCard.prototype.items = $util.emptyArray; - /** - * ListSessionEntityTypesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest - * @instance - */ - ListSessionEntityTypesRequest.prototype.pageSize = 0; + /** + * BrowseCarouselCard imageDisplayOptions. + * @member {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions} imageDisplayOptions + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @instance + */ + BrowseCarouselCard.prototype.imageDisplayOptions = 0; - /** - * ListSessionEntityTypesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest - * @instance - */ - ListSessionEntityTypesRequest.prototype.pageToken = ""; + /** + * Creates a new BrowseCarouselCard instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard} BrowseCarouselCard instance + */ + BrowseCarouselCard.create = function create(properties) { + return new BrowseCarouselCard(properties); + }; - /** - * Creates a new ListSessionEntityTypesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest - * @static - * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest instance - */ - ListSessionEntityTypesRequest.create = function create(properties) { - return new ListSessionEntityTypesRequest(properties); - }; + /** + * Encodes the specified BrowseCarouselCard message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard} message BrowseCarouselCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BrowseCarouselCard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.imageDisplayOptions != null && Object.hasOwnProperty.call(message, "imageDisplayOptions")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.imageDisplayOptions); + return writer; + }; - /** - * Encodes the specified ListSessionEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest - * @static - * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesRequest} message ListSessionEntityTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionEntityTypesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; + /** + * Encodes the specified BrowseCarouselCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IBrowseCarouselCard} message BrowseCarouselCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BrowseCarouselCard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified ListSessionEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest - * @static - * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesRequest} message ListSessionEntityTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a BrowseCarouselCard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard} BrowseCarouselCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BrowseCarouselCard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.decode(reader, reader.uint32())); + break; + case 2: + message.imageDisplayOptions = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionEntityTypesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a BrowseCarouselCard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard} BrowseCarouselCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BrowseCarouselCard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a ListSessionEntityTypesRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSessionEntityTypesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; + /** + * Verifies a BrowseCarouselCard message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BrowseCarouselCard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.imageDisplayOptions != null && message.hasOwnProperty("imageDisplayOptions")) + switch (message.imageDisplayOptions) { + default: + return "imageDisplayOptions: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; - /** - * Creates a ListSessionEntityTypesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest - */ - ListSessionEntityTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; + /** + * Creates a BrowseCarouselCard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard} BrowseCarouselCard + */ + BrowseCarouselCard.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.items: object expected"); + message.items[i] = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.fromObject(object.items[i]); + } + } + switch (object.imageDisplayOptions) { + case "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED": + case 0: + message.imageDisplayOptions = 0; + break; + case "GRAY": + case 1: + message.imageDisplayOptions = 1; + break; + case "WHITE": + case 2: + message.imageDisplayOptions = 2; + break; + case "CROPPED": + case 3: + message.imageDisplayOptions = 3; + break; + case "BLURRED_BACKGROUND": + case 4: + message.imageDisplayOptions = 4; + break; + } + return message; + }; - /** - * Creates a plain object from a ListSessionEntityTypesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest - * @static - * @param {google.cloud.dialogflow.v2.ListSessionEntityTypesRequest} message ListSessionEntityTypesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSessionEntityTypesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; + /** + * Creates a plain object from a BrowseCarouselCard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard} message BrowseCarouselCard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BrowseCarouselCard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) + object.imageDisplayOptions = options.enums === String ? "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED" : 0; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.toObject(message.items[j], options); + } + if (message.imageDisplayOptions != null && message.hasOwnProperty("imageDisplayOptions")) + object.imageDisplayOptions = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions[message.imageDisplayOptions] : message.imageDisplayOptions; + return object; + }; - /** - * Converts this ListSessionEntityTypesRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest - * @instance - * @returns {Object.} JSON object - */ - ListSessionEntityTypesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this BrowseCarouselCard to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @instance + * @returns {Object.} JSON object + */ + BrowseCarouselCard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return ListSessionEntityTypesRequest; - })(); + BrowseCarouselCard.BrowseCarouselCardItem = (function() { - v2.ListSessionEntityTypesResponse = (function() { + /** + * Properties of a BrowseCarouselCardItem. + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @interface IBrowseCarouselCardItem + * @property {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null} [openUriAction] BrowseCarouselCardItem openUriAction + * @property {string|null} [title] BrowseCarouselCardItem title + * @property {string|null} [description] BrowseCarouselCardItem description + * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [image] BrowseCarouselCardItem image + * @property {string|null} [footer] BrowseCarouselCardItem footer + */ - /** - * Properties of a ListSessionEntityTypesResponse. - * @memberof google.cloud.dialogflow.v2 - * @interface IListSessionEntityTypesResponse - * @property {Array.|null} [sessionEntityTypes] ListSessionEntityTypesResponse sessionEntityTypes - * @property {string|null} [nextPageToken] ListSessionEntityTypesResponse nextPageToken - */ + /** + * Constructs a new BrowseCarouselCardItem. + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard + * @classdesc Represents a BrowseCarouselCardItem. + * @implements IBrowseCarouselCardItem + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem=} [properties] Properties to set + */ + function BrowseCarouselCardItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new ListSessionEntityTypesResponse. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a ListSessionEntityTypesResponse. - * @implements IListSessionEntityTypesResponse - * @constructor - * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesResponse=} [properties] Properties to set - */ - function ListSessionEntityTypesResponse(properties) { - this.sessionEntityTypes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * BrowseCarouselCardItem openUriAction. + * @member {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null|undefined} openUriAction + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @instance + */ + BrowseCarouselCardItem.prototype.openUriAction = null; - /** - * ListSessionEntityTypesResponse sessionEntityTypes. - * @member {Array.} sessionEntityTypes - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse - * @instance - */ - ListSessionEntityTypesResponse.prototype.sessionEntityTypes = $util.emptyArray; + /** + * BrowseCarouselCardItem title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @instance + */ + BrowseCarouselCardItem.prototype.title = ""; - /** - * ListSessionEntityTypesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse - * @instance - */ - ListSessionEntityTypesResponse.prototype.nextPageToken = ""; + /** + * BrowseCarouselCardItem description. + * @member {string} description + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @instance + */ + BrowseCarouselCardItem.prototype.description = ""; - /** - * Creates a new ListSessionEntityTypesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse - * @static - * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse instance - */ - ListSessionEntityTypesResponse.create = function create(properties) { - return new ListSessionEntityTypesResponse(properties); - }; + /** + * BrowseCarouselCardItem image. + * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} image + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @instance + */ + BrowseCarouselCardItem.prototype.image = null; - /** - * Encodes the specified ListSessionEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse - * @static - * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesResponse} message ListSessionEntityTypesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionEntityTypesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) - for (var i = 0; i < message.sessionEntityTypes.length; ++i) - $root.google.cloud.dialogflow.v2.SessionEntityType.encode(message.sessionEntityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; + /** + * BrowseCarouselCardItem footer. + * @member {string} footer + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @instance + */ + BrowseCarouselCardItem.prototype.footer = ""; - /** - * Encodes the specified ListSessionEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse - * @static - * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesResponse} message ListSessionEntityTypesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSessionEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new BrowseCarouselCardItem instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem instance + */ + BrowseCarouselCardItem.create = function create(properties) { + return new BrowseCarouselCardItem(properties); + }; - /** - * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionEntityTypesResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) - message.sessionEntityTypes = []; - message.sessionEntityTypes.push($root.google.cloud.dialogflow.v2.SessionEntityType.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified BrowseCarouselCardItem message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem} message BrowseCarouselCardItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BrowseCarouselCardItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.openUriAction != null && Object.hasOwnProperty.call(message, "openUriAction")) + $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.encode(message.openUriAction, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.footer != null && Object.hasOwnProperty.call(message, "footer")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.footer); + return writer; + }; - /** - * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSessionEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified BrowseCarouselCardItem message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem} message BrowseCarouselCardItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BrowseCarouselCardItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a ListSessionEntityTypesResponse message. - * @function verify - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSessionEntityTypesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { - if (!Array.isArray(message.sessionEntityTypes)) - return "sessionEntityTypes: array expected"; - for (var i = 0; i < message.sessionEntityTypes.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.SessionEntityType.verify(message.sessionEntityTypes[i]); - if (error) - return "sessionEntityTypes." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; + /** + * Decodes a BrowseCarouselCardItem message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BrowseCarouselCardItem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.openUriAction = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.decode(reader, reader.uint32()); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); + break; + case 5: + message.footer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a ListSessionEntityTypesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse - */ - ListSessionEntityTypesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse) - return object; - var message = new $root.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse(); - if (object.sessionEntityTypes) { - if (!Array.isArray(object.sessionEntityTypes)) - throw TypeError(".google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.sessionEntityTypes: array expected"); - message.sessionEntityTypes = []; - for (var i = 0; i < object.sessionEntityTypes.length; ++i) { - if (typeof object.sessionEntityTypes[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.sessionEntityTypes: object expected"); - message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.v2.SessionEntityType.fromObject(object.sessionEntityTypes[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; + /** + * Decodes a BrowseCarouselCardItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BrowseCarouselCardItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a ListSessionEntityTypesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse - * @static - * @param {google.cloud.dialogflow.v2.ListSessionEntityTypesResponse} message ListSessionEntityTypesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSessionEntityTypesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.sessionEntityTypes = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.sessionEntityTypes && message.sessionEntityTypes.length) { - object.sessionEntityTypes = []; - for (var j = 0; j < message.sessionEntityTypes.length; ++j) - object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.v2.SessionEntityType.toObject(message.sessionEntityTypes[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + /** + * Verifies a BrowseCarouselCardItem message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BrowseCarouselCardItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify(message.openUriAction); + if (error) + return "openUriAction." + error; + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.footer != null && message.hasOwnProperty("footer")) + if (!$util.isString(message.footer)) + return "footer: string expected"; + return null; + }; - /** - * Converts this ListSessionEntityTypesResponse to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse - * @instance - * @returns {Object.} JSON object - */ - ListSessionEntityTypesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a BrowseCarouselCardItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem + */ + BrowseCarouselCardItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem(); + if (object.openUriAction != null) { + if (typeof object.openUriAction !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.openUriAction: object expected"); + message.openUriAction = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.fromObject(object.openUriAction); + } + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.image: object expected"); + message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.image); + } + if (object.footer != null) + message.footer = String(object.footer); + return message; + }; - return ListSessionEntityTypesResponse; - })(); + /** + * Creates a plain object from a BrowseCarouselCardItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} message BrowseCarouselCardItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BrowseCarouselCardItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.openUriAction = null; + object.title = ""; + object.description = ""; + object.image = null; + object.footer = ""; + } + if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) + object.openUriAction = $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.toObject(message.openUriAction, options); + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.image, options); + if (message.footer != null && message.hasOwnProperty("footer")) + object.footer = message.footer; + return object; + }; - v2.GetSessionEntityTypeRequest = (function() { + /** + * Converts this BrowseCarouselCardItem to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @instance + * @returns {Object.} JSON object + */ + BrowseCarouselCardItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a GetSessionEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IGetSessionEntityTypeRequest - * @property {string|null} [name] GetSessionEntityTypeRequest name - */ + BrowseCarouselCardItem.OpenUrlAction = (function() { - /** - * Constructs a new GetSessionEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a GetSessionEntityTypeRequest. - * @implements IGetSessionEntityTypeRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest=} [properties] Properties to set - */ - function GetSessionEntityTypeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of an OpenUrlAction. + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @interface IOpenUrlAction + * @property {string|null} [url] OpenUrlAction url + * @property {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|null} [urlTypeHint] OpenUrlAction urlTypeHint + */ - /** - * GetSessionEntityTypeRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest - * @instance - */ - GetSessionEntityTypeRequest.prototype.name = ""; + /** + * Constructs a new OpenUrlAction. + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @classdesc Represents an OpenUrlAction. + * @implements IOpenUrlAction + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction=} [properties] Properties to set + */ + function OpenUrlAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new GetSessionEntityTypeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest instance - */ - GetSessionEntityTypeRequest.create = function create(properties) { - return new GetSessionEntityTypeRequest(properties); - }; + /** + * OpenUrlAction url. + * @member {string} url + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @instance + */ + OpenUrlAction.prototype.url = ""; - /** - * Encodes the specified GetSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetSessionEntityTypeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest} message GetSessionEntityTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSessionEntityTypeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + /** + * OpenUrlAction urlTypeHint. + * @member {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint} urlTypeHint + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @instance + */ + OpenUrlAction.prototype.urlTypeHint = 0; - /** - * Encodes the specified GetSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetSessionEntityTypeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest} message GetSessionEntityTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new OpenUrlAction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction instance + */ + OpenUrlAction.create = function create(properties) { + return new OpenUrlAction(properties); + }; - /** - * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSessionEntityTypeRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetSessionEntityTypeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified OpenUrlAction message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction} message OpenUrlAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenUrlAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.urlTypeHint != null && Object.hasOwnProperty.call(message, "urlTypeHint")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.urlTypeHint); + return writer; + }; - /** - * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified OpenUrlAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction} message OpenUrlAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenUrlAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a GetSessionEntityTypeRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetSessionEntityTypeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + /** + * Decodes an OpenUrlAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenUrlAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 3: + message.urlTypeHint = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a GetSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest - */ - GetSessionEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.GetSessionEntityTypeRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.GetSessionEntityTypeRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * Decodes an OpenUrlAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenUrlAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a GetSessionEntityTypeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.GetSessionEntityTypeRequest} message GetSessionEntityTypeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetSessionEntityTypeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + /** + * Verifies an OpenUrlAction message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenUrlAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.urlTypeHint != null && message.hasOwnProperty("urlTypeHint")) + switch (message.urlTypeHint) { + default: + return "urlTypeHint: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; - /** - * Converts this GetSessionEntityTypeRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest - * @instance - * @returns {Object.} JSON object - */ - GetSessionEntityTypeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates an OpenUrlAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction + */ + OpenUrlAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction(); + if (object.url != null) + message.url = String(object.url); + switch (object.urlTypeHint) { + case "URL_TYPE_HINT_UNSPECIFIED": + case 0: + message.urlTypeHint = 0; + break; + case "AMP_ACTION": + case 1: + message.urlTypeHint = 1; + break; + case "AMP_CONTENT": + case 2: + message.urlTypeHint = 2; + break; + } + return message; + }; - return GetSessionEntityTypeRequest; - })(); + /** + * Creates a plain object from an OpenUrlAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} message OpenUrlAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenUrlAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + object.urlTypeHint = options.enums === String ? "URL_TYPE_HINT_UNSPECIFIED" : 0; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.urlTypeHint != null && message.hasOwnProperty("urlTypeHint")) + object.urlTypeHint = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint[message.urlTypeHint] : message.urlTypeHint; + return object; + }; - v2.CreateSessionEntityTypeRequest = (function() { + /** + * Converts this OpenUrlAction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @instance + * @returns {Object.} JSON object + */ + OpenUrlAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a CreateSessionEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface ICreateSessionEntityTypeRequest - * @property {string|null} [parent] CreateSessionEntityTypeRequest parent - * @property {google.cloud.dialogflow.v2.ISessionEntityType|null} [sessionEntityType] CreateSessionEntityTypeRequest sessionEntityType - */ + /** + * UrlTypeHint enum. + * @name google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint + * @enum {number} + * @property {number} URL_TYPE_HINT_UNSPECIFIED=0 URL_TYPE_HINT_UNSPECIFIED value + * @property {number} AMP_ACTION=1 AMP_ACTION value + * @property {number} AMP_CONTENT=2 AMP_CONTENT value + */ + OpenUrlAction.UrlTypeHint = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "URL_TYPE_HINT_UNSPECIFIED"] = 0; + values[valuesById[1] = "AMP_ACTION"] = 1; + values[valuesById[2] = "AMP_CONTENT"] = 2; + return values; + })(); - /** - * Constructs a new CreateSessionEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a CreateSessionEntityTypeRequest. - * @implements ICreateSessionEntityTypeRequest - * @constructor - * @param {google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest=} [properties] Properties to set - */ - function CreateSessionEntityTypeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return OpenUrlAction; + })(); - /** - * CreateSessionEntityTypeRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest - * @instance - */ - CreateSessionEntityTypeRequest.prototype.parent = ""; + return BrowseCarouselCardItem; + })(); - /** - * CreateSessionEntityTypeRequest sessionEntityType. - * @member {google.cloud.dialogflow.v2.ISessionEntityType|null|undefined} sessionEntityType - * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest - * @instance - */ - CreateSessionEntityTypeRequest.prototype.sessionEntityType = null; + /** + * ImageDisplayOptions enum. + * @name google.cloud.dialogflow.v2.Intent.Message.BrowseCarouselCard.ImageDisplayOptions + * @enum {number} + * @property {number} IMAGE_DISPLAY_OPTIONS_UNSPECIFIED=0 IMAGE_DISPLAY_OPTIONS_UNSPECIFIED value + * @property {number} GRAY=1 GRAY value + * @property {number} WHITE=2 WHITE value + * @property {number} CROPPED=3 CROPPED value + * @property {number} BLURRED_BACKGROUND=4 BLURRED_BACKGROUND value + */ + BrowseCarouselCard.ImageDisplayOptions = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED"] = 0; + values[valuesById[1] = "GRAY"] = 1; + values[valuesById[2] = "WHITE"] = 2; + values[valuesById[3] = "CROPPED"] = 3; + values[valuesById[4] = "BLURRED_BACKGROUND"] = 4; + return values; + })(); - /** - * Creates a new CreateSessionEntityTypeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest instance - */ - CreateSessionEntityTypeRequest.create = function create(properties) { - return new CreateSessionEntityTypeRequest(properties); - }; + return BrowseCarouselCard; + })(); - /** - * Encodes the specified CreateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSessionEntityTypeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.sessionEntityType != null && Object.hasOwnProperty.call(message, "sessionEntityType")) - $root.google.cloud.dialogflow.v2.SessionEntityType.encode(message.sessionEntityType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + Message.TableCard = (function() { - /** - * Encodes the specified CreateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a TableCard. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface ITableCard + * @property {string|null} [title] TableCard title + * @property {string|null} [subtitle] TableCard subtitle + * @property {google.cloud.dialogflow.v2.Intent.Message.IImage|null} [image] TableCard image + * @property {Array.|null} [columnProperties] TableCard columnProperties + * @property {Array.|null} [rows] TableCard rows + * @property {Array.|null} [buttons] TableCard buttons + */ - /** - * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSessionEntityTypeRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.sessionEntityType = $root.google.cloud.dialogflow.v2.SessionEntityType.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Constructs a new TableCard. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a TableCard. + * @implements ITableCard + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCard=} [properties] Properties to set + */ + function TableCard(properties) { + this.columnProperties = []; + this.rows = []; + this.buttons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - } - return message; - }; - - /** - * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateSessionEntityTypeRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateSessionEntityTypeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) { - var error = $root.google.cloud.dialogflow.v2.SessionEntityType.verify(message.sessionEntityType); - if (error) - return "sessionEntityType." + error; - } - return null; - }; - - /** - * Creates a CreateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest - */ - CreateSessionEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.sessionEntityType != null) { - if (typeof object.sessionEntityType !== "object") - throw TypeError(".google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest.sessionEntityType: object expected"); - message.sessionEntityType = $root.google.cloud.dialogflow.v2.SessionEntityType.fromObject(object.sessionEntityType); - } - return message; - }; - /** - * Creates a plain object from a CreateSessionEntityTypeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateSessionEntityTypeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.sessionEntityType = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) - object.sessionEntityType = $root.google.cloud.dialogflow.v2.SessionEntityType.toObject(message.sessionEntityType, options); - return object; - }; + /** + * TableCard title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @instance + */ + TableCard.prototype.title = ""; - /** - * Converts this CreateSessionEntityTypeRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest - * @instance - * @returns {Object.} JSON object - */ - CreateSessionEntityTypeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * TableCard subtitle. + * @member {string} subtitle + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @instance + */ + TableCard.prototype.subtitle = ""; - return CreateSessionEntityTypeRequest; - })(); + /** + * TableCard image. + * @member {google.cloud.dialogflow.v2.Intent.Message.IImage|null|undefined} image + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @instance + */ + TableCard.prototype.image = null; - v2.UpdateSessionEntityTypeRequest = (function() { + /** + * TableCard columnProperties. + * @member {Array.} columnProperties + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @instance + */ + TableCard.prototype.columnProperties = $util.emptyArray; - /** - * Properties of an UpdateSessionEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IUpdateSessionEntityTypeRequest - * @property {google.cloud.dialogflow.v2.ISessionEntityType|null} [sessionEntityType] UpdateSessionEntityTypeRequest sessionEntityType - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSessionEntityTypeRequest updateMask - */ + /** + * TableCard rows. + * @member {Array.} rows + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @instance + */ + TableCard.prototype.rows = $util.emptyArray; - /** - * Constructs a new UpdateSessionEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an UpdateSessionEntityTypeRequest. - * @implements IUpdateSessionEntityTypeRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest=} [properties] Properties to set - */ - function UpdateSessionEntityTypeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * TableCard buttons. + * @member {Array.} buttons + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @instance + */ + TableCard.prototype.buttons = $util.emptyArray; - /** - * UpdateSessionEntityTypeRequest sessionEntityType. - * @member {google.cloud.dialogflow.v2.ISessionEntityType|null|undefined} sessionEntityType - * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest - * @instance - */ - UpdateSessionEntityTypeRequest.prototype.sessionEntityType = null; + /** + * Creates a new TableCard instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCard=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCard} TableCard instance + */ + TableCard.create = function create(properties) { + return new TableCard(properties); + }; - /** - * UpdateSessionEntityTypeRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest - * @instance - */ - UpdateSessionEntityTypeRequest.prototype.updateMask = null; + /** + * Encodes the specified TableCard message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCard.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCard} message TableCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.dialogflow.v2.Intent.Message.Image.encode(message.image, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.columnProperties != null && message.columnProperties.length) + for (var i = 0; i < message.columnProperties.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.encode(message.columnProperties[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow.encode(message.rows[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.encode(message.buttons[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; - /** - * Creates a new UpdateSessionEntityTypeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest instance - */ - UpdateSessionEntityTypeRequest.create = function create(properties) { - return new UpdateSessionEntityTypeRequest(properties); - }; + /** + * Encodes the specified TableCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCard} message TableCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified UpdateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSessionEntityTypeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.sessionEntityType != null && Object.hasOwnProperty.call(message, "sessionEntityType")) - $root.google.cloud.dialogflow.v2.SessionEntityType.encode(message.sessionEntityType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified UpdateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a TableCard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCard} TableCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.TableCard(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.subtitle = reader.string(); + break; + case 3: + message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.columnProperties && message.columnProperties.length)) + message.columnProperties = []; + message.columnProperties.push($root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSessionEntityTypeRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.sessionEntityType = $root.google.cloud.dialogflow.v2.SessionEntityType.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a TableCard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCard} TableCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a TableCard message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableCard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.columnProperties != null && message.hasOwnProperty("columnProperties")) { + if (!Array.isArray(message.columnProperties)) + return "columnProperties: array expected"; + for (var i = 0; i < message.columnProperties.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.verify(message.columnProperties[i]); + if (error) + return "columnProperties." + error; + } + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } + } + return null; + }; - /** - * Verifies an UpdateSessionEntityTypeRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateSessionEntityTypeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) { - var error = $root.google.cloud.dialogflow.v2.SessionEntityType.verify(message.sessionEntityType); - if (error) - return "sessionEntityType." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; + /** + * Creates a TableCard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCard} TableCard + */ + TableCard.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.TableCard) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.TableCard(); + if (object.title != null) + message.title = String(object.title); + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.image: object expected"); + message.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.fromObject(object.image); + } + if (object.columnProperties) { + if (!Array.isArray(object.columnProperties)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.columnProperties: array expected"); + message.columnProperties = []; + for (var i = 0; i < object.columnProperties.length; ++i) { + if (typeof object.columnProperties[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.columnProperties: object expected"); + message.columnProperties[i] = $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.fromObject(object.columnProperties[i]); + } + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.rows: object expected"); + message.rows[i] = $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow.fromObject(object.rows[i]); + } + } + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCard.buttons: object expected"); + message.buttons[i] = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.fromObject(object.buttons[i]); + } + } + return message; + }; - /** - * Creates an UpdateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest - */ - UpdateSessionEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest(); - if (object.sessionEntityType != null) { - if (typeof object.sessionEntityType !== "object") - throw TypeError(".google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.sessionEntityType: object expected"); - message.sessionEntityType = $root.google.cloud.dialogflow.v2.SessionEntityType.fromObject(object.sessionEntityType); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - return message; - }; + /** + * Creates a plain object from a TableCard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.TableCard} message TableCard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableCard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.columnProperties = []; + object.rows = []; + object.buttons = []; + } + if (options.defaults) { + object.title = ""; + object.subtitle = ""; + object.image = null; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.dialogflow.v2.Intent.Message.Image.toObject(message.image, options); + if (message.columnProperties && message.columnProperties.length) { + object.columnProperties = []; + for (var j = 0; j < message.columnProperties.length; ++j) + object.columnProperties[j] = $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.toObject(message.columnProperties[j], options); + } + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow.toObject(message.rows[j], options); + } + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.google.cloud.dialogflow.v2.Intent.Message.BasicCard.Button.toObject(message.buttons[j], options); + } + return object; + }; - /** - * Creates a plain object from an UpdateSessionEntityTypeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateSessionEntityTypeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.sessionEntityType = null; - object.updateMask = null; - } - if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) - object.sessionEntityType = $root.google.cloud.dialogflow.v2.SessionEntityType.toObject(message.sessionEntityType, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; + /** + * Converts this TableCard to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCard + * @instance + * @returns {Object.} JSON object + */ + TableCard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this UpdateSessionEntityTypeRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateSessionEntityTypeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return TableCard; + })(); - return UpdateSessionEntityTypeRequest; - })(); + Message.ColumnProperties = (function() { - v2.DeleteSessionEntityTypeRequest = (function() { + /** + * Properties of a ColumnProperties. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface IColumnProperties + * @property {string|null} [header] ColumnProperties header + * @property {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment|null} [horizontalAlignment] ColumnProperties horizontalAlignment + */ - /** - * Properties of a DeleteSessionEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IDeleteSessionEntityTypeRequest - * @property {string|null} [name] DeleteSessionEntityTypeRequest name - */ + /** + * Constructs a new ColumnProperties. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a ColumnProperties. + * @implements IColumnProperties + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.IColumnProperties=} [properties] Properties to set + */ + function ColumnProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new DeleteSessionEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a DeleteSessionEntityTypeRequest. - * @implements IDeleteSessionEntityTypeRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest=} [properties] Properties to set - */ - function DeleteSessionEntityTypeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ColumnProperties header. + * @member {string} header + * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + * @instance + */ + ColumnProperties.prototype.header = ""; - /** - * DeleteSessionEntityTypeRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest - * @instance - */ - DeleteSessionEntityTypeRequest.prototype.name = ""; + /** + * ColumnProperties horizontalAlignment. + * @member {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment} horizontalAlignment + * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + * @instance + */ + ColumnProperties.prototype.horizontalAlignment = 0; - /** - * Creates a new DeleteSessionEntityTypeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest instance - */ - DeleteSessionEntityTypeRequest.create = function create(properties) { - return new DeleteSessionEntityTypeRequest(properties); - }; + /** + * Creates a new ColumnProperties instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IColumnProperties=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties} ColumnProperties instance + */ + ColumnProperties.create = function create(properties) { + return new ColumnProperties(properties); + }; - /** - * Encodes the specified DeleteSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSessionEntityTypeRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + /** + * Encodes the specified ColumnProperties message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IColumnProperties} message ColumnProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.header); + if (message.horizontalAlignment != null && Object.hasOwnProperty.call(message, "horizontalAlignment")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.horizontalAlignment); + return writer; + }; - /** - * Encodes the specified DeleteSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified ColumnProperties message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.IColumnProperties} message ColumnProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSessionEntityTypeRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a ColumnProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties} ColumnProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = reader.string(); + break; + case 2: + message.horizontalAlignment = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a ColumnProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties} ColumnProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a DeleteSessionEntityTypeRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteSessionEntityTypeRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + /** + * Verifies a ColumnProperties message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) + if (!$util.isString(message.header)) + return "header: string expected"; + if (message.horizontalAlignment != null && message.hasOwnProperty("horizontalAlignment")) + switch (message.horizontalAlignment) { + default: + return "horizontalAlignment: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; - /** - * Creates a DeleteSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest - */ - DeleteSessionEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * Creates a ColumnProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties} ColumnProperties + */ + ColumnProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties(); + if (object.header != null) + message.header = String(object.header); + switch (object.horizontalAlignment) { + case "HORIZONTAL_ALIGNMENT_UNSPECIFIED": + case 0: + message.horizontalAlignment = 0; + break; + case "LEADING": + case 1: + message.horizontalAlignment = 1; + break; + case "CENTER": + case 2: + message.horizontalAlignment = 2; + break; + case "TRAILING": + case 3: + message.horizontalAlignment = 3; + break; + } + return message; + }; - /** - * Creates a plain object from a DeleteSessionEntityTypeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest - * @static - * @param {google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteSessionEntityTypeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + /** + * Creates a plain object from a ColumnProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ColumnProperties} message ColumnProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.header = ""; + object.horizontalAlignment = options.enums === String ? "HORIZONTAL_ALIGNMENT_UNSPECIFIED" : 0; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = message.header; + if (message.horizontalAlignment != null && message.hasOwnProperty("horizontalAlignment")) + object.horizontalAlignment = options.enums === String ? $root.google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment[message.horizontalAlignment] : message.horizontalAlignment; + return object; + }; - /** - * Converts this DeleteSessionEntityTypeRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteSessionEntityTypeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this ColumnProperties to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.ColumnProperties + * @instance + * @returns {Object.} JSON object + */ + ColumnProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return DeleteSessionEntityTypeRequest; - })(); + /** + * HorizontalAlignment enum. + * @name google.cloud.dialogflow.v2.Intent.Message.ColumnProperties.HorizontalAlignment + * @enum {number} + * @property {number} HORIZONTAL_ALIGNMENT_UNSPECIFIED=0 HORIZONTAL_ALIGNMENT_UNSPECIFIED value + * @property {number} LEADING=1 LEADING value + * @property {number} CENTER=2 CENTER value + * @property {number} TRAILING=3 TRAILING value + */ + ColumnProperties.HorizontalAlignment = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HORIZONTAL_ALIGNMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "LEADING"] = 1; + values[valuesById[2] = "CENTER"] = 2; + values[valuesById[3] = "TRAILING"] = 3; + return values; + })(); - v2.WebhookRequest = (function() { + return ColumnProperties; + })(); - /** - * Properties of a WebhookRequest. - * @memberof google.cloud.dialogflow.v2 - * @interface IWebhookRequest - * @property {string|null} [session] WebhookRequest session - * @property {string|null} [responseId] WebhookRequest responseId - * @property {google.cloud.dialogflow.v2.IQueryResult|null} [queryResult] WebhookRequest queryResult - * @property {google.cloud.dialogflow.v2.IOriginalDetectIntentRequest|null} [originalDetectIntentRequest] WebhookRequest originalDetectIntentRequest - */ + Message.TableCardRow = (function() { - /** - * Constructs a new WebhookRequest. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a WebhookRequest. - * @implements IWebhookRequest - * @constructor - * @param {google.cloud.dialogflow.v2.IWebhookRequest=} [properties] Properties to set - */ - function WebhookRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a TableCardRow. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface ITableCardRow + * @property {Array.|null} [cells] TableCardRow cells + * @property {boolean|null} [dividerAfter] TableCardRow dividerAfter + */ - /** - * WebhookRequest session. - * @member {string} session - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @instance - */ - WebhookRequest.prototype.session = ""; + /** + * Constructs a new TableCardRow. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a TableCardRow. + * @implements ITableCardRow + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardRow=} [properties] Properties to set + */ + function TableCardRow(properties) { + this.cells = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * WebhookRequest responseId. - * @member {string} responseId - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @instance - */ - WebhookRequest.prototype.responseId = ""; + /** + * TableCardRow cells. + * @member {Array.} cells + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow + * @instance + */ + TableCardRow.prototype.cells = $util.emptyArray; - /** - * WebhookRequest queryResult. - * @member {google.cloud.dialogflow.v2.IQueryResult|null|undefined} queryResult - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @instance - */ - WebhookRequest.prototype.queryResult = null; + /** + * TableCardRow dividerAfter. + * @member {boolean} dividerAfter + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow + * @instance + */ + TableCardRow.prototype.dividerAfter = false; - /** - * WebhookRequest originalDetectIntentRequest. - * @member {google.cloud.dialogflow.v2.IOriginalDetectIntentRequest|null|undefined} originalDetectIntentRequest - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @instance - */ - WebhookRequest.prototype.originalDetectIntentRequest = null; + /** + * Creates a new TableCardRow instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardRow=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardRow} TableCardRow instance + */ + TableCardRow.create = function create(properties) { + return new TableCardRow(properties); + }; - /** - * Creates a new WebhookRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @static - * @param {google.cloud.dialogflow.v2.IWebhookRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.WebhookRequest} WebhookRequest instance - */ - WebhookRequest.create = function create(properties) { - return new WebhookRequest(properties); - }; + /** + * Encodes the specified TableCardRow message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardRow.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardRow} message TableCardRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCardRow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cells != null && message.cells.length) + for (var i = 0; i < message.cells.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell.encode(message.cells[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dividerAfter != null && Object.hasOwnProperty.call(message, "dividerAfter")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.dividerAfter); + return writer; + }; - /** - * Encodes the specified WebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @static - * @param {google.cloud.dialogflow.v2.IWebhookRequest} message WebhookRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebhookRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); - if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) - $root.google.cloud.dialogflow.v2.QueryResult.encode(message.queryResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.originalDetectIntentRequest != null && Object.hasOwnProperty.call(message, "originalDetectIntentRequest")) - $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest.encode(message.originalDetectIntentRequest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.session); - return writer; - }; + /** + * Encodes the specified TableCardRow message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardRow} message TableCardRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCardRow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified WebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @static - * @param {google.cloud.dialogflow.v2.IWebhookRequest} message WebhookRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a TableCardRow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardRow} TableCardRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCardRow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.cells && message.cells.length)) + message.cells = []; + message.cells.push($root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell.decode(reader, reader.uint32())); + break; + case 2: + message.dividerAfter = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a WebhookRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.WebhookRequest} WebhookRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebhookRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.WebhookRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 4: - message.session = reader.string(); - break; - case 1: - message.responseId = reader.string(); - break; - case 2: - message.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.decode(reader, reader.uint32()); - break; - case 3: - message.originalDetectIntentRequest = $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a TableCardRow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardRow} TableCardRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCardRow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a WebhookRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.WebhookRequest} WebhookRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WebhookRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a TableCardRow message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableCardRow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cells != null && message.hasOwnProperty("cells")) { + if (!Array.isArray(message.cells)) + return "cells: array expected"; + for (var i = 0; i < message.cells.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell.verify(message.cells[i]); + if (error) + return "cells." + error; + } + } + if (message.dividerAfter != null && message.hasOwnProperty("dividerAfter")) + if (typeof message.dividerAfter !== "boolean") + return "dividerAfter: boolean expected"; + return null; + }; - /** - * Verifies a WebhookRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WebhookRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.responseId != null && message.hasOwnProperty("responseId")) - if (!$util.isString(message.responseId)) - return "responseId: string expected"; - if (message.queryResult != null && message.hasOwnProperty("queryResult")) { - var error = $root.google.cloud.dialogflow.v2.QueryResult.verify(message.queryResult); - if (error) - return "queryResult." + error; - } - if (message.originalDetectIntentRequest != null && message.hasOwnProperty("originalDetectIntentRequest")) { - var error = $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest.verify(message.originalDetectIntentRequest); - if (error) - return "originalDetectIntentRequest." + error; - } - return null; - }; + /** + * Creates a TableCardRow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardRow} TableCardRow + */ + TableCardRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.TableCardRow(); + if (object.cells) { + if (!Array.isArray(object.cells)) + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCardRow.cells: array expected"); + message.cells = []; + for (var i = 0; i < object.cells.length; ++i) { + if (typeof object.cells[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Intent.Message.TableCardRow.cells: object expected"); + message.cells[i] = $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell.fromObject(object.cells[i]); + } + } + if (object.dividerAfter != null) + message.dividerAfter = Boolean(object.dividerAfter); + return message; + }; - /** - * Creates a WebhookRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.WebhookRequest} WebhookRequest - */ - WebhookRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.WebhookRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2.WebhookRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.responseId != null) - message.responseId = String(object.responseId); - if (object.queryResult != null) { - if (typeof object.queryResult !== "object") - throw TypeError(".google.cloud.dialogflow.v2.WebhookRequest.queryResult: object expected"); - message.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.fromObject(object.queryResult); - } - if (object.originalDetectIntentRequest != null) { - if (typeof object.originalDetectIntentRequest !== "object") - throw TypeError(".google.cloud.dialogflow.v2.WebhookRequest.originalDetectIntentRequest: object expected"); - message.originalDetectIntentRequest = $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest.fromObject(object.originalDetectIntentRequest); - } - return message; - }; + /** + * Creates a plain object from a TableCardRow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.TableCardRow} message TableCardRow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableCardRow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cells = []; + if (options.defaults) + object.dividerAfter = false; + if (message.cells && message.cells.length) { + object.cells = []; + for (var j = 0; j < message.cells.length; ++j) + object.cells[j] = $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell.toObject(message.cells[j], options); + } + if (message.dividerAfter != null && message.hasOwnProperty("dividerAfter")) + object.dividerAfter = message.dividerAfter; + return object; + }; - /** - * Creates a plain object from a WebhookRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @static - * @param {google.cloud.dialogflow.v2.WebhookRequest} message WebhookRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WebhookRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.responseId = ""; - object.queryResult = null; - object.originalDetectIntentRequest = null; - object.session = ""; - } - if (message.responseId != null && message.hasOwnProperty("responseId")) - object.responseId = message.responseId; - if (message.queryResult != null && message.hasOwnProperty("queryResult")) - object.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.toObject(message.queryResult, options); - if (message.originalDetectIntentRequest != null && message.hasOwnProperty("originalDetectIntentRequest")) - object.originalDetectIntentRequest = $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest.toObject(message.originalDetectIntentRequest, options); - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - return object; - }; + /** + * Converts this TableCardRow to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardRow + * @instance + * @returns {Object.} JSON object + */ + TableCardRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this WebhookRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2.WebhookRequest - * @instance - * @returns {Object.} JSON object - */ - WebhookRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return TableCardRow; + })(); - return WebhookRequest; - })(); + Message.TableCardCell = (function() { - v2.WebhookResponse = (function() { + /** + * Properties of a TableCardCell. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @interface ITableCardCell + * @property {string|null} [text] TableCardCell text + */ - /** - * Properties of a WebhookResponse. - * @memberof google.cloud.dialogflow.v2 - * @interface IWebhookResponse - * @property {string|null} [fulfillmentText] WebhookResponse fulfillmentText - * @property {Array.|null} [fulfillmentMessages] WebhookResponse fulfillmentMessages - * @property {string|null} [source] WebhookResponse source - * @property {google.protobuf.IStruct|null} [payload] WebhookResponse payload - * @property {Array.|null} [outputContexts] WebhookResponse outputContexts - * @property {google.cloud.dialogflow.v2.IEventInput|null} [followupEventInput] WebhookResponse followupEventInput - * @property {Array.|null} [sessionEntityTypes] WebhookResponse sessionEntityTypes - */ + /** + * Constructs a new TableCardCell. + * @memberof google.cloud.dialogflow.v2.Intent.Message + * @classdesc Represents a TableCardCell. + * @implements ITableCardCell + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardCell=} [properties] Properties to set + */ + function TableCardCell(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new WebhookResponse. - * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents a WebhookResponse. - * @implements IWebhookResponse - * @constructor - * @param {google.cloud.dialogflow.v2.IWebhookResponse=} [properties] Properties to set - */ - function WebhookResponse(properties) { - this.fulfillmentMessages = []; - this.outputContexts = []; - this.sessionEntityTypes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * TableCardCell text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell + * @instance + */ + TableCardCell.prototype.text = ""; - /** - * WebhookResponse fulfillmentText. - * @member {string} fulfillmentText - * @memberof google.cloud.dialogflow.v2.WebhookResponse - * @instance - */ - WebhookResponse.prototype.fulfillmentText = ""; + /** + * Creates a new TableCardCell instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardCell=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardCell} TableCardCell instance + */ + TableCardCell.create = function create(properties) { + return new TableCardCell(properties); + }; - /** - * WebhookResponse fulfillmentMessages. - * @member {Array.} fulfillmentMessages - * @memberof google.cloud.dialogflow.v2.WebhookResponse - * @instance - */ - WebhookResponse.prototype.fulfillmentMessages = $util.emptyArray; + /** + * Encodes the specified TableCardCell message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardCell.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardCell} message TableCardCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCardCell.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; - /** - * WebhookResponse source. - * @member {string} source - * @memberof google.cloud.dialogflow.v2.WebhookResponse - * @instance - */ - WebhookResponse.prototype.source = ""; + /** + * Encodes the specified TableCardCell message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.Message.TableCardCell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.ITableCardCell} message TableCardCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCardCell.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * WebhookResponse payload. - * @member {google.protobuf.IStruct|null|undefined} payload - * @memberof google.cloud.dialogflow.v2.WebhookResponse - * @instance - */ - WebhookResponse.prototype.payload = null; + /** + * Decodes a TableCardCell message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardCell} TableCardCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCardCell.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * WebhookResponse outputContexts. - * @member {Array.} outputContexts - * @memberof google.cloud.dialogflow.v2.WebhookResponse - * @instance - */ - WebhookResponse.prototype.outputContexts = $util.emptyArray; + /** + * Decodes a TableCardCell message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardCell} TableCardCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCardCell.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * WebhookResponse followupEventInput. - * @member {google.cloud.dialogflow.v2.IEventInput|null|undefined} followupEventInput - * @memberof google.cloud.dialogflow.v2.WebhookResponse - * @instance - */ - WebhookResponse.prototype.followupEventInput = null; + /** + * Verifies a TableCardCell message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableCardCell.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; - /** - * WebhookResponse sessionEntityTypes. - * @member {Array.} sessionEntityTypes - * @memberof google.cloud.dialogflow.v2.WebhookResponse - * @instance - */ - WebhookResponse.prototype.sessionEntityTypes = $util.emptyArray; + /** + * Creates a TableCardCell message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.Message.TableCardCell} TableCardCell + */ + TableCardCell.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.Message.TableCardCell(); + if (object.text != null) + message.text = String(object.text); + return message; + }; - /** - * Creates a new WebhookResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2.WebhookResponse - * @static - * @param {google.cloud.dialogflow.v2.IWebhookResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.WebhookResponse} WebhookResponse instance - */ - WebhookResponse.create = function create(properties) { - return new WebhookResponse(properties); - }; + /** + * Creates a plain object from a TableCardCell message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell + * @static + * @param {google.cloud.dialogflow.v2.Intent.Message.TableCardCell} message TableCardCell + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableCardCell.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; - /** - * Encodes the specified WebhookResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2.WebhookResponse - * @static - * @param {google.cloud.dialogflow.v2.IWebhookResponse} message WebhookResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WebhookResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fulfillmentText != null && Object.hasOwnProperty.call(message, "fulfillmentText")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.fulfillmentText); - if (message.fulfillmentMessages != null && message.fulfillmentMessages.length) - for (var i = 0; i < message.fulfillmentMessages.length; ++i) - $root.google.cloud.dialogflow.v2.Intent.Message.encode(message.fulfillmentMessages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.source); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.outputContexts != null && message.outputContexts.length) - for (var i = 0; i < message.outputContexts.length; ++i) - $root.google.cloud.dialogflow.v2.Context.encode(message.outputContexts[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.followupEventInput != null && Object.hasOwnProperty.call(message, "followupEventInput")) - $root.google.cloud.dialogflow.v2.EventInput.encode(message.followupEventInput, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) - for (var i = 0; i < message.sessionEntityTypes.length; ++i) - $root.google.cloud.dialogflow.v2.SessionEntityType.encode(message.sessionEntityTypes[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + /** + * Converts this TableCardCell to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.Message.TableCardCell + * @instance + * @returns {Object.} JSON object + */ + TableCardCell.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableCardCell; + })(); + + /** + * Platform enum. + * @name google.cloud.dialogflow.v2.Intent.Message.Platform + * @enum {number} + * @property {number} PLATFORM_UNSPECIFIED=0 PLATFORM_UNSPECIFIED value + * @property {number} FACEBOOK=1 FACEBOOK value + * @property {number} SLACK=2 SLACK value + * @property {number} TELEGRAM=3 TELEGRAM value + * @property {number} KIK=4 KIK value + * @property {number} SKYPE=5 SKYPE value + * @property {number} LINE=6 LINE value + * @property {number} VIBER=7 VIBER value + * @property {number} ACTIONS_ON_GOOGLE=8 ACTIONS_ON_GOOGLE value + * @property {number} GOOGLE_HANGOUTS=11 GOOGLE_HANGOUTS value + */ + Message.Platform = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PLATFORM_UNSPECIFIED"] = 0; + values[valuesById[1] = "FACEBOOK"] = 1; + values[valuesById[2] = "SLACK"] = 2; + values[valuesById[3] = "TELEGRAM"] = 3; + values[valuesById[4] = "KIK"] = 4; + values[valuesById[5] = "SKYPE"] = 5; + values[valuesById[6] = "LINE"] = 6; + values[valuesById[7] = "VIBER"] = 7; + values[valuesById[8] = "ACTIONS_ON_GOOGLE"] = 8; + values[valuesById[11] = "GOOGLE_HANGOUTS"] = 11; + return values; + })(); + + return Message; + })(); + + Intent.FollowupIntentInfo = (function() { + + /** + * Properties of a FollowupIntentInfo. + * @memberof google.cloud.dialogflow.v2.Intent + * @interface IFollowupIntentInfo + * @property {string|null} [followupIntentName] FollowupIntentInfo followupIntentName + * @property {string|null} [parentFollowupIntentName] FollowupIntentInfo parentFollowupIntentName + */ + + /** + * Constructs a new FollowupIntentInfo. + * @memberof google.cloud.dialogflow.v2.Intent + * @classdesc Represents a FollowupIntentInfo. + * @implements IFollowupIntentInfo + * @constructor + * @param {google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo=} [properties] Properties to set + */ + function FollowupIntentInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FollowupIntentInfo followupIntentName. + * @member {string} followupIntentName + * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + * @instance + */ + FollowupIntentInfo.prototype.followupIntentName = ""; + + /** + * FollowupIntentInfo parentFollowupIntentName. + * @member {string} parentFollowupIntentName + * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + * @instance + */ + FollowupIntentInfo.prototype.parentFollowupIntentName = ""; + + /** + * Creates a new FollowupIntentInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + * @static + * @param {google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Intent.FollowupIntentInfo} FollowupIntentInfo instance + */ + FollowupIntentInfo.create = function create(properties) { + return new FollowupIntentInfo(properties); + }; + + /** + * Encodes the specified FollowupIntentInfo message. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + * @static + * @param {google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo} message FollowupIntentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FollowupIntentInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.followupIntentName != null && Object.hasOwnProperty.call(message, "followupIntentName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.followupIntentName); + if (message.parentFollowupIntentName != null && Object.hasOwnProperty.call(message, "parentFollowupIntentName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parentFollowupIntentName); + return writer; + }; + + /** + * Encodes the specified FollowupIntentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Intent.FollowupIntentInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + * @static + * @param {google.cloud.dialogflow.v2.Intent.IFollowupIntentInfo} message FollowupIntentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FollowupIntentInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FollowupIntentInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Intent.FollowupIntentInfo} FollowupIntentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FollowupIntentInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.followupIntentName = reader.string(); + break; + case 2: + message.parentFollowupIntentName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FollowupIntentInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Intent.FollowupIntentInfo} FollowupIntentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FollowupIntentInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FollowupIntentInfo message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FollowupIntentInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.followupIntentName != null && message.hasOwnProperty("followupIntentName")) + if (!$util.isString(message.followupIntentName)) + return "followupIntentName: string expected"; + if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) + if (!$util.isString(message.parentFollowupIntentName)) + return "parentFollowupIntentName: string expected"; + return null; + }; + + /** + * Creates a FollowupIntentInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Intent.FollowupIntentInfo} FollowupIntentInfo + */ + FollowupIntentInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo) + return object; + var message = new $root.google.cloud.dialogflow.v2.Intent.FollowupIntentInfo(); + if (object.followupIntentName != null) + message.followupIntentName = String(object.followupIntentName); + if (object.parentFollowupIntentName != null) + message.parentFollowupIntentName = String(object.parentFollowupIntentName); + return message; + }; + + /** + * Creates a plain object from a FollowupIntentInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + * @static + * @param {google.cloud.dialogflow.v2.Intent.FollowupIntentInfo} message FollowupIntentInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FollowupIntentInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.followupIntentName = ""; + object.parentFollowupIntentName = ""; + } + if (message.followupIntentName != null && message.hasOwnProperty("followupIntentName")) + object.followupIntentName = message.followupIntentName; + if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) + object.parentFollowupIntentName = message.parentFollowupIntentName; + return object; + }; + + /** + * Converts this FollowupIntentInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Intent.FollowupIntentInfo + * @instance + * @returns {Object.} JSON object + */ + FollowupIntentInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FollowupIntentInfo; + })(); + + /** + * WebhookState enum. + * @name google.cloud.dialogflow.v2.Intent.WebhookState + * @enum {number} + * @property {number} WEBHOOK_STATE_UNSPECIFIED=0 WEBHOOK_STATE_UNSPECIFIED value + * @property {number} WEBHOOK_STATE_ENABLED=1 WEBHOOK_STATE_ENABLED value + * @property {number} WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING=2 WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING value + */ + Intent.WebhookState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEBHOOK_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "WEBHOOK_STATE_ENABLED"] = 1; + values[valuesById[2] = "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING"] = 2; + return values; + })(); + + return Intent; + })(); + + v2.ListIntentsRequest = (function() { + + /** + * Properties of a ListIntentsRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IListIntentsRequest + * @property {string|null} [parent] ListIntentsRequest parent + * @property {string|null} [languageCode] ListIntentsRequest languageCode + * @property {google.cloud.dialogflow.v2.IntentView|null} [intentView] ListIntentsRequest intentView + * @property {number|null} [pageSize] ListIntentsRequest pageSize + * @property {string|null} [pageToken] ListIntentsRequest pageToken + */ + + /** + * Constructs a new ListIntentsRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListIntentsRequest. + * @implements IListIntentsRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IListIntentsRequest=} [properties] Properties to set + */ + function ListIntentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListIntentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.parent = ""; + + /** + * ListIntentsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.languageCode = ""; + + /** + * ListIntentsRequest intentView. + * @member {google.cloud.dialogflow.v2.IntentView} intentView + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.intentView = 0; + + /** + * ListIntentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.pageSize = 0; + + /** + * ListIntentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListIntentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListIntentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListIntentsRequest} ListIntentsRequest instance + */ + ListIntentsRequest.create = function create(properties) { + return new ListIntentsRequest(properties); + }; + + /** + * Encodes the specified ListIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListIntentsRequest} message ListIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.intentView); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); return writer; }; /** - * Encodes the specified WebhookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookResponse.verify|verify} messages. + * Encodes the specified ListIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest * @static - * @param {google.cloud.dialogflow.v2.IWebhookResponse} message WebhookResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListIntentsRequest} message ListIntentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WebhookResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WebhookResponse message from the specified reader or buffer. + * Decodes a ListIntentsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.WebhookResponse} WebhookResponse + * @returns {google.cloud.dialogflow.v2.ListIntentsRequest} ListIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebhookResponse.decode = function decode(reader, length) { + ListIntentsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.WebhookResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListIntentsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.fulfillmentText = reader.string(); + message.parent = reader.string(); break; case 2: - if (!(message.fulfillmentMessages && message.fulfillmentMessages.length)) - message.fulfillmentMessages = []; - message.fulfillmentMessages.push($root.google.cloud.dialogflow.v2.Intent.Message.decode(reader, reader.uint32())); + message.languageCode = reader.string(); break; case 3: - message.source = reader.string(); + message.intentView = reader.int32(); break; case 4: - message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); break; case 5: - if (!(message.outputContexts && message.outputContexts.length)) - message.outputContexts = []; - message.outputContexts.push($root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32())); - break; - case 6: - message.followupEventInput = $root.google.cloud.dialogflow.v2.EventInput.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) - message.sessionEntityTypes = []; - message.sessionEntityTypes.push($root.google.cloud.dialogflow.v2.SessionEntityType.decode(reader, reader.uint32())); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -30867,221 +31032,155 @@ }; /** - * Decodes a WebhookResponse message from the specified reader or buffer, length delimited. + * Decodes a ListIntentsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.WebhookResponse} WebhookResponse + * @returns {google.cloud.dialogflow.v2.ListIntentsRequest} ListIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WebhookResponse.decodeDelimited = function decodeDelimited(reader) { + ListIntentsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WebhookResponse message. + * Verifies a ListIntentsRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WebhookResponse.verify = function verify(message) { + ListIntentsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) - if (!$util.isString(message.fulfillmentText)) - return "fulfillmentText: string expected"; - if (message.fulfillmentMessages != null && message.hasOwnProperty("fulfillmentMessages")) { - if (!Array.isArray(message.fulfillmentMessages)) - return "fulfillmentMessages: array expected"; - for (var i = 0; i < message.fulfillmentMessages.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Intent.Message.verify(message.fulfillmentMessages[i]); - if (error) - return "fulfillmentMessages." + error; - } - } - if (message.source != null && message.hasOwnProperty("source")) - if (!$util.isString(message.source)) - return "source: string expected"; - if (message.payload != null && message.hasOwnProperty("payload")) { - var error = $root.google.protobuf.Struct.verify(message.payload); - if (error) - return "payload." + error; - } - if (message.outputContexts != null && message.hasOwnProperty("outputContexts")) { - if (!Array.isArray(message.outputContexts)) - return "outputContexts: array expected"; - for (var i = 0; i < message.outputContexts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.Context.verify(message.outputContexts[i]); - if (error) - return "outputContexts." + error; - } - } - if (message.followupEventInput != null && message.hasOwnProperty("followupEventInput")) { - var error = $root.google.cloud.dialogflow.v2.EventInput.verify(message.followupEventInput); - if (error) - return "followupEventInput." + error; - } - if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { - if (!Array.isArray(message.sessionEntityTypes)) - return "sessionEntityTypes: array expected"; - for (var i = 0; i < message.sessionEntityTypes.length; ++i) { - var error = $root.google.cloud.dialogflow.v2.SessionEntityType.verify(message.sessionEntityTypes[i]); - if (error) - return "sessionEntityTypes." + error; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.intentView != null && message.hasOwnProperty("intentView")) + switch (message.intentView) { + default: + return "intentView: enum value expected"; + case 0: + case 1: + break; } - } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a WebhookResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListIntentsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.WebhookResponse} WebhookResponse + * @returns {google.cloud.dialogflow.v2.ListIntentsRequest} ListIntentsRequest */ - WebhookResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.WebhookResponse) + ListIntentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListIntentsRequest) return object; - var message = new $root.google.cloud.dialogflow.v2.WebhookResponse(); - if (object.fulfillmentText != null) - message.fulfillmentText = String(object.fulfillmentText); - if (object.fulfillmentMessages) { - if (!Array.isArray(object.fulfillmentMessages)) - throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.fulfillmentMessages: array expected"); - message.fulfillmentMessages = []; - for (var i = 0; i < object.fulfillmentMessages.length; ++i) { - if (typeof object.fulfillmentMessages[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.fulfillmentMessages: object expected"); - message.fulfillmentMessages[i] = $root.google.cloud.dialogflow.v2.Intent.Message.fromObject(object.fulfillmentMessages[i]); - } - } - if (object.source != null) - message.source = String(object.source); - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.payload: object expected"); - message.payload = $root.google.protobuf.Struct.fromObject(object.payload); - } - if (object.outputContexts) { - if (!Array.isArray(object.outputContexts)) - throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.outputContexts: array expected"); - message.outputContexts = []; - for (var i = 0; i < object.outputContexts.length; ++i) { - if (typeof object.outputContexts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.outputContexts: object expected"); - message.outputContexts[i] = $root.google.cloud.dialogflow.v2.Context.fromObject(object.outputContexts[i]); - } - } - if (object.followupEventInput != null) { - if (typeof object.followupEventInput !== "object") - throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.followupEventInput: object expected"); - message.followupEventInput = $root.google.cloud.dialogflow.v2.EventInput.fromObject(object.followupEventInput); - } - if (object.sessionEntityTypes) { - if (!Array.isArray(object.sessionEntityTypes)) - throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.sessionEntityTypes: array expected"); - message.sessionEntityTypes = []; - for (var i = 0; i < object.sessionEntityTypes.length; ++i) { - if (typeof object.sessionEntityTypes[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.sessionEntityTypes: object expected"); - message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.v2.SessionEntityType.fromObject(object.sessionEntityTypes[i]); - } + var message = new $root.google.cloud.dialogflow.v2.ListIntentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.intentView) { + case "INTENT_VIEW_UNSPECIFIED": + case 0: + message.intentView = 0; + break; + case "INTENT_VIEW_FULL": + case 1: + message.intentView = 1; + break; } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a WebhookResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListIntentsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest * @static - * @param {google.cloud.dialogflow.v2.WebhookResponse} message WebhookResponse + * @param {google.cloud.dialogflow.v2.ListIntentsRequest} message ListIntentsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WebhookResponse.toObject = function toObject(message, options) { + ListIntentsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.fulfillmentMessages = []; - object.outputContexts = []; - object.sessionEntityTypes = []; - } if (options.defaults) { - object.fulfillmentText = ""; - object.source = ""; - object.payload = null; - object.followupEventInput = null; - } - if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) - object.fulfillmentText = message.fulfillmentText; - if (message.fulfillmentMessages && message.fulfillmentMessages.length) { - object.fulfillmentMessages = []; - for (var j = 0; j < message.fulfillmentMessages.length; ++j) - object.fulfillmentMessages[j] = $root.google.cloud.dialogflow.v2.Intent.Message.toObject(message.fulfillmentMessages[j], options); - } - if (message.source != null && message.hasOwnProperty("source")) - object.source = message.source; - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); - if (message.outputContexts && message.outputContexts.length) { - object.outputContexts = []; - for (var j = 0; j < message.outputContexts.length; ++j) - object.outputContexts[j] = $root.google.cloud.dialogflow.v2.Context.toObject(message.outputContexts[j], options); - } - if (message.followupEventInput != null && message.hasOwnProperty("followupEventInput")) - object.followupEventInput = $root.google.cloud.dialogflow.v2.EventInput.toObject(message.followupEventInput, options); - if (message.sessionEntityTypes && message.sessionEntityTypes.length) { - object.sessionEntityTypes = []; - for (var j = 0; j < message.sessionEntityTypes.length; ++j) - object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.v2.SessionEntityType.toObject(message.sessionEntityTypes[j], options); + object.parent = ""; + object.languageCode = ""; + object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.intentView != null && message.hasOwnProperty("intentView")) + object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2.IntentView[message.intentView] : message.intentView; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this WebhookResponse to JSON. + * Converts this ListIntentsRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @memberof google.cloud.dialogflow.v2.ListIntentsRequest * @instance * @returns {Object.} JSON object */ - WebhookResponse.prototype.toJSON = function toJSON() { + ListIntentsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return WebhookResponse; + return ListIntentsRequest; })(); - v2.OriginalDetectIntentRequest = (function() { + v2.ListIntentsResponse = (function() { /** - * Properties of an OriginalDetectIntentRequest. + * Properties of a ListIntentsResponse. * @memberof google.cloud.dialogflow.v2 - * @interface IOriginalDetectIntentRequest - * @property {string|null} [source] OriginalDetectIntentRequest source - * @property {string|null} [version] OriginalDetectIntentRequest version - * @property {google.protobuf.IStruct|null} [payload] OriginalDetectIntentRequest payload + * @interface IListIntentsResponse + * @property {Array.|null} [intents] ListIntentsResponse intents + * @property {string|null} [nextPageToken] ListIntentsResponse nextPageToken */ /** - * Constructs a new OriginalDetectIntentRequest. + * Constructs a new ListIntentsResponse. * @memberof google.cloud.dialogflow.v2 - * @classdesc Represents an OriginalDetectIntentRequest. - * @implements IOriginalDetectIntentRequest + * @classdesc Represents a ListIntentsResponse. + * @implements IListIntentsResponse * @constructor - * @param {google.cloud.dialogflow.v2.IOriginalDetectIntentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListIntentsResponse=} [properties] Properties to set */ - function OriginalDetectIntentRequest(properties) { + function ListIntentsResponse(properties) { + this.intents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31089,101 +31188,91 @@ } /** - * OriginalDetectIntentRequest source. - * @member {string} source - * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest - * @instance - */ - OriginalDetectIntentRequest.prototype.source = ""; - - /** - * OriginalDetectIntentRequest version. - * @member {string} version - * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * ListIntentsResponse intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.v2.ListIntentsResponse * @instance */ - OriginalDetectIntentRequest.prototype.version = ""; + ListIntentsResponse.prototype.intents = $util.emptyArray; /** - * OriginalDetectIntentRequest payload. - * @member {google.protobuf.IStruct|null|undefined} payload - * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * ListIntentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2.ListIntentsResponse * @instance */ - OriginalDetectIntentRequest.prototype.payload = null; + ListIntentsResponse.prototype.nextPageToken = ""; /** - * Creates a new OriginalDetectIntentRequest instance using the specified properties. + * Creates a new ListIntentsResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @memberof google.cloud.dialogflow.v2.ListIntentsResponse * @static - * @param {google.cloud.dialogflow.v2.IOriginalDetectIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2.OriginalDetectIntentRequest} OriginalDetectIntentRequest instance + * @param {google.cloud.dialogflow.v2.IListIntentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListIntentsResponse} ListIntentsResponse instance */ - OriginalDetectIntentRequest.create = function create(properties) { - return new OriginalDetectIntentRequest(properties); + ListIntentsResponse.create = function create(properties) { + return new ListIntentsResponse(properties); }; /** - * Encodes the specified OriginalDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.OriginalDetectIntentRequest.verify|verify} messages. + * Encodes the specified ListIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @memberof google.cloud.dialogflow.v2.ListIntentsResponse * @static - * @param {google.cloud.dialogflow.v2.IOriginalDetectIntentRequest} message OriginalDetectIntentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListIntentsResponse} message ListIntentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OriginalDetectIntentRequest.encode = function encode(message, writer) { + ListIntentsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.source); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified OriginalDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.OriginalDetectIntentRequest.verify|verify} messages. + * Encodes the specified ListIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListIntentsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @memberof google.cloud.dialogflow.v2.ListIntentsResponse * @static - * @param {google.cloud.dialogflow.v2.IOriginalDetectIntentRequest} message OriginalDetectIntentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListIntentsResponse} message ListIntentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OriginalDetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OriginalDetectIntentRequest message from the specified reader or buffer. + * Decodes a ListIntentsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @memberof google.cloud.dialogflow.v2.ListIntentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2.OriginalDetectIntentRequest} OriginalDetectIntentRequest + * @returns {google.cloud.dialogflow.v2.ListIntentsResponse} ListIntentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OriginalDetectIntentRequest.decode = function decode(reader, length) { + ListIntentsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListIntentsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.source = reader.string(); + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32())); break; case 2: - message.version = reader.string(); - break; - case 3: - message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -31194,485 +31283,381 @@ }; /** - * Decodes an OriginalDetectIntentRequest message from the specified reader or buffer, length delimited. + * Decodes a ListIntentsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @memberof google.cloud.dialogflow.v2.ListIntentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2.OriginalDetectIntentRequest} OriginalDetectIntentRequest + * @returns {google.cloud.dialogflow.v2.ListIntentsResponse} ListIntentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OriginalDetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { + ListIntentsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OriginalDetectIntentRequest message. + * Verifies a ListIntentsResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @memberof google.cloud.dialogflow.v2.ListIntentsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OriginalDetectIntentRequest.verify = function verify(message) { + ListIntentsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.source != null && message.hasOwnProperty("source")) - if (!$util.isString(message.source)) - return "source: string expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!$util.isString(message.version)) - return "version: string expected"; - if (message.payload != null && message.hasOwnProperty("payload")) { - var error = $root.google.protobuf.Struct.verify(message.payload); - if (error) - return "payload." + error; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intents[i]); + if (error) + return "intents." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an OriginalDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListIntentsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @memberof google.cloud.dialogflow.v2.ListIntentsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2.OriginalDetectIntentRequest} OriginalDetectIntentRequest + * @returns {google.cloud.dialogflow.v2.ListIntentsResponse} ListIntentsResponse */ - OriginalDetectIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest) + ListIntentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListIntentsResponse) return object; - var message = new $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest(); - if (object.source != null) - message.source = String(object.source); - if (object.version != null) - message.version = String(object.version); - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.dialogflow.v2.OriginalDetectIntentRequest.payload: object expected"); - message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + var message = new $root.google.cloud.dialogflow.v2.ListIntentsResponse(); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.v2.ListIntentsResponse.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListIntentsResponse.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intents[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an OriginalDetectIntentRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListIntentsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @memberof google.cloud.dialogflow.v2.ListIntentsResponse * @static - * @param {google.cloud.dialogflow.v2.OriginalDetectIntentRequest} message OriginalDetectIntentRequest + * @param {google.cloud.dialogflow.v2.ListIntentsResponse} message ListIntentsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OriginalDetectIntentRequest.toObject = function toObject(message, options) { + ListIntentsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.source = ""; - object.version = ""; - object.payload = null; + if (options.arrays || options.defaults) + object.intents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intents[j], options); } - if (message.source != null && message.hasOwnProperty("source")) - object.source = message.source; - if (message.version != null && message.hasOwnProperty("version")) - object.version = message.version; - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this OriginalDetectIntentRequest to JSON. + * Converts this ListIntentsResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @memberof google.cloud.dialogflow.v2.ListIntentsResponse * @instance * @returns {Object.} JSON object */ - OriginalDetectIntentRequest.prototype.toJSON = function toJSON() { + ListIntentsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OriginalDetectIntentRequest; + return ListIntentsResponse; })(); - return v2; - })(); - - dialogflow.v2beta1 = (function() { - - /** - * Namespace v2beta1. - * @memberof google.cloud.dialogflow - * @namespace - */ - var v2beta1 = {}; - - v2beta1.Agents = (function() { + v2.GetIntentRequest = (function() { /** - * Constructs a new Agents service. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an Agents - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * Properties of a GetIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IGetIntentRequest + * @property {string|null} [name] GetIntentRequest name + * @property {string|null} [languageCode] GetIntentRequest languageCode + * @property {google.cloud.dialogflow.v2.IntentView|null} [intentView] GetIntentRequest intentView */ - function Agents(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Agents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Agents; /** - * Creates new Agents service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Agents} RPC service. Useful where requests and/or responses are streamed. + * Constructs a new GetIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a GetIntentRequest. + * @implements IGetIntentRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IGetIntentRequest=} [properties] Properties to set */ - Agents.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + function GetIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#getAgent}. - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @typedef GetAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.Agent} [response] Agent + * GetIntentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.GetIntentRequest + * @instance */ + GetIntentRequest.prototype.name = ""; /** - * Calls GetAgent. - * @function getAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents + * GetIntentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.GetIntentRequest * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetAgentRequest} request GetAgentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Agents.GetAgentCallback} callback Node-style callback called with the error, if any, and Agent - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Agents.prototype.getAgent = function getAgent(request, callback) { - return this.rpcCall(getAgent, $root.google.cloud.dialogflow.v2beta1.GetAgentRequest, $root.google.cloud.dialogflow.v2beta1.Agent, request, callback); - }, "name", { value: "GetAgent" }); + GetIntentRequest.prototype.languageCode = ""; /** - * Calls GetAgent. - * @function getAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents + * GetIntentRequest intentView. + * @member {google.cloud.dialogflow.v2.IntentView} intentView + * @memberof google.cloud.dialogflow.v2.GetIntentRequest * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetAgentRequest} request GetAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + GetIntentRequest.prototype.intentView = 0; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#setAgent}. - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @typedef SetAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.Agent} [response] Agent + * Creates a new GetIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.IGetIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.GetIntentRequest} GetIntentRequest instance */ + GetIntentRequest.create = function create(properties) { + return new GetIntentRequest(properties); + }; /** - * Calls SetAgent. - * @function setAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.ISetAgentRequest} request SetAgentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Agents.SetAgentCallback} callback Node-style callback called with the error, if any, and Agent - * @returns {undefined} - * @variation 1 + * Encodes the specified GetIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.IGetIntentRequest} message GetIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(Agents.prototype.setAgent = function setAgent(request, callback) { - return this.rpcCall(setAgent, $root.google.cloud.dialogflow.v2beta1.SetAgentRequest, $root.google.cloud.dialogflow.v2beta1.Agent, request, callback); - }, "name", { value: "SetAgent" }); + GetIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.intentView); + return writer; + }; /** - * Calls SetAgent. - * @function setAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.ISetAgentRequest} request SetAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified GetIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.IGetIntentRequest} message GetIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + GetIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#deleteAgent}. - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @typedef DeleteAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * Decodes a GetIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.GetIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.GetIntentRequest} GetIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + GetIntentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + case 3: + message.intentView = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls DeleteAgent. - * @function deleteAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteAgentRequest} request DeleteAgentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Agents.DeleteAgentCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Agents.prototype.deleteAgent = function deleteAgent(request, callback) { - return this.rpcCall(deleteAgent, $root.google.cloud.dialogflow.v2beta1.DeleteAgentRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteAgent" }); - - /** - * Calls DeleteAgent. - * @function deleteAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteAgentRequest} request DeleteAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#searchAgents}. - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @typedef SearchAgentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.SearchAgentsResponse} [response] SearchAgentsResponse - */ - - /** - * Calls SearchAgents. - * @function searchAgents - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsRequest} request SearchAgentsRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Agents.SearchAgentsCallback} callback Node-style callback called with the error, if any, and SearchAgentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Agents.prototype.searchAgents = function searchAgents(request, callback) { - return this.rpcCall(searchAgents, $root.google.cloud.dialogflow.v2beta1.SearchAgentsRequest, $root.google.cloud.dialogflow.v2beta1.SearchAgentsResponse, request, callback); - }, "name", { value: "SearchAgents" }); - - /** - * Calls SearchAgents. - * @function searchAgents - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsRequest} request SearchAgentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#trainAgent}. - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @typedef TrainAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls TrainAgent. - * @function trainAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.ITrainAgentRequest} request TrainAgentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Agents.TrainAgentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Agents.prototype.trainAgent = function trainAgent(request, callback) { - return this.rpcCall(trainAgent, $root.google.cloud.dialogflow.v2beta1.TrainAgentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "TrainAgent" }); - - /** - * Calls TrainAgent. - * @function trainAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.ITrainAgentRequest} request TrainAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#exportAgent}. - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @typedef ExportAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ExportAgent. - * @function exportAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IExportAgentRequest} request ExportAgentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Agents.ExportAgentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Agents.prototype.exportAgent = function exportAgent(request, callback) { - return this.rpcCall(exportAgent, $root.google.cloud.dialogflow.v2beta1.ExportAgentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ExportAgent" }); - - /** - * Calls ExportAgent. - * @function exportAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IExportAgentRequest} request ExportAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#importAgent}. - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @typedef ImportAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls ImportAgent. - * @function importAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IImportAgentRequest} request ImportAgentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Agents.ImportAgentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Agents.prototype.importAgent = function importAgent(request, callback) { - return this.rpcCall(importAgent, $root.google.cloud.dialogflow.v2beta1.ImportAgentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ImportAgent" }); - - /** - * Calls ImportAgent. - * @function importAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IImportAgentRequest} request ImportAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#restoreAgent}. - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @typedef RestoreAgentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreAgent. - * @function restoreAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IRestoreAgentRequest} request RestoreAgentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Agents.RestoreAgentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Decodes a GetIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.GetIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.GetIntentRequest} GetIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(Agents.prototype.restoreAgent = function restoreAgent(request, callback) { - return this.rpcCall(restoreAgent, $root.google.cloud.dialogflow.v2beta1.RestoreAgentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreAgent" }); + GetIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls RestoreAgent. - * @function restoreAgent - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IRestoreAgentRequest} request RestoreAgentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a GetIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.GetIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + GetIntentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.intentView != null && message.hasOwnProperty("intentView")) + switch (message.intentView) { + default: + return "intentView: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#getValidationResult}. - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @typedef GetValidationResultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.ValidationResult} [response] ValidationResult + * Creates a GetIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.GetIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.GetIntentRequest} GetIntentRequest */ + GetIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.GetIntentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.GetIntentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.intentView) { + case "INTENT_VIEW_UNSPECIFIED": + case 0: + message.intentView = 0; + break; + case "INTENT_VIEW_FULL": + case 1: + message.intentView = 1; + break; + } + return message; + }; /** - * Calls GetValidationResult. - * @function getValidationResult - * @memberof google.cloud.dialogflow.v2beta1.Agents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetValidationResultRequest} request GetValidationResultRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Agents.GetValidationResultCallback} callback Node-style callback called with the error, if any, and ValidationResult - * @returns {undefined} - * @variation 1 + * Creates a plain object from a GetIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.GetIntentRequest} message GetIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(Agents.prototype.getValidationResult = function getValidationResult(request, callback) { - return this.rpcCall(getValidationResult, $root.google.cloud.dialogflow.v2beta1.GetValidationResultRequest, $root.google.cloud.dialogflow.v2beta1.ValidationResult, request, callback); - }, "name", { value: "GetValidationResult" }); + GetIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.intentView != null && message.hasOwnProperty("intentView")) + object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2.IntentView[message.intentView] : message.intentView; + return object; + }; /** - * Calls GetValidationResult. - * @function getValidationResult - * @memberof google.cloud.dialogflow.v2beta1.Agents + * Converts this GetIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.GetIntentRequest * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetValidationResultRequest} request GetValidationResultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + GetIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Agents; + return GetIntentRequest; })(); - v2beta1.Agent = (function() { + v2.CreateIntentRequest = (function() { /** - * Properties of an Agent. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IAgent - * @property {string|null} [parent] Agent parent - * @property {string|null} [displayName] Agent displayName - * @property {string|null} [defaultLanguageCode] Agent defaultLanguageCode - * @property {Array.|null} [supportedLanguageCodes] Agent supportedLanguageCodes - * @property {string|null} [timeZone] Agent timeZone - * @property {string|null} [description] Agent description - * @property {string|null} [avatarUri] Agent avatarUri - * @property {boolean|null} [enableLogging] Agent enableLogging - * @property {google.cloud.dialogflow.v2beta1.Agent.MatchMode|null} [matchMode] Agent matchMode - * @property {number|null} [classificationThreshold] Agent classificationThreshold - * @property {google.cloud.dialogflow.v2beta1.Agent.ApiVersion|null} [apiVersion] Agent apiVersion - * @property {google.cloud.dialogflow.v2beta1.Agent.Tier|null} [tier] Agent tier + * Properties of a CreateIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface ICreateIntentRequest + * @property {string|null} [parent] CreateIntentRequest parent + * @property {google.cloud.dialogflow.v2.IIntent|null} [intent] CreateIntentRequest intent + * @property {string|null} [languageCode] CreateIntentRequest languageCode + * @property {google.cloud.dialogflow.v2.IntentView|null} [intentView] CreateIntentRequest intentView */ /** - * Constructs a new Agent. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an Agent. - * @implements IAgent + * Constructs a new CreateIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a CreateIntentRequest. + * @implements ICreateIntentRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IAgent=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ICreateIntentRequest=} [properties] Properties to set */ - function Agent(properties) { - this.supportedLanguageCodes = []; + function CreateIntentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -31680,181 +31665,100 @@ } /** - * Agent parent. + * CreateIntentRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.Agent - * @instance - */ - Agent.prototype.parent = ""; - - /** - * Agent displayName. - * @member {string} displayName - * @memberof google.cloud.dialogflow.v2beta1.Agent - * @instance - */ - Agent.prototype.displayName = ""; - - /** - * Agent defaultLanguageCode. - * @member {string} defaultLanguageCode - * @memberof google.cloud.dialogflow.v2beta1.Agent - * @instance - */ - Agent.prototype.defaultLanguageCode = ""; - - /** - * Agent supportedLanguageCodes. - * @member {Array.} supportedLanguageCodes - * @memberof google.cloud.dialogflow.v2beta1.Agent - * @instance - */ - Agent.prototype.supportedLanguageCodes = $util.emptyArray; - - /** - * Agent timeZone. - * @member {string} timeZone - * @memberof google.cloud.dialogflow.v2beta1.Agent - * @instance - */ - Agent.prototype.timeZone = ""; - - /** - * Agent description. - * @member {string} description - * @memberof google.cloud.dialogflow.v2beta1.Agent - * @instance - */ - Agent.prototype.description = ""; - - /** - * Agent avatarUri. - * @member {string} avatarUri - * @memberof google.cloud.dialogflow.v2beta1.Agent - * @instance - */ - Agent.prototype.avatarUri = ""; - - /** - * Agent enableLogging. - * @member {boolean} enableLogging - * @memberof google.cloud.dialogflow.v2beta1.Agent - * @instance - */ - Agent.prototype.enableLogging = false; - - /** - * Agent matchMode. - * @member {google.cloud.dialogflow.v2beta1.Agent.MatchMode} matchMode - * @memberof google.cloud.dialogflow.v2beta1.Agent + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @instance */ - Agent.prototype.matchMode = 0; + CreateIntentRequest.prototype.parent = ""; /** - * Agent classificationThreshold. - * @member {number} classificationThreshold - * @memberof google.cloud.dialogflow.v2beta1.Agent + * CreateIntentRequest intent. + * @member {google.cloud.dialogflow.v2.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @instance */ - Agent.prototype.classificationThreshold = 0; + CreateIntentRequest.prototype.intent = null; /** - * Agent apiVersion. - * @member {google.cloud.dialogflow.v2beta1.Agent.ApiVersion} apiVersion - * @memberof google.cloud.dialogflow.v2beta1.Agent + * CreateIntentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @instance */ - Agent.prototype.apiVersion = 0; + CreateIntentRequest.prototype.languageCode = ""; /** - * Agent tier. - * @member {google.cloud.dialogflow.v2beta1.Agent.Tier} tier - * @memberof google.cloud.dialogflow.v2beta1.Agent + * CreateIntentRequest intentView. + * @member {google.cloud.dialogflow.v2.IntentView} intentView + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @instance */ - Agent.prototype.tier = 0; + CreateIntentRequest.prototype.intentView = 0; /** - * Creates a new Agent instance using the specified properties. + * Creates a new CreateIntentRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.Agent + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IAgent=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Agent} Agent instance + * @param {google.cloud.dialogflow.v2.ICreateIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CreateIntentRequest} CreateIntentRequest instance */ - Agent.create = function create(properties) { - return new Agent(properties); + CreateIntentRequest.create = function create(properties) { + return new CreateIntentRequest(properties); }; /** - * Encodes the specified Agent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Agent.verify|verify} messages. + * Encodes the specified CreateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateIntentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Agent + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IAgent} message Agent message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateIntentRequest} message CreateIntentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Agent.encode = function encode(message, writer) { + CreateIntentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.defaultLanguageCode != null && Object.hasOwnProperty.call(message, "defaultLanguageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.defaultLanguageCode); - if (message.supportedLanguageCodes != null && message.supportedLanguageCodes.length) - for (var i = 0; i < message.supportedLanguageCodes.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.supportedLanguageCodes[i]); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeZone); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); - if (message.avatarUri != null && Object.hasOwnProperty.call(message, "avatarUri")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.avatarUri); - if (message.enableLogging != null && Object.hasOwnProperty.call(message, "enableLogging")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableLogging); - if (message.matchMode != null && Object.hasOwnProperty.call(message, "matchMode")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.matchMode); - if (message.classificationThreshold != null && Object.hasOwnProperty.call(message, "classificationThreshold")) - writer.uint32(/* id 10, wireType 5 =*/85).float(message.classificationThreshold); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.apiVersion); - if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.tier); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.v2.Intent.encode(message.intent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.intentView); return writer; }; /** - * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Agent.verify|verify} messages. + * Encodes the specified CreateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateIntentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Agent + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IAgent} message Agent message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateIntentRequest} message CreateIntentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Agent.encodeDelimited = function encodeDelimited(message, writer) { + CreateIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Agent message from the specified reader or buffer. + * Decodes a CreateIntentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Agent + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Agent} Agent + * @returns {google.cloud.dialogflow.v2.CreateIntentRequest} CreateIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Agent.decode = function decode(reader, length) { + CreateIntentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Agent(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateIntentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -31862,39 +31766,13 @@ message.parent = reader.string(); break; case 2: - message.displayName = reader.string(); + message.intent = $root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32()); break; case 3: - message.defaultLanguageCode = reader.string(); + message.languageCode = reader.string(); break; case 4: - if (!(message.supportedLanguageCodes && message.supportedLanguageCodes.length)) - message.supportedLanguageCodes = []; - message.supportedLanguageCodes.push(reader.string()); - break; - case 5: - message.timeZone = reader.string(); - break; - case 6: - message.description = reader.string(); - break; - case 7: - message.avatarUri = reader.string(); - break; - case 8: - message.enableLogging = reader.bool(); - break; - case 9: - message.matchMode = reader.int32(); - break; - case 10: - message.classificationThreshold = reader.float(); - break; - case 14: - message.apiVersion = reader.int32(); - break; - case 15: - message.tier = reader.int32(); + message.intentView = reader.int32(); break; default: reader.skipType(tag & 7); @@ -31905,325 +31783,153 @@ }; /** - * Decodes an Agent message from the specified reader or buffer, length delimited. + * Decodes a CreateIntentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Agent + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Agent} Agent + * @returns {google.cloud.dialogflow.v2.CreateIntentRequest} CreateIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Agent.decodeDelimited = function decodeDelimited(reader) { + CreateIntentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Agent message. + * Verifies a CreateIntentRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Agent + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Agent.verify = function verify(message) { + CreateIntentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) - if (!$util.isString(message.defaultLanguageCode)) - return "defaultLanguageCode: string expected"; - if (message.supportedLanguageCodes != null && message.hasOwnProperty("supportedLanguageCodes")) { - if (!Array.isArray(message.supportedLanguageCodes)) - return "supportedLanguageCodes: array expected"; - for (var i = 0; i < message.supportedLanguageCodes.length; ++i) - if (!$util.isString(message.supportedLanguageCodes[i])) - return "supportedLanguageCodes: string[] expected"; + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intent); + if (error) + return "intent." + error; } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.avatarUri != null && message.hasOwnProperty("avatarUri")) - if (!$util.isString(message.avatarUri)) - return "avatarUri: string expected"; - if (message.enableLogging != null && message.hasOwnProperty("enableLogging")) - if (typeof message.enableLogging !== "boolean") - return "enableLogging: boolean expected"; - if (message.matchMode != null && message.hasOwnProperty("matchMode")) - switch (message.matchMode) { - default: - return "matchMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.classificationThreshold != null && message.hasOwnProperty("classificationThreshold")) - if (typeof message.classificationThreshold !== "number") - return "classificationThreshold: number expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - switch (message.apiVersion) { - default: - return "apiVersion: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.tier != null && message.hasOwnProperty("tier")) - switch (message.tier) { + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.intentView != null && message.hasOwnProperty("intentView")) + switch (message.intentView) { default: - return "tier: enum value expected"; + return "intentView: enum value expected"; case 0: case 1: - case 2: - case 3: break; } return null; }; /** - * Creates an Agent message from a plain object. Also converts values to their respective internal types. + * Creates a CreateIntentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Agent + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Agent} Agent + * @returns {google.cloud.dialogflow.v2.CreateIntentRequest} CreateIntentRequest */ - Agent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Agent) + CreateIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CreateIntentRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Agent(); + var message = new $root.google.cloud.dialogflow.v2.CreateIntentRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.defaultLanguageCode != null) - message.defaultLanguageCode = String(object.defaultLanguageCode); - if (object.supportedLanguageCodes) { - if (!Array.isArray(object.supportedLanguageCodes)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Agent.supportedLanguageCodes: array expected"); - message.supportedLanguageCodes = []; - for (var i = 0; i < object.supportedLanguageCodes.length; ++i) - message.supportedLanguageCodes[i] = String(object.supportedLanguageCodes[i]); - } - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - if (object.description != null) - message.description = String(object.description); - if (object.avatarUri != null) - message.avatarUri = String(object.avatarUri); - if (object.enableLogging != null) - message.enableLogging = Boolean(object.enableLogging); - switch (object.matchMode) { - case "MATCH_MODE_UNSPECIFIED": - case 0: - message.matchMode = 0; - break; - case "MATCH_MODE_HYBRID": - case 1: - message.matchMode = 1; - break; - case "MATCH_MODE_ML_ONLY": - case 2: - message.matchMode = 2; - break; - } - if (object.classificationThreshold != null) - message.classificationThreshold = Number(object.classificationThreshold); - switch (object.apiVersion) { - case "API_VERSION_UNSPECIFIED": - case 0: - message.apiVersion = 0; - break; - case "API_VERSION_V1": - case 1: - message.apiVersion = 1; - break; - case "API_VERSION_V2": - case 2: - message.apiVersion = 2; - break; - case "API_VERSION_V2_BETA_1": - case 3: - message.apiVersion = 3; - break; + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.v2.CreateIntentRequest.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intent); } - switch (object.tier) { - case "TIER_UNSPECIFIED": + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.intentView) { + case "INTENT_VIEW_UNSPECIFIED": case 0: - message.tier = 0; + message.intentView = 0; break; - case "TIER_STANDARD": + case "INTENT_VIEW_FULL": case 1: - message.tier = 1; - break; - case "TIER_ENTERPRISE": - case 2: - message.tier = 2; - break; - case "TIER_ENTERPRISE_PLUS": - case 3: - message.tier = 3; + message.intentView = 1; break; } return message; }; /** - * Creates a plain object from an Agent message. Also converts values to other types if specified. + * Creates a plain object from a CreateIntentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Agent + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.Agent} message Agent + * @param {google.cloud.dialogflow.v2.CreateIntentRequest} message CreateIntentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Agent.toObject = function toObject(message, options) { + CreateIntentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.supportedLanguageCodes = []; if (options.defaults) { object.parent = ""; - object.displayName = ""; - object.defaultLanguageCode = ""; - object.timeZone = ""; - object.description = ""; - object.avatarUri = ""; - object.enableLogging = false; - object.matchMode = options.enums === String ? "MATCH_MODE_UNSPECIFIED" : 0; - object.classificationThreshold = 0; - object.apiVersion = options.enums === String ? "API_VERSION_UNSPECIFIED" : 0; - object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; + object.intent = null; + object.languageCode = ""; + object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) - object.defaultLanguageCode = message.defaultLanguageCode; - if (message.supportedLanguageCodes && message.supportedLanguageCodes.length) { - object.supportedLanguageCodes = []; - for (var j = 0; j < message.supportedLanguageCodes.length; ++j) - object.supportedLanguageCodes[j] = message.supportedLanguageCodes[j]; - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.avatarUri != null && message.hasOwnProperty("avatarUri")) - object.avatarUri = message.avatarUri; - if (message.enableLogging != null && message.hasOwnProperty("enableLogging")) - object.enableLogging = message.enableLogging; - if (message.matchMode != null && message.hasOwnProperty("matchMode")) - object.matchMode = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Agent.MatchMode[message.matchMode] : message.matchMode; - if (message.classificationThreshold != null && message.hasOwnProperty("classificationThreshold")) - object.classificationThreshold = options.json && !isFinite(message.classificationThreshold) ? String(message.classificationThreshold) : message.classificationThreshold; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Agent.ApiVersion[message.apiVersion] : message.apiVersion; - if (message.tier != null && message.hasOwnProperty("tier")) - object.tier = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Agent.Tier[message.tier] : message.tier; + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intent, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.intentView != null && message.hasOwnProperty("intentView")) + object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2.IntentView[message.intentView] : message.intentView; return object; }; /** - * Converts this Agent to JSON. + * Converts this CreateIntentRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Agent + * @memberof google.cloud.dialogflow.v2.CreateIntentRequest * @instance * @returns {Object.} JSON object */ - Agent.prototype.toJSON = function toJSON() { + CreateIntentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * MatchMode enum. - * @name google.cloud.dialogflow.v2beta1.Agent.MatchMode - * @enum {number} - * @property {number} MATCH_MODE_UNSPECIFIED=0 MATCH_MODE_UNSPECIFIED value - * @property {number} MATCH_MODE_HYBRID=1 MATCH_MODE_HYBRID value - * @property {number} MATCH_MODE_ML_ONLY=2 MATCH_MODE_ML_ONLY value - */ - Agent.MatchMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MATCH_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "MATCH_MODE_HYBRID"] = 1; - values[valuesById[2] = "MATCH_MODE_ML_ONLY"] = 2; - return values; - })(); - - /** - * ApiVersion enum. - * @name google.cloud.dialogflow.v2beta1.Agent.ApiVersion - * @enum {number} - * @property {number} API_VERSION_UNSPECIFIED=0 API_VERSION_UNSPECIFIED value - * @property {number} API_VERSION_V1=1 API_VERSION_V1 value - * @property {number} API_VERSION_V2=2 API_VERSION_V2 value - * @property {number} API_VERSION_V2_BETA_1=3 API_VERSION_V2_BETA_1 value - */ - Agent.ApiVersion = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "API_VERSION_UNSPECIFIED"] = 0; - values[valuesById[1] = "API_VERSION_V1"] = 1; - values[valuesById[2] = "API_VERSION_V2"] = 2; - values[valuesById[3] = "API_VERSION_V2_BETA_1"] = 3; - return values; - })(); - - /** - * Tier enum. - * @name google.cloud.dialogflow.v2beta1.Agent.Tier - * @enum {number} - * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value - * @property {number} TIER_STANDARD=1 TIER_STANDARD value - * @property {number} TIER_ENTERPRISE=2 TIER_ENTERPRISE value - * @property {number} TIER_ENTERPRISE_PLUS=3 TIER_ENTERPRISE_PLUS value - */ - Agent.Tier = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; - values[valuesById[1] = "TIER_STANDARD"] = 1; - values[valuesById[2] = "TIER_ENTERPRISE"] = 2; - values[valuesById[3] = "TIER_ENTERPRISE_PLUS"] = 3; - return values; - })(); - - return Agent; + return CreateIntentRequest; })(); - v2beta1.GetAgentRequest = (function() { + v2.UpdateIntentRequest = (function() { /** - * Properties of a GetAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IGetAgentRequest - * @property {string|null} [parent] GetAgentRequest parent + * Properties of an UpdateIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IUpdateIntentRequest + * @property {google.cloud.dialogflow.v2.IIntent|null} [intent] UpdateIntentRequest intent + * @property {string|null} [languageCode] UpdateIntentRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateIntentRequest updateMask + * @property {google.cloud.dialogflow.v2.IntentView|null} [intentView] UpdateIntentRequest intentView */ /** - * Constructs a new GetAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a GetAgentRequest. - * @implements IGetAgentRequest + * Constructs a new UpdateIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an UpdateIntentRequest. + * @implements IUpdateIntentRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IGetAgentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IUpdateIntentRequest=} [properties] Properties to set */ - function GetAgentRequest(properties) { + function UpdateIntentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32231,75 +31937,114 @@ } /** - * GetAgentRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * UpdateIntentRequest intent. + * @member {google.cloud.dialogflow.v2.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest * @instance */ - GetAgentRequest.prototype.parent = ""; + UpdateIntentRequest.prototype.intent = null; /** - * Creates a new GetAgentRequest instance using the specified properties. + * UpdateIntentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.languageCode = ""; + + /** + * UpdateIntentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.updateMask = null; + + /** + * UpdateIntentRequest intentView. + * @member {google.cloud.dialogflow.v2.IntentView} intentView + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.intentView = 0; + + /** + * Creates a new UpdateIntentRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetAgentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.GetAgentRequest} GetAgentRequest instance + * @param {google.cloud.dialogflow.v2.IUpdateIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.UpdateIntentRequest} UpdateIntentRequest instance */ - GetAgentRequest.create = function create(properties) { - return new GetAgentRequest(properties); + UpdateIntentRequest.create = function create(properties) { + return new UpdateIntentRequest(properties); }; /** - * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetAgentRequest.verify|verify} messages. + * Encodes the specified UpdateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateIntentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IUpdateIntentRequest} message UpdateIntentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetAgentRequest.encode = function encode(message, writer) { + UpdateIntentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.v2.Intent.encode(message.intent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.intentView); return writer; }; /** - * Encodes the specified GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetAgentRequest.verify|verify} messages. + * Encodes the specified UpdateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateIntentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IUpdateIntentRequest} message UpdateIntentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetAgentRequest message from the specified reader or buffer. + * Decodes an UpdateIntentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.GetAgentRequest} GetAgentRequest + * @returns {google.cloud.dialogflow.v2.UpdateIntentRequest} UpdateIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetAgentRequest.decode = function decode(reader, length) { + UpdateIntentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetAgentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateIntentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.intent = $root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32()); + break; + case 2: + message.languageCode = reader.string(); + break; + case 3: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 4: + message.intentView = reader.int32(); break; default: reader.skipType(tag & 7); @@ -32310,108 +32055,155 @@ }; /** - * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateIntentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.GetAgentRequest} GetAgentRequest + * @returns {google.cloud.dialogflow.v2.UpdateIntentRequest} UpdateIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetAgentRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateIntentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetAgentRequest message. + * Verifies an UpdateIntentRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetAgentRequest.verify = function verify(message) { + UpdateIntentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intent); + if (error) + return "intent." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.intentView != null && message.hasOwnProperty("intentView")) + switch (message.intentView) { + default: + return "intentView: enum value expected"; + case 0: + case 1: + break; + } return null; }; /** - * Creates a GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateIntentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.GetAgentRequest} GetAgentRequest + * @returns {google.cloud.dialogflow.v2.UpdateIntentRequest} UpdateIntentRequest */ - GetAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetAgentRequest) + UpdateIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.UpdateIntentRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.GetAgentRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.dialogflow.v2.UpdateIntentRequest(); + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateIntentRequest.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intent); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateIntentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + switch (object.intentView) { + case "INTENT_VIEW_UNSPECIFIED": + case 0: + message.intentView = 0; + break; + case "INTENT_VIEW_FULL": + case 1: + message.intentView = 1; + break; + } return message; }; /** - * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateIntentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.GetAgentRequest} message GetAgentRequest + * @param {google.cloud.dialogflow.v2.UpdateIntentRequest} message UpdateIntentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetAgentRequest.toObject = function toObject(message, options) { + UpdateIntentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - return object; - }; - - /** - * Converts this GetAgentRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest - * @instance - * @returns {Object.} JSON object - */ - GetAgentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + if (options.defaults) { + object.intent = null; + object.languageCode = ""; + object.updateMask = null; + object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; + } + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intent, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.intentView != null && message.hasOwnProperty("intentView")) + object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2.IntentView[message.intentView] : message.intentView; + return object; }; - return GetAgentRequest; + /** + * Converts this UpdateIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.UpdateIntentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateIntentRequest; })(); - v2beta1.SetAgentRequest = (function() { + v2.DeleteIntentRequest = (function() { /** - * Properties of a SetAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface ISetAgentRequest - * @property {google.cloud.dialogflow.v2beta1.IAgent|null} [agent] SetAgentRequest agent - * @property {google.protobuf.IFieldMask|null} [updateMask] SetAgentRequest updateMask + * Properties of a DeleteIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IDeleteIntentRequest + * @property {string|null} [name] DeleteIntentRequest name */ /** - * Constructs a new SetAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a SetAgentRequest. - * @implements ISetAgentRequest + * Constructs a new DeleteIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a DeleteIntentRequest. + * @implements IDeleteIntentRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.ISetAgentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IDeleteIntentRequest=} [properties] Properties to set */ - function SetAgentRequest(properties) { + function DeleteIntentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32419,88 +32211,75 @@ } /** - * SetAgentRequest agent. - * @member {google.cloud.dialogflow.v2beta1.IAgent|null|undefined} agent - * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest - * @instance - */ - SetAgentRequest.prototype.agent = null; - - /** - * SetAgentRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * DeleteIntentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest * @instance */ - SetAgentRequest.prototype.updateMask = null; + DeleteIntentRequest.prototype.name = ""; /** - * Creates a new SetAgentRequest instance using the specified properties. + * Creates a new DeleteIntentRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISetAgentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.SetAgentRequest} SetAgentRequest instance + * @param {google.cloud.dialogflow.v2.IDeleteIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.DeleteIntentRequest} DeleteIntentRequest instance */ - SetAgentRequest.create = function create(properties) { - return new SetAgentRequest(properties); + DeleteIntentRequest.create = function create(properties) { + return new DeleteIntentRequest(properties); }; /** - * Encodes the specified SetAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SetAgentRequest.verify|verify} messages. + * Encodes the specified DeleteIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteIntentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISetAgentRequest} message SetAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IDeleteIntentRequest} message DeleteIntentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetAgentRequest.encode = function encode(message, writer) { + DeleteIntentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) - $root.google.cloud.dialogflow.v2beta1.Agent.encode(message.agent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified SetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SetAgentRequest.verify|verify} messages. + * Encodes the specified DeleteIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteIntentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISetAgentRequest} message SetAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IDeleteIntentRequest} message DeleteIntentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SetAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SetAgentRequest message from the specified reader or buffer. + * Decodes a DeleteIntentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.SetAgentRequest} SetAgentRequest + * @returns {google.cloud.dialogflow.v2.DeleteIntentRequest} DeleteIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetAgentRequest.decode = function decode(reader, length) { + DeleteIntentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SetAgentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteIntentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.agent = $root.google.cloud.dialogflow.v2beta1.Agent.decode(reader, reader.uint32()); - break; - case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -32511,126 +32290,112 @@ }; /** - * Decodes a SetAgentRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteIntentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.SetAgentRequest} SetAgentRequest + * @returns {google.cloud.dialogflow.v2.DeleteIntentRequest} DeleteIntentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SetAgentRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteIntentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SetAgentRequest message. + * Verifies a DeleteIntentRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SetAgentRequest.verify = function verify(message) { + DeleteIntentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.agent != null && message.hasOwnProperty("agent")) { - var error = $root.google.cloud.dialogflow.v2beta1.Agent.verify(message.agent); - if (error) - return "agent." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a SetAgentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteIntentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.SetAgentRequest} SetAgentRequest + * @returns {google.cloud.dialogflow.v2.DeleteIntentRequest} DeleteIntentRequest */ - SetAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.SetAgentRequest) + DeleteIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.DeleteIntentRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.SetAgentRequest(); - if (object.agent != null) { - if (typeof object.agent !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.SetAgentRequest.agent: object expected"); - message.agent = $root.google.cloud.dialogflow.v2beta1.Agent.fromObject(object.agent); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.SetAgentRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.dialogflow.v2.DeleteIntentRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a SetAgentRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteIntentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.SetAgentRequest} message SetAgentRequest + * @param {google.cloud.dialogflow.v2.DeleteIntentRequest} message DeleteIntentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SetAgentRequest.toObject = function toObject(message, options) { + DeleteIntentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.agent = null; - object.updateMask = null; - } - if (message.agent != null && message.hasOwnProperty("agent")) - object.agent = $root.google.cloud.dialogflow.v2beta1.Agent.toObject(message.agent, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this SetAgentRequest to JSON. + * Converts this DeleteIntentRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @memberof google.cloud.dialogflow.v2.DeleteIntentRequest * @instance * @returns {Object.} JSON object */ - SetAgentRequest.prototype.toJSON = function toJSON() { + DeleteIntentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SetAgentRequest; + return DeleteIntentRequest; })(); - v2beta1.DeleteAgentRequest = (function() { + v2.BatchUpdateIntentsRequest = (function() { /** - * Properties of a DeleteAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IDeleteAgentRequest - * @property {string|null} [parent] DeleteAgentRequest parent + * Properties of a BatchUpdateIntentsRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IBatchUpdateIntentsRequest + * @property {string|null} [parent] BatchUpdateIntentsRequest parent + * @property {string|null} [intentBatchUri] BatchUpdateIntentsRequest intentBatchUri + * @property {google.cloud.dialogflow.v2.IIntentBatch|null} [intentBatchInline] BatchUpdateIntentsRequest intentBatchInline + * @property {string|null} [languageCode] BatchUpdateIntentsRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateIntentsRequest updateMask + * @property {google.cloud.dialogflow.v2.IntentView|null} [intentView] BatchUpdateIntentsRequest intentView */ /** - * Constructs a new DeleteAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a DeleteAgentRequest. - * @implements IDeleteAgentRequest + * Constructs a new BatchUpdateIntentsRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a BatchUpdateIntentsRequest. + * @implements IBatchUpdateIntentsRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IDeleteAgentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest=} [properties] Properties to set */ - function DeleteAgentRequest(properties) { + function BatchUpdateIntentsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32638,76 +32403,155 @@ } /** - * DeleteAgentRequest parent. + * BatchUpdateIntentsRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest * @instance */ - DeleteAgentRequest.prototype.parent = ""; + BatchUpdateIntentsRequest.prototype.parent = ""; /** - * Creates a new DeleteAgentRequest instance using the specified properties. + * BatchUpdateIntentsRequest intentBatchUri. + * @member {string} intentBatchUri + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest + * @instance + */ + BatchUpdateIntentsRequest.prototype.intentBatchUri = ""; + + /** + * BatchUpdateIntentsRequest intentBatchInline. + * @member {google.cloud.dialogflow.v2.IIntentBatch|null|undefined} intentBatchInline + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest + * @instance + */ + BatchUpdateIntentsRequest.prototype.intentBatchInline = null; + + /** + * BatchUpdateIntentsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest + * @instance + */ + BatchUpdateIntentsRequest.prototype.languageCode = ""; + + /** + * BatchUpdateIntentsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest + * @instance + */ + BatchUpdateIntentsRequest.prototype.updateMask = null; + + /** + * BatchUpdateIntentsRequest intentView. + * @member {google.cloud.dialogflow.v2.IntentView} intentView + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest + * @instance + */ + BatchUpdateIntentsRequest.prototype.intentView = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchUpdateIntentsRequest intentBatch. + * @member {"intentBatchUri"|"intentBatchInline"|undefined} intentBatch + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest + * @instance + */ + Object.defineProperty(BatchUpdateIntentsRequest.prototype, "intentBatch", { + get: $util.oneOfGetter($oneOfFields = ["intentBatchUri", "intentBatchInline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchUpdateIntentsRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteAgentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.DeleteAgentRequest} DeleteAgentRequest instance + * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest instance */ - DeleteAgentRequest.create = function create(properties) { - return new DeleteAgentRequest(properties); + BatchUpdateIntentsRequest.create = function create(properties) { + return new BatchUpdateIntentsRequest(properties); }; /** - * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAgentRequest.verify|verify} messages. + * Encodes the specified BatchUpdateIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest} message BatchUpdateIntentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteAgentRequest.encode = function encode(message, writer) { + BatchUpdateIntentsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.intentBatchUri != null && Object.hasOwnProperty.call(message, "intentBatchUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.intentBatchUri); + if (message.intentBatchInline != null && Object.hasOwnProperty.call(message, "intentBatchInline")) + $root.google.cloud.dialogflow.v2.IntentBatch.encode(message.intentBatchInline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.intentView); return writer; }; /** - * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAgentRequest.verify|verify} messages. + * Encodes the specified BatchUpdateIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsRequest} message BatchUpdateIntentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchUpdateIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.DeleteAgentRequest} DeleteAgentRequest + * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteAgentRequest.decode = function decode(reader, length) { + BatchUpdateIntentsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteAgentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchUpdateIntentsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; + case 2: + message.intentBatchUri = reader.string(); + break; + case 3: + message.intentBatchInline = $root.google.cloud.dialogflow.v2.IntentBatch.decode(reader, reader.uint32()); + break; + case 4: + message.languageCode = reader.string(); + break; + case 5: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 6: + message.intentView = reader.int32(); + break; default: reader.skipType(tag & 7); break; @@ -32717,108 +32561,184 @@ }; /** - * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.DeleteAgentRequest} DeleteAgentRequest + * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteAgentRequest.decodeDelimited = function decodeDelimited(reader) { + BatchUpdateIntentsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteAgentRequest message. + * Verifies a BatchUpdateIntentsRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteAgentRequest.verify = function verify(message) { + BatchUpdateIntentsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; + var properties = {}; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; + if (message.intentBatchUri != null && message.hasOwnProperty("intentBatchUri")) { + properties.intentBatch = 1; + if (!$util.isString(message.intentBatchUri)) + return "intentBatchUri: string expected"; + } + if (message.intentBatchInline != null && message.hasOwnProperty("intentBatchInline")) { + if (properties.intentBatch === 1) + return "intentBatch: multiple values"; + properties.intentBatch = 1; + { + var error = $root.google.cloud.dialogflow.v2.IntentBatch.verify(message.intentBatchInline); + if (error) + return "intentBatchInline." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.intentView != null && message.hasOwnProperty("intentView")) + switch (message.intentView) { + default: + return "intentView: enum value expected"; + case 0: + case 1: + break; + } return null; }; /** - * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchUpdateIntentsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.DeleteAgentRequest} DeleteAgentRequest + * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest */ - DeleteAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteAgentRequest) + BatchUpdateIntentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.BatchUpdateIntentsRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.DeleteAgentRequest(); + var message = new $root.google.cloud.dialogflow.v2.BatchUpdateIntentsRequest(); if (object.parent != null) message.parent = String(object.parent); + if (object.intentBatchUri != null) + message.intentBatchUri = String(object.intentBatchUri); + if (object.intentBatchInline != null) { + if (typeof object.intentBatchInline !== "object") + throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.intentBatchInline: object expected"); + message.intentBatchInline = $root.google.cloud.dialogflow.v2.IntentBatch.fromObject(object.intentBatchInline); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateIntentsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + switch (object.intentView) { + case "INTENT_VIEW_UNSPECIFIED": + case 0: + message.intentView = 0; + break; + case "INTENT_VIEW_FULL": + case 1: + message.intentView = 1; + break; + } return message; }; /** - * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchUpdateIntentsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest * @static - * @param {google.cloud.dialogflow.v2beta1.DeleteAgentRequest} message DeleteAgentRequest + * @param {google.cloud.dialogflow.v2.BatchUpdateIntentsRequest} message BatchUpdateIntentsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteAgentRequest.toObject = function toObject(message, options) { + BatchUpdateIntentsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.parent = ""; + object.languageCode = ""; + object.updateMask = null; + object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; + } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; + if (message.intentBatchUri != null && message.hasOwnProperty("intentBatchUri")) { + object.intentBatchUri = message.intentBatchUri; + if (options.oneofs) + object.intentBatch = "intentBatchUri"; + } + if (message.intentBatchInline != null && message.hasOwnProperty("intentBatchInline")) { + object.intentBatchInline = $root.google.cloud.dialogflow.v2.IntentBatch.toObject(message.intentBatchInline, options); + if (options.oneofs) + object.intentBatch = "intentBatchInline"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.intentView != null && message.hasOwnProperty("intentView")) + object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2.IntentView[message.intentView] : message.intentView; return object; }; /** - * Converts this DeleteAgentRequest to JSON. + * Converts this BatchUpdateIntentsRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsRequest * @instance * @returns {Object.} JSON object */ - DeleteAgentRequest.prototype.toJSON = function toJSON() { + BatchUpdateIntentsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteAgentRequest; + return BatchUpdateIntentsRequest; })(); - v2beta1.SubAgent = (function() { + v2.BatchUpdateIntentsResponse = (function() { /** - * Properties of a SubAgent. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface ISubAgent - * @property {string|null} [project] SubAgent project - * @property {string|null} [environment] SubAgent environment + * Properties of a BatchUpdateIntentsResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IBatchUpdateIntentsResponse + * @property {Array.|null} [intents] BatchUpdateIntentsResponse intents */ /** - * Constructs a new SubAgent. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a SubAgent. - * @implements ISubAgent + * Constructs a new BatchUpdateIntentsResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a BatchUpdateIntentsResponse. + * @implements IBatchUpdateIntentsResponse * @constructor - * @param {google.cloud.dialogflow.v2beta1.ISubAgent=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse=} [properties] Properties to set */ - function SubAgent(properties) { + function BatchUpdateIntentsResponse(properties) { + this.intents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -32826,88 +32746,78 @@ } /** - * SubAgent project. - * @member {string} project - * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * BatchUpdateIntentsResponse intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse * @instance */ - SubAgent.prototype.project = ""; + BatchUpdateIntentsResponse.prototype.intents = $util.emptyArray; /** - * SubAgent environment. - * @member {string} environment - * @memberof google.cloud.dialogflow.v2beta1.SubAgent - * @instance + * Creates a new BatchUpdateIntentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse + * @static + * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse instance */ - SubAgent.prototype.environment = ""; + BatchUpdateIntentsResponse.create = function create(properties) { + return new BatchUpdateIntentsResponse(properties); + }; /** - * Creates a new SubAgent instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.SubAgent - * @static - * @param {google.cloud.dialogflow.v2beta1.ISubAgent=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.SubAgent} SubAgent instance - */ - SubAgent.create = function create(properties) { - return new SubAgent(properties); - }; - - /** - * Encodes the specified SubAgent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SubAgent.verify|verify} messages. + * Encodes the specified BatchUpdateIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse * @static - * @param {google.cloud.dialogflow.v2beta1.ISubAgent} message SubAgent message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse} message BatchUpdateIntentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SubAgent.encode = function encode(message, writer) { + BatchUpdateIntentsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.environment); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified SubAgent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SubAgent.verify|verify} messages. + * Encodes the specified BatchUpdateIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse * @static - * @param {google.cloud.dialogflow.v2beta1.ISubAgent} message SubAgent message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchUpdateIntentsResponse} message BatchUpdateIntentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SubAgent.encodeDelimited = function encodeDelimited(message, writer) { + BatchUpdateIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SubAgent message from the specified reader or buffer. + * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.SubAgent} SubAgent + * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SubAgent.decode = function decode(reader, length) { + BatchUpdateIntentsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SubAgent(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchUpdateIntentsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.project = reader.string(); - break; - case 2: - message.environment = reader.string(); + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -32918,118 +32828,126 @@ }; /** - * Decodes a SubAgent message from the specified reader or buffer, length delimited. + * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.SubAgent} SubAgent + * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SubAgent.decodeDelimited = function decodeDelimited(reader) { + BatchUpdateIntentsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SubAgent message. + * Verifies a BatchUpdateIntentsResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SubAgent.verify = function verify(message) { + BatchUpdateIntentsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.environment != null && message.hasOwnProperty("environment")) - if (!$util.isString(message.environment)) - return "environment: string expected"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intents[i]); + if (error) + return "intents." + error; + } + } return null; }; /** - * Creates a SubAgent message from a plain object. Also converts values to their respective internal types. + * Creates a BatchUpdateIntentsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.SubAgent} SubAgent + * @returns {google.cloud.dialogflow.v2.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse */ - SubAgent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.SubAgent) + BatchUpdateIntentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.BatchUpdateIntentsResponse) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.SubAgent(); - if (object.project != null) - message.project = String(object.project); - if (object.environment != null) - message.environment = String(object.environment); + var message = new $root.google.cloud.dialogflow.v2.BatchUpdateIntentsResponse(); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateIntentsResponse.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intents[i]); + } + } return message; }; /** - * Creates a plain object from a SubAgent message. Also converts values to other types if specified. + * Creates a plain object from a BatchUpdateIntentsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse * @static - * @param {google.cloud.dialogflow.v2beta1.SubAgent} message SubAgent + * @param {google.cloud.dialogflow.v2.BatchUpdateIntentsResponse} message BatchUpdateIntentsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SubAgent.toObject = function toObject(message, options) { + BatchUpdateIntentsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.project = ""; - object.environment = ""; + if (options.arrays || options.defaults) + object.intents = []; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intents[j], options); } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.environment != null && message.hasOwnProperty("environment")) - object.environment = message.environment; return object; }; /** - * Converts this SubAgent to JSON. + * Converts this BatchUpdateIntentsResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @memberof google.cloud.dialogflow.v2.BatchUpdateIntentsResponse * @instance * @returns {Object.} JSON object */ - SubAgent.prototype.toJSON = function toJSON() { + BatchUpdateIntentsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SubAgent; + return BatchUpdateIntentsResponse; })(); - v2beta1.SearchAgentsRequest = (function() { + v2.BatchDeleteIntentsRequest = (function() { /** - * Properties of a SearchAgentsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface ISearchAgentsRequest - * @property {string|null} [parent] SearchAgentsRequest parent - * @property {number|null} [pageSize] SearchAgentsRequest pageSize - * @property {string|null} [pageToken] SearchAgentsRequest pageToken + * Properties of a BatchDeleteIntentsRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IBatchDeleteIntentsRequest + * @property {string|null} [parent] BatchDeleteIntentsRequest parent + * @property {Array.|null} [intents] BatchDeleteIntentsRequest intents */ /** - * Constructs a new SearchAgentsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a SearchAgentsRequest. - * @implements ISearchAgentsRequest + * Constructs a new BatchDeleteIntentsRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a BatchDeleteIntentsRequest. + * @implements IBatchDeleteIntentsRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest=} [properties] Properties to set */ - function SearchAgentsRequest(properties) { + function BatchDeleteIntentsRequest(properties) { + this.intents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33037,90 +32955,81 @@ } /** - * SearchAgentsRequest parent. + * BatchDeleteIntentsRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest - * @instance - */ - SearchAgentsRequest.prototype.parent = ""; - - /** - * SearchAgentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest * @instance */ - SearchAgentsRequest.prototype.pageSize = 0; + BatchDeleteIntentsRequest.prototype.parent = ""; /** - * SearchAgentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * BatchDeleteIntentsRequest intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest * @instance */ - SearchAgentsRequest.prototype.pageToken = ""; + BatchDeleteIntentsRequest.prototype.intents = $util.emptyArray; /** - * Creates a new SearchAgentsRequest instance using the specified properties. + * Creates a new BatchDeleteIntentsRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsRequest} SearchAgentsRequest instance + * @param {google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest instance */ - SearchAgentsRequest.create = function create(properties) { - return new SearchAgentsRequest(properties); + BatchDeleteIntentsRequest.create = function create(properties) { + return new BatchDeleteIntentsRequest(properties); }; /** - * Encodes the specified SearchAgentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsRequest.verify|verify} messages. + * Encodes the specified BatchDeleteIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsRequest} message SearchAgentsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest} message BatchDeleteIntentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchAgentsRequest.encode = function encode(message, writer) { + BatchDeleteIntentsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.encode(message.intents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified SearchAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsRequest.verify|verify} messages. + * Encodes the specified BatchDeleteIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsRequest} message SearchAgentsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchDeleteIntentsRequest} message BatchDeleteIntentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchAgentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchDeleteIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchAgentsRequest message from the specified reader or buffer. + * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsRequest} SearchAgentsRequest + * @returns {google.cloud.dialogflow.v2.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchAgentsRequest.decode = function decode(reader, length) { + BatchDeleteIntentsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SearchAgentsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchDeleteIntentsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -33128,10 +33037,9 @@ message.parent = reader.string(); break; case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -33142,126 +33050,134 @@ }; /** - * Decodes a SearchAgentsRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsRequest} SearchAgentsRequest + * @returns {google.cloud.dialogflow.v2.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchAgentsRequest.decodeDelimited = function decodeDelimited(reader) { + BatchDeleteIntentsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchAgentsRequest message. + * Verifies a BatchDeleteIntentsRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchAgentsRequest.verify = function verify(message) { + BatchDeleteIntentsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intents[i]); + if (error) + return "intents." + error; + } + } return null; }; /** - * Creates a SearchAgentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDeleteIntentsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsRequest} SearchAgentsRequest + * @returns {google.cloud.dialogflow.v2.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest */ - SearchAgentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchAgentsRequest) + BatchDeleteIntentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.BatchDeleteIntentsRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.SearchAgentsRequest(); + var message = new $root.google.cloud.dialogflow.v2.BatchDeleteIntentsRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.BatchDeleteIntentsRequest.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intents[i]); + } + } return message; }; /** - * Creates a plain object from a SearchAgentsRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchDeleteIntentsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest * @static - * @param {google.cloud.dialogflow.v2beta1.SearchAgentsRequest} message SearchAgentsRequest + * @param {google.cloud.dialogflow.v2.BatchDeleteIntentsRequest} message BatchDeleteIntentsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchAgentsRequest.toObject = function toObject(message, options) { + BatchDeleteIntentsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.arrays || options.defaults) + object.intents = []; + if (options.defaults) object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intents[j], options); + } return object; }; /** - * Converts this SearchAgentsRequest to JSON. + * Converts this BatchDeleteIntentsRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteIntentsRequest * @instance * @returns {Object.} JSON object */ - SearchAgentsRequest.prototype.toJSON = function toJSON() { + BatchDeleteIntentsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SearchAgentsRequest; + return BatchDeleteIntentsRequest; })(); - v2beta1.SearchAgentsResponse = (function() { + v2.IntentBatch = (function() { /** - * Properties of a SearchAgentsResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface ISearchAgentsResponse - * @property {Array.|null} [agents] SearchAgentsResponse agents - * @property {string|null} [nextPageToken] SearchAgentsResponse nextPageToken + * Properties of an IntentBatch. + * @memberof google.cloud.dialogflow.v2 + * @interface IIntentBatch + * @property {Array.|null} [intents] IntentBatch intents */ /** - * Constructs a new SearchAgentsResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a SearchAgentsResponse. - * @implements ISearchAgentsResponse + * Constructs a new IntentBatch. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an IntentBatch. + * @implements IIntentBatch * @constructor - * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IIntentBatch=} [properties] Properties to set */ - function SearchAgentsResponse(properties) { - this.agents = []; + function IntentBatch(properties) { + this.intents = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33269,91 +33185,78 @@ } /** - * SearchAgentsResponse agents. - * @member {Array.} agents - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse - * @instance - */ - SearchAgentsResponse.prototype.agents = $util.emptyArray; - - /** - * SearchAgentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * IntentBatch intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.v2.IntentBatch * @instance */ - SearchAgentsResponse.prototype.nextPageToken = ""; + IntentBatch.prototype.intents = $util.emptyArray; /** - * Creates a new SearchAgentsResponse instance using the specified properties. + * Creates a new IntentBatch instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @memberof google.cloud.dialogflow.v2.IntentBatch * @static - * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsResponse} SearchAgentsResponse instance + * @param {google.cloud.dialogflow.v2.IIntentBatch=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.IntentBatch} IntentBatch instance */ - SearchAgentsResponse.create = function create(properties) { - return new SearchAgentsResponse(properties); + IntentBatch.create = function create(properties) { + return new IntentBatch(properties); }; /** - * Encodes the specified SearchAgentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsResponse.verify|verify} messages. + * Encodes the specified IntentBatch message. Does not implicitly {@link google.cloud.dialogflow.v2.IntentBatch.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @memberof google.cloud.dialogflow.v2.IntentBatch * @static - * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsResponse} message SearchAgentsResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IIntentBatch} message IntentBatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchAgentsResponse.encode = function encode(message, writer) { + IntentBatch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.agents != null && message.agents.length) - for (var i = 0; i < message.agents.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Agent.encode(message.agents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified SearchAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsResponse.verify|verify} messages. + * Encodes the specified IntentBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.IntentBatch.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @memberof google.cloud.dialogflow.v2.IntentBatch * @static - * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsResponse} message SearchAgentsResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IIntentBatch} message IntentBatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SearchAgentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + IntentBatch.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SearchAgentsResponse message from the specified reader or buffer. + * Decodes an IntentBatch message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @memberof google.cloud.dialogflow.v2.IntentBatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsResponse} SearchAgentsResponse + * @returns {google.cloud.dialogflow.v2.IntentBatch} IntentBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchAgentsResponse.decode = function decode(reader, length) { + IntentBatch.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SearchAgentsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.IntentBatch(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.agents && message.agents.length)) - message.agents = []; - message.agents.push($root.google.cloud.dialogflow.v2beta1.Agent.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.v2.Intent.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -33364,133 +33267,341 @@ }; /** - * Decodes a SearchAgentsResponse message from the specified reader or buffer, length delimited. + * Decodes an IntentBatch message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @memberof google.cloud.dialogflow.v2.IntentBatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsResponse} SearchAgentsResponse + * @returns {google.cloud.dialogflow.v2.IntentBatch} IntentBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SearchAgentsResponse.decodeDelimited = function decodeDelimited(reader) { + IntentBatch.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SearchAgentsResponse message. + * Verifies an IntentBatch message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @memberof google.cloud.dialogflow.v2.IntentBatch * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SearchAgentsResponse.verify = function verify(message) { + IntentBatch.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.agents != null && message.hasOwnProperty("agents")) { - if (!Array.isArray(message.agents)) - return "agents: array expected"; - for (var i = 0; i < message.agents.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Agent.verify(message.agents[i]); + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.verify(message.intents[i]); if (error) - return "agents." + error; + return "intents." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; return null; }; /** - * Creates a SearchAgentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an IntentBatch message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @memberof google.cloud.dialogflow.v2.IntentBatch * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsResponse} SearchAgentsResponse + * @returns {google.cloud.dialogflow.v2.IntentBatch} IntentBatch */ - SearchAgentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchAgentsResponse) + IntentBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.IntentBatch) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.SearchAgentsResponse(); - if (object.agents) { - if (!Array.isArray(object.agents)) - throw TypeError(".google.cloud.dialogflow.v2beta1.SearchAgentsResponse.agents: array expected"); - message.agents = []; - for (var i = 0; i < object.agents.length; ++i) { - if (typeof object.agents[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.SearchAgentsResponse.agents: object expected"); - message.agents[i] = $root.google.cloud.dialogflow.v2beta1.Agent.fromObject(object.agents[i]); + var message = new $root.google.cloud.dialogflow.v2.IntentBatch(); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.v2.IntentBatch.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.IntentBatch.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.v2.Intent.fromObject(object.intents[i]); } } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a SearchAgentsResponse message. Also converts values to other types if specified. + * Creates a plain object from an IntentBatch message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @memberof google.cloud.dialogflow.v2.IntentBatch * @static - * @param {google.cloud.dialogflow.v2beta1.SearchAgentsResponse} message SearchAgentsResponse + * @param {google.cloud.dialogflow.v2.IntentBatch} message IntentBatch * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SearchAgentsResponse.toObject = function toObject(message, options) { + IntentBatch.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.agents = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.agents && message.agents.length) { - object.agents = []; - for (var j = 0; j < message.agents.length; ++j) - object.agents[j] = $root.google.cloud.dialogflow.v2beta1.Agent.toObject(message.agents[j], options); + object.intents = []; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.v2.Intent.toObject(message.intents[j], options); } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this SearchAgentsResponse to JSON. + * Converts this IntentBatch to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @memberof google.cloud.dialogflow.v2.IntentBatch * @instance * @returns {Object.} JSON object */ - SearchAgentsResponse.prototype.toJSON = function toJSON() { + IntentBatch.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SearchAgentsResponse; + return IntentBatch; })(); - v2beta1.TrainAgentRequest = (function() { - - /** - * Properties of a TrainAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface ITrainAgentRequest - * @property {string|null} [parent] TrainAgentRequest parent + /** + * IntentView enum. + * @name google.cloud.dialogflow.v2.IntentView + * @enum {number} + * @property {number} INTENT_VIEW_UNSPECIFIED=0 INTENT_VIEW_UNSPECIFIED value + * @property {number} INTENT_VIEW_FULL=1 INTENT_VIEW_FULL value + */ + v2.IntentView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTENT_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTENT_VIEW_FULL"] = 1; + return values; + })(); + + v2.SessionEntityTypes = (function() { + + /** + * Constructs a new SessionEntityTypes service. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a SessionEntityTypes + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function SessionEntityTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (SessionEntityTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionEntityTypes; + + /** + * Creates new SessionEntityTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {SessionEntityTypes} RPC service. Useful where requests and/or responses are streamed. */ + SessionEntityTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * Constructs a new TrainAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a TrainAgentRequest. - * @implements ITrainAgentRequest + * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#listSessionEntityTypes}. + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @typedef ListSessionEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.ListSessionEntityTypesResponse} [response] ListSessionEntityTypesResponse + */ + + /** + * Calls ListSessionEntityTypes. + * @function listSessionEntityTypes + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesRequest} request ListSessionEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.v2.SessionEntityTypes.ListSessionEntityTypesCallback} callback Node-style callback called with the error, if any, and ListSessionEntityTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.listSessionEntityTypes = function listSessionEntityTypes(request, callback) { + return this.rpcCall(listSessionEntityTypes, $root.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest, $root.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse, request, callback); + }, "name", { value: "ListSessionEntityTypes" }); + + /** + * Calls ListSessionEntityTypes. + * @function listSessionEntityTypes + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesRequest} request ListSessionEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#getSessionEntityType}. + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @typedef GetSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.SessionEntityType} [response] SessionEntityType + */ + + /** + * Calls GetSessionEntityType. + * @function getSessionEntityType + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest} request GetSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2.SessionEntityTypes.GetSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.getSessionEntityType = function getSessionEntityType(request, callback) { + return this.rpcCall(getSessionEntityType, $root.google.cloud.dialogflow.v2.GetSessionEntityTypeRequest, $root.google.cloud.dialogflow.v2.SessionEntityType, request, callback); + }, "name", { value: "GetSessionEntityType" }); + + /** + * Calls GetSessionEntityType. + * @function getSessionEntityType + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest} request GetSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#createSessionEntityType}. + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @typedef CreateSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.SessionEntityType} [response] SessionEntityType + */ + + /** + * Calls CreateSessionEntityType. + * @function createSessionEntityType + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest} request CreateSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2.SessionEntityTypes.CreateSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.createSessionEntityType = function createSessionEntityType(request, callback) { + return this.rpcCall(createSessionEntityType, $root.google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest, $root.google.cloud.dialogflow.v2.SessionEntityType, request, callback); + }, "name", { value: "CreateSessionEntityType" }); + + /** + * Calls CreateSessionEntityType. + * @function createSessionEntityType + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest} request CreateSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#updateSessionEntityType}. + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @typedef UpdateSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.SessionEntityType} [response] SessionEntityType + */ + + /** + * Calls UpdateSessionEntityType. + * @function updateSessionEntityType + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest} request UpdateSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2.SessionEntityTypes.UpdateSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.updateSessionEntityType = function updateSessionEntityType(request, callback) { + return this.rpcCall(updateSessionEntityType, $root.google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest, $root.google.cloud.dialogflow.v2.SessionEntityType, request, callback); + }, "name", { value: "UpdateSessionEntityType" }); + + /** + * Calls UpdateSessionEntityType. + * @function updateSessionEntityType + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest} request UpdateSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.SessionEntityTypes#deleteSessionEntityType}. + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @typedef DeleteSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSessionEntityType. + * @function deleteSessionEntityType + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest} request DeleteSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2.SessionEntityTypes.DeleteSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.deleteSessionEntityType = function deleteSessionEntityType(request, callback) { + return this.rpcCall(deleteSessionEntityType, $root.google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSessionEntityType" }); + + /** + * Calls DeleteSessionEntityType. + * @function deleteSessionEntityType + * @memberof google.cloud.dialogflow.v2.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest} request DeleteSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SessionEntityTypes; + })(); + + v2.SessionEntityType = (function() { + + /** + * Properties of a SessionEntityType. + * @memberof google.cloud.dialogflow.v2 + * @interface ISessionEntityType + * @property {string|null} [name] SessionEntityType name + * @property {google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode|null} [entityOverrideMode] SessionEntityType entityOverrideMode + * @property {Array.|null} [entities] SessionEntityType entities + */ + + /** + * Constructs a new SessionEntityType. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a SessionEntityType. + * @implements ISessionEntityType * @constructor - * @param {google.cloud.dialogflow.v2beta1.ITrainAgentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ISessionEntityType=} [properties] Properties to set */ - function TrainAgentRequest(properties) { + function SessionEntityType(properties) { + this.entities = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33498,75 +33609,104 @@ } /** - * TrainAgentRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * SessionEntityType name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.SessionEntityType * @instance */ - TrainAgentRequest.prototype.parent = ""; + SessionEntityType.prototype.name = ""; /** - * Creates a new TrainAgentRequest instance using the specified properties. + * SessionEntityType entityOverrideMode. + * @member {google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode} entityOverrideMode + * @memberof google.cloud.dialogflow.v2.SessionEntityType + * @instance + */ + SessionEntityType.prototype.entityOverrideMode = 0; + + /** + * SessionEntityType entities. + * @member {Array.} entities + * @memberof google.cloud.dialogflow.v2.SessionEntityType + * @instance + */ + SessionEntityType.prototype.entities = $util.emptyArray; + + /** + * Creates a new SessionEntityType instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @memberof google.cloud.dialogflow.v2.SessionEntityType * @static - * @param {google.cloud.dialogflow.v2beta1.ITrainAgentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.TrainAgentRequest} TrainAgentRequest instance + * @param {google.cloud.dialogflow.v2.ISessionEntityType=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SessionEntityType} SessionEntityType instance */ - TrainAgentRequest.create = function create(properties) { - return new TrainAgentRequest(properties); + SessionEntityType.create = function create(properties) { + return new SessionEntityType(properties); }; /** - * Encodes the specified TrainAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TrainAgentRequest.verify|verify} messages. + * Encodes the specified SessionEntityType message. Does not implicitly {@link google.cloud.dialogflow.v2.SessionEntityType.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @memberof google.cloud.dialogflow.v2.SessionEntityType * @static - * @param {google.cloud.dialogflow.v2beta1.ITrainAgentRequest} message TrainAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISessionEntityType} message SessionEntityType message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TrainAgentRequest.encode = function encode(message, writer) { + SessionEntityType.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.entityOverrideMode != null && Object.hasOwnProperty.call(message, "entityOverrideMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.entityOverrideMode); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dialogflow.v2.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified TrainAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TrainAgentRequest.verify|verify} messages. + * Encodes the specified SessionEntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SessionEntityType.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @memberof google.cloud.dialogflow.v2.SessionEntityType * @static - * @param {google.cloud.dialogflow.v2beta1.ITrainAgentRequest} message TrainAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ISessionEntityType} message SessionEntityType message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TrainAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + SessionEntityType.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TrainAgentRequest message from the specified reader or buffer. + * Decodes a SessionEntityType message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @memberof google.cloud.dialogflow.v2.SessionEntityType * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.TrainAgentRequest} TrainAgentRequest + * @returns {google.cloud.dialogflow.v2.SessionEntityType} SessionEntityType * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TrainAgentRequest.decode = function decode(reader, length) { + SessionEntityType.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.TrainAgentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SessionEntityType(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.name = reader.string(); + break; + case 2: + message.entityOverrideMode = reader.int32(); + break; + case 3: + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dialogflow.v2.EntityType.Entity.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -33577,108 +33717,178 @@ }; /** - * Decodes a TrainAgentRequest message from the specified reader or buffer, length delimited. + * Decodes a SessionEntityType message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @memberof google.cloud.dialogflow.v2.SessionEntityType * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.TrainAgentRequest} TrainAgentRequest + * @returns {google.cloud.dialogflow.v2.SessionEntityType} SessionEntityType * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TrainAgentRequest.decodeDelimited = function decodeDelimited(reader) { + SessionEntityType.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TrainAgentRequest message. + * Verifies a SessionEntityType message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @memberof google.cloud.dialogflow.v2.SessionEntityType * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TrainAgentRequest.verify = function verify(message) { + SessionEntityType.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.entityOverrideMode != null && message.hasOwnProperty("entityOverrideMode")) + switch (message.entityOverrideMode) { + default: + return "entityOverrideMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.EntityType.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } return null; }; /** - * Creates a TrainAgentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SessionEntityType message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @memberof google.cloud.dialogflow.v2.SessionEntityType * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.TrainAgentRequest} TrainAgentRequest + * @returns {google.cloud.dialogflow.v2.SessionEntityType} SessionEntityType */ - TrainAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.TrainAgentRequest) + SessionEntityType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SessionEntityType) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.TrainAgentRequest(); - if (object.parent != null) - message.parent = String(object.parent); + var message = new $root.google.cloud.dialogflow.v2.SessionEntityType(); + if (object.name != null) + message.name = String(object.name); + switch (object.entityOverrideMode) { + case "ENTITY_OVERRIDE_MODE_UNSPECIFIED": + case 0: + message.entityOverrideMode = 0; + break; + case "ENTITY_OVERRIDE_MODE_OVERRIDE": + case 1: + message.entityOverrideMode = 1; + break; + case "ENTITY_OVERRIDE_MODE_SUPPLEMENT": + case 2: + message.entityOverrideMode = 2; + break; + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dialogflow.v2.SessionEntityType.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.SessionEntityType.entities: object expected"); + message.entities[i] = $root.google.cloud.dialogflow.v2.EntityType.Entity.fromObject(object.entities[i]); + } + } return message; }; /** - * Creates a plain object from a TrainAgentRequest message. Also converts values to other types if specified. + * Creates a plain object from a SessionEntityType message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @memberof google.cloud.dialogflow.v2.SessionEntityType * @static - * @param {google.cloud.dialogflow.v2beta1.TrainAgentRequest} message TrainAgentRequest + * @param {google.cloud.dialogflow.v2.SessionEntityType} message SessionEntityType * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TrainAgentRequest.toObject = function toObject(message, options) { + SessionEntityType.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) { + object.name = ""; + object.entityOverrideMode = options.enums === String ? "ENTITY_OVERRIDE_MODE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.entityOverrideMode != null && message.hasOwnProperty("entityOverrideMode")) + object.entityOverrideMode = options.enums === String ? $root.google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode[message.entityOverrideMode] : message.entityOverrideMode; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dialogflow.v2.EntityType.Entity.toObject(message.entities[j], options); + } return object; }; /** - * Converts this TrainAgentRequest to JSON. + * Converts this SessionEntityType to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @memberof google.cloud.dialogflow.v2.SessionEntityType * @instance * @returns {Object.} JSON object */ - TrainAgentRequest.prototype.toJSON = function toJSON() { + SessionEntityType.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TrainAgentRequest; + /** + * EntityOverrideMode enum. + * @name google.cloud.dialogflow.v2.SessionEntityType.EntityOverrideMode + * @enum {number} + * @property {number} ENTITY_OVERRIDE_MODE_UNSPECIFIED=0 ENTITY_OVERRIDE_MODE_UNSPECIFIED value + * @property {number} ENTITY_OVERRIDE_MODE_OVERRIDE=1 ENTITY_OVERRIDE_MODE_OVERRIDE value + * @property {number} ENTITY_OVERRIDE_MODE_SUPPLEMENT=2 ENTITY_OVERRIDE_MODE_SUPPLEMENT value + */ + SessionEntityType.EntityOverrideMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENTITY_OVERRIDE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENTITY_OVERRIDE_MODE_OVERRIDE"] = 1; + values[valuesById[2] = "ENTITY_OVERRIDE_MODE_SUPPLEMENT"] = 2; + return values; + })(); + + return SessionEntityType; })(); - v2beta1.ExportAgentRequest = (function() { + v2.ListSessionEntityTypesRequest = (function() { /** - * Properties of an ExportAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IExportAgentRequest - * @property {string|null} [parent] ExportAgentRequest parent - * @property {string|null} [agentUri] ExportAgentRequest agentUri + * Properties of a ListSessionEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IListSessionEntityTypesRequest + * @property {string|null} [parent] ListSessionEntityTypesRequest parent + * @property {number|null} [pageSize] ListSessionEntityTypesRequest pageSize + * @property {string|null} [pageToken] ListSessionEntityTypesRequest pageToken */ /** - * Constructs a new ExportAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an ExportAgentRequest. - * @implements IExportAgentRequest + * Constructs a new ListSessionEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListSessionEntityTypesRequest. + * @implements IListSessionEntityTypesRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IExportAgentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesRequest=} [properties] Properties to set */ - function ExportAgentRequest(properties) { + function ListSessionEntityTypesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33686,80 +33896,90 @@ } /** - * ExportAgentRequest parent. + * ListSessionEntityTypesRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest * @instance */ - ExportAgentRequest.prototype.parent = ""; + ListSessionEntityTypesRequest.prototype.parent = ""; /** - * ExportAgentRequest agentUri. - * @member {string} agentUri - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * ListSessionEntityTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest * @instance */ - ExportAgentRequest.prototype.agentUri = ""; + ListSessionEntityTypesRequest.prototype.pageSize = 0; /** - * Creates a new ExportAgentRequest instance using the specified properties. + * ListSessionEntityTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest + * @instance + */ + ListSessionEntityTypesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSessionEntityTypesRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IExportAgentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ExportAgentRequest} ExportAgentRequest instance + * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest instance */ - ExportAgentRequest.create = function create(properties) { - return new ExportAgentRequest(properties); + ListSessionEntityTypesRequest.create = function create(properties) { + return new ListSessionEntityTypesRequest(properties); }; /** - * Encodes the specified ExportAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentRequest.verify|verify} messages. + * Encodes the specified ListSessionEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IExportAgentRequest} message ExportAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesRequest} message ListSessionEntityTypesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAgentRequest.encode = function encode(message, writer) { + ListSessionEntityTypesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentUri); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified ExportAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentRequest.verify|verify} messages. + * Encodes the specified ListSessionEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IExportAgentRequest} message ExportAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesRequest} message ListSessionEntityTypesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListSessionEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportAgentRequest message from the specified reader or buffer. + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ExportAgentRequest} ExportAgentRequest + * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAgentRequest.decode = function decode(reader, length) { + ListSessionEntityTypesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ExportAgentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -33767,7 +33987,10 @@ message.parent = reader.string(); break; case 2: - message.agentUri = reader.string(); + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -33778,117 +34001,126 @@ }; /** - * Decodes an ExportAgentRequest message from the specified reader or buffer, length delimited. + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ExportAgentRequest} ExportAgentRequest + * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAgentRequest.decodeDelimited = function decodeDelimited(reader) { + ListSessionEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportAgentRequest message. + * Verifies a ListSessionEntityTypesRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportAgentRequest.verify = function verify(message) { + ListSessionEntityTypesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.agentUri != null && message.hasOwnProperty("agentUri")) - if (!$util.isString(message.agentUri)) - return "agentUri: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates an ExportAgentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListSessionEntityTypesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ExportAgentRequest} ExportAgentRequest + * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest */ - ExportAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ExportAgentRequest) + ListSessionEntityTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ExportAgentRequest(); + var message = new $root.google.cloud.dialogflow.v2.ListSessionEntityTypesRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.agentUri != null) - message.agentUri = String(object.agentUri); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from an ExportAgentRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListSessionEntityTypesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ExportAgentRequest} message ExportAgentRequest + * @param {google.cloud.dialogflow.v2.ListSessionEntityTypesRequest} message ListSessionEntityTypesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportAgentRequest.toObject = function toObject(message, options) { + ListSessionEntityTypesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.agentUri = ""; + object.pageSize = 0; + object.pageToken = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.agentUri != null && message.hasOwnProperty("agentUri")) - object.agentUri = message.agentUri; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this ExportAgentRequest to JSON. + * Converts this ListSessionEntityTypesRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesRequest * @instance * @returns {Object.} JSON object */ - ExportAgentRequest.prototype.toJSON = function toJSON() { + ListSessionEntityTypesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportAgentRequest; + return ListSessionEntityTypesRequest; })(); - v2beta1.ExportAgentResponse = (function() { + v2.ListSessionEntityTypesResponse = (function() { /** - * Properties of an ExportAgentResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IExportAgentResponse - * @property {string|null} [agentUri] ExportAgentResponse agentUri - * @property {Uint8Array|null} [agentContent] ExportAgentResponse agentContent + * Properties of a ListSessionEntityTypesResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IListSessionEntityTypesResponse + * @property {Array.|null} [sessionEntityTypes] ListSessionEntityTypesResponse sessionEntityTypes + * @property {string|null} [nextPageToken] ListSessionEntityTypesResponse nextPageToken */ /** - * Constructs a new ExportAgentResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an ExportAgentResponse. - * @implements IExportAgentResponse + * Constructs a new ListSessionEntityTypesResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListSessionEntityTypesResponse. + * @implements IListSessionEntityTypesResponse * @constructor - * @param {google.cloud.dialogflow.v2beta1.IExportAgentResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesResponse=} [properties] Properties to set */ - function ExportAgentResponse(properties) { + function ListSessionEntityTypesResponse(properties) { + this.sessionEntityTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -33896,102 +34128,91 @@ } /** - * ExportAgentResponse agentUri. - * @member {string} agentUri - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse - * @instance - */ - ExportAgentResponse.prototype.agentUri = ""; - - /** - * ExportAgentResponse agentContent. - * @member {Uint8Array} agentContent - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * ListSessionEntityTypesResponse sessionEntityTypes. + * @member {Array.} sessionEntityTypes + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse * @instance */ - ExportAgentResponse.prototype.agentContent = $util.newBuffer([]); - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + ListSessionEntityTypesResponse.prototype.sessionEntityTypes = $util.emptyArray; /** - * ExportAgentResponse agent. - * @member {"agentUri"|"agentContent"|undefined} agent - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * ListSessionEntityTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse * @instance */ - Object.defineProperty(ExportAgentResponse.prototype, "agent", { - get: $util.oneOfGetter($oneOfFields = ["agentUri", "agentContent"]), - set: $util.oneOfSetter($oneOfFields) - }); + ListSessionEntityTypesResponse.prototype.nextPageToken = ""; /** - * Creates a new ExportAgentResponse instance using the specified properties. + * Creates a new ListSessionEntityTypesResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IExportAgentResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ExportAgentResponse} ExportAgentResponse instance + * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse instance */ - ExportAgentResponse.create = function create(properties) { - return new ExportAgentResponse(properties); + ListSessionEntityTypesResponse.create = function create(properties) { + return new ListSessionEntityTypesResponse(properties); }; /** - * Encodes the specified ExportAgentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentResponse.verify|verify} messages. + * Encodes the specified ListSessionEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IExportAgentResponse} message ExportAgentResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesResponse} message ListSessionEntityTypesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAgentResponse.encode = function encode(message, writer) { + ListSessionEntityTypesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.agentUri); - if (message.agentContent != null && Object.hasOwnProperty.call(message, "agentContent")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.agentContent); + if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) + for (var i = 0; i < message.sessionEntityTypes.length; ++i) + $root.google.cloud.dialogflow.v2.SessionEntityType.encode(message.sessionEntityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ExportAgentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentResponse.verify|verify} messages. + * Encodes the specified ListSessionEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IExportAgentResponse} message ExportAgentResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListSessionEntityTypesResponse} message ListSessionEntityTypesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ExportAgentResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListSessionEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ExportAgentResponse message from the specified reader or buffer. + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ExportAgentResponse} ExportAgentResponse + * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAgentResponse.decode = function decode(reader, length) { + ListSessionEntityTypesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ExportAgentResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.agentUri = reader.string(); + if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) + message.sessionEntityTypes = []; + message.sessionEntityTypes.push($root.google.cloud.dialogflow.v2.SessionEntityType.decode(reader, reader.uint32())); break; case 2: - message.agentContent = reader.bytes(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -34002,130 +34223,133 @@ }; /** - * Decodes an ExportAgentResponse message from the specified reader or buffer, length delimited. + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ExportAgentResponse} ExportAgentResponse + * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ExportAgentResponse.decodeDelimited = function decodeDelimited(reader) { + ListSessionEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ExportAgentResponse message. + * Verifies a ListSessionEntityTypesResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ExportAgentResponse.verify = function verify(message) { + ListSessionEntityTypesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.agentUri != null && message.hasOwnProperty("agentUri")) { - properties.agent = 1; - if (!$util.isString(message.agentUri)) - return "agentUri: string expected"; - } - if (message.agentContent != null && message.hasOwnProperty("agentContent")) { - if (properties.agent === 1) - return "agent: multiple values"; - properties.agent = 1; - if (!(message.agentContent && typeof message.agentContent.length === "number" || $util.isString(message.agentContent))) - return "agentContent: buffer expected"; + if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { + if (!Array.isArray(message.sessionEntityTypes)) + return "sessionEntityTypes: array expected"; + for (var i = 0; i < message.sessionEntityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.SessionEntityType.verify(message.sessionEntityTypes[i]); + if (error) + return "sessionEntityTypes." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an ExportAgentResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListSessionEntityTypesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ExportAgentResponse} ExportAgentResponse + * @returns {google.cloud.dialogflow.v2.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse */ - ExportAgentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ExportAgentResponse) + ListSessionEntityTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ExportAgentResponse(); - if (object.agentUri != null) - message.agentUri = String(object.agentUri); - if (object.agentContent != null) - if (typeof object.agentContent === "string") - $util.base64.decode(object.agentContent, message.agentContent = $util.newBuffer($util.base64.length(object.agentContent)), 0); - else if (object.agentContent.length) - message.agentContent = object.agentContent; + var message = new $root.google.cloud.dialogflow.v2.ListSessionEntityTypesResponse(); + if (object.sessionEntityTypes) { + if (!Array.isArray(object.sessionEntityTypes)) + throw TypeError(".google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.sessionEntityTypes: array expected"); + message.sessionEntityTypes = []; + for (var i = 0; i < object.sessionEntityTypes.length; ++i) { + if (typeof object.sessionEntityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListSessionEntityTypesResponse.sessionEntityTypes: object expected"); + message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.v2.SessionEntityType.fromObject(object.sessionEntityTypes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an ExportAgentResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListSessionEntityTypesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.ExportAgentResponse} message ExportAgentResponse + * @param {google.cloud.dialogflow.v2.ListSessionEntityTypesResponse} message ListSessionEntityTypesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ExportAgentResponse.toObject = function toObject(message, options) { + ListSessionEntityTypesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.agentUri != null && message.hasOwnProperty("agentUri")) { - object.agentUri = message.agentUri; - if (options.oneofs) - object.agent = "agentUri"; - } - if (message.agentContent != null && message.hasOwnProperty("agentContent")) { - object.agentContent = options.bytes === String ? $util.base64.encode(message.agentContent, 0, message.agentContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.agentContent) : message.agentContent; - if (options.oneofs) - object.agent = "agentContent"; + if (options.arrays || options.defaults) + object.sessionEntityTypes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sessionEntityTypes && message.sessionEntityTypes.length) { + object.sessionEntityTypes = []; + for (var j = 0; j < message.sessionEntityTypes.length; ++j) + object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.v2.SessionEntityType.toObject(message.sessionEntityTypes[j], options); } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this ExportAgentResponse to JSON. + * Converts this ListSessionEntityTypesResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @memberof google.cloud.dialogflow.v2.ListSessionEntityTypesResponse * @instance * @returns {Object.} JSON object */ - ExportAgentResponse.prototype.toJSON = function toJSON() { + ListSessionEntityTypesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ExportAgentResponse; + return ListSessionEntityTypesResponse; })(); - v2beta1.ImportAgentRequest = (function() { + v2.GetSessionEntityTypeRequest = (function() { /** - * Properties of an ImportAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IImportAgentRequest - * @property {string|null} [parent] ImportAgentRequest parent - * @property {string|null} [agentUri] ImportAgentRequest agentUri - * @property {Uint8Array|null} [agentContent] ImportAgentRequest agentContent + * Properties of a GetSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IGetSessionEntityTypeRequest + * @property {string|null} [name] GetSessionEntityTypeRequest name */ /** - * Constructs a new ImportAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an ImportAgentRequest. - * @implements IImportAgentRequest + * Constructs a new GetSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a GetSessionEntityTypeRequest. + * @implements IGetSessionEntityTypeRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IImportAgentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest=} [properties] Properties to set */ - function ImportAgentRequest(properties) { + function GetSessionEntityTypeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34133,115 +34357,75 @@ } /** - * ImportAgentRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest - * @instance - */ - ImportAgentRequest.prototype.parent = ""; - - /** - * ImportAgentRequest agentUri. - * @member {string} agentUri - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest - * @instance - */ - ImportAgentRequest.prototype.agentUri = ""; - - /** - * ImportAgentRequest agentContent. - * @member {Uint8Array} agentContent - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest - * @instance - */ - ImportAgentRequest.prototype.agentContent = $util.newBuffer([]); - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ImportAgentRequest agent. - * @member {"agentUri"|"agentContent"|undefined} agent - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * GetSessionEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest * @instance */ - Object.defineProperty(ImportAgentRequest.prototype, "agent", { - get: $util.oneOfGetter($oneOfFields = ["agentUri", "agentContent"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetSessionEntityTypeRequest.prototype.name = ""; /** - * Creates a new ImportAgentRequest instance using the specified properties. + * Creates a new GetSessionEntityTypeRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IImportAgentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ImportAgentRequest} ImportAgentRequest instance + * @param {google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest instance */ - ImportAgentRequest.create = function create(properties) { - return new ImportAgentRequest(properties); + GetSessionEntityTypeRequest.create = function create(properties) { + return new GetSessionEntityTypeRequest(properties); }; /** - * Encodes the specified ImportAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportAgentRequest.verify|verify} messages. + * Encodes the specified GetSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetSessionEntityTypeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IImportAgentRequest} message ImportAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest} message GetSessionEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportAgentRequest.encode = function encode(message, writer) { + GetSessionEntityTypeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentUri); - if (message.agentContent != null && Object.hasOwnProperty.call(message, "agentContent")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.agentContent); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified ImportAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportAgentRequest.verify|verify} messages. + * Encodes the specified GetSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetSessionEntityTypeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IImportAgentRequest} message ImportAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IGetSessionEntityTypeRequest} message GetSessionEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ImportAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an ImportAgentRequest message from the specified reader or buffer. + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ImportAgentRequest} ImportAgentRequest + * @returns {google.cloud.dialogflow.v2.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportAgentRequest.decode = function decode(reader, length) { + GetSessionEntityTypeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ImportAgentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetSessionEntityTypeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.agentUri = reader.string(); - break; - case 3: - message.agentContent = reader.bytes(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -34252,139 +34436,108 @@ }; /** - * Decodes an ImportAgentRequest message from the specified reader or buffer, length delimited. + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ImportAgentRequest} ImportAgentRequest + * @returns {google.cloud.dialogflow.v2.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ImportAgentRequest.decodeDelimited = function decodeDelimited(reader) { + GetSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an ImportAgentRequest message. + * Verifies a GetSessionEntityTypeRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ImportAgentRequest.verify = function verify(message) { + GetSessionEntityTypeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.agentUri != null && message.hasOwnProperty("agentUri")) { - properties.agent = 1; - if (!$util.isString(message.agentUri)) - return "agentUri: string expected"; - } - if (message.agentContent != null && message.hasOwnProperty("agentContent")) { - if (properties.agent === 1) - return "agent: multiple values"; - properties.agent = 1; - if (!(message.agentContent && typeof message.agentContent.length === "number" || $util.isString(message.agentContent))) - return "agentContent: buffer expected"; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates an ImportAgentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ImportAgentRequest} ImportAgentRequest + * @returns {google.cloud.dialogflow.v2.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest */ - ImportAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ImportAgentRequest) + GetSessionEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.GetSessionEntityTypeRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ImportAgentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.agentUri != null) - message.agentUri = String(object.agentUri); - if (object.agentContent != null) - if (typeof object.agentContent === "string") - $util.base64.decode(object.agentContent, message.agentContent = $util.newBuffer($util.base64.length(object.agentContent)), 0); - else if (object.agentContent.length) - message.agentContent = object.agentContent; + var message = new $root.google.cloud.dialogflow.v2.GetSessionEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from an ImportAgentRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetSessionEntityTypeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ImportAgentRequest} message ImportAgentRequest + * @param {google.cloud.dialogflow.v2.GetSessionEntityTypeRequest} message GetSessionEntityTypeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ImportAgentRequest.toObject = function toObject(message, options) { + GetSessionEntityTypeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.agentUri != null && message.hasOwnProperty("agentUri")) { - object.agentUri = message.agentUri; - if (options.oneofs) - object.agent = "agentUri"; - } - if (message.agentContent != null && message.hasOwnProperty("agentContent")) { - object.agentContent = options.bytes === String ? $util.base64.encode(message.agentContent, 0, message.agentContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.agentContent) : message.agentContent; - if (options.oneofs) - object.agent = "agentContent"; - } + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this ImportAgentRequest to JSON. + * Converts this GetSessionEntityTypeRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @memberof google.cloud.dialogflow.v2.GetSessionEntityTypeRequest * @instance * @returns {Object.} JSON object */ - ImportAgentRequest.prototype.toJSON = function toJSON() { + GetSessionEntityTypeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ImportAgentRequest; + return GetSessionEntityTypeRequest; })(); - v2beta1.RestoreAgentRequest = (function() { + v2.CreateSessionEntityTypeRequest = (function() { /** - * Properties of a RestoreAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IRestoreAgentRequest - * @property {string|null} [parent] RestoreAgentRequest parent - * @property {string|null} [agentUri] RestoreAgentRequest agentUri - * @property {Uint8Array|null} [agentContent] RestoreAgentRequest agentContent + * Properties of a CreateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface ICreateSessionEntityTypeRequest + * @property {string|null} [parent] CreateSessionEntityTypeRequest parent + * @property {google.cloud.dialogflow.v2.ISessionEntityType|null} [sessionEntityType] CreateSessionEntityTypeRequest sessionEntityType */ /** - * Constructs a new RestoreAgentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a RestoreAgentRequest. - * @implements IRestoreAgentRequest + * Constructs a new CreateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a CreateSessionEntityTypeRequest. + * @implements ICreateSessionEntityTypeRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IRestoreAgentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest=} [properties] Properties to set */ - function RestoreAgentRequest(properties) { + function CreateSessionEntityTypeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34392,104 +34545,80 @@ } /** - * RestoreAgentRequest parent. + * CreateSessionEntityTypeRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest - * @instance - */ - RestoreAgentRequest.prototype.parent = ""; - - /** - * RestoreAgentRequest agentUri. - * @member {string} agentUri - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest - * @instance - */ - RestoreAgentRequest.prototype.agentUri = ""; - - /** - * RestoreAgentRequest agentContent. - * @member {Uint8Array} agentContent - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest * @instance */ - RestoreAgentRequest.prototype.agentContent = $util.newBuffer([]); - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + CreateSessionEntityTypeRequest.prototype.parent = ""; /** - * RestoreAgentRequest agent. - * @member {"agentUri"|"agentContent"|undefined} agent - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * CreateSessionEntityTypeRequest sessionEntityType. + * @member {google.cloud.dialogflow.v2.ISessionEntityType|null|undefined} sessionEntityType + * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest * @instance */ - Object.defineProperty(RestoreAgentRequest.prototype, "agent", { - get: $util.oneOfGetter($oneOfFields = ["agentUri", "agentContent"]), - set: $util.oneOfSetter($oneOfFields) - }); + CreateSessionEntityTypeRequest.prototype.sessionEntityType = null; /** - * Creates a new RestoreAgentRequest instance using the specified properties. + * Creates a new CreateSessionEntityTypeRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IRestoreAgentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.RestoreAgentRequest} RestoreAgentRequest instance + * @param {google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest instance */ - RestoreAgentRequest.create = function create(properties) { - return new RestoreAgentRequest(properties); + CreateSessionEntityTypeRequest.create = function create(properties) { + return new CreateSessionEntityTypeRequest(properties); }; /** - * Encodes the specified RestoreAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.RestoreAgentRequest.verify|verify} messages. + * Encodes the specified CreateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IRestoreAgentRequest} message RestoreAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreAgentRequest.encode = function encode(message, writer) { + CreateSessionEntityTypeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentUri); - if (message.agentContent != null && Object.hasOwnProperty.call(message, "agentContent")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.agentContent); + if (message.sessionEntityType != null && Object.hasOwnProperty.call(message, "sessionEntityType")) + $root.google.cloud.dialogflow.v2.SessionEntityType.encode(message.sessionEntityType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified RestoreAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.RestoreAgentRequest.verify|verify} messages. + * Encodes the specified CreateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IRestoreAgentRequest} message RestoreAgentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - RestoreAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a RestoreAgentRequest message from the specified reader or buffer. + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.RestoreAgentRequest} RestoreAgentRequest + * @returns {google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestoreAgentRequest.decode = function decode(reader, length) { + CreateSessionEntityTypeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.RestoreAgentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -34497,10 +34626,7 @@ message.parent = reader.string(); break; case 2: - message.agentUri = reader.string(); - break; - case 3: - message.agentContent = reader.bytes(); + message.sessionEntityType = $root.google.cloud.dialogflow.v2.SessionEntityType.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -34511,138 +34637,122 @@ }; /** - * Decodes a RestoreAgentRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.RestoreAgentRequest} RestoreAgentRequest + * @returns {google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - RestoreAgentRequest.decodeDelimited = function decodeDelimited(reader) { + CreateSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a RestoreAgentRequest message. + * Verifies a CreateSessionEntityTypeRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - RestoreAgentRequest.verify = function verify(message) { + CreateSessionEntityTypeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.agentUri != null && message.hasOwnProperty("agentUri")) { - properties.agent = 1; - if (!$util.isString(message.agentUri)) - return "agentUri: string expected"; - } - if (message.agentContent != null && message.hasOwnProperty("agentContent")) { - if (properties.agent === 1) - return "agent: multiple values"; - properties.agent = 1; - if (!(message.agentContent && typeof message.agentContent.length === "number" || $util.isString(message.agentContent))) - return "agentContent: buffer expected"; + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) { + var error = $root.google.cloud.dialogflow.v2.SessionEntityType.verify(message.sessionEntityType); + if (error) + return "sessionEntityType." + error; } return null; }; /** - * Creates a RestoreAgentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.RestoreAgentRequest} RestoreAgentRequest + * @returns {google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest */ - RestoreAgentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.RestoreAgentRequest) + CreateSessionEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.RestoreAgentRequest(); + var message = new $root.google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.agentUri != null) - message.agentUri = String(object.agentUri); - if (object.agentContent != null) - if (typeof object.agentContent === "string") - $util.base64.decode(object.agentContent, message.agentContent = $util.newBuffer($util.base64.length(object.agentContent)), 0); - else if (object.agentContent.length) - message.agentContent = object.agentContent; + if (object.sessionEntityType != null) { + if (typeof object.sessionEntityType !== "object") + throw TypeError(".google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest.sessionEntityType: object expected"); + message.sessionEntityType = $root.google.cloud.dialogflow.v2.SessionEntityType.fromObject(object.sessionEntityType); + } return message; }; /** - * Creates a plain object from a RestoreAgentRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateSessionEntityTypeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.RestoreAgentRequest} message RestoreAgentRequest + * @param {google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - RestoreAgentRequest.toObject = function toObject(message, options) { + CreateSessionEntityTypeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.parent = ""; + object.sessionEntityType = null; + } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.agentUri != null && message.hasOwnProperty("agentUri")) { - object.agentUri = message.agentUri; - if (options.oneofs) - object.agent = "agentUri"; - } - if (message.agentContent != null && message.hasOwnProperty("agentContent")) { - object.agentContent = options.bytes === String ? $util.base64.encode(message.agentContent, 0, message.agentContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.agentContent) : message.agentContent; - if (options.oneofs) - object.agent = "agentContent"; - } + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) + object.sessionEntityType = $root.google.cloud.dialogflow.v2.SessionEntityType.toObject(message.sessionEntityType, options); return object; }; /** - * Converts this RestoreAgentRequest to JSON. + * Converts this CreateSessionEntityTypeRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @memberof google.cloud.dialogflow.v2.CreateSessionEntityTypeRequest * @instance * @returns {Object.} JSON object */ - RestoreAgentRequest.prototype.toJSON = function toJSON() { + CreateSessionEntityTypeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return RestoreAgentRequest; + return CreateSessionEntityTypeRequest; })(); - v2beta1.GetValidationResultRequest = (function() { + v2.UpdateSessionEntityTypeRequest = (function() { /** - * Properties of a GetValidationResultRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IGetValidationResultRequest - * @property {string|null} [parent] GetValidationResultRequest parent - * @property {string|null} [languageCode] GetValidationResultRequest languageCode + * Properties of an UpdateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IUpdateSessionEntityTypeRequest + * @property {google.cloud.dialogflow.v2.ISessionEntityType|null} [sessionEntityType] UpdateSessionEntityTypeRequest sessionEntityType + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSessionEntityTypeRequest updateMask */ /** - * Constructs a new GetValidationResultRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a GetValidationResultRequest. - * @implements IGetValidationResultRequest + * Constructs a new UpdateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an UpdateSessionEntityTypeRequest. + * @implements IUpdateSessionEntityTypeRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IGetValidationResultRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest=} [properties] Properties to set */ - function GetValidationResultRequest(properties) { + function UpdateSessionEntityTypeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34650,88 +34760,88 @@ } /** - * GetValidationResultRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * UpdateSessionEntityTypeRequest sessionEntityType. + * @member {google.cloud.dialogflow.v2.ISessionEntityType|null|undefined} sessionEntityType + * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest * @instance */ - GetValidationResultRequest.prototype.parent = ""; + UpdateSessionEntityTypeRequest.prototype.sessionEntityType = null; /** - * GetValidationResultRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * UpdateSessionEntityTypeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest * @instance */ - GetValidationResultRequest.prototype.languageCode = ""; + UpdateSessionEntityTypeRequest.prototype.updateMask = null; /** - * Creates a new GetValidationResultRequest instance using the specified properties. + * Creates a new UpdateSessionEntityTypeRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetValidationResultRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.GetValidationResultRequest} GetValidationResultRequest instance + * @param {google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest instance */ - GetValidationResultRequest.create = function create(properties) { - return new GetValidationResultRequest(properties); + UpdateSessionEntityTypeRequest.create = function create(properties) { + return new UpdateSessionEntityTypeRequest(properties); }; /** - * Encodes the specified GetValidationResultRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetValidationResultRequest.verify|verify} messages. + * Encodes the specified UpdateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetValidationResultRequest} message GetValidationResultRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetValidationResultRequest.encode = function encode(message, writer) { + UpdateSessionEntityTypeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.sessionEntityType != null && Object.hasOwnProperty.call(message, "sessionEntityType")) + $root.google.cloud.dialogflow.v2.SessionEntityType.encode(message.sessionEntityType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetValidationResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetValidationResultRequest.verify|verify} messages. + * Encodes the specified UpdateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetValidationResultRequest} message GetValidationResultRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IUpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetValidationResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetValidationResultRequest message from the specified reader or buffer. + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.GetValidationResultRequest} GetValidationResultRequest + * @returns {google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetValidationResultRequest.decode = function decode(reader, length) { + UpdateSessionEntityTypeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetValidationResultRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.sessionEntityType = $root.google.cloud.dialogflow.v2.SessionEntityType.decode(reader, reader.uint32()); break; - case 3: - message.languageCode = reader.string(); + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -34742,188 +34852,126 @@ }; /** - * Decodes a GetValidationResultRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.GetValidationResultRequest} GetValidationResultRequest + * @returns {google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetValidationResultRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetValidationResultRequest message. + * Verifies an UpdateSessionEntityTypeRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetValidationResultRequest.verify = function verify(message) { + UpdateSessionEntityTypeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) { + var error = $root.google.cloud.dialogflow.v2.SessionEntityType.verify(message.sessionEntityType); + if (error) + return "sessionEntityType." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a GetValidationResultRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.GetValidationResultRequest} GetValidationResultRequest + * @returns {google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest */ - GetValidationResultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetValidationResultRequest) + UpdateSessionEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.GetValidationResultRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); + var message = new $root.google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest(); + if (object.sessionEntityType != null) { + if (typeof object.sessionEntityType !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.sessionEntityType: object expected"); + message.sessionEntityType = $root.google.cloud.dialogflow.v2.SessionEntityType.fromObject(object.sessionEntityType); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a GetValidationResultRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateSessionEntityTypeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.GetValidationResultRequest} message GetValidationResultRequest + * @param {google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetValidationResultRequest.toObject = function toObject(message, options) { + UpdateSessionEntityTypeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.languageCode = ""; + object.sessionEntityType = null; + object.updateMask = null; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) + object.sessionEntityType = $root.google.cloud.dialogflow.v2.SessionEntityType.toObject(message.sessionEntityType, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this GetValidationResultRequest to JSON. + * Converts this UpdateSessionEntityTypeRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @memberof google.cloud.dialogflow.v2.UpdateSessionEntityTypeRequest * @instance * @returns {Object.} JSON object */ - GetValidationResultRequest.prototype.toJSON = function toJSON() { + UpdateSessionEntityTypeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetValidationResultRequest; - })(); - - v2beta1.Environments = (function() { - - /** - * Constructs a new Environments service. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an Environments - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Environments(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Environments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Environments; - - /** - * Creates new Environments service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Environments - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Environments} RPC service. Useful where requests and/or responses are streamed. - */ - Environments.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Environments#listEnvironments}. - * @memberof google.cloud.dialogflow.v2beta1.Environments - * @typedef ListEnvironmentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse} [response] ListEnvironmentsResponse - */ - - /** - * Calls ListEnvironments. - * @function listEnvironments - * @memberof google.cloud.dialogflow.v2beta1.Environments - * @instance - * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Environments.ListEnvironmentsCallback} callback Node-style callback called with the error, if any, and ListEnvironmentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Environments.prototype.listEnvironments = function listEnvironments(request, callback) { - return this.rpcCall(listEnvironments, $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest, $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse, request, callback); - }, "name", { value: "ListEnvironments" }); - - /** - * Calls ListEnvironments. - * @function listEnvironments - * @memberof google.cloud.dialogflow.v2beta1.Environments - * @instance - * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Environments; + return UpdateSessionEntityTypeRequest; })(); - v2beta1.Environment = (function() { + v2.DeleteSessionEntityTypeRequest = (function() { /** - * Properties of an Environment. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IEnvironment - * @property {string|null} [name] Environment name - * @property {string|null} [description] Environment description - * @property {string|null} [agentVersion] Environment agentVersion - * @property {google.cloud.dialogflow.v2beta1.Environment.State|null} [state] Environment state - * @property {google.protobuf.ITimestamp|null} [updateTime] Environment updateTime + * Properties of a DeleteSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IDeleteSessionEntityTypeRequest + * @property {string|null} [name] DeleteSessionEntityTypeRequest name */ /** - * Constructs a new Environment. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an Environment. - * @implements IEnvironment + * Constructs a new DeleteSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a DeleteSessionEntityTypeRequest. + * @implements IDeleteSessionEntityTypeRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IEnvironment=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest=} [properties] Properties to set */ - function Environment(properties) { + function DeleteSessionEntityTypeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -34931,128 +34979,76 @@ } /** - * Environment name. + * DeleteSessionEntityTypeRequest name. * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.Environment + * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest * @instance */ - Environment.prototype.name = ""; + DeleteSessionEntityTypeRequest.prototype.name = ""; /** - * Environment description. - * @member {string} description - * @memberof google.cloud.dialogflow.v2beta1.Environment - * @instance + * Creates a new DeleteSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest instance */ - Environment.prototype.description = ""; + DeleteSessionEntityTypeRequest.create = function create(properties) { + return new DeleteSessionEntityTypeRequest(properties); + }; /** - * Environment agentVersion. - * @member {string} agentVersion - * @memberof google.cloud.dialogflow.v2beta1.Environment - * @instance + * Encodes the specified DeleteSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Environment.prototype.agentVersion = ""; + DeleteSessionEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; /** - * Environment state. - * @member {google.cloud.dialogflow.v2beta1.Environment.State} state - * @memberof google.cloud.dialogflow.v2beta1.Environment - * @instance - */ - Environment.prototype.state = 0; - - /** - * Environment updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.dialogflow.v2beta1.Environment - * @instance - */ - Environment.prototype.updateTime = null; - - /** - * Creates a new Environment instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Environment - * @static - * @param {google.cloud.dialogflow.v2beta1.IEnvironment=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Environment} Environment instance - */ - Environment.create = function create(properties) { - return new Environment(properties); - }; - - /** - * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Environment.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Environment - * @static - * @param {google.cloud.dialogflow.v2beta1.IEnvironment} message Environment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Environment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.agentVersion != null && Object.hasOwnProperty.call(message, "agentVersion")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.agentVersion); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Environment.verify|verify} messages. + * Encodes the specified DeleteSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Environment + * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IEnvironment} message Environment message or plain object to encode + * @param {google.cloud.dialogflow.v2.IDeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Environment.encodeDelimited = function encodeDelimited(message, writer) { + DeleteSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Environment message from the specified reader or buffer. + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Environment + * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Environment} Environment + * @returns {google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Environment.decode = function decode(reader, length) { + DeleteSessionEntityTypeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Environment(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; - case 2: - message.description = reader.string(); - break; - case 3: - message.agentVersion = reader.string(); - break; - case 4: - message.state = reader.int32(); - break; - case 5: - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -35062,651 +35058,478 @@ }; /** - * Decodes an Environment message from the specified reader or buffer, length delimited. + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Environment + * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Environment} Environment + * @returns {google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Environment.decodeDelimited = function decodeDelimited(reader) { + DeleteSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Environment message. + * Verifies a DeleteSessionEntityTypeRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Environment + * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Environment.verify = function verify(message) { + DeleteSessionEntityTypeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.agentVersion != null && message.hasOwnProperty("agentVersion")) - if (!$util.isString(message.agentVersion)) - return "agentVersion: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } return null; }; /** - * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Environment + * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Environment} Environment + * @returns {google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest */ - Environment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Environment) + DeleteSessionEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Environment(); + var message = new $root.google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest(); if (object.name != null) message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.agentVersion != null) - message.agentVersion = String(object.agentVersion); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "STOPPED": - case 1: - message.state = 1; - break; - case "LOADING": - case 2: - message.state = 2; - break; - case "RUNNING": - case 3: - message.state = 3; - break; - } - if (object.updateTime != null) { - if (typeof object.updateTime !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Environment.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } return message; }; /** - * Creates a plain object from an Environment message. Also converts values to other types if specified. + * Creates a plain object from a DeleteSessionEntityTypeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Environment + * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.Environment} message Environment + * @param {google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Environment.toObject = function toObject(message, options) { + DeleteSessionEntityTypeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.description = ""; - object.agentVersion = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.updateTime = null; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.agentVersion != null && message.hasOwnProperty("agentVersion")) - object.agentVersion = message.agentVersion; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Environment.State[message.state] : message.state; - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this Environment to JSON. + * Converts this DeleteSessionEntityTypeRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Environment + * @memberof google.cloud.dialogflow.v2.DeleteSessionEntityTypeRequest * @instance * @returns {Object.} JSON object */ - Environment.prototype.toJSON = function toJSON() { + DeleteSessionEntityTypeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.dialogflow.v2beta1.Environment.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} STOPPED=1 STOPPED value - * @property {number} LOADING=2 LOADING value - * @property {number} RUNNING=3 RUNNING value - */ - Environment.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "STOPPED"] = 1; - values[valuesById[2] = "LOADING"] = 2; - values[valuesById[3] = "RUNNING"] = 3; - return values; - })(); - - return Environment; + return DeleteSessionEntityTypeRequest; })(); - v2beta1.ListEnvironmentsRequest = (function() { - - /** - * Properties of a ListEnvironmentsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListEnvironmentsRequest - * @property {string|null} [parent] ListEnvironmentsRequest parent - * @property {number|null} [pageSize] ListEnvironmentsRequest pageSize - * @property {string|null} [pageToken] ListEnvironmentsRequest pageToken - */ + v2.EntityTypes = (function() { /** - * Constructs a new ListEnvironmentsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListEnvironmentsRequest. - * @implements IListEnvironmentsRequest + * Constructs a new EntityTypes service. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an EntityTypes + * @extends $protobuf.rpc.Service * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest=} [properties] Properties to set + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function ListEnvironmentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + function EntityTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } + (EntityTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EntityTypes; + /** - * ListEnvironmentsRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest - * @instance + * Creates new EntityTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {EntityTypes} RPC service. Useful where requests and/or responses are streamed. */ - ListEnvironmentsRequest.prototype.parent = ""; + EntityTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * ListEnvironmentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest - * @instance + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#listEntityTypes}. + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @typedef ListEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.ListEntityTypesResponse} [response] ListEntityTypesResponse */ - ListEnvironmentsRequest.prototype.pageSize = 0; /** - * ListEnvironmentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * Calls ListEntityTypes. + * @function listEntityTypes + * @memberof google.cloud.dialogflow.v2.EntityTypes * @instance + * @param {google.cloud.dialogflow.v2.IListEntityTypesRequest} request ListEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.v2.EntityTypes.ListEntityTypesCallback} callback Node-style callback called with the error, if any, and ListEntityTypesResponse + * @returns {undefined} + * @variation 1 */ - ListEnvironmentsRequest.prototype.pageToken = ""; + Object.defineProperty(EntityTypes.prototype.listEntityTypes = function listEntityTypes(request, callback) { + return this.rpcCall(listEntityTypes, $root.google.cloud.dialogflow.v2.ListEntityTypesRequest, $root.google.cloud.dialogflow.v2.ListEntityTypesResponse, request, callback); + }, "name", { value: "ListEntityTypes" }); /** - * Creates a new ListEnvironmentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest} ListEnvironmentsRequest instance + * Calls ListEntityTypes. + * @function listEntityTypes + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IListEntityTypesRequest} request ListEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListEnvironmentsRequest.create = function create(properties) { - return new ListEnvironmentsRequest(properties); - }; /** - * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#getEntityType}. + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @typedef GetEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.EntityType} [response] EntityType */ - ListEnvironmentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - return writer; - }; /** - * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls GetEntityType. + * @function getEntityType + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IGetEntityTypeRequest} request GetEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2.EntityTypes.GetEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @returns {undefined} + * @variation 1 */ - ListEnvironmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(EntityTypes.prototype.getEntityType = function getEntityType(request, callback) { + return this.rpcCall(getEntityType, $root.google.cloud.dialogflow.v2.GetEntityTypeRequest, $root.google.cloud.dialogflow.v2.EntityType, request, callback); + }, "name", { value: "GetEntityType" }); /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest} ListEnvironmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls GetEntityType. + * @function getEntityType + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IGetEntityTypeRequest} request GetEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListEnvironmentsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest} ListEnvironmentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#createEntityType}. + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @typedef CreateEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.EntityType} [response] EntityType */ - ListEnvironmentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a ListEnvironmentsRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls CreateEntityType. + * @function createEntityType + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.ICreateEntityTypeRequest} request CreateEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2.EntityTypes.CreateEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @returns {undefined} + * @variation 1 */ - ListEnvironmentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; + Object.defineProperty(EntityTypes.prototype.createEntityType = function createEntityType(request, callback) { + return this.rpcCall(createEntityType, $root.google.cloud.dialogflow.v2.CreateEntityTypeRequest, $root.google.cloud.dialogflow.v2.EntityType, request, callback); + }, "name", { value: "CreateEntityType" }); /** - * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest} ListEnvironmentsRequest + * Calls CreateEntityType. + * @function createEntityType + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.ICreateEntityTypeRequest} request CreateEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListEnvironmentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; /** - * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest} message ListEnvironmentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#updateEntityType}. + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @typedef UpdateEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.EntityType} [response] EntityType */ - ListEnvironmentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; /** - * Converts this ListEnvironmentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * Calls UpdateEntityType. + * @function updateEntityType + * @memberof google.cloud.dialogflow.v2.EntityTypes * @instance - * @returns {Object.} JSON object + * @param {google.cloud.dialogflow.v2.IUpdateEntityTypeRequest} request UpdateEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2.EntityTypes.UpdateEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @returns {undefined} + * @variation 1 */ - ListEnvironmentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ListEnvironmentsRequest; - })(); - - v2beta1.ListEnvironmentsResponse = (function() { + Object.defineProperty(EntityTypes.prototype.updateEntityType = function updateEntityType(request, callback) { + return this.rpcCall(updateEntityType, $root.google.cloud.dialogflow.v2.UpdateEntityTypeRequest, $root.google.cloud.dialogflow.v2.EntityType, request, callback); + }, "name", { value: "UpdateEntityType" }); /** - * Properties of a ListEnvironmentsResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListEnvironmentsResponse - * @property {Array.|null} [environments] ListEnvironmentsResponse environments - * @property {string|null} [nextPageToken] ListEnvironmentsResponse nextPageToken + * Calls UpdateEntityType. + * @function updateEntityType + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateEntityTypeRequest} request UpdateEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ /** - * Constructs a new ListEnvironmentsResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListEnvironmentsResponse. - * @implements IListEnvironmentsResponse - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse=} [properties] Properties to set + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#deleteEntityType}. + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @typedef DeleteEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - function ListEnvironmentsResponse(properties) { - this.environments = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } /** - * ListEnvironmentsResponse environments. - * @member {Array.} environments - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * Calls DeleteEntityType. + * @function deleteEntityType + * @memberof google.cloud.dialogflow.v2.EntityTypes * @instance + * @param {google.cloud.dialogflow.v2.IDeleteEntityTypeRequest} request DeleteEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2.EntityTypes.DeleteEntityTypeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - ListEnvironmentsResponse.prototype.environments = $util.emptyArray; + Object.defineProperty(EntityTypes.prototype.deleteEntityType = function deleteEntityType(request, callback) { + return this.rpcCall(deleteEntityType, $root.google.cloud.dialogflow.v2.DeleteEntityTypeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEntityType" }); /** - * ListEnvironmentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * Calls DeleteEntityType. + * @function deleteEntityType + * @memberof google.cloud.dialogflow.v2.EntityTypes * @instance + * @param {google.cloud.dialogflow.v2.IDeleteEntityTypeRequest} request DeleteEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListEnvironmentsResponse.prototype.nextPageToken = ""; /** - * Creates a new ListEnvironmentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse} ListEnvironmentsResponse instance + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchUpdateEntityTypes}. + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @typedef BatchUpdateEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListEnvironmentsResponse.create = function create(properties) { - return new ListEnvironmentsResponse(properties); - }; /** - * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls BatchUpdateEntityTypes. + * @function batchUpdateEntityTypes + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest} request BatchUpdateEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntityTypesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListEnvironmentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.environments != null && message.environments.length) - for (var i = 0; i < message.environments.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Environment.encode(message.environments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); - return writer; - }; + Object.defineProperty(EntityTypes.prototype.batchUpdateEntityTypes = function batchUpdateEntityTypes(request, callback) { + return this.rpcCall(batchUpdateEntityTypes, $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchUpdateEntityTypes" }); /** - * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls BatchUpdateEntityTypes. + * @function batchUpdateEntityTypes + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest} request BatchUpdateEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListEnvironmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse} ListEnvironmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchDeleteEntityTypes}. + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @typedef BatchDeleteEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListEnvironmentsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.environments && message.environments.length)) - message.environments = []; - message.environments.push($root.google.cloud.dialogflow.v2beta1.Environment.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse} ListEnvironmentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls BatchDeleteEntityTypes. + * @function batchDeleteEntityTypes + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest} request BatchDeleteEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntityTypesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListEnvironmentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(EntityTypes.prototype.batchDeleteEntityTypes = function batchDeleteEntityTypes(request, callback) { + return this.rpcCall(batchDeleteEntityTypes, $root.google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchDeleteEntityTypes" }); /** - * Verifies a ListEnvironmentsResponse message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls BatchDeleteEntityTypes. + * @function batchDeleteEntityTypes + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest} request BatchDeleteEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListEnvironmentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.environments != null && message.hasOwnProperty("environments")) { - if (!Array.isArray(message.environments)) - return "environments: array expected"; - for (var i = 0; i < message.environments.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Environment.verify(message.environments[i]); - if (error) - return "environments." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; /** - * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse} ListEnvironmentsResponse + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchCreateEntities}. + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @typedef BatchCreateEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - ListEnvironmentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse(); - if (object.environments) { - if (!Array.isArray(object.environments)) - throw TypeError(".google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse.environments: array expected"); - message.environments = []; - for (var i = 0; i < object.environments.length; ++i) { - if (typeof object.environments[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse.environments: object expected"); - message.environments[i] = $root.google.cloud.dialogflow.v2beta1.Environment.fromObject(object.environments[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; /** - * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse} message ListEnvironmentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls BatchCreateEntities. + * @function batchCreateEntities + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest} request BatchCreateEntitiesRequest message or plain object + * @param {google.cloud.dialogflow.v2.EntityTypes.BatchCreateEntitiesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - ListEnvironmentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.environments = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.environments && message.environments.length) { - object.environments = []; - for (var j = 0; j < message.environments.length; ++j) - object.environments[j] = $root.google.cloud.dialogflow.v2beta1.Environment.toObject(message.environments[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; + Object.defineProperty(EntityTypes.prototype.batchCreateEntities = function batchCreateEntities(request, callback) { + return this.rpcCall(batchCreateEntities, $root.google.cloud.dialogflow.v2.BatchCreateEntitiesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchCreateEntities" }); /** - * Converts this ListEnvironmentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * Calls BatchCreateEntities. + * @function batchCreateEntities + * @memberof google.cloud.dialogflow.v2.EntityTypes * @instance - * @returns {Object.} JSON object + * @param {google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest} request BatchCreateEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListEnvironmentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return ListEnvironmentsResponse; + /** + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchUpdateEntities}. + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @typedef BatchUpdateEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchUpdateEntities. + * @function batchUpdateEntities + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest} request BatchUpdateEntitiesRequest message or plain object + * @param {google.cloud.dialogflow.v2.EntityTypes.BatchUpdateEntitiesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.batchUpdateEntities = function batchUpdateEntities(request, callback) { + return this.rpcCall(batchUpdateEntities, $root.google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchUpdateEntities" }); + + /** + * Calls BatchUpdateEntities. + * @function batchUpdateEntities + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest} request BatchUpdateEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.EntityTypes#batchDeleteEntities}. + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @typedef BatchDeleteEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchDeleteEntities. + * @function batchDeleteEntities + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest} request BatchDeleteEntitiesRequest message or plain object + * @param {google.cloud.dialogflow.v2.EntityTypes.BatchDeleteEntitiesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.batchDeleteEntities = function batchDeleteEntities(request, callback) { + return this.rpcCall(batchDeleteEntities, $root.google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchDeleteEntities" }); + + /** + * Calls BatchDeleteEntities. + * @function batchDeleteEntities + * @memberof google.cloud.dialogflow.v2.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest} request BatchDeleteEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return EntityTypes; })(); - v2beta1.SpeechContext = (function() { + v2.EntityType = (function() { /** - * Properties of a SpeechContext. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface ISpeechContext - * @property {Array.|null} [phrases] SpeechContext phrases - * @property {number|null} [boost] SpeechContext boost + * Properties of an EntityType. + * @memberof google.cloud.dialogflow.v2 + * @interface IEntityType + * @property {string|null} [name] EntityType name + * @property {string|null} [displayName] EntityType displayName + * @property {google.cloud.dialogflow.v2.EntityType.Kind|null} [kind] EntityType kind + * @property {google.cloud.dialogflow.v2.EntityType.AutoExpansionMode|null} [autoExpansionMode] EntityType autoExpansionMode + * @property {Array.|null} [entities] EntityType entities + * @property {boolean|null} [enableFuzzyExtraction] EntityType enableFuzzyExtraction */ /** - * Constructs a new SpeechContext. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a SpeechContext. - * @implements ISpeechContext + * Constructs a new EntityType. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an EntityType. + * @implements IEntityType * @constructor - * @param {google.cloud.dialogflow.v2beta1.ISpeechContext=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IEntityType=} [properties] Properties to set */ - function SpeechContext(properties) { - this.phrases = []; + function EntityType(properties) { + this.entities = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -35714,91 +35537,143 @@ } /** - * SpeechContext phrases. - * @member {Array.} phrases - * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * EntityType name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.EntityType * @instance */ - SpeechContext.prototype.phrases = $util.emptyArray; + EntityType.prototype.name = ""; /** - * SpeechContext boost. - * @member {number} boost - * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * EntityType displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2.EntityType * @instance */ - SpeechContext.prototype.boost = 0; + EntityType.prototype.displayName = ""; /** - * Creates a new SpeechContext instance using the specified properties. + * EntityType kind. + * @member {google.cloud.dialogflow.v2.EntityType.Kind} kind + * @memberof google.cloud.dialogflow.v2.EntityType + * @instance + */ + EntityType.prototype.kind = 0; + + /** + * EntityType autoExpansionMode. + * @member {google.cloud.dialogflow.v2.EntityType.AutoExpansionMode} autoExpansionMode + * @memberof google.cloud.dialogflow.v2.EntityType + * @instance + */ + EntityType.prototype.autoExpansionMode = 0; + + /** + * EntityType entities. + * @member {Array.} entities + * @memberof google.cloud.dialogflow.v2.EntityType + * @instance + */ + EntityType.prototype.entities = $util.emptyArray; + + /** + * EntityType enableFuzzyExtraction. + * @member {boolean} enableFuzzyExtraction + * @memberof google.cloud.dialogflow.v2.EntityType + * @instance + */ + EntityType.prototype.enableFuzzyExtraction = false; + + /** + * Creates a new EntityType instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @memberof google.cloud.dialogflow.v2.EntityType * @static - * @param {google.cloud.dialogflow.v2beta1.ISpeechContext=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.SpeechContext} SpeechContext instance + * @param {google.cloud.dialogflow.v2.IEntityType=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.EntityType} EntityType instance */ - SpeechContext.create = function create(properties) { - return new SpeechContext(properties); + EntityType.create = function create(properties) { + return new EntityType(properties); }; /** - * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechContext.verify|verify} messages. + * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @memberof google.cloud.dialogflow.v2.EntityType * @static - * @param {google.cloud.dialogflow.v2beta1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {google.cloud.dialogflow.v2.IEntityType} message EntityType message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpeechContext.encode = function encode(message, writer) { + EntityType.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.phrases != null && message.phrases.length) - for (var i = 0; i < message.phrases.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]); - if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.kind); + if (message.autoExpansionMode != null && Object.hasOwnProperty.call(message, "autoExpansionMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.autoExpansionMode); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dialogflow.v2.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.enableFuzzyExtraction != null && Object.hasOwnProperty.call(message, "enableFuzzyExtraction")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableFuzzyExtraction); return writer; }; /** - * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechContext.verify|verify} messages. + * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @memberof google.cloud.dialogflow.v2.EntityType * @static - * @param {google.cloud.dialogflow.v2beta1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {google.cloud.dialogflow.v2.IEntityType} message EntityType message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpeechContext.encodeDelimited = function encodeDelimited(message, writer) { + EntityType.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SpeechContext message from the specified reader or buffer. + * Decodes an EntityType message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @memberof google.cloud.dialogflow.v2.EntityType * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.SpeechContext} SpeechContext + * @returns {google.cloud.dialogflow.v2.EntityType} EntityType * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpeechContext.decode = function decode(reader, length) { + EntityType.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SpeechContext(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.EntityType(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.phrases && message.phrases.length)) - message.phrases = []; - message.phrases.push(reader.string()); + message.name = reader.string(); break; case 2: - message.boost = reader.float(); + message.displayName = reader.string(); + break; + case 3: + message.kind = reader.int32(); + break; + case 4: + message.autoExpansionMode = reader.int32(); + break; + case 6: + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dialogflow.v2.EntityType.Entity.decode(reader, reader.uint32())); + break; + case 7: + message.enableFuzzyExtraction = reader.bool(); break; default: reader.skipType(tag & 7); @@ -35809,157 +35684,463 @@ }; /** - * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * Decodes an EntityType message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @memberof google.cloud.dialogflow.v2.EntityType * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.SpeechContext} SpeechContext + * @returns {google.cloud.dialogflow.v2.EntityType} EntityType * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpeechContext.decodeDelimited = function decodeDelimited(reader) { + EntityType.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SpeechContext message. + * Verifies an EntityType message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @memberof google.cloud.dialogflow.v2.EntityType * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SpeechContext.verify = function verify(message) { + EntityType.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.phrases != null && message.hasOwnProperty("phrases")) { - if (!Array.isArray(message.phrases)) - return "phrases: array expected"; - for (var i = 0; i < message.phrases.length; ++i) - if (!$util.isString(message.phrases[i])) - return "phrases: string[] expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.autoExpansionMode != null && message.hasOwnProperty("autoExpansionMode")) + switch (message.autoExpansionMode) { + default: + return "autoExpansionMode: enum value expected"; + case 0: + case 1: + break; + } + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.EntityType.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } } - if (message.boost != null && message.hasOwnProperty("boost")) - if (typeof message.boost !== "number") - return "boost: number expected"; + if (message.enableFuzzyExtraction != null && message.hasOwnProperty("enableFuzzyExtraction")) + if (typeof message.enableFuzzyExtraction !== "boolean") + return "enableFuzzyExtraction: boolean expected"; return null; }; /** - * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * Creates an EntityType message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @memberof google.cloud.dialogflow.v2.EntityType * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.SpeechContext} SpeechContext + * @returns {google.cloud.dialogflow.v2.EntityType} EntityType */ - SpeechContext.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.SpeechContext) + EntityType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.EntityType) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.SpeechContext(); - if (object.phrases) { - if (!Array.isArray(object.phrases)) - throw TypeError(".google.cloud.dialogflow.v2beta1.SpeechContext.phrases: array expected"); - message.phrases = []; - for (var i = 0; i < object.phrases.length; ++i) - message.phrases[i] = String(object.phrases[i]); + var message = new $root.google.cloud.dialogflow.v2.EntityType(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.kind) { + case "KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "KIND_MAP": + case 1: + message.kind = 1; + break; + case "KIND_LIST": + case 2: + message.kind = 2; + break; + case "KIND_REGEXP": + case 3: + message.kind = 3; + break; } - if (object.boost != null) - message.boost = Number(object.boost); + switch (object.autoExpansionMode) { + case "AUTO_EXPANSION_MODE_UNSPECIFIED": + case 0: + message.autoExpansionMode = 0; + break; + case "AUTO_EXPANSION_MODE_DEFAULT": + case 1: + message.autoExpansionMode = 1; + break; + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dialogflow.v2.EntityType.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.EntityType.entities: object expected"); + message.entities[i] = $root.google.cloud.dialogflow.v2.EntityType.Entity.fromObject(object.entities[i]); + } + } + if (object.enableFuzzyExtraction != null) + message.enableFuzzyExtraction = Boolean(object.enableFuzzyExtraction); return message; }; /** - * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * Creates a plain object from an EntityType message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @memberof google.cloud.dialogflow.v2.EntityType * @static - * @param {google.cloud.dialogflow.v2beta1.SpeechContext} message SpeechContext + * @param {google.cloud.dialogflow.v2.EntityType} message EntityType * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpeechContext.toObject = function toObject(message, options) { + EntityType.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.phrases = []; - if (options.defaults) - object.boost = 0; - if (message.phrases && message.phrases.length) { - object.phrases = []; - for (var j = 0; j < message.phrases.length; ++j) - object.phrases[j] = message.phrases[j]; + object.entities = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; + object.autoExpansionMode = options.enums === String ? "AUTO_EXPANSION_MODE_UNSPECIFIED" : 0; + object.enableFuzzyExtraction = false; } - if (message.boost != null && message.hasOwnProperty("boost")) - object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.cloud.dialogflow.v2.EntityType.Kind[message.kind] : message.kind; + if (message.autoExpansionMode != null && message.hasOwnProperty("autoExpansionMode")) + object.autoExpansionMode = options.enums === String ? $root.google.cloud.dialogflow.v2.EntityType.AutoExpansionMode[message.autoExpansionMode] : message.autoExpansionMode; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dialogflow.v2.EntityType.Entity.toObject(message.entities[j], options); + } + if (message.enableFuzzyExtraction != null && message.hasOwnProperty("enableFuzzyExtraction")) + object.enableFuzzyExtraction = message.enableFuzzyExtraction; return object; }; /** - * Converts this SpeechContext to JSON. + * Converts this EntityType to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @memberof google.cloud.dialogflow.v2.EntityType * @instance * @returns {Object.} JSON object */ - SpeechContext.prototype.toJSON = function toJSON() { + EntityType.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SpeechContext; - })(); + EntityType.Entity = (function() { - /** - * AudioEncoding enum. - * @name google.cloud.dialogflow.v2beta1.AudioEncoding - * @enum {number} - * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value - * @property {number} AUDIO_ENCODING_LINEAR_16=1 AUDIO_ENCODING_LINEAR_16 value - * @property {number} AUDIO_ENCODING_FLAC=2 AUDIO_ENCODING_FLAC value - * @property {number} AUDIO_ENCODING_MULAW=3 AUDIO_ENCODING_MULAW value - * @property {number} AUDIO_ENCODING_AMR=4 AUDIO_ENCODING_AMR value - * @property {number} AUDIO_ENCODING_AMR_WB=5 AUDIO_ENCODING_AMR_WB value - * @property {number} AUDIO_ENCODING_OGG_OPUS=6 AUDIO_ENCODING_OGG_OPUS value - * @property {number} AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE=7 AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE value - */ - v2beta1.AudioEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUDIO_ENCODING_LINEAR_16"] = 1; - values[valuesById[2] = "AUDIO_ENCODING_FLAC"] = 2; - values[valuesById[3] = "AUDIO_ENCODING_MULAW"] = 3; - values[valuesById[4] = "AUDIO_ENCODING_AMR"] = 4; - values[valuesById[5] = "AUDIO_ENCODING_AMR_WB"] = 5; - values[valuesById[6] = "AUDIO_ENCODING_OGG_OPUS"] = 6; - values[valuesById[7] = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"] = 7; - return values; + /** + * Properties of an Entity. + * @memberof google.cloud.dialogflow.v2.EntityType + * @interface IEntity + * @property {string|null} [value] Entity value + * @property {Array.|null} [synonyms] Entity synonyms + */ + + /** + * Constructs a new Entity. + * @memberof google.cloud.dialogflow.v2.EntityType + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.dialogflow.v2.EntityType.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + this.synonyms = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entity value. + * @member {string} value + * @memberof google.cloud.dialogflow.v2.EntityType.Entity + * @instance + */ + Entity.prototype.value = ""; + + /** + * Entity synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.dialogflow.v2.EntityType.Entity + * @instance + */ + Entity.prototype.synonyms = $util.emptyArray; + + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.v2.EntityType.IEntity=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.EntityType.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; + + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.v2.EntityType.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.synonyms[i]); + return writer; + }; + + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EntityType.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.v2.EntityType.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.EntityType.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.EntityType.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.EntityType.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + case 2: + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.EntityType.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.EntityType.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.dialogflow.v2.EntityType.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) + if (!$util.isString(message.synonyms[i])) + return "synonyms: string[] expected"; + } + return null; + }; + + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.EntityType.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.EntityType.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.EntityType.Entity) + return object; + var message = new $root.google.cloud.dialogflow.v2.EntityType.Entity(); + if (object.value != null) + message.value = String(object.value); + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.dialogflow.v2.EntityType.Entity.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) + message.synonyms[i] = String(object.synonyms[i]); + } + return message; + }; + + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.v2.EntityType.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.synonyms = []; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = message.synonyms[j]; + } + return object; + }; + + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.EntityType.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Entity; + })(); + + /** + * Kind enum. + * @name google.cloud.dialogflow.v2.EntityType.Kind + * @enum {number} + * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value + * @property {number} KIND_MAP=1 KIND_MAP value + * @property {number} KIND_LIST=2 KIND_LIST value + * @property {number} KIND_REGEXP=3 KIND_REGEXP value + */ + EntityType.Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "KIND_MAP"] = 1; + values[valuesById[2] = "KIND_LIST"] = 2; + values[valuesById[3] = "KIND_REGEXP"] = 3; + return values; + })(); + + /** + * AutoExpansionMode enum. + * @name google.cloud.dialogflow.v2.EntityType.AutoExpansionMode + * @enum {number} + * @property {number} AUTO_EXPANSION_MODE_UNSPECIFIED=0 AUTO_EXPANSION_MODE_UNSPECIFIED value + * @property {number} AUTO_EXPANSION_MODE_DEFAULT=1 AUTO_EXPANSION_MODE_DEFAULT value + */ + EntityType.AutoExpansionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTO_EXPANSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTO_EXPANSION_MODE_DEFAULT"] = 1; + return values; + })(); + + return EntityType; })(); - v2beta1.SpeechWordInfo = (function() { + v2.ListEntityTypesRequest = (function() { /** - * Properties of a SpeechWordInfo. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface ISpeechWordInfo - * @property {string|null} [word] SpeechWordInfo word - * @property {google.protobuf.IDuration|null} [startOffset] SpeechWordInfo startOffset - * @property {google.protobuf.IDuration|null} [endOffset] SpeechWordInfo endOffset - * @property {number|null} [confidence] SpeechWordInfo confidence + * Properties of a ListEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IListEntityTypesRequest + * @property {string|null} [parent] ListEntityTypesRequest parent + * @property {string|null} [languageCode] ListEntityTypesRequest languageCode + * @property {number|null} [pageSize] ListEntityTypesRequest pageSize + * @property {string|null} [pageToken] ListEntityTypesRequest pageToken */ /** - * Constructs a new SpeechWordInfo. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a SpeechWordInfo. - * @implements ISpeechWordInfo + * Constructs a new ListEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListEntityTypesRequest. + * @implements IListEntityTypesRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.ISpeechWordInfo=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListEntityTypesRequest=} [properties] Properties to set */ - function SpeechWordInfo(properties) { + function ListEntityTypesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -35967,114 +36148,114 @@ } /** - * SpeechWordInfo word. - * @member {string} word - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * ListEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @instance */ - SpeechWordInfo.prototype.word = ""; + ListEntityTypesRequest.prototype.parent = ""; /** - * SpeechWordInfo startOffset. - * @member {google.protobuf.IDuration|null|undefined} startOffset - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * ListEntityTypesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @instance */ - SpeechWordInfo.prototype.startOffset = null; + ListEntityTypesRequest.prototype.languageCode = ""; /** - * SpeechWordInfo endOffset. - * @member {google.protobuf.IDuration|null|undefined} endOffset - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * ListEntityTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @instance */ - SpeechWordInfo.prototype.endOffset = null; + ListEntityTypesRequest.prototype.pageSize = 0; /** - * SpeechWordInfo confidence. - * @member {number} confidence - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * ListEntityTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @instance */ - SpeechWordInfo.prototype.confidence = 0; + ListEntityTypesRequest.prototype.pageToken = ""; /** - * Creates a new SpeechWordInfo instance using the specified properties. + * Creates a new ListEntityTypesRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISpeechWordInfo=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.SpeechWordInfo} SpeechWordInfo instance + * @param {google.cloud.dialogflow.v2.IListEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListEntityTypesRequest} ListEntityTypesRequest instance */ - SpeechWordInfo.create = function create(properties) { - return new SpeechWordInfo(properties); + ListEntityTypesRequest.create = function create(properties) { + return new ListEntityTypesRequest(properties); }; /** - * Encodes the specified SpeechWordInfo message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechWordInfo.verify|verify} messages. + * Encodes the specified ListEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISpeechWordInfo} message SpeechWordInfo message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListEntityTypesRequest} message ListEntityTypesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpeechWordInfo.encode = function encode(message, writer) { + ListEntityTypesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) - $root.google.protobuf.Duration.encode(message.startOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) - $root.google.protobuf.Duration.encode(message.endOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.word != null && Object.hasOwnProperty.call(message, "word")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); - if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); return writer; }; /** - * Encodes the specified SpeechWordInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechWordInfo.verify|verify} messages. + * Encodes the specified ListEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISpeechWordInfo} message SpeechWordInfo message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListEntityTypesRequest} message ListEntityTypesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SpeechWordInfo.encodeDelimited = function encodeDelimited(message, writer) { + ListEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SpeechWordInfo message from the specified reader or buffer. + * Decodes a ListEntityTypesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.SpeechWordInfo} SpeechWordInfo + * @returns {google.cloud.dialogflow.v2.ListEntityTypesRequest} ListEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpeechWordInfo.decode = function decode(reader, length) { + ListEntityTypesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListEntityTypesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 3: - message.word = reader.string(); - break; case 1: - message.startOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 2: - message.endOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + message.languageCode = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); break; case 4: - message.confidence = reader.float(); + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -36085,170 +36266,134 @@ }; /** - * Decodes a SpeechWordInfo message from the specified reader or buffer, length delimited. + * Decodes a ListEntityTypesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.SpeechWordInfo} SpeechWordInfo + * @returns {google.cloud.dialogflow.v2.ListEntityTypesRequest} ListEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SpeechWordInfo.decodeDelimited = function decodeDelimited(reader) { + ListEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SpeechWordInfo message. + * Verifies a ListEntityTypesRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SpeechWordInfo.verify = function verify(message) { + ListEntityTypesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.word != null && message.hasOwnProperty("word")) - if (!$util.isString(message.word)) - return "word: string expected"; - if (message.startOffset != null && message.hasOwnProperty("startOffset")) { - var error = $root.google.protobuf.Duration.verify(message.startOffset); - if (error) - return "startOffset." + error; - } - if (message.endOffset != null && message.hasOwnProperty("endOffset")) { - var error = $root.google.protobuf.Duration.verify(message.endOffset); - if (error) - return "endOffset." + error; - } - if (message.confidence != null && message.hasOwnProperty("confidence")) - if (typeof message.confidence !== "number") - return "confidence: number expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a SpeechWordInfo message from a plain object. Also converts values to their respective internal types. + * Creates a ListEntityTypesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.SpeechWordInfo} SpeechWordInfo + * @returns {google.cloud.dialogflow.v2.ListEntityTypesRequest} ListEntityTypesRequest */ - SpeechWordInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo) + ListEntityTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListEntityTypesRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo(); - if (object.word != null) - message.word = String(object.word); - if (object.startOffset != null) { - if (typeof object.startOffset !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.SpeechWordInfo.startOffset: object expected"); - message.startOffset = $root.google.protobuf.Duration.fromObject(object.startOffset); - } - if (object.endOffset != null) { - if (typeof object.endOffset !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.SpeechWordInfo.endOffset: object expected"); - message.endOffset = $root.google.protobuf.Duration.fromObject(object.endOffset); - } - if (object.confidence != null) - message.confidence = Number(object.confidence); + var message = new $root.google.cloud.dialogflow.v2.ListEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a SpeechWordInfo message. Also converts values to other types if specified. + * Creates a plain object from a ListEntityTypesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.SpeechWordInfo} message SpeechWordInfo + * @param {google.cloud.dialogflow.v2.ListEntityTypesRequest} message ListEntityTypesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SpeechWordInfo.toObject = function toObject(message, options) { + ListEntityTypesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.startOffset = null; - object.endOffset = null; - object.word = ""; - object.confidence = 0; + object.parent = ""; + object.languageCode = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.startOffset != null && message.hasOwnProperty("startOffset")) - object.startOffset = $root.google.protobuf.Duration.toObject(message.startOffset, options); - if (message.endOffset != null && message.hasOwnProperty("endOffset")) - object.endOffset = $root.google.protobuf.Duration.toObject(message.endOffset, options); - if (message.word != null && message.hasOwnProperty("word")) - object.word = message.word; - if (message.confidence != null && message.hasOwnProperty("confidence")) - object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this SpeechWordInfo to JSON. + * Converts this ListEntityTypesRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @memberof google.cloud.dialogflow.v2.ListEntityTypesRequest * @instance * @returns {Object.} JSON object */ - SpeechWordInfo.prototype.toJSON = function toJSON() { + ListEntityTypesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SpeechWordInfo; - })(); - - /** - * SpeechModelVariant enum. - * @name google.cloud.dialogflow.v2beta1.SpeechModelVariant - * @enum {number} - * @property {number} SPEECH_MODEL_VARIANT_UNSPECIFIED=0 SPEECH_MODEL_VARIANT_UNSPECIFIED value - * @property {number} USE_BEST_AVAILABLE=1 USE_BEST_AVAILABLE value - * @property {number} USE_STANDARD=2 USE_STANDARD value - * @property {number} USE_ENHANCED=3 USE_ENHANCED value - */ - v2beta1.SpeechModelVariant = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SPEECH_MODEL_VARIANT_UNSPECIFIED"] = 0; - values[valuesById[1] = "USE_BEST_AVAILABLE"] = 1; - values[valuesById[2] = "USE_STANDARD"] = 2; - values[valuesById[3] = "USE_ENHANCED"] = 3; - return values; + return ListEntityTypesRequest; })(); - v2beta1.InputAudioConfig = (function() { + v2.ListEntityTypesResponse = (function() { /** - * Properties of an InputAudioConfig. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IInputAudioConfig - * @property {google.cloud.dialogflow.v2beta1.AudioEncoding|null} [audioEncoding] InputAudioConfig audioEncoding - * @property {number|null} [sampleRateHertz] InputAudioConfig sampleRateHertz - * @property {string|null} [languageCode] InputAudioConfig languageCode - * @property {boolean|null} [enableWordInfo] InputAudioConfig enableWordInfo - * @property {Array.|null} [phraseHints] InputAudioConfig phraseHints - * @property {Array.|null} [speechContexts] InputAudioConfig speechContexts - * @property {string|null} [model] InputAudioConfig model - * @property {google.cloud.dialogflow.v2beta1.SpeechModelVariant|null} [modelVariant] InputAudioConfig modelVariant - * @property {boolean|null} [singleUtterance] InputAudioConfig singleUtterance + * Properties of a ListEntityTypesResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IListEntityTypesResponse + * @property {Array.|null} [entityTypes] ListEntityTypesResponse entityTypes + * @property {string|null} [nextPageToken] ListEntityTypesResponse nextPageToken */ /** - * Constructs a new InputAudioConfig. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an InputAudioConfig. - * @implements IInputAudioConfig + * Constructs a new ListEntityTypesResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListEntityTypesResponse. + * @implements IListEntityTypesResponse * @constructor - * @param {google.cloud.dialogflow.v2beta1.IInputAudioConfig=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListEntityTypesResponse=} [properties] Properties to set */ - function InputAudioConfig(properties) { - this.phraseHints = []; - this.speechContexts = []; + function ListEntityTypesResponse(properties) { + this.entityTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36256,185 +36401,91 @@ } /** - * InputAudioConfig audioEncoding. - * @member {google.cloud.dialogflow.v2beta1.AudioEncoding} audioEncoding - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.audioEncoding = 0; - - /** - * InputAudioConfig sampleRateHertz. - * @member {number} sampleRateHertz - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.sampleRateHertz = 0; - - /** - * InputAudioConfig languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.languageCode = ""; - - /** - * InputAudioConfig enableWordInfo. - * @member {boolean} enableWordInfo - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.enableWordInfo = false; - - /** - * InputAudioConfig phraseHints. - * @member {Array.} phraseHints - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.phraseHints = $util.emptyArray; - - /** - * InputAudioConfig speechContexts. - * @member {Array.} speechContexts - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.speechContexts = $util.emptyArray; - - /** - * InputAudioConfig model. - * @member {string} model - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig - * @instance - */ - InputAudioConfig.prototype.model = ""; - - /** - * InputAudioConfig modelVariant. - * @member {google.cloud.dialogflow.v2beta1.SpeechModelVariant} modelVariant - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * ListEntityTypesResponse entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse * @instance */ - InputAudioConfig.prototype.modelVariant = 0; + ListEntityTypesResponse.prototype.entityTypes = $util.emptyArray; /** - * InputAudioConfig singleUtterance. - * @member {boolean} singleUtterance - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * ListEntityTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse * @instance */ - InputAudioConfig.prototype.singleUtterance = false; + ListEntityTypesResponse.prototype.nextPageToken = ""; /** - * Creates a new InputAudioConfig instance using the specified properties. + * Creates a new ListEntityTypesResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IInputAudioConfig=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.InputAudioConfig} InputAudioConfig instance + * @param {google.cloud.dialogflow.v2.IListEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListEntityTypesResponse} ListEntityTypesResponse instance */ - InputAudioConfig.create = function create(properties) { - return new InputAudioConfig(properties); + ListEntityTypesResponse.create = function create(properties) { + return new ListEntityTypesResponse(properties); }; /** - * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputAudioConfig.verify|verify} messages. + * Encodes the specified ListEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListEntityTypesResponse} message ListEntityTypesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InputAudioConfig.encode = function encode(message, writer) { + ListEntityTypesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); - if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); - if (message.phraseHints != null && message.phraseHints.length) - for (var i = 0; i < message.phraseHints.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.phraseHints[i]); - if (message.model != null && Object.hasOwnProperty.call(message, "model")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.model); - if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.singleUtterance); - if (message.modelVariant != null && Object.hasOwnProperty.call(message, "modelVariant")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.modelVariant); - if (message.speechContexts != null && message.speechContexts.length) - for (var i = 0; i < message.speechContexts.length; ++i) - $root.google.cloud.dialogflow.v2beta1.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.enableWordInfo != null && Object.hasOwnProperty.call(message, "enableWordInfo")) - writer.uint32(/* id 13, wireType 0 =*/104).bool(message.enableWordInfo); + if (message.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + $root.google.cloud.dialogflow.v2.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputAudioConfig.verify|verify} messages. + * Encodes the specified ListEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEntityTypesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListEntityTypesResponse} message ListEntityTypesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - InputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + ListEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an InputAudioConfig message from the specified reader or buffer. + * Decodes a ListEntityTypesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.InputAudioConfig} InputAudioConfig + * @returns {google.cloud.dialogflow.v2.ListEntityTypesResponse} ListEntityTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InputAudioConfig.decode = function decode(reader, length) { + ListEntityTypesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.InputAudioConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListEntityTypesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.audioEncoding = reader.int32(); + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push($root.google.cloud.dialogflow.v2.EntityType.decode(reader, reader.uint32())); break; case 2: - message.sampleRateHertz = reader.int32(); - break; - case 3: - message.languageCode = reader.string(); - break; - case 13: - message.enableWordInfo = reader.bool(); - break; - case 4: - if (!(message.phraseHints && message.phraseHints.length)) - message.phraseHints = []; - message.phraseHints.push(reader.string()); - break; - case 11: - if (!(message.speechContexts && message.speechContexts.length)) - message.speechContexts = []; - message.speechContexts.push($root.google.cloud.dialogflow.v2beta1.SpeechContext.decode(reader, reader.uint32())); - break; - case 7: - message.model = reader.string(); - break; - case 10: - message.modelVariant = reader.int32(); - break; - case 8: - message.singleUtterance = reader.bool(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -36445,270 +36496,134 @@ }; /** - * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * Decodes a ListEntityTypesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.InputAudioConfig} InputAudioConfig + * @returns {google.cloud.dialogflow.v2.ListEntityTypesResponse} ListEntityTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - InputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + ListEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an InputAudioConfig message. + * Verifies a ListEntityTypesResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - InputAudioConfig.verify = function verify(message) { + ListEntityTypesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - switch (message.audioEncoding) { - default: - return "audioEncoding: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - if (!$util.isInteger(message.sampleRateHertz)) - return "sampleRateHertz: integer expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.enableWordInfo != null && message.hasOwnProperty("enableWordInfo")) - if (typeof message.enableWordInfo !== "boolean") - return "enableWordInfo: boolean expected"; - if (message.phraseHints != null && message.hasOwnProperty("phraseHints")) { - if (!Array.isArray(message.phraseHints)) - return "phraseHints: array expected"; - for (var i = 0; i < message.phraseHints.length; ++i) - if (!$util.isString(message.phraseHints[i])) - return "phraseHints: string[] expected"; - } - if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) { - if (!Array.isArray(message.speechContexts)) - return "speechContexts: array expected"; - for (var i = 0; i < message.speechContexts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.SpeechContext.verify(message.speechContexts[i]); + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.EntityType.verify(message.entityTypes[i]); if (error) - return "speechContexts." + error; + return "entityTypes." + error; } } - if (message.model != null && message.hasOwnProperty("model")) - if (!$util.isString(message.model)) - return "model: string expected"; - if (message.modelVariant != null && message.hasOwnProperty("modelVariant")) - switch (message.modelVariant) { - default: - return "modelVariant: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) - if (typeof message.singleUtterance !== "boolean") - return "singleUtterance: boolean expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * Creates a ListEntityTypesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.InputAudioConfig} InputAudioConfig + * @returns {google.cloud.dialogflow.v2.ListEntityTypesResponse} ListEntityTypesResponse */ - InputAudioConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.InputAudioConfig) + ListEntityTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListEntityTypesResponse) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.InputAudioConfig(); - switch (object.audioEncoding) { - case "AUDIO_ENCODING_UNSPECIFIED": - case 0: - message.audioEncoding = 0; - break; - case "AUDIO_ENCODING_LINEAR_16": - case 1: - message.audioEncoding = 1; - break; - case "AUDIO_ENCODING_FLAC": - case 2: - message.audioEncoding = 2; - break; - case "AUDIO_ENCODING_MULAW": - case 3: - message.audioEncoding = 3; - break; - case "AUDIO_ENCODING_AMR": - case 4: - message.audioEncoding = 4; - break; - case "AUDIO_ENCODING_AMR_WB": - case 5: - message.audioEncoding = 5; - break; - case "AUDIO_ENCODING_OGG_OPUS": - case 6: - message.audioEncoding = 6; - break; - case "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": - case 7: - message.audioEncoding = 7; - break; + var message = new $root.google.cloud.dialogflow.v2.ListEntityTypesResponse(); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.dialogflow.v2.ListEntityTypesResponse.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) { + if (typeof object.entityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListEntityTypesResponse.entityTypes: object expected"); + message.entityTypes[i] = $root.google.cloud.dialogflow.v2.EntityType.fromObject(object.entityTypes[i]); + } } - if (object.sampleRateHertz != null) - message.sampleRateHertz = object.sampleRateHertz | 0; - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.enableWordInfo != null) - message.enableWordInfo = Boolean(object.enableWordInfo); - if (object.phraseHints) { - if (!Array.isArray(object.phraseHints)) - throw TypeError(".google.cloud.dialogflow.v2beta1.InputAudioConfig.phraseHints: array expected"); - message.phraseHints = []; - for (var i = 0; i < object.phraseHints.length; ++i) - message.phraseHints[i] = String(object.phraseHints[i]); - } - if (object.speechContexts) { - if (!Array.isArray(object.speechContexts)) - throw TypeError(".google.cloud.dialogflow.v2beta1.InputAudioConfig.speechContexts: array expected"); - message.speechContexts = []; - for (var i = 0; i < object.speechContexts.length; ++i) { - if (typeof object.speechContexts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.InputAudioConfig.speechContexts: object expected"); - message.speechContexts[i] = $root.google.cloud.dialogflow.v2beta1.SpeechContext.fromObject(object.speechContexts[i]); - } - } - if (object.model != null) - message.model = String(object.model); - switch (object.modelVariant) { - case "SPEECH_MODEL_VARIANT_UNSPECIFIED": - case 0: - message.modelVariant = 0; - break; - case "USE_BEST_AVAILABLE": - case 1: - message.modelVariant = 1; - break; - case "USE_STANDARD": - case 2: - message.modelVariant = 2; - break; - case "USE_ENHANCED": - case 3: - message.modelVariant = 3; - break; - } - if (object.singleUtterance != null) - message.singleUtterance = Boolean(object.singleUtterance); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * Creates a plain object from a ListEntityTypesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.InputAudioConfig} message InputAudioConfig + * @param {google.cloud.dialogflow.v2.ListEntityTypesResponse} message ListEntityTypesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - InputAudioConfig.toObject = function toObject(message, options) { + ListEntityTypesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.phraseHints = []; - object.speechContexts = []; - } - if (options.defaults) { - object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; - object.sampleRateHertz = 0; - object.languageCode = ""; - object.model = ""; - object.singleUtterance = false; - object.modelVariant = options.enums === String ? "SPEECH_MODEL_VARIANT_UNSPECIFIED" : 0; - object.enableWordInfo = false; - } - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - object.audioEncoding = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.AudioEncoding[message.audioEncoding] : message.audioEncoding; - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - object.sampleRateHertz = message.sampleRateHertz; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.phraseHints && message.phraseHints.length) { - object.phraseHints = []; - for (var j = 0; j < message.phraseHints.length; ++j) - object.phraseHints[j] = message.phraseHints[j]; - } - if (message.model != null && message.hasOwnProperty("model")) - object.model = message.model; - if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) - object.singleUtterance = message.singleUtterance; - if (message.modelVariant != null && message.hasOwnProperty("modelVariant")) - object.modelVariant = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.SpeechModelVariant[message.modelVariant] : message.modelVariant; - if (message.speechContexts && message.speechContexts.length) { - object.speechContexts = []; - for (var j = 0; j < message.speechContexts.length; ++j) - object.speechContexts[j] = $root.google.cloud.dialogflow.v2beta1.SpeechContext.toObject(message.speechContexts[j], options); + if (options.arrays || options.defaults) + object.entityTypes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = $root.google.cloud.dialogflow.v2.EntityType.toObject(message.entityTypes[j], options); } - if (message.enableWordInfo != null && message.hasOwnProperty("enableWordInfo")) - object.enableWordInfo = message.enableWordInfo; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this InputAudioConfig to JSON. + * Converts this ListEntityTypesResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @memberof google.cloud.dialogflow.v2.ListEntityTypesResponse * @instance * @returns {Object.} JSON object */ - InputAudioConfig.prototype.toJSON = function toJSON() { + ListEntityTypesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return InputAudioConfig; + return ListEntityTypesResponse; })(); - v2beta1.VoiceSelectionParams = (function() { + v2.GetEntityTypeRequest = (function() { /** - * Properties of a VoiceSelectionParams. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IVoiceSelectionParams - * @property {string|null} [name] VoiceSelectionParams name - * @property {google.cloud.dialogflow.v2beta1.SsmlVoiceGender|null} [ssmlGender] VoiceSelectionParams ssmlGender + * Properties of a GetEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IGetEntityTypeRequest + * @property {string|null} [name] GetEntityTypeRequest name + * @property {string|null} [languageCode] GetEntityTypeRequest languageCode */ /** - * Constructs a new VoiceSelectionParams. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a VoiceSelectionParams. - * @implements IVoiceSelectionParams + * Constructs a new GetEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a GetEntityTypeRequest. + * @implements IGetEntityTypeRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IVoiceSelectionParams=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IGetEntityTypeRequest=} [properties] Properties to set */ - function VoiceSelectionParams(properties) { + function GetEntityTypeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36716,80 +36631,80 @@ } /** - * VoiceSelectionParams name. + * GetEntityTypeRequest name. * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest * @instance */ - VoiceSelectionParams.prototype.name = ""; + GetEntityTypeRequest.prototype.name = ""; /** - * VoiceSelectionParams ssmlGender. - * @member {google.cloud.dialogflow.v2beta1.SsmlVoiceGender} ssmlGender - * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * GetEntityTypeRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest * @instance */ - VoiceSelectionParams.prototype.ssmlGender = 0; + GetEntityTypeRequest.prototype.languageCode = ""; /** - * Creates a new VoiceSelectionParams instance using the specified properties. + * Creates a new GetEntityTypeRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IVoiceSelectionParams=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.VoiceSelectionParams} VoiceSelectionParams instance + * @param {google.cloud.dialogflow.v2.IGetEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.GetEntityTypeRequest} GetEntityTypeRequest instance */ - VoiceSelectionParams.create = function create(properties) { - return new VoiceSelectionParams(properties); + GetEntityTypeRequest.create = function create(properties) { + return new GetEntityTypeRequest(properties); }; /** - * Encodes the specified VoiceSelectionParams message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.VoiceSelectionParams.verify|verify} messages. + * Encodes the specified GetEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetEntityTypeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IVoiceSelectionParams} message VoiceSelectionParams message or plain object to encode + * @param {google.cloud.dialogflow.v2.IGetEntityTypeRequest} message GetEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VoiceSelectionParams.encode = function encode(message, writer) { + GetEntityTypeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.ssmlGender != null && Object.hasOwnProperty.call(message, "ssmlGender")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ssmlGender); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); return writer; }; /** - * Encodes the specified VoiceSelectionParams message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.VoiceSelectionParams.verify|verify} messages. + * Encodes the specified GetEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetEntityTypeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IVoiceSelectionParams} message VoiceSelectionParams message or plain object to encode + * @param {google.cloud.dialogflow.v2.IGetEntityTypeRequest} message GetEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - VoiceSelectionParams.encodeDelimited = function encodeDelimited(message, writer) { + GetEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a VoiceSelectionParams message from the specified reader or buffer. + * Decodes a GetEntityTypeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.VoiceSelectionParams} VoiceSelectionParams + * @returns {google.cloud.dialogflow.v2.GetEntityTypeRequest} GetEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VoiceSelectionParams.decode = function decode(reader, length) { + GetEntityTypeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetEntityTypeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -36797,7 +36712,7 @@ message.name = reader.string(); break; case 2: - message.ssmlGender = reader.int32(); + message.languageCode = reader.string(); break; default: reader.skipType(tag & 7); @@ -36808,144 +36723,118 @@ }; /** - * Decodes a VoiceSelectionParams message from the specified reader or buffer, length delimited. + * Decodes a GetEntityTypeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.VoiceSelectionParams} VoiceSelectionParams + * @returns {google.cloud.dialogflow.v2.GetEntityTypeRequest} GetEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - VoiceSelectionParams.decodeDelimited = function decodeDelimited(reader) { + GetEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a VoiceSelectionParams message. + * Verifies a GetEntityTypeRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - VoiceSelectionParams.verify = function verify(message) { + GetEntityTypeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.ssmlGender != null && message.hasOwnProperty("ssmlGender")) - switch (message.ssmlGender) { - default: - return "ssmlGender: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; return null; }; /** - * Creates a VoiceSelectionParams message from a plain object. Also converts values to their respective internal types. + * Creates a GetEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.VoiceSelectionParams} VoiceSelectionParams + * @returns {google.cloud.dialogflow.v2.GetEntityTypeRequest} GetEntityTypeRequest */ - VoiceSelectionParams.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams) + GetEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.GetEntityTypeRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams(); + var message = new $root.google.cloud.dialogflow.v2.GetEntityTypeRequest(); if (object.name != null) message.name = String(object.name); - switch (object.ssmlGender) { - case "SSML_VOICE_GENDER_UNSPECIFIED": - case 0: - message.ssmlGender = 0; - break; - case "SSML_VOICE_GENDER_MALE": - case 1: - message.ssmlGender = 1; - break; - case "SSML_VOICE_GENDER_FEMALE": - case 2: - message.ssmlGender = 2; - break; - case "SSML_VOICE_GENDER_NEUTRAL": - case 3: - message.ssmlGender = 3; - break; - } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); return message; }; /** - * Creates a plain object from a VoiceSelectionParams message. Also converts values to other types if specified. + * Creates a plain object from a GetEntityTypeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.VoiceSelectionParams} message VoiceSelectionParams + * @param {google.cloud.dialogflow.v2.GetEntityTypeRequest} message GetEntityTypeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - VoiceSelectionParams.toObject = function toObject(message, options) { + GetEntityTypeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.name = ""; - object.ssmlGender = options.enums === String ? "SSML_VOICE_GENDER_UNSPECIFIED" : 0; + object.languageCode = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.ssmlGender != null && message.hasOwnProperty("ssmlGender")) - object.ssmlGender = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.SsmlVoiceGender[message.ssmlGender] : message.ssmlGender; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; return object; }; /** - * Converts this VoiceSelectionParams to JSON. + * Converts this GetEntityTypeRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @memberof google.cloud.dialogflow.v2.GetEntityTypeRequest * @instance * @returns {Object.} JSON object */ - VoiceSelectionParams.prototype.toJSON = function toJSON() { + GetEntityTypeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return VoiceSelectionParams; + return GetEntityTypeRequest; })(); - v2beta1.SynthesizeSpeechConfig = (function() { + v2.CreateEntityTypeRequest = (function() { /** - * Properties of a SynthesizeSpeechConfig. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface ISynthesizeSpeechConfig - * @property {number|null} [speakingRate] SynthesizeSpeechConfig speakingRate - * @property {number|null} [pitch] SynthesizeSpeechConfig pitch - * @property {number|null} [volumeGainDb] SynthesizeSpeechConfig volumeGainDb - * @property {Array.|null} [effectsProfileId] SynthesizeSpeechConfig effectsProfileId - * @property {google.cloud.dialogflow.v2beta1.IVoiceSelectionParams|null} [voice] SynthesizeSpeechConfig voice + * Properties of a CreateEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface ICreateEntityTypeRequest + * @property {string|null} [parent] CreateEntityTypeRequest parent + * @property {google.cloud.dialogflow.v2.IEntityType|null} [entityType] CreateEntityTypeRequest entityType + * @property {string|null} [languageCode] CreateEntityTypeRequest languageCode */ /** - * Constructs a new SynthesizeSpeechConfig. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a SynthesizeSpeechConfig. - * @implements ISynthesizeSpeechConfig + * Constructs a new CreateEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a CreateEntityTypeRequest. + * @implements ICreateEntityTypeRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ICreateEntityTypeRequest=} [properties] Properties to set */ - function SynthesizeSpeechConfig(properties) { - this.effectsProfileId = []; + function CreateEntityTypeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -36953,130 +36842,101 @@ } /** - * SynthesizeSpeechConfig speakingRate. - * @member {number} speakingRate - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig - * @instance - */ - SynthesizeSpeechConfig.prototype.speakingRate = 0; - - /** - * SynthesizeSpeechConfig pitch. - * @member {number} pitch - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig - * @instance - */ - SynthesizeSpeechConfig.prototype.pitch = 0; - - /** - * SynthesizeSpeechConfig volumeGainDb. - * @member {number} volumeGainDb - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * CreateEntityTypeRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest * @instance */ - SynthesizeSpeechConfig.prototype.volumeGainDb = 0; + CreateEntityTypeRequest.prototype.parent = ""; /** - * SynthesizeSpeechConfig effectsProfileId. - * @member {Array.} effectsProfileId - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * CreateEntityTypeRequest entityType. + * @member {google.cloud.dialogflow.v2.IEntityType|null|undefined} entityType + * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest * @instance */ - SynthesizeSpeechConfig.prototype.effectsProfileId = $util.emptyArray; + CreateEntityTypeRequest.prototype.entityType = null; /** - * SynthesizeSpeechConfig voice. - * @member {google.cloud.dialogflow.v2beta1.IVoiceSelectionParams|null|undefined} voice - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * CreateEntityTypeRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest * @instance */ - SynthesizeSpeechConfig.prototype.voice = null; + CreateEntityTypeRequest.prototype.languageCode = ""; /** - * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * Creates a new CreateEntityTypeRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig} SynthesizeSpeechConfig instance + * @param {google.cloud.dialogflow.v2.ICreateEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CreateEntityTypeRequest} CreateEntityTypeRequest instance */ - SynthesizeSpeechConfig.create = function create(properties) { - return new SynthesizeSpeechConfig(properties); + CreateEntityTypeRequest.create = function create(properties) { + return new CreateEntityTypeRequest(properties); }; /** - * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.verify|verify} messages. + * Encodes the specified CreateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateEntityTypeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateEntityTypeRequest} message CreateEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SynthesizeSpeechConfig.encode = function encode(message, writer) { + CreateEntityTypeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) - writer.uint32(/* id 1, wireType 1 =*/9).double(message.speakingRate); - if (message.pitch != null && Object.hasOwnProperty.call(message, "pitch")) - writer.uint32(/* id 2, wireType 1 =*/17).double(message.pitch); - if (message.volumeGainDb != null && Object.hasOwnProperty.call(message, "volumeGainDb")) - writer.uint32(/* id 3, wireType 1 =*/25).double(message.volumeGainDb); - if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) - $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams.encode(message.voice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.effectsProfileId != null && message.effectsProfileId.length) - for (var i = 0; i < message.effectsProfileId.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.effectsProfileId[i]); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + $root.google.cloud.dialogflow.v2.EntityType.encode(message.entityType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); return writer; }; /** - * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.verify|verify} messages. + * Encodes the specified CreateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateEntityTypeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateEntityTypeRequest} message CreateEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SynthesizeSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + CreateEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @returns {google.cloud.dialogflow.v2.CreateEntityTypeRequest} CreateEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SynthesizeSpeechConfig.decode = function decode(reader, length) { + CreateEntityTypeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateEntityTypeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.speakingRate = reader.double(); + message.parent = reader.string(); break; case 2: - message.pitch = reader.double(); + message.entityType = $root.google.cloud.dialogflow.v2.EntityType.decode(reader, reader.uint32()); break; case 3: - message.volumeGainDb = reader.double(); - break; - case 5: - if (!(message.effectsProfileId && message.effectsProfileId.length)) - message.effectsProfileId = []; - message.effectsProfileId.push(reader.string()); - break; - case 4: - message.voice = $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams.decode(reader, reader.uint32()); + message.languageCode = reader.string(); break; default: reader.skipType(tag & 7); @@ -37087,178 +36947,131 @@ }; /** - * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @returns {google.cloud.dialogflow.v2.CreateEntityTypeRequest} CreateEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SynthesizeSpeechConfig.decodeDelimited = function decodeDelimited(reader) { + CreateEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SynthesizeSpeechConfig message. + * Verifies a CreateEntityTypeRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SynthesizeSpeechConfig.verify = function verify(message) { + CreateEntityTypeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) - if (typeof message.speakingRate !== "number") - return "speakingRate: number expected"; - if (message.pitch != null && message.hasOwnProperty("pitch")) - if (typeof message.pitch !== "number") - return "pitch: number expected"; - if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) - if (typeof message.volumeGainDb !== "number") - return "volumeGainDb: number expected"; - if (message.effectsProfileId != null && message.hasOwnProperty("effectsProfileId")) { - if (!Array.isArray(message.effectsProfileId)) - return "effectsProfileId: array expected"; - for (var i = 0; i < message.effectsProfileId.length; ++i) - if (!$util.isString(message.effectsProfileId[i])) - return "effectsProfileId: string[] expected"; - } - if (message.voice != null && message.hasOwnProperty("voice")) { - var error = $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams.verify(message.voice); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) { + var error = $root.google.cloud.dialogflow.v2.EntityType.verify(message.entityType); if (error) - return "voice." + error; + return "entityType." + error; } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; return null; }; /** - * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * Creates a CreateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @returns {google.cloud.dialogflow.v2.CreateEntityTypeRequest} CreateEntityTypeRequest */ - SynthesizeSpeechConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig) + CreateEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CreateEntityTypeRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig(); - if (object.speakingRate != null) - message.speakingRate = Number(object.speakingRate); - if (object.pitch != null) - message.pitch = Number(object.pitch); - if (object.volumeGainDb != null) - message.volumeGainDb = Number(object.volumeGainDb); - if (object.effectsProfileId) { - if (!Array.isArray(object.effectsProfileId)) - throw TypeError(".google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.effectsProfileId: array expected"); - message.effectsProfileId = []; - for (var i = 0; i < object.effectsProfileId.length; ++i) - message.effectsProfileId[i] = String(object.effectsProfileId[i]); - } - if (object.voice != null) { - if (typeof object.voice !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.voice: object expected"); - message.voice = $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams.fromObject(object.voice); + var message = new $root.google.cloud.dialogflow.v2.CreateEntityTypeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityType != null) { + if (typeof object.entityType !== "object") + throw TypeError(".google.cloud.dialogflow.v2.CreateEntityTypeRequest.entityType: object expected"); + message.entityType = $root.google.cloud.dialogflow.v2.EntityType.fromObject(object.entityType); } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); return message; }; /** - * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * Creates a plain object from a CreateEntityTypeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig} message SynthesizeSpeechConfig + * @param {google.cloud.dialogflow.v2.CreateEntityTypeRequest} message CreateEntityTypeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SynthesizeSpeechConfig.toObject = function toObject(message, options) { + CreateEntityTypeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.effectsProfileId = []; if (options.defaults) { - object.speakingRate = 0; - object.pitch = 0; - object.volumeGainDb = 0; - object.voice = null; - } - if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) - object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; - if (message.pitch != null && message.hasOwnProperty("pitch")) - object.pitch = options.json && !isFinite(message.pitch) ? String(message.pitch) : message.pitch; - if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) - object.volumeGainDb = options.json && !isFinite(message.volumeGainDb) ? String(message.volumeGainDb) : message.volumeGainDb; - if (message.voice != null && message.hasOwnProperty("voice")) - object.voice = $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams.toObject(message.voice, options); - if (message.effectsProfileId && message.effectsProfileId.length) { - object.effectsProfileId = []; - for (var j = 0; j < message.effectsProfileId.length; ++j) - object.effectsProfileId[j] = message.effectsProfileId[j]; + object.parent = ""; + object.entityType = null; + object.languageCode = ""; } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = $root.google.cloud.dialogflow.v2.EntityType.toObject(message.entityType, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; return object; }; /** - * Converts this SynthesizeSpeechConfig to JSON. + * Converts this CreateEntityTypeRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2.CreateEntityTypeRequest * @instance * @returns {Object.} JSON object */ - SynthesizeSpeechConfig.prototype.toJSON = function toJSON() { + CreateEntityTypeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SynthesizeSpeechConfig; - })(); - - /** - * SsmlVoiceGender enum. - * @name google.cloud.dialogflow.v2beta1.SsmlVoiceGender - * @enum {number} - * @property {number} SSML_VOICE_GENDER_UNSPECIFIED=0 SSML_VOICE_GENDER_UNSPECIFIED value - * @property {number} SSML_VOICE_GENDER_MALE=1 SSML_VOICE_GENDER_MALE value - * @property {number} SSML_VOICE_GENDER_FEMALE=2 SSML_VOICE_GENDER_FEMALE value - * @property {number} SSML_VOICE_GENDER_NEUTRAL=3 SSML_VOICE_GENDER_NEUTRAL value - */ - v2beta1.SsmlVoiceGender = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SSML_VOICE_GENDER_UNSPECIFIED"] = 0; - values[valuesById[1] = "SSML_VOICE_GENDER_MALE"] = 1; - values[valuesById[2] = "SSML_VOICE_GENDER_FEMALE"] = 2; - values[valuesById[3] = "SSML_VOICE_GENDER_NEUTRAL"] = 3; - return values; + return CreateEntityTypeRequest; })(); - v2beta1.OutputAudioConfig = (function() { + v2.UpdateEntityTypeRequest = (function() { /** - * Properties of an OutputAudioConfig. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IOutputAudioConfig - * @property {google.cloud.dialogflow.v2beta1.OutputAudioEncoding|null} [audioEncoding] OutputAudioConfig audioEncoding - * @property {number|null} [sampleRateHertz] OutputAudioConfig sampleRateHertz - * @property {google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig|null} [synthesizeSpeechConfig] OutputAudioConfig synthesizeSpeechConfig + * Properties of an UpdateEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IUpdateEntityTypeRequest + * @property {google.cloud.dialogflow.v2.IEntityType|null} [entityType] UpdateEntityTypeRequest entityType + * @property {string|null} [languageCode] UpdateEntityTypeRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEntityTypeRequest updateMask */ /** - * Constructs a new OutputAudioConfig. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an OutputAudioConfig. - * @implements IOutputAudioConfig + * Constructs a new UpdateEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an UpdateEntityTypeRequest. + * @implements IUpdateEntityTypeRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IOutputAudioConfig=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IUpdateEntityTypeRequest=} [properties] Properties to set */ - function OutputAudioConfig(properties) { + function UpdateEntityTypeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37266,101 +37079,101 @@ } /** - * OutputAudioConfig audioEncoding. - * @member {google.cloud.dialogflow.v2beta1.OutputAudioEncoding} audioEncoding - * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * UpdateEntityTypeRequest entityType. + * @member {google.cloud.dialogflow.v2.IEntityType|null|undefined} entityType + * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest * @instance */ - OutputAudioConfig.prototype.audioEncoding = 0; + UpdateEntityTypeRequest.prototype.entityType = null; /** - * OutputAudioConfig sampleRateHertz. - * @member {number} sampleRateHertz - * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * UpdateEntityTypeRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest * @instance */ - OutputAudioConfig.prototype.sampleRateHertz = 0; + UpdateEntityTypeRequest.prototype.languageCode = ""; /** - * OutputAudioConfig synthesizeSpeechConfig. - * @member {google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig|null|undefined} synthesizeSpeechConfig - * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * UpdateEntityTypeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest * @instance */ - OutputAudioConfig.prototype.synthesizeSpeechConfig = null; + UpdateEntityTypeRequest.prototype.updateMask = null; /** - * Creates a new OutputAudioConfig instance using the specified properties. + * Creates a new UpdateEntityTypeRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IOutputAudioConfig=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.OutputAudioConfig} OutputAudioConfig instance + * @param {google.cloud.dialogflow.v2.IUpdateEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.UpdateEntityTypeRequest} UpdateEntityTypeRequest instance */ - OutputAudioConfig.create = function create(properties) { - return new OutputAudioConfig(properties); + UpdateEntityTypeRequest.create = function create(properties) { + return new UpdateEntityTypeRequest(properties); }; /** - * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify|verify} messages. + * Encodes the specified UpdateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateEntityTypeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2.IUpdateEntityTypeRequest} message UpdateEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputAudioConfig.encode = function encode(message, writer) { + UpdateEntityTypeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); - if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); - if (message.synthesizeSpeechConfig != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfig")) - $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + $root.google.cloud.dialogflow.v2.EntityType.encode(message.entityType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify|verify} messages. + * Encodes the specified UpdateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateEntityTypeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2.IUpdateEntityTypeRequest} message UpdateEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - OutputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + UpdateEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an OutputAudioConfig message from the specified reader or buffer. + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.OutputAudioConfig} OutputAudioConfig + * @returns {google.cloud.dialogflow.v2.UpdateEntityTypeRequest} UpdateEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputAudioConfig.decode = function decode(reader, length) { + UpdateEntityTypeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateEntityTypeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.audioEncoding = reader.int32(); + message.entityType = $root.google.cloud.dialogflow.v2.EntityType.decode(reader, reader.uint32()); break; case 2: - message.sampleRateHertz = reader.int32(); + message.languageCode = reader.string(); break; case 3: - message.synthesizeSpeechConfig = $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.decode(reader, reader.uint32()); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -37371,153 +37184,134 @@ }; /** - * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.OutputAudioConfig} OutputAudioConfig + * @returns {google.cloud.dialogflow.v2.UpdateEntityTypeRequest} UpdateEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - OutputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + UpdateEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an OutputAudioConfig message. + * Verifies an UpdateEntityTypeRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - OutputAudioConfig.verify = function verify(message) { + UpdateEntityTypeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - switch (message.audioEncoding) { - default: - return "audioEncoding: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - if (!$util.isInteger(message.sampleRateHertz)) - return "sampleRateHertz: integer expected"; - if (message.synthesizeSpeechConfig != null && message.hasOwnProperty("synthesizeSpeechConfig")) { - var error = $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfig); + if (message.entityType != null && message.hasOwnProperty("entityType")) { + var error = $root.google.cloud.dialogflow.v2.EntityType.verify(message.entityType); if (error) - return "synthesizeSpeechConfig." + error; + return "entityType." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } return null; }; /** - * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.OutputAudioConfig} OutputAudioConfig + * @returns {google.cloud.dialogflow.v2.UpdateEntityTypeRequest} UpdateEntityTypeRequest */ - OutputAudioConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig) + UpdateEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.UpdateEntityTypeRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig(); - switch (object.audioEncoding) { - case "OUTPUT_AUDIO_ENCODING_UNSPECIFIED": - case 0: - message.audioEncoding = 0; - break; - case "OUTPUT_AUDIO_ENCODING_LINEAR_16": - case 1: - message.audioEncoding = 1; - break; - case "OUTPUT_AUDIO_ENCODING_MP3": - case 2: - message.audioEncoding = 2; - break; - case "OUTPUT_AUDIO_ENCODING_OGG_OPUS": - case 3: - message.audioEncoding = 3; - break; + var message = new $root.google.cloud.dialogflow.v2.UpdateEntityTypeRequest(); + if (object.entityType != null) { + if (typeof object.entityType !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateEntityTypeRequest.entityType: object expected"); + message.entityType = $root.google.cloud.dialogflow.v2.EntityType.fromObject(object.entityType); } - if (object.sampleRateHertz != null) - message.sampleRateHertz = object.sampleRateHertz | 0; - if (object.synthesizeSpeechConfig != null) { - if (typeof object.synthesizeSpeechConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.OutputAudioConfig.synthesizeSpeechConfig: object expected"); - message.synthesizeSpeechConfig = $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfig); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateEntityTypeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * Creates a plain object from an UpdateEntityTypeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.OutputAudioConfig} message OutputAudioConfig + * @param {google.cloud.dialogflow.v2.UpdateEntityTypeRequest} message UpdateEntityTypeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - OutputAudioConfig.toObject = function toObject(message, options) { + UpdateEntityTypeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.audioEncoding = options.enums === String ? "OUTPUT_AUDIO_ENCODING_UNSPECIFIED" : 0; - object.sampleRateHertz = 0; - object.synthesizeSpeechConfig = null; + object.entityType = null; + object.languageCode = ""; + object.updateMask = null; } - if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) - object.audioEncoding = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.OutputAudioEncoding[message.audioEncoding] : message.audioEncoding; - if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) - object.sampleRateHertz = message.sampleRateHertz; - if (message.synthesizeSpeechConfig != null && message.hasOwnProperty("synthesizeSpeechConfig")) - object.synthesizeSpeechConfig = $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfig, options); + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = $root.google.cloud.dialogflow.v2.EntityType.toObject(message.entityType, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this OutputAudioConfig to JSON. + * Converts this UpdateEntityTypeRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @memberof google.cloud.dialogflow.v2.UpdateEntityTypeRequest * @instance * @returns {Object.} JSON object */ - OutputAudioConfig.prototype.toJSON = function toJSON() { + UpdateEntityTypeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return OutputAudioConfig; + return UpdateEntityTypeRequest; })(); - v2beta1.TelephonyDtmfEvents = (function() { + v2.DeleteEntityTypeRequest = (function() { /** - * Properties of a TelephonyDtmfEvents. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface ITelephonyDtmfEvents - * @property {Array.|null} [dtmfEvents] TelephonyDtmfEvents dtmfEvents + * Properties of a DeleteEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IDeleteEntityTypeRequest + * @property {string|null} [name] DeleteEntityTypeRequest name */ /** - * Constructs a new TelephonyDtmfEvents. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a TelephonyDtmfEvents. - * @implements ITelephonyDtmfEvents + * Constructs a new DeleteEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a DeleteEntityTypeRequest. + * @implements IDeleteEntityTypeRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IDeleteEntityTypeRequest=} [properties] Properties to set */ - function TelephonyDtmfEvents(properties) { - this.dtmfEvents = []; + function DeleteEntityTypeRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37525,86 +37319,75 @@ } /** - * TelephonyDtmfEvents dtmfEvents. - * @member {Array.} dtmfEvents - * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * DeleteEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest * @instance */ - TelephonyDtmfEvents.prototype.dtmfEvents = $util.emptyArray; + DeleteEntityTypeRequest.prototype.name = ""; /** - * Creates a new TelephonyDtmfEvents instance using the specified properties. + * Creates a new DeleteEntityTypeRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents} TelephonyDtmfEvents instance + * @param {google.cloud.dialogflow.v2.IDeleteEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.DeleteEntityTypeRequest} DeleteEntityTypeRequest instance */ - TelephonyDtmfEvents.create = function create(properties) { - return new TelephonyDtmfEvents(properties); + DeleteEntityTypeRequest.create = function create(properties) { + return new DeleteEntityTypeRequest(properties); }; /** - * Encodes the specified TelephonyDtmfEvents message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.verify|verify} messages. + * Encodes the specified DeleteEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteEntityTypeRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents} message TelephonyDtmfEvents message or plain object to encode + * @param {google.cloud.dialogflow.v2.IDeleteEntityTypeRequest} message DeleteEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TelephonyDtmfEvents.encode = function encode(message, writer) { + DeleteEntityTypeRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dtmfEvents != null && message.dtmfEvents.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.dtmfEvents.length; ++i) - writer.int32(message.dtmfEvents[i]); - writer.ldelim(); - } + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified TelephonyDtmfEvents message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.verify|verify} messages. + * Encodes the specified DeleteEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteEntityTypeRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents} message TelephonyDtmfEvents message or plain object to encode + * @param {google.cloud.dialogflow.v2.IDeleteEntityTypeRequest} message DeleteEntityTypeRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TelephonyDtmfEvents.encodeDelimited = function encodeDelimited(message, writer) { + DeleteEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TelephonyDtmfEvents message from the specified reader or buffer. + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents} TelephonyDtmfEvents + * @returns {google.cloud.dialogflow.v2.DeleteEntityTypeRequest} DeleteEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TelephonyDtmfEvents.decode = function decode(reader, length) { + DeleteEntityTypeRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteEntityTypeRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.dtmfEvents && message.dtmfEvents.length)) - message.dtmfEvents = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.dtmfEvents.push(reader.int32()); - } else - message.dtmfEvents.push(reader.int32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -37615,274 +37398,111 @@ }; /** - * Decodes a TelephonyDtmfEvents message from the specified reader or buffer, length delimited. + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents} TelephonyDtmfEvents + * @returns {google.cloud.dialogflow.v2.DeleteEntityTypeRequest} DeleteEntityTypeRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TelephonyDtmfEvents.decodeDelimited = function decodeDelimited(reader) { + DeleteEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TelephonyDtmfEvents message. + * Verifies a DeleteEntityTypeRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TelephonyDtmfEvents.verify = function verify(message) { + DeleteEntityTypeRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dtmfEvents != null && message.hasOwnProperty("dtmfEvents")) { - if (!Array.isArray(message.dtmfEvents)) - return "dtmfEvents: array expected"; - for (var i = 0; i < message.dtmfEvents.length; ++i) - switch (message.dtmfEvents[i]) { - default: - return "dtmfEvents: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - break; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a TelephonyDtmfEvents message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents} TelephonyDtmfEvents + * @returns {google.cloud.dialogflow.v2.DeleteEntityTypeRequest} DeleteEntityTypeRequest */ - TelephonyDtmfEvents.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents) + DeleteEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.DeleteEntityTypeRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents(); - if (object.dtmfEvents) { - if (!Array.isArray(object.dtmfEvents)) - throw TypeError(".google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.dtmfEvents: array expected"); - message.dtmfEvents = []; - for (var i = 0; i < object.dtmfEvents.length; ++i) - switch (object.dtmfEvents[i]) { - default: - case "TELEPHONY_DTMF_UNSPECIFIED": - case 0: - message.dtmfEvents[i] = 0; - break; - case "DTMF_ONE": - case 1: - message.dtmfEvents[i] = 1; - break; - case "DTMF_TWO": - case 2: - message.dtmfEvents[i] = 2; - break; - case "DTMF_THREE": - case 3: - message.dtmfEvents[i] = 3; - break; - case "DTMF_FOUR": - case 4: - message.dtmfEvents[i] = 4; - break; - case "DTMF_FIVE": - case 5: - message.dtmfEvents[i] = 5; - break; - case "DTMF_SIX": - case 6: - message.dtmfEvents[i] = 6; - break; - case "DTMF_SEVEN": - case 7: - message.dtmfEvents[i] = 7; - break; - case "DTMF_EIGHT": - case 8: - message.dtmfEvents[i] = 8; - break; - case "DTMF_NINE": - case 9: - message.dtmfEvents[i] = 9; - break; - case "DTMF_ZERO": - case 10: - message.dtmfEvents[i] = 10; - break; - case "DTMF_A": - case 11: - message.dtmfEvents[i] = 11; - break; - case "DTMF_B": - case 12: - message.dtmfEvents[i] = 12; - break; - case "DTMF_C": - case 13: - message.dtmfEvents[i] = 13; - break; - case "DTMF_D": - case 14: - message.dtmfEvents[i] = 14; - break; - case "DTMF_STAR": - case 15: - message.dtmfEvents[i] = 15; - break; - case "DTMF_POUND": - case 16: - message.dtmfEvents[i] = 16; - break; - } - } + var message = new $root.google.cloud.dialogflow.v2.DeleteEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a TelephonyDtmfEvents message. Also converts values to other types if specified. + * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest * @static - * @param {google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents} message TelephonyDtmfEvents + * @param {google.cloud.dialogflow.v2.DeleteEntityTypeRequest} message DeleteEntityTypeRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TelephonyDtmfEvents.toObject = function toObject(message, options) { + DeleteEntityTypeRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.dtmfEvents = []; - if (message.dtmfEvents && message.dtmfEvents.length) { - object.dtmfEvents = []; - for (var j = 0; j < message.dtmfEvents.length; ++j) - object.dtmfEvents[j] = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.TelephonyDtmf[message.dtmfEvents[j]] : message.dtmfEvents[j]; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this TelephonyDtmfEvents to JSON. + * Converts this DeleteEntityTypeRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @memberof google.cloud.dialogflow.v2.DeleteEntityTypeRequest * @instance * @returns {Object.} JSON object */ - TelephonyDtmfEvents.prototype.toJSON = function toJSON() { + DeleteEntityTypeRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TelephonyDtmfEvents; + return DeleteEntityTypeRequest; })(); - /** - * OutputAudioEncoding enum. - * @name google.cloud.dialogflow.v2beta1.OutputAudioEncoding - * @enum {number} - * @property {number} OUTPUT_AUDIO_ENCODING_UNSPECIFIED=0 OUTPUT_AUDIO_ENCODING_UNSPECIFIED value - * @property {number} OUTPUT_AUDIO_ENCODING_LINEAR_16=1 OUTPUT_AUDIO_ENCODING_LINEAR_16 value - * @property {number} OUTPUT_AUDIO_ENCODING_MP3=2 OUTPUT_AUDIO_ENCODING_MP3 value - * @property {number} OUTPUT_AUDIO_ENCODING_OGG_OPUS=3 OUTPUT_AUDIO_ENCODING_OGG_OPUS value - */ - v2beta1.OutputAudioEncoding = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OUTPUT_AUDIO_ENCODING_UNSPECIFIED"] = 0; - values[valuesById[1] = "OUTPUT_AUDIO_ENCODING_LINEAR_16"] = 1; - values[valuesById[2] = "OUTPUT_AUDIO_ENCODING_MP3"] = 2; - values[valuesById[3] = "OUTPUT_AUDIO_ENCODING_OGG_OPUS"] = 3; - return values; - })(); - - /** - * TelephonyDtmf enum. - * @name google.cloud.dialogflow.v2beta1.TelephonyDtmf - * @enum {number} - * @property {number} TELEPHONY_DTMF_UNSPECIFIED=0 TELEPHONY_DTMF_UNSPECIFIED value - * @property {number} DTMF_ONE=1 DTMF_ONE value - * @property {number} DTMF_TWO=2 DTMF_TWO value - * @property {number} DTMF_THREE=3 DTMF_THREE value - * @property {number} DTMF_FOUR=4 DTMF_FOUR value - * @property {number} DTMF_FIVE=5 DTMF_FIVE value - * @property {number} DTMF_SIX=6 DTMF_SIX value - * @property {number} DTMF_SEVEN=7 DTMF_SEVEN value - * @property {number} DTMF_EIGHT=8 DTMF_EIGHT value - * @property {number} DTMF_NINE=9 DTMF_NINE value - * @property {number} DTMF_ZERO=10 DTMF_ZERO value - * @property {number} DTMF_A=11 DTMF_A value - * @property {number} DTMF_B=12 DTMF_B value - * @property {number} DTMF_C=13 DTMF_C value - * @property {number} DTMF_D=14 DTMF_D value - * @property {number} DTMF_STAR=15 DTMF_STAR value - * @property {number} DTMF_POUND=16 DTMF_POUND value - */ - v2beta1.TelephonyDtmf = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TELEPHONY_DTMF_UNSPECIFIED"] = 0; - values[valuesById[1] = "DTMF_ONE"] = 1; - values[valuesById[2] = "DTMF_TWO"] = 2; - values[valuesById[3] = "DTMF_THREE"] = 3; - values[valuesById[4] = "DTMF_FOUR"] = 4; - values[valuesById[5] = "DTMF_FIVE"] = 5; - values[valuesById[6] = "DTMF_SIX"] = 6; - values[valuesById[7] = "DTMF_SEVEN"] = 7; - values[valuesById[8] = "DTMF_EIGHT"] = 8; - values[valuesById[9] = "DTMF_NINE"] = 9; - values[valuesById[10] = "DTMF_ZERO"] = 10; - values[valuesById[11] = "DTMF_A"] = 11; - values[valuesById[12] = "DTMF_B"] = 12; - values[valuesById[13] = "DTMF_C"] = 13; - values[valuesById[14] = "DTMF_D"] = 14; - values[valuesById[15] = "DTMF_STAR"] = 15; - values[valuesById[16] = "DTMF_POUND"] = 16; - return values; - })(); - - v2beta1.ValidationError = (function() { + v2.BatchUpdateEntityTypesRequest = (function() { /** - * Properties of a ValidationError. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IValidationError - * @property {google.cloud.dialogflow.v2beta1.ValidationError.Severity|null} [severity] ValidationError severity - * @property {Array.|null} [entries] ValidationError entries - * @property {string|null} [errorMessage] ValidationError errorMessage + * Properties of a BatchUpdateEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IBatchUpdateEntityTypesRequest + * @property {string|null} [parent] BatchUpdateEntityTypesRequest parent + * @property {string|null} [entityTypeBatchUri] BatchUpdateEntityTypesRequest entityTypeBatchUri + * @property {google.cloud.dialogflow.v2.IEntityTypeBatch|null} [entityTypeBatchInline] BatchUpdateEntityTypesRequest entityTypeBatchInline + * @property {string|null} [languageCode] BatchUpdateEntityTypesRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateEntityTypesRequest updateMask */ /** - * Constructs a new ValidationError. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ValidationError. - * @implements IValidationError + * Constructs a new BatchUpdateEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a BatchUpdateEntityTypesRequest. + * @implements IBatchUpdateEntityTypesRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IValidationError=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest=} [properties] Properties to set */ - function ValidationError(properties) { - this.entries = []; + function BatchUpdateEntityTypesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -37890,104 +37510,141 @@ } /** - * ValidationError severity. - * @member {google.cloud.dialogflow.v2beta1.ValidationError.Severity} severity - * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * BatchUpdateEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest * @instance */ - ValidationError.prototype.severity = 0; + BatchUpdateEntityTypesRequest.prototype.parent = ""; /** - * ValidationError entries. - * @member {Array.} entries - * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * BatchUpdateEntityTypesRequest entityTypeBatchUri. + * @member {string} entityTypeBatchUri + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest * @instance */ - ValidationError.prototype.entries = $util.emptyArray; + BatchUpdateEntityTypesRequest.prototype.entityTypeBatchUri = ""; /** - * ValidationError errorMessage. - * @member {string} errorMessage - * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * BatchUpdateEntityTypesRequest entityTypeBatchInline. + * @member {google.cloud.dialogflow.v2.IEntityTypeBatch|null|undefined} entityTypeBatchInline + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest * @instance */ - ValidationError.prototype.errorMessage = ""; + BatchUpdateEntityTypesRequest.prototype.entityTypeBatchInline = null; /** - * Creates a new ValidationError instance using the specified properties. + * BatchUpdateEntityTypesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * @instance + */ + BatchUpdateEntityTypesRequest.prototype.languageCode = ""; + + /** + * BatchUpdateEntityTypesRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * @instance + */ + BatchUpdateEntityTypesRequest.prototype.updateMask = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchUpdateEntityTypesRequest entityTypeBatch. + * @member {"entityTypeBatchUri"|"entityTypeBatchInline"|undefined} entityTypeBatch + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest + * @instance + */ + Object.defineProperty(BatchUpdateEntityTypesRequest.prototype, "entityTypeBatch", { + get: $util.oneOfGetter($oneOfFields = ["entityTypeBatchUri", "entityTypeBatchInline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchUpdateEntityTypesRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IValidationError=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ValidationError} ValidationError instance + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest instance */ - ValidationError.create = function create(properties) { - return new ValidationError(properties); + BatchUpdateEntityTypesRequest.create = function create(properties) { + return new BatchUpdateEntityTypesRequest(properties); }; /** - * Encodes the specified ValidationError message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationError.verify|verify} messages. + * Encodes the specified BatchUpdateEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IValidationError} message ValidationError message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest} message BatchUpdateEntityTypesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ValidationError.encode = function encode(message, writer) { + BatchUpdateEntityTypesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.severity); - if (message.entries != null && message.entries.length) - for (var i = 0; i < message.entries.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.entries[i]); - if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.errorMessage); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.entityTypeBatchUri != null && Object.hasOwnProperty.call(message, "entityTypeBatchUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityTypeBatchUri); + if (message.entityTypeBatchInline != null && Object.hasOwnProperty.call(message, "entityTypeBatchInline")) + $root.google.cloud.dialogflow.v2.EntityTypeBatch.encode(message.entityTypeBatchInline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified ValidationError message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationError.verify|verify} messages. + * Encodes the specified BatchUpdateEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IValidationError} message ValidationError message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesRequest} message BatchUpdateEntityTypesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ValidationError.encodeDelimited = function encodeDelimited(message, writer) { + BatchUpdateEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ValidationError message from the specified reader or buffer. + * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ValidationError} ValidationError + * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ValidationError.decode = function decode(reader, length) { + BatchUpdateEntityTypesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ValidationError(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.severity = reader.int32(); + message.parent = reader.string(); + break; + case 2: + message.entityTypeBatchUri = reader.string(); break; case 3: - if (!(message.entries && message.entries.length)) - message.entries = []; - message.entries.push(reader.string()); + message.entityTypeBatchInline = $root.google.cloud.dialogflow.v2.EntityTypeBatch.decode(reader, reader.uint32()); break; case 4: - message.errorMessage = reader.string(); + message.languageCode = reader.string(); + break; + case 5: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -37998,186 +37655,163 @@ }; /** - * Decodes a ValidationError message from the specified reader or buffer, length delimited. + * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ValidationError} ValidationError + * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ValidationError.decodeDelimited = function decodeDelimited(reader) { + BatchUpdateEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ValidationError message. + * Verifies a BatchUpdateEntityTypesRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ValidationError.verify = function verify(message) { + BatchUpdateEntityTypesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.severity != null && message.hasOwnProperty("severity")) - switch (message.severity) { - default: - return "severity: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityTypeBatchUri != null && message.hasOwnProperty("entityTypeBatchUri")) { + properties.entityTypeBatch = 1; + if (!$util.isString(message.entityTypeBatchUri)) + return "entityTypeBatchUri: string expected"; + } + if (message.entityTypeBatchInline != null && message.hasOwnProperty("entityTypeBatchInline")) { + if (properties.entityTypeBatch === 1) + return "entityTypeBatch: multiple values"; + properties.entityTypeBatch = 1; + { + var error = $root.google.cloud.dialogflow.v2.EntityTypeBatch.verify(message.entityTypeBatchInline); + if (error) + return "entityTypeBatchInline." + error; } - if (message.entries != null && message.hasOwnProperty("entries")) { - if (!Array.isArray(message.entries)) - return "entries: array expected"; - for (var i = 0; i < message.entries.length; ++i) - if (!$util.isString(message.entries[i])) - return "entries: string[] expected"; } - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) - if (!$util.isString(message.errorMessage)) - return "errorMessage: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a ValidationError message from a plain object. Also converts values to their respective internal types. + * Creates a BatchUpdateEntityTypesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ValidationError} ValidationError + * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest */ - ValidationError.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ValidationError) + BatchUpdateEntityTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ValidationError(); - switch (object.severity) { - case "SEVERITY_UNSPECIFIED": - case 0: - message.severity = 0; - break; - case "INFO": - case 1: - message.severity = 1; - break; - case "WARNING": - case 2: - message.severity = 2; - break; - case "ERROR": - case 3: - message.severity = 3; - break; - case "CRITICAL": - case 4: - message.severity = 4; - break; + var message = new $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityTypeBatchUri != null) + message.entityTypeBatchUri = String(object.entityTypeBatchUri); + if (object.entityTypeBatchInline != null) { + if (typeof object.entityTypeBatchInline !== "object") + throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.entityTypeBatchInline: object expected"); + message.entityTypeBatchInline = $root.google.cloud.dialogflow.v2.EntityTypeBatch.fromObject(object.entityTypeBatchInline); } - if (object.entries) { - if (!Array.isArray(object.entries)) - throw TypeError(".google.cloud.dialogflow.v2beta1.ValidationError.entries: array expected"); - message.entries = []; - for (var i = 0; i < object.entries.length; ++i) - message.entries[i] = String(object.entries[i]); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.errorMessage != null) - message.errorMessage = String(object.errorMessage); return message; }; /** - * Creates a plain object from a ValidationError message. Also converts values to other types if specified. + * Creates a plain object from a BatchUpdateEntityTypesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ValidationError} message ValidationError + * @param {google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest} message BatchUpdateEntityTypesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ValidationError.toObject = function toObject(message, options) { + BatchUpdateEntityTypesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entries = []; if (options.defaults) { - object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; - object.errorMessage = ""; + object.parent = ""; + object.languageCode = ""; + object.updateMask = null; } - if (message.severity != null && message.hasOwnProperty("severity")) - object.severity = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.ValidationError.Severity[message.severity] : message.severity; - if (message.entries && message.entries.length) { - object.entries = []; - for (var j = 0; j < message.entries.length; ++j) - object.entries[j] = message.entries[j]; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityTypeBatchUri != null && message.hasOwnProperty("entityTypeBatchUri")) { + object.entityTypeBatchUri = message.entityTypeBatchUri; + if (options.oneofs) + object.entityTypeBatch = "entityTypeBatchUri"; } - if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) - object.errorMessage = message.errorMessage; + if (message.entityTypeBatchInline != null && message.hasOwnProperty("entityTypeBatchInline")) { + object.entityTypeBatchInline = $root.google.cloud.dialogflow.v2.EntityTypeBatch.toObject(message.entityTypeBatchInline, options); + if (options.oneofs) + object.entityTypeBatch = "entityTypeBatchInline"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this ValidationError to JSON. + * Converts this BatchUpdateEntityTypesRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesRequest * @instance * @returns {Object.} JSON object */ - ValidationError.prototype.toJSON = function toJSON() { + BatchUpdateEntityTypesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * Severity enum. - * @name google.cloud.dialogflow.v2beta1.ValidationError.Severity - * @enum {number} - * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value - * @property {number} INFO=1 INFO value - * @property {number} WARNING=2 WARNING value - * @property {number} ERROR=3 ERROR value - * @property {number} CRITICAL=4 CRITICAL value - */ - ValidationError.Severity = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; - values[valuesById[1] = "INFO"] = 1; - values[valuesById[2] = "WARNING"] = 2; - values[valuesById[3] = "ERROR"] = 3; - values[valuesById[4] = "CRITICAL"] = 4; - return values; - })(); - - return ValidationError; + return BatchUpdateEntityTypesRequest; })(); - v2beta1.ValidationResult = (function() { + v2.BatchUpdateEntityTypesResponse = (function() { /** - * Properties of a ValidationResult. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IValidationResult - * @property {Array.|null} [validationErrors] ValidationResult validationErrors + * Properties of a BatchUpdateEntityTypesResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IBatchUpdateEntityTypesResponse + * @property {Array.|null} [entityTypes] BatchUpdateEntityTypesResponse entityTypes */ /** - * Constructs a new ValidationResult. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ValidationResult. - * @implements IValidationResult + * Constructs a new BatchUpdateEntityTypesResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a BatchUpdateEntityTypesResponse. + * @implements IBatchUpdateEntityTypesResponse * @constructor - * @param {google.cloud.dialogflow.v2beta1.IValidationResult=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse=} [properties] Properties to set */ - function ValidationResult(properties) { - this.validationErrors = []; + function BatchUpdateEntityTypesResponse(properties) { + this.entityTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38185,78 +37819,78 @@ } /** - * ValidationResult validationErrors. - * @member {Array.} validationErrors - * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * BatchUpdateEntityTypesResponse entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse * @instance */ - ValidationResult.prototype.validationErrors = $util.emptyArray; + BatchUpdateEntityTypesResponse.prototype.entityTypes = $util.emptyArray; /** - * Creates a new ValidationResult instance using the specified properties. + * Creates a new BatchUpdateEntityTypesResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IValidationResult=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ValidationResult} ValidationResult instance + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse instance */ - ValidationResult.create = function create(properties) { - return new ValidationResult(properties); + BatchUpdateEntityTypesResponse.create = function create(properties) { + return new BatchUpdateEntityTypesResponse(properties); }; /** - * Encodes the specified ValidationResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationResult.verify|verify} messages. + * Encodes the specified BatchUpdateEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IValidationResult} message ValidationResult message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse} message BatchUpdateEntityTypesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ValidationResult.encode = function encode(message, writer) { + BatchUpdateEntityTypesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.validationErrors != null && message.validationErrors.length) - for (var i = 0; i < message.validationErrors.length; ++i) - $root.google.cloud.dialogflow.v2beta1.ValidationError.encode(message.validationErrors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + $root.google.cloud.dialogflow.v2.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified ValidationResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationResult.verify|verify} messages. + * Encodes the specified BatchUpdateEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IValidationResult} message ValidationResult message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntityTypesResponse} message BatchUpdateEntityTypesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ValidationResult.encodeDelimited = function encodeDelimited(message, writer) { + BatchUpdateEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ValidationResult message from the specified reader or buffer. + * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ValidationResult} ValidationResult + * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ValidationResult.decode = function decode(reader, length) { + BatchUpdateEntityTypesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ValidationResult(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.validationErrors && message.validationErrors.length)) - message.validationErrors = []; - message.validationErrors.push($root.google.cloud.dialogflow.v2beta1.ValidationError.decode(reader, reader.uint32())); + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push($root.google.cloud.dialogflow.v2.EntityType.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -38267,359 +37901,126 @@ }; /** - * Decodes a ValidationResult message from the specified reader or buffer, length delimited. + * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ValidationResult} ValidationResult + * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ValidationResult.decodeDelimited = function decodeDelimited(reader) { + BatchUpdateEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ValidationResult message. + * Verifies a BatchUpdateEntityTypesResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ValidationResult.verify = function verify(message) { + BatchUpdateEntityTypesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.validationErrors != null && message.hasOwnProperty("validationErrors")) { - if (!Array.isArray(message.validationErrors)) - return "validationErrors: array expected"; - for (var i = 0; i < message.validationErrors.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.ValidationError.verify(message.validationErrors[i]); + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.EntityType.verify(message.entityTypes[i]); if (error) - return "validationErrors." + error; + return "entityTypes." + error; } } return null; }; /** - * Creates a ValidationResult message from a plain object. Also converts values to their respective internal types. + * Creates a BatchUpdateEntityTypesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ValidationResult} ValidationResult + * @returns {google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse */ - ValidationResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ValidationResult) + BatchUpdateEntityTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ValidationResult(); - if (object.validationErrors) { - if (!Array.isArray(object.validationErrors)) - throw TypeError(".google.cloud.dialogflow.v2beta1.ValidationResult.validationErrors: array expected"); - message.validationErrors = []; - for (var i = 0; i < object.validationErrors.length; ++i) { - if (typeof object.validationErrors[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.ValidationResult.validationErrors: object expected"); - message.validationErrors[i] = $root.google.cloud.dialogflow.v2beta1.ValidationError.fromObject(object.validationErrors[i]); + var message = new $root.google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse(); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) { + if (typeof object.entityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse.entityTypes: object expected"); + message.entityTypes[i] = $root.google.cloud.dialogflow.v2.EntityType.fromObject(object.entityTypes[i]); } } return message; }; /** - * Creates a plain object from a ValidationResult message. Also converts values to other types if specified. + * Creates a plain object from a BatchUpdateEntityTypesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.ValidationResult} message ValidationResult + * @param {google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse} message BatchUpdateEntityTypesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ValidationResult.toObject = function toObject(message, options) { + BatchUpdateEntityTypesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.validationErrors = []; - if (message.validationErrors && message.validationErrors.length) { - object.validationErrors = []; - for (var j = 0; j < message.validationErrors.length; ++j) - object.validationErrors[j] = $root.google.cloud.dialogflow.v2beta1.ValidationError.toObject(message.validationErrors[j], options); + object.entityTypes = []; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = $root.google.cloud.dialogflow.v2.EntityType.toObject(message.entityTypes[j], options); } return object; }; /** - * Converts this ValidationResult to JSON. + * Converts this BatchUpdateEntityTypesResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse * @instance * @returns {Object.} JSON object */ - ValidationResult.prototype.toJSON = function toJSON() { + BatchUpdateEntityTypesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ValidationResult; - })(); - - v2beta1.Contexts = (function() { - - /** - * Constructs a new Contexts service. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a Contexts - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Contexts(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Contexts.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Contexts; - - /** - * Creates new Contexts service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Contexts} RPC service. Useful where requests and/or responses are streamed. - */ - Contexts.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#listContexts}. - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @typedef ListContextsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.ListContextsResponse} [response] ListContextsResponse - */ - - /** - * Calls ListContexts. - * @function listContexts - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @instance - * @param {google.cloud.dialogflow.v2beta1.IListContextsRequest} request ListContextsRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Contexts.ListContextsCallback} callback Node-style callback called with the error, if any, and ListContextsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Contexts.prototype.listContexts = function listContexts(request, callback) { - return this.rpcCall(listContexts, $root.google.cloud.dialogflow.v2beta1.ListContextsRequest, $root.google.cloud.dialogflow.v2beta1.ListContextsResponse, request, callback); - }, "name", { value: "ListContexts" }); - - /** - * Calls ListContexts. - * @function listContexts - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @instance - * @param {google.cloud.dialogflow.v2beta1.IListContextsRequest} request ListContextsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#getContext}. - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @typedef GetContextCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.Context} [response] Context - */ - - /** - * Calls GetContext. - * @function getContext - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetContextRequest} request GetContextRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Contexts.GetContextCallback} callback Node-style callback called with the error, if any, and Context - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Contexts.prototype.getContext = function getContext(request, callback) { - return this.rpcCall(getContext, $root.google.cloud.dialogflow.v2beta1.GetContextRequest, $root.google.cloud.dialogflow.v2beta1.Context, request, callback); - }, "name", { value: "GetContext" }); - - /** - * Calls GetContext. - * @function getContext - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetContextRequest} request GetContextRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#createContext}. - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @typedef CreateContextCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.Context} [response] Context - */ - - /** - * Calls CreateContext. - * @function createContext - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @instance - * @param {google.cloud.dialogflow.v2beta1.ICreateContextRequest} request CreateContextRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Contexts.CreateContextCallback} callback Node-style callback called with the error, if any, and Context - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Contexts.prototype.createContext = function createContext(request, callback) { - return this.rpcCall(createContext, $root.google.cloud.dialogflow.v2beta1.CreateContextRequest, $root.google.cloud.dialogflow.v2beta1.Context, request, callback); - }, "name", { value: "CreateContext" }); - - /** - * Calls CreateContext. - * @function createContext - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @instance - * @param {google.cloud.dialogflow.v2beta1.ICreateContextRequest} request CreateContextRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#updateContext}. - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @typedef UpdateContextCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.Context} [response] Context - */ - - /** - * Calls UpdateContext. - * @function updateContext - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @instance - * @param {google.cloud.dialogflow.v2beta1.IUpdateContextRequest} request UpdateContextRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Contexts.UpdateContextCallback} callback Node-style callback called with the error, if any, and Context - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Contexts.prototype.updateContext = function updateContext(request, callback) { - return this.rpcCall(updateContext, $root.google.cloud.dialogflow.v2beta1.UpdateContextRequest, $root.google.cloud.dialogflow.v2beta1.Context, request, callback); - }, "name", { value: "UpdateContext" }); - - /** - * Calls UpdateContext. - * @function updateContext - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @instance - * @param {google.cloud.dialogflow.v2beta1.IUpdateContextRequest} request UpdateContextRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#deleteContext}. - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @typedef DeleteContextCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteContext. - * @function deleteContext - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteContextRequest} request DeleteContextRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Contexts.DeleteContextCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Contexts.prototype.deleteContext = function deleteContext(request, callback) { - return this.rpcCall(deleteContext, $root.google.cloud.dialogflow.v2beta1.DeleteContextRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteContext" }); - - /** - * Calls DeleteContext. - * @function deleteContext - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteContextRequest} request DeleteContextRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#deleteAllContexts}. - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @typedef DeleteAllContextsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ - - /** - * Calls DeleteAllContexts. - * @function deleteAllContexts - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest} request DeleteAllContextsRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Contexts.DeleteAllContextsCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Contexts.prototype.deleteAllContexts = function deleteAllContexts(request, callback) { - return this.rpcCall(deleteAllContexts, $root.google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteAllContexts" }); - - /** - * Calls DeleteAllContexts. - * @function deleteAllContexts - * @memberof google.cloud.dialogflow.v2beta1.Contexts - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest} request DeleteAllContextsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Contexts; + return BatchUpdateEntityTypesResponse; })(); - v2beta1.Context = (function() { + v2.BatchDeleteEntityTypesRequest = (function() { /** - * Properties of a Context. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IContext - * @property {string|null} [name] Context name - * @property {number|null} [lifespanCount] Context lifespanCount - * @property {google.protobuf.IStruct|null} [parameters] Context parameters + * Properties of a BatchDeleteEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IBatchDeleteEntityTypesRequest + * @property {string|null} [parent] BatchDeleteEntityTypesRequest parent + * @property {Array.|null} [entityTypeNames] BatchDeleteEntityTypesRequest entityTypeNames */ /** - * Constructs a new Context. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a Context. - * @implements IContext + * Constructs a new BatchDeleteEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a BatchDeleteEntityTypesRequest. + * @implements IBatchDeleteEntityTypesRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IContext=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest=} [properties] Properties to set */ - function Context(properties) { + function BatchDeleteEntityTypesRequest(properties) { + this.entityTypeNames = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38627,101 +38028,91 @@ } /** - * Context name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.Context - * @instance - */ - Context.prototype.name = ""; - - /** - * Context lifespanCount. - * @member {number} lifespanCount - * @memberof google.cloud.dialogflow.v2beta1.Context + * BatchDeleteEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest * @instance */ - Context.prototype.lifespanCount = 0; + BatchDeleteEntityTypesRequest.prototype.parent = ""; /** - * Context parameters. - * @member {google.protobuf.IStruct|null|undefined} parameters - * @memberof google.cloud.dialogflow.v2beta1.Context + * BatchDeleteEntityTypesRequest entityTypeNames. + * @member {Array.} entityTypeNames + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest * @instance */ - Context.prototype.parameters = null; + BatchDeleteEntityTypesRequest.prototype.entityTypeNames = $util.emptyArray; /** - * Creates a new Context instance using the specified properties. + * Creates a new BatchDeleteEntityTypesRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.Context + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IContext=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Context} Context instance + * @param {google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest instance */ - Context.create = function create(properties) { - return new Context(properties); + BatchDeleteEntityTypesRequest.create = function create(properties) { + return new BatchDeleteEntityTypesRequest(properties); }; /** - * Encodes the specified Context message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Context.verify|verify} messages. + * Encodes the specified BatchDeleteEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Context + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IContext} message Context message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest} message BatchDeleteEntityTypesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Context.encode = function encode(message, writer) { + BatchDeleteEntityTypesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.lifespanCount != null && Object.hasOwnProperty.call(message, "lifespanCount")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.lifespanCount); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.entityTypeNames != null && message.entityTypeNames.length) + for (var i = 0; i < message.entityTypeNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityTypeNames[i]); return writer; }; /** - * Encodes the specified Context message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Context.verify|verify} messages. + * Encodes the specified BatchDeleteEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Context + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IContext} message Context message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchDeleteEntityTypesRequest} message BatchDeleteEntityTypesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Context.encodeDelimited = function encodeDelimited(message, writer) { + BatchDeleteEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Context message from the specified reader or buffer. + * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Context + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Context} Context + * @returns {google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Context.decode = function decode(reader, length) { + BatchDeleteEntityTypesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Context(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); break; case 2: - message.lifespanCount = reader.int32(); - break; - case 3: - message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + if (!(message.entityTypeNames && message.entityTypeNames.length)) + message.entityTypeNames = []; + message.entityTypeNames.push(reader.string()); break; default: reader.skipType(tag & 7); @@ -38732,131 +38123,131 @@ }; /** - * Decodes a Context message from the specified reader or buffer, length delimited. + * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Context + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Context} Context + * @returns {google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Context.decodeDelimited = function decodeDelimited(reader) { + BatchDeleteEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Context message. + * Verifies a BatchDeleteEntityTypesRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Context + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Context.verify = function verify(message) { + BatchDeleteEntityTypesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.lifespanCount != null && message.hasOwnProperty("lifespanCount")) - if (!$util.isInteger(message.lifespanCount)) - return "lifespanCount: integer expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - var error = $root.google.protobuf.Struct.verify(message.parameters); - if (error) - return "parameters." + error; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityTypeNames != null && message.hasOwnProperty("entityTypeNames")) { + if (!Array.isArray(message.entityTypeNames)) + return "entityTypeNames: array expected"; + for (var i = 0; i < message.entityTypeNames.length; ++i) + if (!$util.isString(message.entityTypeNames[i])) + return "entityTypeNames: string[] expected"; } return null; }; /** - * Creates a Context message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDeleteEntityTypesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Context + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Context} Context + * @returns {google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest */ - Context.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Context) + BatchDeleteEntityTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Context(); - if (object.name != null) - message.name = String(object.name); - if (object.lifespanCount != null) - message.lifespanCount = object.lifespanCount | 0; - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Context.parameters: object expected"); - message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters); + var message = new $root.google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityTypeNames) { + if (!Array.isArray(object.entityTypeNames)) + throw TypeError(".google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest.entityTypeNames: array expected"); + message.entityTypeNames = []; + for (var i = 0; i < object.entityTypeNames.length; ++i) + message.entityTypeNames[i] = String(object.entityTypeNames[i]); } return message; }; /** - * Creates a plain object from a Context message. Also converts values to other types if specified. + * Creates a plain object from a BatchDeleteEntityTypesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Context + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.Context} message Context + * @param {google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest} message BatchDeleteEntityTypesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Context.toObject = function toObject(message, options) { + BatchDeleteEntityTypesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.lifespanCount = 0; - object.parameters = null; + if (options.arrays || options.defaults) + object.entityTypeNames = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityTypeNames && message.entityTypeNames.length) { + object.entityTypeNames = []; + for (var j = 0; j < message.entityTypeNames.length; ++j) + object.entityTypeNames[j] = message.entityTypeNames[j]; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.lifespanCount != null && message.hasOwnProperty("lifespanCount")) - object.lifespanCount = message.lifespanCount; - if (message.parameters != null && message.hasOwnProperty("parameters")) - object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); return object; }; /** - * Converts this Context to JSON. + * Converts this BatchDeleteEntityTypesRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Context + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntityTypesRequest * @instance * @returns {Object.} JSON object */ - Context.prototype.toJSON = function toJSON() { + BatchDeleteEntityTypesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Context; + return BatchDeleteEntityTypesRequest; })(); - v2beta1.ListContextsRequest = (function() { + v2.BatchCreateEntitiesRequest = (function() { /** - * Properties of a ListContextsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListContextsRequest - * @property {string|null} [parent] ListContextsRequest parent - * @property {number|null} [pageSize] ListContextsRequest pageSize - * @property {string|null} [pageToken] ListContextsRequest pageToken + * Properties of a BatchCreateEntitiesRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IBatchCreateEntitiesRequest + * @property {string|null} [parent] BatchCreateEntitiesRequest parent + * @property {Array.|null} [entities] BatchCreateEntitiesRequest entities + * @property {string|null} [languageCode] BatchCreateEntitiesRequest languageCode */ /** - * Constructs a new ListContextsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListContextsRequest. - * @implements IListContextsRequest + * Constructs a new BatchCreateEntitiesRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a BatchCreateEntitiesRequest. + * @implements IBatchCreateEntitiesRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListContextsRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest=} [properties] Properties to set */ - function ListContextsRequest(properties) { + function BatchCreateEntitiesRequest(properties) { + this.entities = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -38864,90 +38255,91 @@ } /** - * ListContextsRequest parent. + * BatchCreateEntitiesRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest * @instance */ - ListContextsRequest.prototype.parent = ""; + BatchCreateEntitiesRequest.prototype.parent = ""; /** - * ListContextsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * BatchCreateEntitiesRequest entities. + * @member {Array.} entities + * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest * @instance */ - ListContextsRequest.prototype.pageSize = 0; + BatchCreateEntitiesRequest.prototype.entities = $util.emptyArray; /** - * ListContextsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * BatchCreateEntitiesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest * @instance */ - ListContextsRequest.prototype.pageToken = ""; + BatchCreateEntitiesRequest.prototype.languageCode = ""; /** - * Creates a new ListContextsRequest instance using the specified properties. + * Creates a new BatchCreateEntitiesRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListContextsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListContextsRequest} ListContextsRequest instance + * @param {google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest instance */ - ListContextsRequest.create = function create(properties) { - return new ListContextsRequest(properties); + BatchCreateEntitiesRequest.create = function create(properties) { + return new BatchCreateEntitiesRequest(properties); }; /** - * Encodes the specified ListContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsRequest.verify|verify} messages. + * Encodes the specified BatchCreateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListContextsRequest} message ListContextsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest} message BatchCreateEntitiesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListContextsRequest.encode = function encode(message, writer) { + BatchCreateEntitiesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dialogflow.v2.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); return writer; }; /** - * Encodes the specified ListContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsRequest.verify|verify} messages. + * Encodes the specified BatchCreateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListContextsRequest} message ListContextsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchCreateEntitiesRequest} message BatchCreateEntitiesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListContextsRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchCreateEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListContextsRequest message from the specified reader or buffer. + * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListContextsRequest} ListContextsRequest + * @returns {google.cloud.dialogflow.v2.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListContextsRequest.decode = function decode(reader, length) { + BatchCreateEntitiesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListContextsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchCreateEntitiesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -38955,10 +38347,12 @@ message.parent = reader.string(); break; case 2: - message.pageSize = reader.int32(); + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dialogflow.v2.EntityType.Entity.decode(reader, reader.uint32())); break; case 3: - message.pageToken = reader.string(); + message.languageCode = reader.string(); break; default: reader.skipType(tag & 7); @@ -38969,126 +38363,146 @@ }; /** - * Decodes a ListContextsRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListContextsRequest} ListContextsRequest + * @returns {google.cloud.dialogflow.v2.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListContextsRequest.decodeDelimited = function decodeDelimited(reader) { + BatchCreateEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListContextsRequest message. + * Verifies a BatchCreateEntitiesRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListContextsRequest.verify = function verify(message) { + BatchCreateEntitiesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.EntityType.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; return null; }; /** - * Creates a ListContextsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchCreateEntitiesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListContextsRequest} ListContextsRequest + * @returns {google.cloud.dialogflow.v2.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest */ - ListContextsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListContextsRequest) + BatchCreateEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.BatchCreateEntitiesRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListContextsRequest(); + var message = new $root.google.cloud.dialogflow.v2.BatchCreateEntitiesRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.BatchCreateEntitiesRequest.entities: object expected"); + message.entities[i] = $root.google.cloud.dialogflow.v2.EntityType.Entity.fromObject(object.entities[i]); + } + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); return message; }; /** - * Creates a plain object from a ListContextsRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchCreateEntitiesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ListContextsRequest} message ListContextsRequest + * @param {google.cloud.dialogflow.v2.BatchCreateEntitiesRequest} message BatchCreateEntitiesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListContextsRequest.toObject = function toObject(message, options) { + BatchCreateEntitiesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.entities = []; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; + object.languageCode = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dialogflow.v2.EntityType.Entity.toObject(message.entities[j], options); + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; return object; }; /** - * Converts this ListContextsRequest to JSON. + * Converts this BatchCreateEntitiesRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @memberof google.cloud.dialogflow.v2.BatchCreateEntitiesRequest * @instance * @returns {Object.} JSON object */ - ListContextsRequest.prototype.toJSON = function toJSON() { + BatchCreateEntitiesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListContextsRequest; + return BatchCreateEntitiesRequest; })(); - v2beta1.ListContextsResponse = (function() { + v2.BatchUpdateEntitiesRequest = (function() { /** - * Properties of a ListContextsResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListContextsResponse - * @property {Array.|null} [contexts] ListContextsResponse contexts - * @property {string|null} [nextPageToken] ListContextsResponse nextPageToken + * Properties of a BatchUpdateEntitiesRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IBatchUpdateEntitiesRequest + * @property {string|null} [parent] BatchUpdateEntitiesRequest parent + * @property {Array.|null} [entities] BatchUpdateEntitiesRequest entities + * @property {string|null} [languageCode] BatchUpdateEntitiesRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateEntitiesRequest updateMask */ /** - * Constructs a new ListContextsResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListContextsResponse. - * @implements IListContextsResponse + * Constructs a new BatchUpdateEntitiesRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a BatchUpdateEntitiesRequest. + * @implements IBatchUpdateEntitiesRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListContextsResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest=} [properties] Properties to set */ - function ListContextsResponse(properties) { - this.contexts = []; + function BatchUpdateEntitiesRequest(properties) { + this.entities = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39096,91 +38510,117 @@ } /** - * ListContextsResponse contexts. - * @member {Array.} contexts - * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * BatchUpdateEntitiesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest * @instance */ - ListContextsResponse.prototype.contexts = $util.emptyArray; + BatchUpdateEntitiesRequest.prototype.parent = ""; /** - * ListContextsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * BatchUpdateEntitiesRequest entities. + * @member {Array.} entities + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest * @instance */ - ListContextsResponse.prototype.nextPageToken = ""; + BatchUpdateEntitiesRequest.prototype.entities = $util.emptyArray; /** - * Creates a new ListContextsResponse instance using the specified properties. + * BatchUpdateEntitiesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * @instance + */ + BatchUpdateEntitiesRequest.prototype.languageCode = ""; + + /** + * BatchUpdateEntitiesRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest + * @instance + */ + BatchUpdateEntitiesRequest.prototype.updateMask = null; + + /** + * Creates a new BatchUpdateEntitiesRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListContextsResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListContextsResponse} ListContextsResponse instance + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest instance */ - ListContextsResponse.create = function create(properties) { - return new ListContextsResponse(properties); + BatchUpdateEntitiesRequest.create = function create(properties) { + return new BatchUpdateEntitiesRequest(properties); }; /** - * Encodes the specified ListContextsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsResponse.verify|verify} messages. + * Encodes the specified BatchUpdateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListContextsResponse} message ListContextsResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest} message BatchUpdateEntitiesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListContextsResponse.encode = function encode(message, writer) { + BatchUpdateEntitiesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.contexts != null && message.contexts.length) - for (var i = 0; i < message.contexts.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Context.encode(message.contexts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dialogflow.v2.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListContextsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsResponse.verify|verify} messages. + * Encodes the specified BatchUpdateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListContextsResponse} message ListContextsResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchUpdateEntitiesRequest} message BatchUpdateEntitiesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListContextsResponse.encodeDelimited = function encodeDelimited(message, writer) { + BatchUpdateEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListContextsResponse message from the specified reader or buffer. + * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListContextsResponse} ListContextsResponse + * @returns {google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListContextsResponse.decode = function decode(reader, length) { + BatchUpdateEntitiesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListContextsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.contexts && message.contexts.length)) - message.contexts = []; - message.contexts.push($root.google.cloud.dialogflow.v2beta1.Context.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dialogflow.v2.EntityType.Entity.decode(reader, reader.uint32())); + break; + case 3: + message.languageCode = reader.string(); + break; + case 4: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -39191,133 +38631,158 @@ }; /** - * Decodes a ListContextsResponse message from the specified reader or buffer, length delimited. + * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListContextsResponse} ListContextsResponse + * @returns {google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListContextsResponse.decodeDelimited = function decodeDelimited(reader) { + BatchUpdateEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListContextsResponse message. + * Verifies a BatchUpdateEntitiesRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListContextsResponse.verify = function verify(message) { + BatchUpdateEntitiesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.contexts != null && message.hasOwnProperty("contexts")) { - if (!Array.isArray(message.contexts)) - return "contexts: array expected"; - for (var i = 0; i < message.contexts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Context.verify(message.contexts[i]); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.EntityType.Entity.verify(message.entities[i]); if (error) - return "contexts." + error; + return "entities." + error; } } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a ListContextsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a BatchUpdateEntitiesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListContextsResponse} ListContextsResponse + * @returns {google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest */ - ListContextsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListContextsResponse) + BatchUpdateEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListContextsResponse(); - if (object.contexts) { - if (!Array.isArray(object.contexts)) - throw TypeError(".google.cloud.dialogflow.v2beta1.ListContextsResponse.contexts: array expected"); - message.contexts = []; - for (var i = 0; i < object.contexts.length; ++i) { - if (typeof object.contexts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.ListContextsResponse.contexts: object expected"); - message.contexts[i] = $root.google.cloud.dialogflow.v2beta1.Context.fromObject(object.contexts[i]); + var message = new $root.google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.entities: object expected"); + message.entities[i] = $root.google.cloud.dialogflow.v2.EntityType.Entity.fromObject(object.entities[i]); } } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a ListContextsResponse message. Also converts values to other types if specified. + * Creates a plain object from a BatchUpdateEntitiesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ListContextsResponse} message ListContextsResponse + * @param {google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest} message BatchUpdateEntitiesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListContextsResponse.toObject = function toObject(message, options) { + BatchUpdateEntitiesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.contexts = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.contexts && message.contexts.length) { - object.contexts = []; - for (var j = 0; j < message.contexts.length; ++j) - object.contexts[j] = $root.google.cloud.dialogflow.v2beta1.Context.toObject(message.contexts[j], options); + object.entities = []; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.updateMask = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dialogflow.v2.EntityType.Entity.toObject(message.entities[j], options); + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this ListContextsResponse to JSON. + * Converts this BatchUpdateEntitiesRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @memberof google.cloud.dialogflow.v2.BatchUpdateEntitiesRequest * @instance * @returns {Object.} JSON object */ - ListContextsResponse.prototype.toJSON = function toJSON() { + BatchUpdateEntitiesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListContextsResponse; + return BatchUpdateEntitiesRequest; })(); - v2beta1.GetContextRequest = (function() { + v2.BatchDeleteEntitiesRequest = (function() { /** - * Properties of a GetContextRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IGetContextRequest - * @property {string|null} [name] GetContextRequest name + * Properties of a BatchDeleteEntitiesRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IBatchDeleteEntitiesRequest + * @property {string|null} [parent] BatchDeleteEntitiesRequest parent + * @property {Array.|null} [entityValues] BatchDeleteEntitiesRequest entityValues + * @property {string|null} [languageCode] BatchDeleteEntitiesRequest languageCode */ /** - * Constructs a new GetContextRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a GetContextRequest. - * @implements IGetContextRequest + * Constructs a new BatchDeleteEntitiesRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a BatchDeleteEntitiesRequest. + * @implements IBatchDeleteEntitiesRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IGetContextRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest=} [properties] Properties to set */ - function GetContextRequest(properties) { + function BatchDeleteEntitiesRequest(properties) { + this.entityValues = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39325,187 +38790,246 @@ } /** - * GetContextRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * BatchDeleteEntitiesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest * @instance */ - GetContextRequest.prototype.name = ""; + BatchDeleteEntitiesRequest.prototype.parent = ""; /** - * Creates a new GetContextRequest instance using the specified properties. + * BatchDeleteEntitiesRequest entityValues. + * @member {Array.} entityValues + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + * @instance + */ + BatchDeleteEntitiesRequest.prototype.entityValues = $util.emptyArray; + + /** + * BatchDeleteEntitiesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest + * @instance + */ + BatchDeleteEntitiesRequest.prototype.languageCode = ""; + + /** + * Creates a new BatchDeleteEntitiesRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetContextRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.GetContextRequest} GetContextRequest instance + * @param {google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest instance */ - GetContextRequest.create = function create(properties) { - return new GetContextRequest(properties); + BatchDeleteEntitiesRequest.create = function create(properties) { + return new BatchDeleteEntitiesRequest(properties); }; /** - * Encodes the specified GetContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetContextRequest.verify|verify} messages. + * Encodes the specified BatchDeleteEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetContextRequest} message GetContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest} message BatchDeleteEntitiesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetContextRequest.encode = function encode(message, writer) { + BatchDeleteEntitiesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.entityValues != null && message.entityValues.length) + for (var i = 0; i < message.entityValues.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityValues[i]); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); return writer; }; /** - * Encodes the specified GetContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetContextRequest.verify|verify} messages. + * Encodes the specified BatchDeleteEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetContextRequest} message GetContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IBatchDeleteEntitiesRequest} message BatchDeleteEntitiesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + BatchDeleteEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetContextRequest message from the specified reader or buffer. + * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.GetContextRequest} GetContextRequest + * @returns {google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetContextRequest.decode = function decode(reader, length) { + BatchDeleteEntitiesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetContextRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); break; - default: - reader.skipType(tag & 7); + case 2: + if (!(message.entityValues && message.entityValues.length)) + message.entityValues = []; + message.entityValues.push(reader.string()); break; - } + case 3: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } return message; }; /** - * Decodes a GetContextRequest message from the specified reader or buffer, length delimited. + * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.GetContextRequest} GetContextRequest + * @returns {google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetContextRequest.decodeDelimited = function decodeDelimited(reader) { + BatchDeleteEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetContextRequest message. + * Verifies a BatchDeleteEntitiesRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetContextRequest.verify = function verify(message) { + BatchDeleteEntitiesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityValues != null && message.hasOwnProperty("entityValues")) { + if (!Array.isArray(message.entityValues)) + return "entityValues: array expected"; + for (var i = 0; i < message.entityValues.length; ++i) + if (!$util.isString(message.entityValues[i])) + return "entityValues: string[] expected"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; return null; }; /** - * Creates a GetContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a BatchDeleteEntitiesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.GetContextRequest} GetContextRequest + * @returns {google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest */ - GetContextRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetContextRequest) + BatchDeleteEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.GetContextRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityValues) { + if (!Array.isArray(object.entityValues)) + throw TypeError(".google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest.entityValues: array expected"); + message.entityValues = []; + for (var i = 0; i < object.entityValues.length; ++i) + message.entityValues[i] = String(object.entityValues[i]); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); return message; }; /** - * Creates a plain object from a GetContextRequest message. Also converts values to other types if specified. + * Creates a plain object from a BatchDeleteEntitiesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.GetContextRequest} message GetContextRequest + * @param {google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest} message BatchDeleteEntitiesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetContextRequest.toObject = function toObject(message, options) { + BatchDeleteEntitiesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.arrays || options.defaults) + object.entityValues = []; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityValues && message.entityValues.length) { + object.entityValues = []; + for (var j = 0; j < message.entityValues.length; ++j) + object.entityValues[j] = message.entityValues[j]; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; return object; }; /** - * Converts this GetContextRequest to JSON. + * Converts this BatchDeleteEntitiesRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @memberof google.cloud.dialogflow.v2.BatchDeleteEntitiesRequest * @instance * @returns {Object.} JSON object */ - GetContextRequest.prototype.toJSON = function toJSON() { + BatchDeleteEntitiesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetContextRequest; + return BatchDeleteEntitiesRequest; })(); - v2beta1.CreateContextRequest = (function() { + v2.EntityTypeBatch = (function() { /** - * Properties of a CreateContextRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface ICreateContextRequest - * @property {string|null} [parent] CreateContextRequest parent - * @property {google.cloud.dialogflow.v2beta1.IContext|null} [context] CreateContextRequest context + * Properties of an EntityTypeBatch. + * @memberof google.cloud.dialogflow.v2 + * @interface IEntityTypeBatch + * @property {Array.|null} [entityTypes] EntityTypeBatch entityTypes */ /** - * Constructs a new CreateContextRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a CreateContextRequest. - * @implements ICreateContextRequest + * Constructs a new EntityTypeBatch. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an EntityTypeBatch. + * @implements IEntityTypeBatch * @constructor - * @param {google.cloud.dialogflow.v2beta1.ICreateContextRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IEntityTypeBatch=} [properties] Properties to set */ - function CreateContextRequest(properties) { + function EntityTypeBatch(properties) { + this.entityTypes = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39513,88 +39037,78 @@ } /** - * CreateContextRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest - * @instance - */ - CreateContextRequest.prototype.parent = ""; - - /** - * CreateContextRequest context. - * @member {google.cloud.dialogflow.v2beta1.IContext|null|undefined} context - * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * EntityTypeBatch entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.dialogflow.v2.EntityTypeBatch * @instance */ - CreateContextRequest.prototype.context = null; + EntityTypeBatch.prototype.entityTypes = $util.emptyArray; /** - * Creates a new CreateContextRequest instance using the specified properties. + * Creates a new EntityTypeBatch instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.EntityTypeBatch * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateContextRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.CreateContextRequest} CreateContextRequest instance + * @param {google.cloud.dialogflow.v2.IEntityTypeBatch=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.EntityTypeBatch} EntityTypeBatch instance */ - CreateContextRequest.create = function create(properties) { - return new CreateContextRequest(properties); + EntityTypeBatch.create = function create(properties) { + return new EntityTypeBatch(properties); }; /** - * Encodes the specified CreateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateContextRequest.verify|verify} messages. + * Encodes the specified EntityTypeBatch message. Does not implicitly {@link google.cloud.dialogflow.v2.EntityTypeBatch.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.EntityTypeBatch * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateContextRequest} message CreateContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IEntityTypeBatch} message EntityTypeBatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateContextRequest.encode = function encode(message, writer) { + EntityTypeBatch.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.context != null && Object.hasOwnProperty.call(message, "context")) - $root.google.cloud.dialogflow.v2beta1.Context.encode(message.context, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + $root.google.cloud.dialogflow.v2.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateContextRequest.verify|verify} messages. + * Encodes the specified EntityTypeBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.EntityTypeBatch.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.EntityTypeBatch * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateContextRequest} message CreateContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IEntityTypeBatch} message EntityTypeBatch message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + EntityTypeBatch.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateContextRequest message from the specified reader or buffer. + * Decodes an EntityTypeBatch message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.EntityTypeBatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.CreateContextRequest} CreateContextRequest + * @returns {google.cloud.dialogflow.v2.EntityTypeBatch} EntityTypeBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateContextRequest.decode = function decode(reader, length) { + EntityTypeBatch.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateContextRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.EntityTypeBatch(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.context = $root.google.cloud.dialogflow.v2beta1.Context.decode(reader, reader.uint32()); + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push($root.google.cloud.dialogflow.v2.EntityType.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -39605,122 +39119,429 @@ }; /** - * Decodes a CreateContextRequest message from the specified reader or buffer, length delimited. + * Decodes an EntityTypeBatch message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.EntityTypeBatch * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.CreateContextRequest} CreateContextRequest + * @returns {google.cloud.dialogflow.v2.EntityTypeBatch} EntityTypeBatch * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateContextRequest.decodeDelimited = function decodeDelimited(reader) { + EntityTypeBatch.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateContextRequest message. + * Verifies an EntityTypeBatch message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.EntityTypeBatch * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateContextRequest.verify = function verify(message) { + EntityTypeBatch.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.context != null && message.hasOwnProperty("context")) { - var error = $root.google.cloud.dialogflow.v2beta1.Context.verify(message.context); - if (error) - return "context." + error; + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.EntityType.verify(message.entityTypes[i]); + if (error) + return "entityTypes." + error; + } } return null; }; /** - * Creates a CreateContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates an EntityTypeBatch message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.EntityTypeBatch * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.CreateContextRequest} CreateContextRequest + * @returns {google.cloud.dialogflow.v2.EntityTypeBatch} EntityTypeBatch */ - CreateContextRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateContextRequest) + EntityTypeBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.EntityTypeBatch) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.CreateContextRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.context != null) { - if (typeof object.context !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.CreateContextRequest.context: object expected"); - message.context = $root.google.cloud.dialogflow.v2beta1.Context.fromObject(object.context); + var message = new $root.google.cloud.dialogflow.v2.EntityTypeBatch(); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.dialogflow.v2.EntityTypeBatch.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) { + if (typeof object.entityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.EntityTypeBatch.entityTypes: object expected"); + message.entityTypes[i] = $root.google.cloud.dialogflow.v2.EntityType.fromObject(object.entityTypes[i]); + } } return message; }; /** - * Creates a plain object from a CreateContextRequest message. Also converts values to other types if specified. + * Creates a plain object from an EntityTypeBatch message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.EntityTypeBatch * @static - * @param {google.cloud.dialogflow.v2beta1.CreateContextRequest} message CreateContextRequest + * @param {google.cloud.dialogflow.v2.EntityTypeBatch} message EntityTypeBatch * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateContextRequest.toObject = function toObject(message, options) { + EntityTypeBatch.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.context = null; + if (options.arrays || options.defaults) + object.entityTypes = []; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = $root.google.cloud.dialogflow.v2.EntityType.toObject(message.entityTypes[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.context != null && message.hasOwnProperty("context")) - object.context = $root.google.cloud.dialogflow.v2beta1.Context.toObject(message.context, options); return object; }; /** - * Converts this CreateContextRequest to JSON. + * Converts this EntityTypeBatch to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @memberof google.cloud.dialogflow.v2.EntityTypeBatch * @instance * @returns {Object.} JSON object */ - CreateContextRequest.prototype.toJSON = function toJSON() { + EntityTypeBatch.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateContextRequest; + return EntityTypeBatch; })(); - v2beta1.UpdateContextRequest = (function() { + v2.Conversations = (function() { /** - * Properties of an UpdateContextRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IUpdateContextRequest - * @property {google.cloud.dialogflow.v2beta1.IContext|null} [context] UpdateContextRequest context - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateContextRequest updateMask + * Constructs a new Conversations service. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a Conversations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Conversations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Conversations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Conversations; + + /** + * Creates new Conversations service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2.Conversations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Conversations} RPC service. Useful where requests and/or responses are streamed. */ + Conversations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; /** - * Constructs a new UpdateContextRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an UpdateContextRequest. - * @implements IUpdateContextRequest + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#createConversation}. + * @memberof google.cloud.dialogflow.v2.Conversations + * @typedef CreateConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.Conversation} [response] Conversation + */ + + /** + * Calls CreateConversation. + * @function createConversation + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.ICreateConversationRequest} request CreateConversationRequest message or plain object + * @param {google.cloud.dialogflow.v2.Conversations.CreateConversationCallback} callback Node-style callback called with the error, if any, and Conversation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.createConversation = function createConversation(request, callback) { + return this.rpcCall(createConversation, $root.google.cloud.dialogflow.v2.CreateConversationRequest, $root.google.cloud.dialogflow.v2.Conversation, request, callback); + }, "name", { value: "CreateConversation" }); + + /** + * Calls CreateConversation. + * @function createConversation + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.ICreateConversationRequest} request CreateConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#listConversations}. + * @memberof google.cloud.dialogflow.v2.Conversations + * @typedef ListConversationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.ListConversationsResponse} [response] ListConversationsResponse + */ + + /** + * Calls ListConversations. + * @function listConversations + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.IListConversationsRequest} request ListConversationsRequest message or plain object + * @param {google.cloud.dialogflow.v2.Conversations.ListConversationsCallback} callback Node-style callback called with the error, if any, and ListConversationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.listConversations = function listConversations(request, callback) { + return this.rpcCall(listConversations, $root.google.cloud.dialogflow.v2.ListConversationsRequest, $root.google.cloud.dialogflow.v2.ListConversationsResponse, request, callback); + }, "name", { value: "ListConversations" }); + + /** + * Calls ListConversations. + * @function listConversations + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.IListConversationsRequest} request ListConversationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#getConversation}. + * @memberof google.cloud.dialogflow.v2.Conversations + * @typedef GetConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.Conversation} [response] Conversation + */ + + /** + * Calls GetConversation. + * @function getConversation + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.IGetConversationRequest} request GetConversationRequest message or plain object + * @param {google.cloud.dialogflow.v2.Conversations.GetConversationCallback} callback Node-style callback called with the error, if any, and Conversation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.getConversation = function getConversation(request, callback) { + return this.rpcCall(getConversation, $root.google.cloud.dialogflow.v2.GetConversationRequest, $root.google.cloud.dialogflow.v2.Conversation, request, callback); + }, "name", { value: "GetConversation" }); + + /** + * Calls GetConversation. + * @function getConversation + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.IGetConversationRequest} request GetConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#completeConversation}. + * @memberof google.cloud.dialogflow.v2.Conversations + * @typedef CompleteConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.Conversation} [response] Conversation + */ + + /** + * Calls CompleteConversation. + * @function completeConversation + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.ICompleteConversationRequest} request CompleteConversationRequest message or plain object + * @param {google.cloud.dialogflow.v2.Conversations.CompleteConversationCallback} callback Node-style callback called with the error, if any, and Conversation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.completeConversation = function completeConversation(request, callback) { + return this.rpcCall(completeConversation, $root.google.cloud.dialogflow.v2.CompleteConversationRequest, $root.google.cloud.dialogflow.v2.Conversation, request, callback); + }, "name", { value: "CompleteConversation" }); + + /** + * Calls CompleteConversation. + * @function completeConversation + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.ICompleteConversationRequest} request CompleteConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#createCallMatcher}. + * @memberof google.cloud.dialogflow.v2.Conversations + * @typedef CreateCallMatcherCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.CallMatcher} [response] CallMatcher + */ + + /** + * Calls CreateCallMatcher. + * @function createCallMatcher + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.ICreateCallMatcherRequest} request CreateCallMatcherRequest message or plain object + * @param {google.cloud.dialogflow.v2.Conversations.CreateCallMatcherCallback} callback Node-style callback called with the error, if any, and CallMatcher + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.createCallMatcher = function createCallMatcher(request, callback) { + return this.rpcCall(createCallMatcher, $root.google.cloud.dialogflow.v2.CreateCallMatcherRequest, $root.google.cloud.dialogflow.v2.CallMatcher, request, callback); + }, "name", { value: "CreateCallMatcher" }); + + /** + * Calls CreateCallMatcher. + * @function createCallMatcher + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.ICreateCallMatcherRequest} request CreateCallMatcherRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#listCallMatchers}. + * @memberof google.cloud.dialogflow.v2.Conversations + * @typedef ListCallMatchersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.ListCallMatchersResponse} [response] ListCallMatchersResponse + */ + + /** + * Calls ListCallMatchers. + * @function listCallMatchers + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.IListCallMatchersRequest} request ListCallMatchersRequest message or plain object + * @param {google.cloud.dialogflow.v2.Conversations.ListCallMatchersCallback} callback Node-style callback called with the error, if any, and ListCallMatchersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.listCallMatchers = function listCallMatchers(request, callback) { + return this.rpcCall(listCallMatchers, $root.google.cloud.dialogflow.v2.ListCallMatchersRequest, $root.google.cloud.dialogflow.v2.ListCallMatchersResponse, request, callback); + }, "name", { value: "ListCallMatchers" }); + + /** + * Calls ListCallMatchers. + * @function listCallMatchers + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.IListCallMatchersRequest} request ListCallMatchersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#deleteCallMatcher}. + * @memberof google.cloud.dialogflow.v2.Conversations + * @typedef DeleteCallMatcherCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteCallMatcher. + * @function deleteCallMatcher + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteCallMatcherRequest} request DeleteCallMatcherRequest message or plain object + * @param {google.cloud.dialogflow.v2.Conversations.DeleteCallMatcherCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.deleteCallMatcher = function deleteCallMatcher(request, callback) { + return this.rpcCall(deleteCallMatcher, $root.google.cloud.dialogflow.v2.DeleteCallMatcherRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCallMatcher" }); + + /** + * Calls DeleteCallMatcher. + * @function deleteCallMatcher + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteCallMatcherRequest} request DeleteCallMatcherRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Conversations#listMessages}. + * @memberof google.cloud.dialogflow.v2.Conversations + * @typedef ListMessagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.ListMessagesResponse} [response] ListMessagesResponse + */ + + /** + * Calls ListMessages. + * @function listMessages + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.IListMessagesRequest} request ListMessagesRequest message or plain object + * @param {google.cloud.dialogflow.v2.Conversations.ListMessagesCallback} callback Node-style callback called with the error, if any, and ListMessagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.listMessages = function listMessages(request, callback) { + return this.rpcCall(listMessages, $root.google.cloud.dialogflow.v2.ListMessagesRequest, $root.google.cloud.dialogflow.v2.ListMessagesResponse, request, callback); + }, "name", { value: "ListMessages" }); + + /** + * Calls ListMessages. + * @function listMessages + * @memberof google.cloud.dialogflow.v2.Conversations + * @instance + * @param {google.cloud.dialogflow.v2.IListMessagesRequest} request ListMessagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Conversations; + })(); + + v2.Conversation = (function() { + + /** + * Properties of a Conversation. + * @memberof google.cloud.dialogflow.v2 + * @interface IConversation + * @property {string|null} [name] Conversation name + * @property {google.cloud.dialogflow.v2.Conversation.LifecycleState|null} [lifecycleState] Conversation lifecycleState + * @property {string|null} [conversationProfile] Conversation conversationProfile + * @property {google.cloud.dialogflow.v2.IConversationPhoneNumber|null} [phoneNumber] Conversation phoneNumber + * @property {google.protobuf.ITimestamp|null} [startTime] Conversation startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Conversation endTime + * @property {google.cloud.dialogflow.v2.Conversation.ConversationStage|null} [conversationStage] Conversation conversationStage + */ + + /** + * Constructs a new Conversation. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a Conversation. + * @implements IConversation * @constructor - * @param {google.cloud.dialogflow.v2beta1.IUpdateContextRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IConversation=} [properties] Properties to set */ - function UpdateContextRequest(properties) { + function Conversation(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39728,88 +39549,153 @@ } /** - * UpdateContextRequest context. - * @member {google.cloud.dialogflow.v2beta1.IContext|null|undefined} context - * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * Conversation name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.Conversation * @instance */ - UpdateContextRequest.prototype.context = null; + Conversation.prototype.name = ""; /** - * UpdateContextRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * Conversation lifecycleState. + * @member {google.cloud.dialogflow.v2.Conversation.LifecycleState} lifecycleState + * @memberof google.cloud.dialogflow.v2.Conversation * @instance */ - UpdateContextRequest.prototype.updateMask = null; + Conversation.prototype.lifecycleState = 0; /** - * Creates a new UpdateContextRequest instance using the specified properties. + * Conversation conversationProfile. + * @member {string} conversationProfile + * @memberof google.cloud.dialogflow.v2.Conversation + * @instance + */ + Conversation.prototype.conversationProfile = ""; + + /** + * Conversation phoneNumber. + * @member {google.cloud.dialogflow.v2.IConversationPhoneNumber|null|undefined} phoneNumber + * @memberof google.cloud.dialogflow.v2.Conversation + * @instance + */ + Conversation.prototype.phoneNumber = null; + + /** + * Conversation startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.v2.Conversation + * @instance + */ + Conversation.prototype.startTime = null; + + /** + * Conversation endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.dialogflow.v2.Conversation + * @instance + */ + Conversation.prototype.endTime = null; + + /** + * Conversation conversationStage. + * @member {google.cloud.dialogflow.v2.Conversation.ConversationStage} conversationStage + * @memberof google.cloud.dialogflow.v2.Conversation + * @instance + */ + Conversation.prototype.conversationStage = 0; + + /** + * Creates a new Conversation instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.Conversation * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateContextRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.UpdateContextRequest} UpdateContextRequest instance + * @param {google.cloud.dialogflow.v2.IConversation=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Conversation} Conversation instance */ - UpdateContextRequest.create = function create(properties) { - return new UpdateContextRequest(properties); + Conversation.create = function create(properties) { + return new Conversation(properties); }; /** - * Encodes the specified UpdateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateContextRequest.verify|verify} messages. + * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.dialogflow.v2.Conversation.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.Conversation * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateContextRequest} message UpdateContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IConversation} message Conversation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateContextRequest.encode = function encode(message, writer) { + Conversation.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.context != null && Object.hasOwnProperty.call(message, "context")) - $root.google.cloud.dialogflow.v2beta1.Context.encode(message.context, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.lifecycleState != null && Object.hasOwnProperty.call(message, "lifecycleState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.lifecycleState); + if (message.conversationProfile != null && Object.hasOwnProperty.call(message, "conversationProfile")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.conversationProfile); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + $root.google.cloud.dialogflow.v2.ConversationPhoneNumber.encode(message.phoneNumber, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.conversationStage != null && Object.hasOwnProperty.call(message, "conversationStage")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.conversationStage); return writer; }; /** - * Encodes the specified UpdateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateContextRequest.verify|verify} messages. + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Conversation.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.Conversation * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateContextRequest} message UpdateContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IConversation} message Conversation message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + Conversation.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateContextRequest message from the specified reader or buffer. + * Decodes a Conversation message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.Conversation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.UpdateContextRequest} UpdateContextRequest + * @returns {google.cloud.dialogflow.v2.Conversation} Conversation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateContextRequest.decode = function decode(reader, length) { + Conversation.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateContextRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Conversation(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.context = $root.google.cloud.dialogflow.v2beta1.Context.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.lifecycleState = reader.int32(); + break; + case 3: + message.conversationProfile = reader.string(); + break; + case 4: + message.phoneNumber = $root.google.cloud.dialogflow.v2.ConversationPhoneNumber.decode(reader, reader.uint32()); + break; + case 5: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.conversationStage = reader.int32(); break; default: reader.skipType(tag & 7); @@ -39820,126 +39706,243 @@ }; /** - * Decodes an UpdateContextRequest message from the specified reader or buffer, length delimited. + * Decodes a Conversation message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.Conversation * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.UpdateContextRequest} UpdateContextRequest + * @returns {google.cloud.dialogflow.v2.Conversation} Conversation * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateContextRequest.decodeDelimited = function decodeDelimited(reader) { + Conversation.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateContextRequest message. + * Verifies a Conversation message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.Conversation * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateContextRequest.verify = function verify(message) { + Conversation.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.context != null && message.hasOwnProperty("context")) { - var error = $root.google.cloud.dialogflow.v2beta1.Context.verify(message.context); + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.lifecycleState != null && message.hasOwnProperty("lifecycleState")) + switch (message.lifecycleState) { + default: + return "lifecycleState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) + if (!$util.isString(message.conversationProfile)) + return "conversationProfile: string expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) { + var error = $root.google.cloud.dialogflow.v2.ConversationPhoneNumber.verify(message.phoneNumber); if (error) - return "context." + error; + return "phoneNumber." + error; } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); if (error) - return "updateMask." + error; + return "startTime." + error; } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.conversationStage != null && message.hasOwnProperty("conversationStage")) + switch (message.conversationStage) { + default: + return "conversationStage: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates an UpdateContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.Conversation * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.UpdateContextRequest} UpdateContextRequest + * @returns {google.cloud.dialogflow.v2.Conversation} Conversation */ - UpdateContextRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateContextRequest) + Conversation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Conversation) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.UpdateContextRequest(); - if (object.context != null) { - if (typeof object.context !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateContextRequest.context: object expected"); - message.context = $root.google.cloud.dialogflow.v2beta1.Context.fromObject(object.context); + var message = new $root.google.cloud.dialogflow.v2.Conversation(); + if (object.name != null) + message.name = String(object.name); + switch (object.lifecycleState) { + case "LIFECYCLE_STATE_UNSPECIFIED": + case 0: + message.lifecycleState = 0; + break; + case "IN_PROGRESS": + case 1: + message.lifecycleState = 1; + break; + case "COMPLETED": + case 2: + message.lifecycleState = 2; + break; } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateContextRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + if (object.conversationProfile != null) + message.conversationProfile = String(object.conversationProfile); + if (object.phoneNumber != null) { + if (typeof object.phoneNumber !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Conversation.phoneNumber: object expected"); + message.phoneNumber = $root.google.cloud.dialogflow.v2.ConversationPhoneNumber.fromObject(object.phoneNumber); + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Conversation.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Conversation.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + switch (object.conversationStage) { + case "CONVERSATION_STAGE_UNSPECIFIED": + case 0: + message.conversationStage = 0; + break; + case "VIRTUAL_AGENT_STAGE": + case 1: + message.conversationStage = 1; + break; + case "HUMAN_ASSIST_STAGE": + case 2: + message.conversationStage = 2; + break; } return message; }; /** - * Creates a plain object from an UpdateContextRequest message. Also converts values to other types if specified. + * Creates a plain object from a Conversation message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.Conversation * @static - * @param {google.cloud.dialogflow.v2beta1.UpdateContextRequest} message UpdateContextRequest + * @param {google.cloud.dialogflow.v2.Conversation} message Conversation * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateContextRequest.toObject = function toObject(message, options) { + Conversation.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.context = null; - object.updateMask = null; + object.name = ""; + object.lifecycleState = options.enums === String ? "LIFECYCLE_STATE_UNSPECIFIED" : 0; + object.conversationProfile = ""; + object.phoneNumber = null; + object.startTime = null; + object.endTime = null; + object.conversationStage = options.enums === String ? "CONVERSATION_STAGE_UNSPECIFIED" : 0; } - if (message.context != null && message.hasOwnProperty("context")) - object.context = $root.google.cloud.dialogflow.v2beta1.Context.toObject(message.context, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.lifecycleState != null && message.hasOwnProperty("lifecycleState")) + object.lifecycleState = options.enums === String ? $root.google.cloud.dialogflow.v2.Conversation.LifecycleState[message.lifecycleState] : message.lifecycleState; + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) + object.conversationProfile = message.conversationProfile; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = $root.google.cloud.dialogflow.v2.ConversationPhoneNumber.toObject(message.phoneNumber, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.conversationStage != null && message.hasOwnProperty("conversationStage")) + object.conversationStage = options.enums === String ? $root.google.cloud.dialogflow.v2.Conversation.ConversationStage[message.conversationStage] : message.conversationStage; return object; }; /** - * Converts this UpdateContextRequest to JSON. + * Converts this Conversation to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @memberof google.cloud.dialogflow.v2.Conversation * @instance * @returns {Object.} JSON object */ - UpdateContextRequest.prototype.toJSON = function toJSON() { + Conversation.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateContextRequest; + /** + * LifecycleState enum. + * @name google.cloud.dialogflow.v2.Conversation.LifecycleState + * @enum {number} + * @property {number} LIFECYCLE_STATE_UNSPECIFIED=0 LIFECYCLE_STATE_UNSPECIFIED value + * @property {number} IN_PROGRESS=1 IN_PROGRESS value + * @property {number} COMPLETED=2 COMPLETED value + */ + Conversation.LifecycleState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LIFECYCLE_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_PROGRESS"] = 1; + values[valuesById[2] = "COMPLETED"] = 2; + return values; + })(); + + /** + * ConversationStage enum. + * @name google.cloud.dialogflow.v2.Conversation.ConversationStage + * @enum {number} + * @property {number} CONVERSATION_STAGE_UNSPECIFIED=0 CONVERSATION_STAGE_UNSPECIFIED value + * @property {number} VIRTUAL_AGENT_STAGE=1 VIRTUAL_AGENT_STAGE value + * @property {number} HUMAN_ASSIST_STAGE=2 HUMAN_ASSIST_STAGE value + */ + Conversation.ConversationStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONVERSATION_STAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VIRTUAL_AGENT_STAGE"] = 1; + values[valuesById[2] = "HUMAN_ASSIST_STAGE"] = 2; + return values; + })(); + + return Conversation; })(); - v2beta1.DeleteContextRequest = (function() { + v2.CallMatcher = (function() { /** - * Properties of a DeleteContextRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IDeleteContextRequest - * @property {string|null} [name] DeleteContextRequest name + * Properties of a CallMatcher. + * @memberof google.cloud.dialogflow.v2 + * @interface ICallMatcher + * @property {string|null} [name] CallMatcher name + * @property {string|null} [toHeader] CallMatcher toHeader + * @property {string|null} [fromHeader] CallMatcher fromHeader + * @property {string|null} [callIdHeader] CallMatcher callIdHeader + * @property {google.cloud.dialogflow.v2.CallMatcher.ICustomHeaders|null} [customHeaders] CallMatcher customHeaders */ /** - * Constructs a new DeleteContextRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a DeleteContextRequest. - * @implements IDeleteContextRequest + * Constructs a new CallMatcher. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a CallMatcher. + * @implements ICallMatcher * @constructor - * @param {google.cloud.dialogflow.v2beta1.IDeleteContextRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ICallMatcher=} [properties] Properties to set */ - function DeleteContextRequest(properties) { + function CallMatcher(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -39947,76 +39950,128 @@ } /** - * DeleteContextRequest name. + * CallMatcher name. * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.CallMatcher * @instance */ - DeleteContextRequest.prototype.name = ""; + CallMatcher.prototype.name = ""; /** - * Creates a new DeleteContextRequest instance using the specified properties. + * CallMatcher toHeader. + * @member {string} toHeader + * @memberof google.cloud.dialogflow.v2.CallMatcher + * @instance + */ + CallMatcher.prototype.toHeader = ""; + + /** + * CallMatcher fromHeader. + * @member {string} fromHeader + * @memberof google.cloud.dialogflow.v2.CallMatcher + * @instance + */ + CallMatcher.prototype.fromHeader = ""; + + /** + * CallMatcher callIdHeader. + * @member {string} callIdHeader + * @memberof google.cloud.dialogflow.v2.CallMatcher + * @instance + */ + CallMatcher.prototype.callIdHeader = ""; + + /** + * CallMatcher customHeaders. + * @member {google.cloud.dialogflow.v2.CallMatcher.ICustomHeaders|null|undefined} customHeaders + * @memberof google.cloud.dialogflow.v2.CallMatcher + * @instance + */ + CallMatcher.prototype.customHeaders = null; + + /** + * Creates a new CallMatcher instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.CallMatcher * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteContextRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.DeleteContextRequest} DeleteContextRequest instance + * @param {google.cloud.dialogflow.v2.ICallMatcher=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CallMatcher} CallMatcher instance */ - DeleteContextRequest.create = function create(properties) { - return new DeleteContextRequest(properties); + CallMatcher.create = function create(properties) { + return new CallMatcher(properties); }; /** - * Encodes the specified DeleteContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteContextRequest.verify|verify} messages. + * Encodes the specified CallMatcher message. Does not implicitly {@link google.cloud.dialogflow.v2.CallMatcher.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.CallMatcher * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteContextRequest} message DeleteContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICallMatcher} message CallMatcher message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteContextRequest.encode = function encode(message, writer) { + CallMatcher.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.toHeader != null && Object.hasOwnProperty.call(message, "toHeader")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toHeader); + if (message.fromHeader != null && Object.hasOwnProperty.call(message, "fromHeader")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fromHeader); + if (message.callIdHeader != null && Object.hasOwnProperty.call(message, "callIdHeader")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.callIdHeader); + if (message.customHeaders != null && Object.hasOwnProperty.call(message, "customHeaders")) + $root.google.cloud.dialogflow.v2.CallMatcher.CustomHeaders.encode(message.customHeaders, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteContextRequest.verify|verify} messages. + * Encodes the specified CallMatcher message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CallMatcher.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.CallMatcher * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteContextRequest} message DeleteContextRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICallMatcher} message CallMatcher message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + CallMatcher.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteContextRequest message from the specified reader or buffer. + * Decodes a CallMatcher message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.CallMatcher * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.DeleteContextRequest} DeleteContextRequest + * @returns {google.cloud.dialogflow.v2.CallMatcher} CallMatcher * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteContextRequest.decode = function decode(reader, length) { + CallMatcher.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteContextRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CallMatcher(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; + case 2: + message.toHeader = reader.string(); + break; + case 3: + message.fromHeader = reader.string(); + break; + case 4: + message.callIdHeader = reader.string(); + break; + case 5: + message.customHeaders = $root.google.cloud.dialogflow.v2.CallMatcher.CustomHeaders.decode(reader, reader.uint32()); + break; default: reader.skipType(tag & 7); break; @@ -40026,107 +40081,334 @@ }; /** - * Decodes a DeleteContextRequest message from the specified reader or buffer, length delimited. + * Decodes a CallMatcher message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.CallMatcher * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.DeleteContextRequest} DeleteContextRequest + * @returns {google.cloud.dialogflow.v2.CallMatcher} CallMatcher * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteContextRequest.decodeDelimited = function decodeDelimited(reader) { + CallMatcher.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteContextRequest message. + * Verifies a CallMatcher message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.CallMatcher * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteContextRequest.verify = function verify(message) { + CallMatcher.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; + if (message.toHeader != null && message.hasOwnProperty("toHeader")) + if (!$util.isString(message.toHeader)) + return "toHeader: string expected"; + if (message.fromHeader != null && message.hasOwnProperty("fromHeader")) + if (!$util.isString(message.fromHeader)) + return "fromHeader: string expected"; + if (message.callIdHeader != null && message.hasOwnProperty("callIdHeader")) + if (!$util.isString(message.callIdHeader)) + return "callIdHeader: string expected"; + if (message.customHeaders != null && message.hasOwnProperty("customHeaders")) { + var error = $root.google.cloud.dialogflow.v2.CallMatcher.CustomHeaders.verify(message.customHeaders); + if (error) + return "customHeaders." + error; + } return null; }; /** - * Creates a DeleteContextRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CallMatcher message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.CallMatcher * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.DeleteContextRequest} DeleteContextRequest + * @returns {google.cloud.dialogflow.v2.CallMatcher} CallMatcher */ - DeleteContextRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteContextRequest) + CallMatcher.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CallMatcher) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.DeleteContextRequest(); + var message = new $root.google.cloud.dialogflow.v2.CallMatcher(); if (object.name != null) message.name = String(object.name); + if (object.toHeader != null) + message.toHeader = String(object.toHeader); + if (object.fromHeader != null) + message.fromHeader = String(object.fromHeader); + if (object.callIdHeader != null) + message.callIdHeader = String(object.callIdHeader); + if (object.customHeaders != null) { + if (typeof object.customHeaders !== "object") + throw TypeError(".google.cloud.dialogflow.v2.CallMatcher.customHeaders: object expected"); + message.customHeaders = $root.google.cloud.dialogflow.v2.CallMatcher.CustomHeaders.fromObject(object.customHeaders); + } return message; }; /** - * Creates a plain object from a DeleteContextRequest message. Also converts values to other types if specified. + * Creates a plain object from a CallMatcher message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.CallMatcher * @static - * @param {google.cloud.dialogflow.v2beta1.DeleteContextRequest} message DeleteContextRequest + * @param {google.cloud.dialogflow.v2.CallMatcher} message CallMatcher * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteContextRequest.toObject = function toObject(message, options) { + CallMatcher.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.name = ""; + object.toHeader = ""; + object.fromHeader = ""; + object.callIdHeader = ""; + object.customHeaders = null; + } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; + if (message.toHeader != null && message.hasOwnProperty("toHeader")) + object.toHeader = message.toHeader; + if (message.fromHeader != null && message.hasOwnProperty("fromHeader")) + object.fromHeader = message.fromHeader; + if (message.callIdHeader != null && message.hasOwnProperty("callIdHeader")) + object.callIdHeader = message.callIdHeader; + if (message.customHeaders != null && message.hasOwnProperty("customHeaders")) + object.customHeaders = $root.google.cloud.dialogflow.v2.CallMatcher.CustomHeaders.toObject(message.customHeaders, options); return object; }; /** - * Converts this DeleteContextRequest to JSON. + * Converts this CallMatcher to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @memberof google.cloud.dialogflow.v2.CallMatcher * @instance * @returns {Object.} JSON object */ - DeleteContextRequest.prototype.toJSON = function toJSON() { + CallMatcher.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteContextRequest; + CallMatcher.CustomHeaders = (function() { + + /** + * Properties of a CustomHeaders. + * @memberof google.cloud.dialogflow.v2.CallMatcher + * @interface ICustomHeaders + * @property {string|null} [ciscoGuid] CustomHeaders ciscoGuid + */ + + /** + * Constructs a new CustomHeaders. + * @memberof google.cloud.dialogflow.v2.CallMatcher + * @classdesc Represents a CustomHeaders. + * @implements ICustomHeaders + * @constructor + * @param {google.cloud.dialogflow.v2.CallMatcher.ICustomHeaders=} [properties] Properties to set + */ + function CustomHeaders(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomHeaders ciscoGuid. + * @member {string} ciscoGuid + * @memberof google.cloud.dialogflow.v2.CallMatcher.CustomHeaders + * @instance + */ + CustomHeaders.prototype.ciscoGuid = ""; + + /** + * Creates a new CustomHeaders instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.CallMatcher.CustomHeaders + * @static + * @param {google.cloud.dialogflow.v2.CallMatcher.ICustomHeaders=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CallMatcher.CustomHeaders} CustomHeaders instance + */ + CustomHeaders.create = function create(properties) { + return new CustomHeaders(properties); + }; + + /** + * Encodes the specified CustomHeaders message. Does not implicitly {@link google.cloud.dialogflow.v2.CallMatcher.CustomHeaders.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.CallMatcher.CustomHeaders + * @static + * @param {google.cloud.dialogflow.v2.CallMatcher.ICustomHeaders} message CustomHeaders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHeaders.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ciscoGuid != null && Object.hasOwnProperty.call(message, "ciscoGuid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ciscoGuid); + return writer; + }; + + /** + * Encodes the specified CustomHeaders message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CallMatcher.CustomHeaders.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.CallMatcher.CustomHeaders + * @static + * @param {google.cloud.dialogflow.v2.CallMatcher.ICustomHeaders} message CustomHeaders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHeaders.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomHeaders message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.CallMatcher.CustomHeaders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.CallMatcher.CustomHeaders} CustomHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHeaders.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CallMatcher.CustomHeaders(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ciscoGuid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomHeaders message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.CallMatcher.CustomHeaders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.CallMatcher.CustomHeaders} CustomHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHeaders.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomHeaders message. + * @function verify + * @memberof google.cloud.dialogflow.v2.CallMatcher.CustomHeaders + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHeaders.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ciscoGuid != null && message.hasOwnProperty("ciscoGuid")) + if (!$util.isString(message.ciscoGuid)) + return "ciscoGuid: string expected"; + return null; + }; + + /** + * Creates a CustomHeaders message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.CallMatcher.CustomHeaders + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.CallMatcher.CustomHeaders} CustomHeaders + */ + CustomHeaders.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CallMatcher.CustomHeaders) + return object; + var message = new $root.google.cloud.dialogflow.v2.CallMatcher.CustomHeaders(); + if (object.ciscoGuid != null) + message.ciscoGuid = String(object.ciscoGuid); + return message; + }; + + /** + * Creates a plain object from a CustomHeaders message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.CallMatcher.CustomHeaders + * @static + * @param {google.cloud.dialogflow.v2.CallMatcher.CustomHeaders} message CustomHeaders + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHeaders.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.ciscoGuid = ""; + if (message.ciscoGuid != null && message.hasOwnProperty("ciscoGuid")) + object.ciscoGuid = message.ciscoGuid; + return object; + }; + + /** + * Converts this CustomHeaders to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.CallMatcher.CustomHeaders + * @instance + * @returns {Object.} JSON object + */ + CustomHeaders.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CustomHeaders; + })(); + + return CallMatcher; })(); - v2beta1.DeleteAllContextsRequest = (function() { + v2.CreateConversationRequest = (function() { /** - * Properties of a DeleteAllContextsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IDeleteAllContextsRequest - * @property {string|null} [parent] DeleteAllContextsRequest parent + * Properties of a CreateConversationRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface ICreateConversationRequest + * @property {string|null} [parent] CreateConversationRequest parent + * @property {google.cloud.dialogflow.v2.IConversation|null} [conversation] CreateConversationRequest conversation + * @property {string|null} [conversationId] CreateConversationRequest conversationId */ /** - * Constructs a new DeleteAllContextsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a DeleteAllContextsRequest. - * @implements IDeleteAllContextsRequest + * Constructs a new CreateConversationRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a CreateConversationRequest. + * @implements ICreateConversationRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ICreateConversationRequest=} [properties] Properties to set */ - function DeleteAllContextsRequest(properties) { + function CreateConversationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40134,76 +40416,102 @@ } /** - * DeleteAllContextsRequest parent. + * CreateConversationRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationRequest * @instance */ - DeleteAllContextsRequest.prototype.parent = ""; + CreateConversationRequest.prototype.parent = ""; /** - * Creates a new DeleteAllContextsRequest instance using the specified properties. + * CreateConversationRequest conversation. + * @member {google.cloud.dialogflow.v2.IConversation|null|undefined} conversation + * @memberof google.cloud.dialogflow.v2.CreateConversationRequest + * @instance + */ + CreateConversationRequest.prototype.conversation = null; + + /** + * CreateConversationRequest conversationId. + * @member {string} conversationId + * @memberof google.cloud.dialogflow.v2.CreateConversationRequest + * @instance + */ + CreateConversationRequest.prototype.conversationId = ""; + + /** + * Creates a new CreateConversationRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest} DeleteAllContextsRequest instance + * @param {google.cloud.dialogflow.v2.ICreateConversationRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CreateConversationRequest} CreateConversationRequest instance */ - DeleteAllContextsRequest.create = function create(properties) { - return new DeleteAllContextsRequest(properties); + CreateConversationRequest.create = function create(properties) { + return new CreateConversationRequest(properties); }; /** - * Encodes the specified DeleteAllContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest.verify|verify} messages. + * Encodes the specified CreateConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateConversationRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest} message DeleteAllContextsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateConversationRequest} message CreateConversationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteAllContextsRequest.encode = function encode(message, writer) { + CreateConversationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + $root.google.cloud.dialogflow.v2.Conversation.encode(message.conversation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.conversationId != null && Object.hasOwnProperty.call(message, "conversationId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.conversationId); return writer; }; /** - * Encodes the specified DeleteAllContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest.verify|verify} messages. + * Encodes the specified CreateConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateConversationRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest} message DeleteAllContextsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateConversationRequest} message CreateConversationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteAllContextsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteAllContextsRequest message from the specified reader or buffer. + * Decodes a CreateConversationRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest} DeleteAllContextsRequest + * @returns {google.cloud.dialogflow.v2.CreateConversationRequest} CreateConversationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteAllContextsRequest.decode = function decode(reader, length) { + CreateConversationRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateConversationRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.parent = reader.string(); break; + case 2: + message.conversation = $root.google.cloud.dialogflow.v2.Conversation.decode(reader, reader.uint32()); + break; + case 3: + message.conversationId = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -40213,349 +40521,385 @@ }; /** - * Decodes a DeleteAllContextsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateConversationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest} DeleteAllContextsRequest + * @returns {google.cloud.dialogflow.v2.CreateConversationRequest} CreateConversationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteAllContextsRequest.decodeDelimited = function decodeDelimited(reader) { + CreateConversationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteAllContextsRequest message. + * Verifies a CreateConversationRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteAllContextsRequest.verify = function verify(message) { + CreateConversationRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; + if (message.conversation != null && message.hasOwnProperty("conversation")) { + var error = $root.google.cloud.dialogflow.v2.Conversation.verify(message.conversation); + if (error) + return "conversation." + error; + } + if (message.conversationId != null && message.hasOwnProperty("conversationId")) + if (!$util.isString(message.conversationId)) + return "conversationId: string expected"; return null; }; /** - * Creates a DeleteAllContextsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateConversationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest} DeleteAllContextsRequest + * @returns {google.cloud.dialogflow.v2.CreateConversationRequest} CreateConversationRequest */ - DeleteAllContextsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest) + CreateConversationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CreateConversationRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest(); + var message = new $root.google.cloud.dialogflow.v2.CreateConversationRequest(); if (object.parent != null) message.parent = String(object.parent); + if (object.conversation != null) { + if (typeof object.conversation !== "object") + throw TypeError(".google.cloud.dialogflow.v2.CreateConversationRequest.conversation: object expected"); + message.conversation = $root.google.cloud.dialogflow.v2.Conversation.fromObject(object.conversation); + } + if (object.conversationId != null) + message.conversationId = String(object.conversationId); return message; }; /** - * Creates a plain object from a DeleteAllContextsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateConversationRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationRequest * @static - * @param {google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest} message DeleteAllContextsRequest + * @param {google.cloud.dialogflow.v2.CreateConversationRequest} message CreateConversationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteAllContextsRequest.toObject = function toObject(message, options) { + CreateConversationRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) + if (options.defaults) { object.parent = ""; + object.conversation = null; + object.conversationId = ""; + } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = $root.google.cloud.dialogflow.v2.Conversation.toObject(message.conversation, options); + if (message.conversationId != null && message.hasOwnProperty("conversationId")) + object.conversationId = message.conversationId; return object; }; /** - * Converts this DeleteAllContextsRequest to JSON. + * Converts this CreateConversationRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationRequest * @instance * @returns {Object.} JSON object */ - DeleteAllContextsRequest.prototype.toJSON = function toJSON() { + CreateConversationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteAllContextsRequest; + return CreateConversationRequest; })(); - v2beta1.Documents = (function() { - - /** - * Constructs a new Documents service. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a Documents - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Documents(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Documents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Documents; + v2.ListConversationsRequest = (function() { /** - * Creates new Documents service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Documents} RPC service. Useful where requests and/or responses are streamed. + * Properties of a ListConversationsRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IListConversationsRequest + * @property {string|null} [parent] ListConversationsRequest parent + * @property {number|null} [pageSize] ListConversationsRequest pageSize + * @property {string|null} [pageToken] ListConversationsRequest pageToken + * @property {string|null} [filter] ListConversationsRequest filter */ - Documents.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#listDocuments}. - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @typedef ListDocumentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.ListDocumentsResponse} [response] ListDocumentsResponse + * Constructs a new ListConversationsRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListConversationsRequest. + * @implements IListConversationsRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IListConversationsRequest=} [properties] Properties to set */ + function ListConversationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls ListDocuments. - * @function listDocuments - * @memberof google.cloud.dialogflow.v2beta1.Documents + * ListConversationsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest * @instance - * @param {google.cloud.dialogflow.v2beta1.IListDocumentsRequest} request ListDocumentsRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Documents.ListDocumentsCallback} callback Node-style callback called with the error, if any, and ListDocumentsResponse - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Documents.prototype.listDocuments = function listDocuments(request, callback) { - return this.rpcCall(listDocuments, $root.google.cloud.dialogflow.v2beta1.ListDocumentsRequest, $root.google.cloud.dialogflow.v2beta1.ListDocumentsResponse, request, callback); - }, "name", { value: "ListDocuments" }); + ListConversationsRequest.prototype.parent = ""; /** - * Calls ListDocuments. - * @function listDocuments - * @memberof google.cloud.dialogflow.v2beta1.Documents + * ListConversationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest * @instance - * @param {google.cloud.dialogflow.v2beta1.IListDocumentsRequest} request ListDocumentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#getDocument}. - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @typedef GetDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.Document} [response] Document */ + ListConversationsRequest.prototype.pageSize = 0; /** - * Calls GetDocument. - * @function getDocument - * @memberof google.cloud.dialogflow.v2beta1.Documents + * ListConversationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetDocumentRequest} request GetDocumentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Documents.GetDocumentCallback} callback Node-style callback called with the error, if any, and Document - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(Documents.prototype.getDocument = function getDocument(request, callback) { - return this.rpcCall(getDocument, $root.google.cloud.dialogflow.v2beta1.GetDocumentRequest, $root.google.cloud.dialogflow.v2beta1.Document, request, callback); - }, "name", { value: "GetDocument" }); + ListConversationsRequest.prototype.pageToken = ""; /** - * Calls GetDocument. - * @function getDocument - * @memberof google.cloud.dialogflow.v2beta1.Documents + * ListConversationsRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetDocumentRequest} request GetDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ListConversationsRequest.prototype.filter = ""; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#createDocument}. - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @typedef CreateDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a new ListConversationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListConversationsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListConversationsRequest} ListConversationsRequest instance */ + ListConversationsRequest.create = function create(properties) { + return new ListConversationsRequest(properties); + }; /** - * Calls CreateDocument. - * @function createDocument - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @instance - * @param {google.cloud.dialogflow.v2beta1.ICreateDocumentRequest} request CreateDocumentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Documents.CreateDocumentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListConversationsRequest} message ListConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Object.defineProperty(Documents.prototype.createDocument = function createDocument(request, callback) { - return this.rpcCall(createDocument, $root.google.cloud.dialogflow.v2beta1.CreateDocumentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateDocument" }); + ListConversationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; /** - * Calls CreateDocument. - * @function createDocument - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @instance - * @param {google.cloud.dialogflow.v2beta1.ICreateDocumentRequest} request CreateDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListConversationsRequest} message ListConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ + ListConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#deleteDocument}. - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @typedef DeleteDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteDocument. - * @function deleteDocument - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Documents.DeleteDocumentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Documents.prototype.deleteDocument = function deleteDocument(request, callback) { - return this.rpcCall(deleteDocument, $root.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteDocument" }); - - /** - * Calls DeleteDocument. - * @function deleteDocument - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#updateDocument}. - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @typedef UpdateDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Decodes a ListConversationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.ListConversationsRequest} ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ + ListConversationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListConversationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Calls UpdateDocument. - * @function updateDocument - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Documents.UpdateDocumentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.ListConversationsRequest} ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Object.defineProperty(Documents.prototype.updateDocument = function updateDocument(request, callback) { - return this.rpcCall(updateDocument, $root.google.cloud.dialogflow.v2beta1.UpdateDocumentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateDocument" }); + ListConversationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Calls UpdateDocument. - * @function updateDocument - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * Verifies a ListConversationsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ + ListConversationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#reloadDocument}. - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @typedef ReloadDocumentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.ListConversationsRequest} ListConversationsRequest */ + ListConversationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListConversationsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.ListConversationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; /** - * Calls ReloadDocument. - * @function reloadDocument - * @memberof google.cloud.dialogflow.v2beta1.Documents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IReloadDocumentRequest} request ReloadDocumentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Documents.ReloadDocumentCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 + * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest + * @static + * @param {google.cloud.dialogflow.v2.ListConversationsRequest} message ListConversationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - Object.defineProperty(Documents.prototype.reloadDocument = function reloadDocument(request, callback) { - return this.rpcCall(reloadDocument, $root.google.cloud.dialogflow.v2beta1.ReloadDocumentRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "ReloadDocument" }); + ListConversationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; /** - * Calls ReloadDocument. - * @function reloadDocument - * @memberof google.cloud.dialogflow.v2beta1.Documents + * Converts this ListConversationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.ListConversationsRequest * @instance - * @param {google.cloud.dialogflow.v2beta1.IReloadDocumentRequest} request ReloadDocumentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 + * @returns {Object.} JSON object */ + ListConversationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Documents; + return ListConversationsRequest; })(); - v2beta1.Document = (function() { + v2.ListConversationsResponse = (function() { /** - * Properties of a Document. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IDocument - * @property {string|null} [name] Document name - * @property {string|null} [displayName] Document displayName - * @property {string|null} [mimeType] Document mimeType - * @property {Array.|null} [knowledgeTypes] Document knowledgeTypes - * @property {string|null} [contentUri] Document contentUri - * @property {string|null} [content] Document content - * @property {Uint8Array|null} [rawContent] Document rawContent - * @property {boolean|null} [enableAutoReload] Document enableAutoReload - * @property {google.cloud.dialogflow.v2beta1.Document.IReloadStatus|null} [latestReloadStatus] Document latestReloadStatus + * Properties of a ListConversationsResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IListConversationsResponse + * @property {Array.|null} [conversations] ListConversationsResponse conversations + * @property {string|null} [nextPageToken] ListConversationsResponse nextPageToken */ /** - * Constructs a new Document. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a Document. - * @implements IDocument + * Constructs a new ListConversationsResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListConversationsResponse. + * @implements IListConversationsResponse * @constructor - * @param {google.cloud.dialogflow.v2beta1.IDocument=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListConversationsResponse=} [properties] Properties to set */ - function Document(properties) { - this.knowledgeTypes = []; + function ListConversationsResponse(properties) { + this.conversations = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -40563,205 +40907,305 @@ } /** - * Document name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.Document + * ListConversationsResponse conversations. + * @member {Array.} conversations + * @memberof google.cloud.dialogflow.v2.ListConversationsResponse * @instance */ - Document.prototype.name = ""; + ListConversationsResponse.prototype.conversations = $util.emptyArray; /** - * Document displayName. - * @member {string} displayName - * @memberof google.cloud.dialogflow.v2beta1.Document + * ListConversationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2.ListConversationsResponse * @instance */ - Document.prototype.displayName = ""; + ListConversationsResponse.prototype.nextPageToken = ""; /** - * Document mimeType. - * @member {string} mimeType - * @memberof google.cloud.dialogflow.v2beta1.Document - * @instance + * Creates a new ListConversationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListConversationsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListConversationsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListConversationsResponse} ListConversationsResponse instance */ - Document.prototype.mimeType = ""; + ListConversationsResponse.create = function create(properties) { + return new ListConversationsResponse(properties); + }; /** - * Document knowledgeTypes. - * @member {Array.} knowledgeTypes - * @memberof google.cloud.dialogflow.v2beta1.Document - * @instance + * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListConversationsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListConversationsResponse} message ListConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Document.prototype.knowledgeTypes = $util.emptyArray; + ListConversationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversations != null && message.conversations.length) + for (var i = 0; i < message.conversations.length; ++i) + $root.google.cloud.dialogflow.v2.Conversation.encode(message.conversations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; /** - * Document contentUri. - * @member {string} contentUri - * @memberof google.cloud.dialogflow.v2beta1.Document - * @instance + * Encodes the specified ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.ListConversationsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListConversationsResponse} message ListConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - Document.prototype.contentUri = ""; + ListConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * Document content. - * @member {string} content - * @memberof google.cloud.dialogflow.v2beta1.Document - * @instance + * Decodes a ListConversationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.ListConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.ListConversationsResponse} ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Document.prototype.content = ""; + ListConversationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListConversationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.conversations && message.conversations.length)) + message.conversations = []; + message.conversations.push($root.google.cloud.dialogflow.v2.Conversation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; /** - * Document rawContent. - * @member {Uint8Array} rawContent - * @memberof google.cloud.dialogflow.v2beta1.Document - * @instance + * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.ListConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.ListConversationsResponse} ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Document.prototype.rawContent = $util.newBuffer([]); + ListConversationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * Document enableAutoReload. - * @member {boolean} enableAutoReload - * @memberof google.cloud.dialogflow.v2beta1.Document - * @instance + * Verifies a ListConversationsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2.ListConversationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Document.prototype.enableAutoReload = false; + ListConversationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversations != null && message.hasOwnProperty("conversations")) { + if (!Array.isArray(message.conversations)) + return "conversations: array expected"; + for (var i = 0; i < message.conversations.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Conversation.verify(message.conversations[i]); + if (error) + return "conversations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; /** - * Document latestReloadStatus. - * @member {google.cloud.dialogflow.v2beta1.Document.IReloadStatus|null|undefined} latestReloadStatus - * @memberof google.cloud.dialogflow.v2beta1.Document + * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.ListConversationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.ListConversationsResponse} ListConversationsResponse + */ + ListConversationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListConversationsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2.ListConversationsResponse(); + if (object.conversations) { + if (!Array.isArray(object.conversations)) + throw TypeError(".google.cloud.dialogflow.v2.ListConversationsResponse.conversations: array expected"); + message.conversations = []; + for (var i = 0; i < object.conversations.length; ++i) { + if (typeof object.conversations[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListConversationsResponse.conversations: object expected"); + message.conversations[i] = $root.google.cloud.dialogflow.v2.Conversation.fromObject(object.conversations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.ListConversationsResponse + * @static + * @param {google.cloud.dialogflow.v2.ListConversationsResponse} message ListConversationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConversationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.conversations && message.conversations.length) { + object.conversations = []; + for (var j = 0; j < message.conversations.length; ++j) + object.conversations[j] = $root.google.cloud.dialogflow.v2.Conversation.toObject(message.conversations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListConversationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.ListConversationsResponse * @instance + * @returns {Object.} JSON object */ - Document.prototype.latestReloadStatus = null; + ListConversationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + return ListConversationsResponse; + })(); + + v2.GetConversationRequest = (function() { /** - * Document source. - * @member {"contentUri"|"content"|"rawContent"|undefined} source - * @memberof google.cloud.dialogflow.v2beta1.Document + * Properties of a GetConversationRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IGetConversationRequest + * @property {string|null} [name] GetConversationRequest name + */ + + /** + * Constructs a new GetConversationRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a GetConversationRequest. + * @implements IGetConversationRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IGetConversationRequest=} [properties] Properties to set + */ + function GetConversationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConversationRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.GetConversationRequest * @instance */ - Object.defineProperty(Document.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["contentUri", "content", "rawContent"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetConversationRequest.prototype.name = ""; /** - * Creates a new Document instance using the specified properties. + * Creates a new GetConversationRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.Document + * @memberof google.cloud.dialogflow.v2.GetConversationRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDocument=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Document} Document instance + * @param {google.cloud.dialogflow.v2.IGetConversationRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.GetConversationRequest} GetConversationRequest instance */ - Document.create = function create(properties) { - return new Document(properties); + GetConversationRequest.create = function create(properties) { + return new GetConversationRequest(properties); }; /** - * Encodes the specified Document message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.verify|verify} messages. + * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetConversationRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Document + * @memberof google.cloud.dialogflow.v2.GetConversationRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDocument} message Document message or plain object to encode + * @param {google.cloud.dialogflow.v2.IGetConversationRequest} message GetConversationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Document.encode = function encode(message, writer) { + GetConversationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); - if (message.knowledgeTypes != null && message.knowledgeTypes.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.knowledgeTypes.length; ++i) - writer.int32(message.knowledgeTypes[i]); - writer.ldelim(); - } - if (message.contentUri != null && Object.hasOwnProperty.call(message, "contentUri")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.contentUri); - if (message.content != null && Object.hasOwnProperty.call(message, "content")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.content); - if (message.rawContent != null && Object.hasOwnProperty.call(message, "rawContent")) - writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.rawContent); - if (message.enableAutoReload != null && Object.hasOwnProperty.call(message, "enableAutoReload")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableAutoReload); - if (message.latestReloadStatus != null && Object.hasOwnProperty.call(message, "latestReloadStatus")) - $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.encode(message.latestReloadStatus, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; /** - * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.verify|verify} messages. + * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetConversationRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Document + * @memberof google.cloud.dialogflow.v2.GetConversationRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDocument} message Document message or plain object to encode + * @param {google.cloud.dialogflow.v2.IGetConversationRequest} message GetConversationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Document.encodeDelimited = function encodeDelimited(message, writer) { + GetConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Document message from the specified reader or buffer. + * Decodes a GetConversationRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Document + * @memberof google.cloud.dialogflow.v2.GetConversationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Document} Document + * @returns {google.cloud.dialogflow.v2.GetConversationRequest} GetConversationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Document.decode = function decode(reader, length) { + GetConversationRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Document(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetConversationRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; - case 2: - message.displayName = reader.string(); - break; - case 3: - message.mimeType = reader.string(); - break; - case 4: - if (!(message.knowledgeTypes && message.knowledgeTypes.length)) - message.knowledgeTypes = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.knowledgeTypes.push(reader.int32()); - } else - message.knowledgeTypes.push(reader.int32()); - break; - case 5: - message.contentUri = reader.string(); - break; - case 6: - message.content = reader.string(); - break; - case 9: - message.rawContent = reader.bytes(); - break; - case 11: - message.enableAutoReload = reader.bool(); - break; - case 12: - message.latestReloadStatus = $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -40771,466 +41215,107 @@ }; /** - * Decodes a Document message from the specified reader or buffer, length delimited. + * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Document + * @memberof google.cloud.dialogflow.v2.GetConversationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Document} Document + * @returns {google.cloud.dialogflow.v2.GetConversationRequest} GetConversationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Document.decodeDelimited = function decodeDelimited(reader) { + GetConversationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Document message. + * Verifies a GetConversationRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Document + * @memberof google.cloud.dialogflow.v2.GetConversationRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Document.verify = function verify(message) { + GetConversationRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - if (!$util.isString(message.mimeType)) - return "mimeType: string expected"; - if (message.knowledgeTypes != null && message.hasOwnProperty("knowledgeTypes")) { - if (!Array.isArray(message.knowledgeTypes)) - return "knowledgeTypes: array expected"; - for (var i = 0; i < message.knowledgeTypes.length; ++i) - switch (message.knowledgeTypes[i]) { - default: - return "knowledgeTypes: enum value[] expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.contentUri != null && message.hasOwnProperty("contentUri")) { - properties.source = 1; - if (!$util.isString(message.contentUri)) - return "contentUri: string expected"; - } - if (message.content != null && message.hasOwnProperty("content")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.content)) - return "content: string expected"; - } - if (message.rawContent != null && message.hasOwnProperty("rawContent")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!(message.rawContent && typeof message.rawContent.length === "number" || $util.isString(message.rawContent))) - return "rawContent: buffer expected"; - } - if (message.enableAutoReload != null && message.hasOwnProperty("enableAutoReload")) - if (typeof message.enableAutoReload !== "boolean") - return "enableAutoReload: boolean expected"; - if (message.latestReloadStatus != null && message.hasOwnProperty("latestReloadStatus")) { - var error = $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.verify(message.latestReloadStatus); - if (error) - return "latestReloadStatus." + error; - } return null; }; /** - * Creates a Document message from a plain object. Also converts values to their respective internal types. + * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Document + * @memberof google.cloud.dialogflow.v2.GetConversationRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Document} Document + * @returns {google.cloud.dialogflow.v2.GetConversationRequest} GetConversationRequest */ - Document.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Document) + GetConversationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.GetConversationRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Document(); + var message = new $root.google.cloud.dialogflow.v2.GetConversationRequest(); if (object.name != null) message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.mimeType != null) - message.mimeType = String(object.mimeType); - if (object.knowledgeTypes) { - if (!Array.isArray(object.knowledgeTypes)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Document.knowledgeTypes: array expected"); - message.knowledgeTypes = []; - for (var i = 0; i < object.knowledgeTypes.length; ++i) - switch (object.knowledgeTypes[i]) { - default: - case "KNOWLEDGE_TYPE_UNSPECIFIED": - case 0: - message.knowledgeTypes[i] = 0; - break; - case "FAQ": - case 1: - message.knowledgeTypes[i] = 1; - break; - case "EXTRACTIVE_QA": - case 2: - message.knowledgeTypes[i] = 2; - break; - } - } - if (object.contentUri != null) - message.contentUri = String(object.contentUri); - if (object.content != null) - message.content = String(object.content); - if (object.rawContent != null) - if (typeof object.rawContent === "string") - $util.base64.decode(object.rawContent, message.rawContent = $util.newBuffer($util.base64.length(object.rawContent)), 0); - else if (object.rawContent.length) - message.rawContent = object.rawContent; - if (object.enableAutoReload != null) - message.enableAutoReload = Boolean(object.enableAutoReload); - if (object.latestReloadStatus != null) { - if (typeof object.latestReloadStatus !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Document.latestReloadStatus: object expected"); - message.latestReloadStatus = $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.fromObject(object.latestReloadStatus); - } return message; }; /** - * Creates a plain object from a Document message. Also converts values to other types if specified. + * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Document + * @memberof google.cloud.dialogflow.v2.GetConversationRequest * @static - * @param {google.cloud.dialogflow.v2beta1.Document} message Document + * @param {google.cloud.dialogflow.v2.GetConversationRequest} message GetConversationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Document.toObject = function toObject(message, options) { + GetConversationRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.knowledgeTypes = []; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.displayName = ""; - object.mimeType = ""; - object.enableAutoReload = false; - object.latestReloadStatus = null; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.mimeType != null && message.hasOwnProperty("mimeType")) - object.mimeType = message.mimeType; - if (message.knowledgeTypes && message.knowledgeTypes.length) { - object.knowledgeTypes = []; - for (var j = 0; j < message.knowledgeTypes.length; ++j) - object.knowledgeTypes[j] = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Document.KnowledgeType[message.knowledgeTypes[j]] : message.knowledgeTypes[j]; - } - if (message.contentUri != null && message.hasOwnProperty("contentUri")) { - object.contentUri = message.contentUri; - if (options.oneofs) - object.source = "contentUri"; - } - if (message.content != null && message.hasOwnProperty("content")) { - object.content = message.content; - if (options.oneofs) - object.source = "content"; - } - if (message.rawContent != null && message.hasOwnProperty("rawContent")) { - object.rawContent = options.bytes === String ? $util.base64.encode(message.rawContent, 0, message.rawContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawContent) : message.rawContent; - if (options.oneofs) - object.source = "rawContent"; - } - if (message.enableAutoReload != null && message.hasOwnProperty("enableAutoReload")) - object.enableAutoReload = message.enableAutoReload; - if (message.latestReloadStatus != null && message.hasOwnProperty("latestReloadStatus")) - object.latestReloadStatus = $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.toObject(message.latestReloadStatus, options); return object; }; /** - * Converts this Document to JSON. + * Converts this GetConversationRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Document + * @memberof google.cloud.dialogflow.v2.GetConversationRequest * @instance * @returns {Object.} JSON object */ - Document.prototype.toJSON = function toJSON() { + GetConversationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Document.ReloadStatus = (function() { - - /** - * Properties of a ReloadStatus. - * @memberof google.cloud.dialogflow.v2beta1.Document - * @interface IReloadStatus - * @property {google.protobuf.ITimestamp|null} [time] ReloadStatus time - * @property {google.rpc.IStatus|null} [status] ReloadStatus status - */ - - /** - * Constructs a new ReloadStatus. - * @memberof google.cloud.dialogflow.v2beta1.Document - * @classdesc Represents a ReloadStatus. - * @implements IReloadStatus - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Document.IReloadStatus=} [properties] Properties to set - */ - function ReloadStatus(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ReloadStatus time. - * @member {google.protobuf.ITimestamp|null|undefined} time - * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus - * @instance - */ - ReloadStatus.prototype.time = null; - - /** - * ReloadStatus status. - * @member {google.rpc.IStatus|null|undefined} status - * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus - * @instance - */ - ReloadStatus.prototype.status = null; - - /** - * Creates a new ReloadStatus instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus - * @static - * @param {google.cloud.dialogflow.v2beta1.Document.IReloadStatus=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Document.ReloadStatus} ReloadStatus instance - */ - ReloadStatus.create = function create(properties) { - return new ReloadStatus(properties); - }; - - /** - * Encodes the specified ReloadStatus message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.ReloadStatus.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus - * @static - * @param {google.cloud.dialogflow.v2beta1.Document.IReloadStatus} message ReloadStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReloadStatus.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ReloadStatus message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.ReloadStatus.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus - * @static - * @param {google.cloud.dialogflow.v2beta1.Document.IReloadStatus} message ReloadStatus message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReloadStatus.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReloadStatus message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Document.ReloadStatus} ReloadStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReloadStatus.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - case 2: - message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReloadStatus message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Document.ReloadStatus} ReloadStatus - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReloadStatus.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReloadStatus message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReloadStatus.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.time != null && message.hasOwnProperty("time")) { - var error = $root.google.protobuf.Timestamp.verify(message.time); - if (error) - return "time." + error; - } - if (message.status != null && message.hasOwnProperty("status")) { - var error = $root.google.rpc.Status.verify(message.status); - if (error) - return "status." + error; - } - return null; - }; - - /** - * Creates a ReloadStatus message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Document.ReloadStatus} ReloadStatus - */ - ReloadStatus.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus(); - if (object.time != null) { - if (typeof object.time !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Document.ReloadStatus.time: object expected"); - message.time = $root.google.protobuf.Timestamp.fromObject(object.time); - } - if (object.status != null) { - if (typeof object.status !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Document.ReloadStatus.status: object expected"); - message.status = $root.google.rpc.Status.fromObject(object.status); - } - return message; - }; - - /** - * Creates a plain object from a ReloadStatus message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus - * @static - * @param {google.cloud.dialogflow.v2beta1.Document.ReloadStatus} message ReloadStatus - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReloadStatus.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.time = null; - object.status = null; - } - if (message.time != null && message.hasOwnProperty("time")) - object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = $root.google.rpc.Status.toObject(message.status, options); - return object; - }; - - /** - * Converts this ReloadStatus to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus - * @instance - * @returns {Object.} JSON object - */ - ReloadStatus.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ReloadStatus; - })(); - - /** - * KnowledgeType enum. - * @name google.cloud.dialogflow.v2beta1.Document.KnowledgeType - * @enum {number} - * @property {number} KNOWLEDGE_TYPE_UNSPECIFIED=0 KNOWLEDGE_TYPE_UNSPECIFIED value - * @property {number} FAQ=1 FAQ value - * @property {number} EXTRACTIVE_QA=2 EXTRACTIVE_QA value - */ - Document.KnowledgeType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KNOWLEDGE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "FAQ"] = 1; - values[valuesById[2] = "EXTRACTIVE_QA"] = 2; - return values; - })(); - - return Document; + return GetConversationRequest; })(); - v2beta1.GetDocumentRequest = (function() { + v2.CompleteConversationRequest = (function() { /** - * Properties of a GetDocumentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IGetDocumentRequest - * @property {string|null} [name] GetDocumentRequest name + * Properties of a CompleteConversationRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface ICompleteConversationRequest + * @property {string|null} [name] CompleteConversationRequest name */ /** - * Constructs a new GetDocumentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a GetDocumentRequest. - * @implements IGetDocumentRequest + * Constructs a new CompleteConversationRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a CompleteConversationRequest. + * @implements ICompleteConversationRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IGetDocumentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ICompleteConversationRequest=} [properties] Properties to set */ - function GetDocumentRequest(properties) { + function CompleteConversationRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41238,35 +41323,35 @@ } /** - * GetDocumentRequest name. + * CompleteConversationRequest name. * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest + * @memberof google.cloud.dialogflow.v2.CompleteConversationRequest * @instance */ - GetDocumentRequest.prototype.name = ""; + CompleteConversationRequest.prototype.name = ""; /** - * Creates a new GetDocumentRequest instance using the specified properties. + * Creates a new CompleteConversationRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest + * @memberof google.cloud.dialogflow.v2.CompleteConversationRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.GetDocumentRequest} GetDocumentRequest instance + * @param {google.cloud.dialogflow.v2.ICompleteConversationRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CompleteConversationRequest} CompleteConversationRequest instance */ - GetDocumentRequest.create = function create(properties) { - return new GetDocumentRequest(properties); + CompleteConversationRequest.create = function create(properties) { + return new CompleteConversationRequest(properties); }; /** - * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetDocumentRequest.verify|verify} messages. + * Encodes the specified CompleteConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CompleteConversationRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest + * @memberof google.cloud.dialogflow.v2.CompleteConversationRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICompleteConversationRequest} message CompleteConversationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentRequest.encode = function encode(message, writer) { + CompleteConversationRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -41275,33 +41360,33 @@ }; /** - * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetDocumentRequest.verify|verify} messages. + * Encodes the specified CompleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CompleteConversationRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest + * @memberof google.cloud.dialogflow.v2.CompleteConversationRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICompleteConversationRequest} message CompleteConversationRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + CompleteConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDocumentRequest message from the specified reader or buffer. + * Decodes a CompleteConversationRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest + * @memberof google.cloud.dialogflow.v2.CompleteConversationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.GetDocumentRequest} GetDocumentRequest + * @returns {google.cloud.dialogflow.v2.CompleteConversationRequest} CompleteConversationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentRequest.decode = function decode(reader, length) { + CompleteConversationRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetDocumentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CompleteConversationRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -41317,30 +41402,30 @@ }; /** - * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. + * Decodes a CompleteConversationRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest + * @memberof google.cloud.dialogflow.v2.CompleteConversationRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.GetDocumentRequest} GetDocumentRequest + * @returns {google.cloud.dialogflow.v2.CompleteConversationRequest} CompleteConversationRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + CompleteConversationRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDocumentRequest message. + * Verifies a CompleteConversationRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest + * @memberof google.cloud.dialogflow.v2.CompleteConversationRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDocumentRequest.verify = function verify(message) { + CompleteConversationRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -41350,32 +41435,32 @@ }; /** - * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CompleteConversationRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest + * @memberof google.cloud.dialogflow.v2.CompleteConversationRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.GetDocumentRequest} GetDocumentRequest + * @returns {google.cloud.dialogflow.v2.CompleteConversationRequest} CompleteConversationRequest */ - GetDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetDocumentRequest) + CompleteConversationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CompleteConversationRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.GetDocumentRequest(); + var message = new $root.google.cloud.dialogflow.v2.CompleteConversationRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. + * Creates a plain object from a CompleteConversationRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest + * @memberof google.cloud.dialogflow.v2.CompleteConversationRequest * @static - * @param {google.cloud.dialogflow.v2beta1.GetDocumentRequest} message GetDocumentRequest + * @param {google.cloud.dialogflow.v2.CompleteConversationRequest} message CompleteConversationRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDocumentRequest.toObject = function toObject(message, options) { + CompleteConversationRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -41387,40 +41472,38 @@ }; /** - * Converts this GetDocumentRequest to JSON. + * Converts this CompleteConversationRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest + * @memberof google.cloud.dialogflow.v2.CompleteConversationRequest * @instance * @returns {Object.} JSON object */ - GetDocumentRequest.prototype.toJSON = function toJSON() { + CompleteConversationRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetDocumentRequest; + return CompleteConversationRequest; })(); - v2beta1.ListDocumentsRequest = (function() { + v2.CreateCallMatcherRequest = (function() { /** - * Properties of a ListDocumentsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListDocumentsRequest - * @property {string|null} [parent] ListDocumentsRequest parent - * @property {number|null} [pageSize] ListDocumentsRequest pageSize - * @property {string|null} [pageToken] ListDocumentsRequest pageToken - * @property {string|null} [filter] ListDocumentsRequest filter + * Properties of a CreateCallMatcherRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface ICreateCallMatcherRequest + * @property {string|null} [parent] CreateCallMatcherRequest parent + * @property {google.cloud.dialogflow.v2.ICallMatcher|null} [callMatcher] CreateCallMatcherRequest callMatcher */ /** - * Constructs a new ListDocumentsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListDocumentsRequest. - * @implements IListDocumentsRequest + * Constructs a new CreateCallMatcherRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a CreateCallMatcherRequest. + * @implements ICreateCallMatcherRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListDocumentsRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ICreateCallMatcherRequest=} [properties] Properties to set */ - function ListDocumentsRequest(properties) { + function CreateCallMatcherRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41428,100 +41511,80 @@ } /** - * ListDocumentsRequest parent. + * CreateCallMatcherRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest - * @instance - */ - ListDocumentsRequest.prototype.parent = ""; - - /** - * ListDocumentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest - * @instance - */ - ListDocumentsRequest.prototype.pageSize = 0; - - /** - * ListDocumentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @memberof google.cloud.dialogflow.v2.CreateCallMatcherRequest * @instance */ - ListDocumentsRequest.prototype.pageToken = ""; + CreateCallMatcherRequest.prototype.parent = ""; /** - * ListDocumentsRequest filter. - * @member {string} filter - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * CreateCallMatcherRequest callMatcher. + * @member {google.cloud.dialogflow.v2.ICallMatcher|null|undefined} callMatcher + * @memberof google.cloud.dialogflow.v2.CreateCallMatcherRequest * @instance */ - ListDocumentsRequest.prototype.filter = ""; + CreateCallMatcherRequest.prototype.callMatcher = null; /** - * Creates a new ListDocumentsRequest instance using the specified properties. + * Creates a new CreateCallMatcherRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @memberof google.cloud.dialogflow.v2.CreateCallMatcherRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListDocumentsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsRequest} ListDocumentsRequest instance + * @param {google.cloud.dialogflow.v2.ICreateCallMatcherRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CreateCallMatcherRequest} CreateCallMatcherRequest instance */ - ListDocumentsRequest.create = function create(properties) { - return new ListDocumentsRequest(properties); + CreateCallMatcherRequest.create = function create(properties) { + return new CreateCallMatcherRequest(properties); }; /** - * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsRequest.verify|verify} messages. + * Encodes the specified CreateCallMatcherRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateCallMatcherRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @memberof google.cloud.dialogflow.v2.CreateCallMatcherRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateCallMatcherRequest} message CreateCallMatcherRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDocumentsRequest.encode = function encode(message, writer) { + CreateCallMatcherRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.callMatcher != null && Object.hasOwnProperty.call(message, "callMatcher")) + $root.google.cloud.dialogflow.v2.CallMatcher.encode(message.callMatcher, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsRequest.verify|verify} messages. + * Encodes the specified CreateCallMatcherRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateCallMatcherRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @memberof google.cloud.dialogflow.v2.CreateCallMatcherRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateCallMatcherRequest} message CreateCallMatcherRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateCallMatcherRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListDocumentsRequest message from the specified reader or buffer. + * Decodes a CreateCallMatcherRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @memberof google.cloud.dialogflow.v2.CreateCallMatcherRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsRequest} ListDocumentsRequest + * @returns {google.cloud.dialogflow.v2.CreateCallMatcherRequest} CreateCallMatcherRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDocumentsRequest.decode = function decode(reader, length) { + CreateCallMatcherRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListDocumentsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateCallMatcherRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -41529,13 +41592,7 @@ message.parent = reader.string(); break; case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); + message.callMatcher = $root.google.cloud.dialogflow.v2.CallMatcher.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -41546,134 +41603,123 @@ }; /** - * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateCallMatcherRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @memberof google.cloud.dialogflow.v2.CreateCallMatcherRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsRequest} ListDocumentsRequest + * @returns {google.cloud.dialogflow.v2.CreateCallMatcherRequest} CreateCallMatcherRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + CreateCallMatcherRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListDocumentsRequest message. + * Verifies a CreateCallMatcherRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @memberof google.cloud.dialogflow.v2.CreateCallMatcherRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListDocumentsRequest.verify = function verify(message) { + CreateCallMatcherRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.callMatcher != null && message.hasOwnProperty("callMatcher")) { + var error = $root.google.cloud.dialogflow.v2.CallMatcher.verify(message.callMatcher); + if (error) + return "callMatcher." + error; + } return null; }; /** - * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateCallMatcherRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @memberof google.cloud.dialogflow.v2.CreateCallMatcherRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsRequest} ListDocumentsRequest + * @returns {google.cloud.dialogflow.v2.CreateCallMatcherRequest} CreateCallMatcherRequest */ - ListDocumentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListDocumentsRequest) + CreateCallMatcherRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CreateCallMatcherRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListDocumentsRequest(); + var message = new $root.google.cloud.dialogflow.v2.CreateCallMatcherRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); + if (object.callMatcher != null) { + if (typeof object.callMatcher !== "object") + throw TypeError(".google.cloud.dialogflow.v2.CreateCallMatcherRequest.callMatcher: object expected"); + message.callMatcher = $root.google.cloud.dialogflow.v2.CallMatcher.fromObject(object.callMatcher); + } return message; }; /** - * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateCallMatcherRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @memberof google.cloud.dialogflow.v2.CreateCallMatcherRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ListDocumentsRequest} message ListDocumentsRequest + * @param {google.cloud.dialogflow.v2.CreateCallMatcherRequest} message CreateCallMatcherRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListDocumentsRequest.toObject = function toObject(message, options) { + CreateCallMatcherRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; + object.callMatcher = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; + if (message.callMatcher != null && message.hasOwnProperty("callMatcher")) + object.callMatcher = $root.google.cloud.dialogflow.v2.CallMatcher.toObject(message.callMatcher, options); return object; }; /** - * Converts this ListDocumentsRequest to JSON. + * Converts this CreateCallMatcherRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @memberof google.cloud.dialogflow.v2.CreateCallMatcherRequest * @instance * @returns {Object.} JSON object */ - ListDocumentsRequest.prototype.toJSON = function toJSON() { + CreateCallMatcherRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListDocumentsRequest; + return CreateCallMatcherRequest; })(); - v2beta1.ListDocumentsResponse = (function() { + v2.ListCallMatchersRequest = (function() { /** - * Properties of a ListDocumentsResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListDocumentsResponse - * @property {Array.|null} [documents] ListDocumentsResponse documents - * @property {string|null} [nextPageToken] ListDocumentsResponse nextPageToken + * Properties of a ListCallMatchersRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IListCallMatchersRequest + * @property {string|null} [parent] ListCallMatchersRequest parent + * @property {number|null} [pageSize] ListCallMatchersRequest pageSize + * @property {string|null} [pageToken] ListCallMatchersRequest pageToken */ /** - * Constructs a new ListDocumentsResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListDocumentsResponse. - * @implements IListDocumentsResponse + * Constructs a new ListCallMatchersRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListCallMatchersRequest. + * @implements IListCallMatchersRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListDocumentsResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListCallMatchersRequest=} [properties] Properties to set */ - function ListDocumentsResponse(properties) { - this.documents = []; + function ListCallMatchersRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41681,91 +41727,101 @@ } /** - * ListDocumentsResponse documents. - * @member {Array.} documents - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse + * ListCallMatchersRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.ListCallMatchersRequest * @instance */ - ListDocumentsResponse.prototype.documents = $util.emptyArray; + ListCallMatchersRequest.prototype.parent = ""; /** - * ListDocumentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse + * ListCallMatchersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListCallMatchersRequest * @instance */ - ListDocumentsResponse.prototype.nextPageToken = ""; + ListCallMatchersRequest.prototype.pageSize = 0; /** - * Creates a new ListDocumentsResponse instance using the specified properties. + * ListCallMatchersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListCallMatchersRequest + * @instance + */ + ListCallMatchersRequest.prototype.pageToken = ""; + + /** + * Creates a new ListCallMatchersRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse + * @memberof google.cloud.dialogflow.v2.ListCallMatchersRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListDocumentsResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsResponse} ListDocumentsResponse instance + * @param {google.cloud.dialogflow.v2.IListCallMatchersRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListCallMatchersRequest} ListCallMatchersRequest instance */ - ListDocumentsResponse.create = function create(properties) { - return new ListDocumentsResponse(properties); + ListCallMatchersRequest.create = function create(properties) { + return new ListCallMatchersRequest(properties); }; /** - * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsResponse.verify|verify} messages. + * Encodes the specified ListCallMatchersRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListCallMatchersRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse + * @memberof google.cloud.dialogflow.v2.ListCallMatchersRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListCallMatchersRequest} message ListCallMatchersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDocumentsResponse.encode = function encode(message, writer) { + ListCallMatchersRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.documents != null && message.documents.length) - for (var i = 0; i < message.documents.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Document.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsResponse.verify|verify} messages. + * Encodes the specified ListCallMatchersRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListCallMatchersRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse + * @memberof google.cloud.dialogflow.v2.ListCallMatchersRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListCallMatchersRequest} message ListCallMatchersRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListCallMatchersRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListDocumentsResponse message from the specified reader or buffer. + * Decodes a ListCallMatchersRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse + * @memberof google.cloud.dialogflow.v2.ListCallMatchersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsResponse} ListDocumentsResponse + * @returns {google.cloud.dialogflow.v2.ListCallMatchersRequest} ListCallMatchersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDocumentsResponse.decode = function decode(reader, length) { + ListCallMatchersRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListDocumentsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListCallMatchersRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.documents && message.documents.length)) - message.documents = []; - message.documents.push($root.google.cloud.dialogflow.v2beta1.Document.decode(reader, reader.uint32())); + message.parent = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -41776,135 +41832,126 @@ }; /** - * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. + * Decodes a ListCallMatchersRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse + * @memberof google.cloud.dialogflow.v2.ListCallMatchersRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsResponse} ListDocumentsResponse + * @returns {google.cloud.dialogflow.v2.ListCallMatchersRequest} ListCallMatchersRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + ListCallMatchersRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListDocumentsResponse message. + * Verifies a ListCallMatchersRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse + * @memberof google.cloud.dialogflow.v2.ListCallMatchersRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListDocumentsResponse.verify = function verify(message) { + ListCallMatchersRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.documents != null && message.hasOwnProperty("documents")) { - if (!Array.isArray(message.documents)) - return "documents: array expected"; - for (var i = 0; i < message.documents.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Document.verify(message.documents[i]); - if (error) - return "documents." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListCallMatchersRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse + * @memberof google.cloud.dialogflow.v2.ListCallMatchersRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsResponse} ListDocumentsResponse + * @returns {google.cloud.dialogflow.v2.ListCallMatchersRequest} ListCallMatchersRequest */ - ListDocumentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListDocumentsResponse) + ListCallMatchersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListCallMatchersRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListDocumentsResponse(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".google.cloud.dialogflow.v2beta1.ListDocumentsResponse.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) { - if (typeof object.documents[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.ListDocumentsResponse.documents: object expected"); - message.documents[i] = $root.google.cloud.dialogflow.v2beta1.Document.fromObject(object.documents[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.cloud.dialogflow.v2.ListCallMatchersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListCallMatchersRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse + * @memberof google.cloud.dialogflow.v2.ListCallMatchersRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ListDocumentsResponse} message ListDocumentsResponse + * @param {google.cloud.dialogflow.v2.ListCallMatchersRequest} message ListCallMatchersRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListDocumentsResponse.toObject = function toObject(message, options) { + ListCallMatchersRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = $root.google.cloud.dialogflow.v2beta1.Document.toObject(message.documents[j], options); + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this ListDocumentsResponse to JSON. + * Converts this ListCallMatchersRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse + * @memberof google.cloud.dialogflow.v2.ListCallMatchersRequest * @instance * @returns {Object.} JSON object */ - ListDocumentsResponse.prototype.toJSON = function toJSON() { + ListCallMatchersRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListDocumentsResponse; + return ListCallMatchersRequest; })(); - v2beta1.CreateDocumentRequest = (function() { + v2.ListCallMatchersResponse = (function() { /** - * Properties of a CreateDocumentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface ICreateDocumentRequest - * @property {string|null} [parent] CreateDocumentRequest parent - * @property {google.cloud.dialogflow.v2beta1.IDocument|null} [document] CreateDocumentRequest document - * @property {boolean|null} [importGcsCustomMetadata] CreateDocumentRequest importGcsCustomMetadata + * Properties of a ListCallMatchersResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IListCallMatchersResponse + * @property {Array.|null} [callMatchers] ListCallMatchersResponse callMatchers + * @property {string|null} [nextPageToken] ListCallMatchersResponse nextPageToken */ /** - * Constructs a new CreateDocumentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a CreateDocumentRequest. - * @implements ICreateDocumentRequest + * Constructs a new ListCallMatchersResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListCallMatchersResponse. + * @implements IListCallMatchersResponse * @constructor - * @param {google.cloud.dialogflow.v2beta1.ICreateDocumentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListCallMatchersResponse=} [properties] Properties to set */ - function CreateDocumentRequest(properties) { + function ListCallMatchersResponse(properties) { + this.callMatchers = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -41912,101 +41959,91 @@ } /** - * CreateDocumentRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest - * @instance - */ - CreateDocumentRequest.prototype.parent = ""; - - /** - * CreateDocumentRequest document. - * @member {google.cloud.dialogflow.v2beta1.IDocument|null|undefined} document - * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * ListCallMatchersResponse callMatchers. + * @member {Array.} callMatchers + * @memberof google.cloud.dialogflow.v2.ListCallMatchersResponse * @instance */ - CreateDocumentRequest.prototype.document = null; + ListCallMatchersResponse.prototype.callMatchers = $util.emptyArray; /** - * CreateDocumentRequest importGcsCustomMetadata. - * @member {boolean} importGcsCustomMetadata - * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * ListCallMatchersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2.ListCallMatchersResponse * @instance */ - CreateDocumentRequest.prototype.importGcsCustomMetadata = false; + ListCallMatchersResponse.prototype.nextPageToken = ""; /** - * Creates a new CreateDocumentRequest instance using the specified properties. + * Creates a new ListCallMatchersResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListCallMatchersResponse * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.CreateDocumentRequest} CreateDocumentRequest instance + * @param {google.cloud.dialogflow.v2.IListCallMatchersResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListCallMatchersResponse} ListCallMatchersResponse instance */ - CreateDocumentRequest.create = function create(properties) { - return new CreateDocumentRequest(properties); + ListCallMatchersResponse.create = function create(properties) { + return new ListCallMatchersResponse(properties); }; /** - * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateDocumentRequest.verify|verify} messages. + * Encodes the specified ListCallMatchersResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListCallMatchersResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListCallMatchersResponse * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListCallMatchersResponse} message ListCallMatchersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateDocumentRequest.encode = function encode(message, writer) { + ListCallMatchersResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.document != null && Object.hasOwnProperty.call(message, "document")) - $root.google.cloud.dialogflow.v2beta1.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.importGcsCustomMetadata != null && Object.hasOwnProperty.call(message, "importGcsCustomMetadata")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.importGcsCustomMetadata); + if (message.callMatchers != null && message.callMatchers.length) + for (var i = 0; i < message.callMatchers.length; ++i) + $root.google.cloud.dialogflow.v2.CallMatcher.encode(message.callMatchers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateDocumentRequest.verify|verify} messages. + * Encodes the specified ListCallMatchersResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListCallMatchersResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListCallMatchersResponse * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListCallMatchersResponse} message ListCallMatchersResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListCallMatchersResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateDocumentRequest message from the specified reader or buffer. + * Decodes a ListCallMatchersResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListCallMatchersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.CreateDocumentRequest} CreateDocumentRequest + * @returns {google.cloud.dialogflow.v2.ListCallMatchersResponse} ListCallMatchersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateDocumentRequest.decode = function decode(reader, length) { + ListCallMatchersResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateDocumentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListCallMatchersResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (!(message.callMatchers && message.callMatchers.length)) + message.callMatchers = []; + message.callMatchers.push($root.google.cloud.dialogflow.v2.CallMatcher.decode(reader, reader.uint32())); break; case 2: - message.document = $root.google.cloud.dialogflow.v2beta1.Document.decode(reader, reader.uint32()); - break; - case 3: - message.importGcsCustomMetadata = reader.bool(); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -42017,129 +42054,133 @@ }; /** - * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. + * Decodes a ListCallMatchersResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListCallMatchersResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.CreateDocumentRequest} CreateDocumentRequest + * @returns {google.cloud.dialogflow.v2.ListCallMatchersResponse} ListCallMatchersResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + ListCallMatchersResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateDocumentRequest message. + * Verifies a ListCallMatchersResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListCallMatchersResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateDocumentRequest.verify = function verify(message) { + ListCallMatchersResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.document != null && message.hasOwnProperty("document")) { - var error = $root.google.cloud.dialogflow.v2beta1.Document.verify(message.document); - if (error) - return "document." + error; + if (message.callMatchers != null && message.hasOwnProperty("callMatchers")) { + if (!Array.isArray(message.callMatchers)) + return "callMatchers: array expected"; + for (var i = 0; i < message.callMatchers.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.CallMatcher.verify(message.callMatchers[i]); + if (error) + return "callMatchers." + error; + } } - if (message.importGcsCustomMetadata != null && message.hasOwnProperty("importGcsCustomMetadata")) - if (typeof message.importGcsCustomMetadata !== "boolean") - return "importGcsCustomMetadata: boolean expected"; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListCallMatchersResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListCallMatchersResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.CreateDocumentRequest} CreateDocumentRequest + * @returns {google.cloud.dialogflow.v2.ListCallMatchersResponse} ListCallMatchersResponse */ - CreateDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateDocumentRequest) + ListCallMatchersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListCallMatchersResponse) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.CreateDocumentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.CreateDocumentRequest.document: object expected"); - message.document = $root.google.cloud.dialogflow.v2beta1.Document.fromObject(object.document); + var message = new $root.google.cloud.dialogflow.v2.ListCallMatchersResponse(); + if (object.callMatchers) { + if (!Array.isArray(object.callMatchers)) + throw TypeError(".google.cloud.dialogflow.v2.ListCallMatchersResponse.callMatchers: array expected"); + message.callMatchers = []; + for (var i = 0; i < object.callMatchers.length; ++i) { + if (typeof object.callMatchers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListCallMatchersResponse.callMatchers: object expected"); + message.callMatchers[i] = $root.google.cloud.dialogflow.v2.CallMatcher.fromObject(object.callMatchers[i]); + } } - if (object.importGcsCustomMetadata != null) - message.importGcsCustomMetadata = Boolean(object.importGcsCustomMetadata); + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListCallMatchersResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListCallMatchersResponse * @static - * @param {google.cloud.dialogflow.v2beta1.CreateDocumentRequest} message CreateDocumentRequest + * @param {google.cloud.dialogflow.v2.ListCallMatchersResponse} message ListCallMatchersResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateDocumentRequest.toObject = function toObject(message, options) { + ListCallMatchersResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.document = null; - object.importGcsCustomMetadata = false; + if (options.arrays || options.defaults) + object.callMatchers = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.callMatchers && message.callMatchers.length) { + object.callMatchers = []; + for (var j = 0; j < message.callMatchers.length; ++j) + object.callMatchers[j] = $root.google.cloud.dialogflow.v2.CallMatcher.toObject(message.callMatchers[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.document != null && message.hasOwnProperty("document")) - object.document = $root.google.cloud.dialogflow.v2beta1.Document.toObject(message.document, options); - if (message.importGcsCustomMetadata != null && message.hasOwnProperty("importGcsCustomMetadata")) - object.importGcsCustomMetadata = message.importGcsCustomMetadata; + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this CreateDocumentRequest to JSON. + * Converts this ListCallMatchersResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListCallMatchersResponse * @instance * @returns {Object.} JSON object */ - CreateDocumentRequest.prototype.toJSON = function toJSON() { + ListCallMatchersResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateDocumentRequest; + return ListCallMatchersResponse; })(); - v2beta1.DeleteDocumentRequest = (function() { + v2.DeleteCallMatcherRequest = (function() { /** - * Properties of a DeleteDocumentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IDeleteDocumentRequest - * @property {string|null} [name] DeleteDocumentRequest name + * Properties of a DeleteCallMatcherRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IDeleteCallMatcherRequest + * @property {string|null} [name] DeleteCallMatcherRequest name */ /** - * Constructs a new DeleteDocumentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a DeleteDocumentRequest. - * @implements IDeleteDocumentRequest + * Constructs a new DeleteCallMatcherRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a DeleteCallMatcherRequest. + * @implements IDeleteCallMatcherRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IDeleteCallMatcherRequest=} [properties] Properties to set */ - function DeleteDocumentRequest(properties) { + function DeleteCallMatcherRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42147,35 +42188,35 @@ } /** - * DeleteDocumentRequest name. + * DeleteCallMatcherRequest name. * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest + * @memberof google.cloud.dialogflow.v2.DeleteCallMatcherRequest * @instance */ - DeleteDocumentRequest.prototype.name = ""; + DeleteCallMatcherRequest.prototype.name = ""; /** - * Creates a new DeleteDocumentRequest instance using the specified properties. + * Creates a new DeleteCallMatcherRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest + * @memberof google.cloud.dialogflow.v2.DeleteCallMatcherRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.DeleteDocumentRequest} DeleteDocumentRequest instance + * @param {google.cloud.dialogflow.v2.IDeleteCallMatcherRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.DeleteCallMatcherRequest} DeleteCallMatcherRequest instance */ - DeleteDocumentRequest.create = function create(properties) { - return new DeleteDocumentRequest(properties); + DeleteCallMatcherRequest.create = function create(properties) { + return new DeleteCallMatcherRequest(properties); }; /** - * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteDocumentRequest.verify|verify} messages. + * Encodes the specified DeleteCallMatcherRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteCallMatcherRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest + * @memberof google.cloud.dialogflow.v2.DeleteCallMatcherRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IDeleteCallMatcherRequest} message DeleteCallMatcherRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteDocumentRequest.encode = function encode(message, writer) { + DeleteCallMatcherRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -42184,33 +42225,33 @@ }; /** - * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteDocumentRequest.verify|verify} messages. + * Encodes the specified DeleteCallMatcherRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteCallMatcherRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest + * @memberof google.cloud.dialogflow.v2.DeleteCallMatcherRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IDeleteCallMatcherRequest} message DeleteCallMatcherRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteCallMatcherRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteDocumentRequest message from the specified reader or buffer. + * Decodes a DeleteCallMatcherRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest + * @memberof google.cloud.dialogflow.v2.DeleteCallMatcherRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.DeleteDocumentRequest} DeleteDocumentRequest + * @returns {google.cloud.dialogflow.v2.DeleteCallMatcherRequest} DeleteCallMatcherRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteDocumentRequest.decode = function decode(reader, length) { + DeleteCallMatcherRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteCallMatcherRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -42226,30 +42267,30 @@ }; /** - * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteCallMatcherRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest + * @memberof google.cloud.dialogflow.v2.DeleteCallMatcherRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.DeleteDocumentRequest} DeleteDocumentRequest + * @returns {google.cloud.dialogflow.v2.DeleteCallMatcherRequest} DeleteCallMatcherRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteCallMatcherRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteDocumentRequest message. + * Verifies a DeleteCallMatcherRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest + * @memberof google.cloud.dialogflow.v2.DeleteCallMatcherRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteDocumentRequest.verify = function verify(message) { + DeleteCallMatcherRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -42259,32 +42300,32 @@ }; /** - * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteCallMatcherRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest + * @memberof google.cloud.dialogflow.v2.DeleteCallMatcherRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.DeleteDocumentRequest} DeleteDocumentRequest + * @returns {google.cloud.dialogflow.v2.DeleteCallMatcherRequest} DeleteCallMatcherRequest */ - DeleteDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest) + DeleteCallMatcherRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.DeleteCallMatcherRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest(); + var message = new $root.google.cloud.dialogflow.v2.DeleteCallMatcherRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteCallMatcherRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest + * @memberof google.cloud.dialogflow.v2.DeleteCallMatcherRequest * @static - * @param {google.cloud.dialogflow.v2beta1.DeleteDocumentRequest} message DeleteDocumentRequest + * @param {google.cloud.dialogflow.v2.DeleteCallMatcherRequest} message DeleteCallMatcherRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteDocumentRequest.toObject = function toObject(message, options) { + DeleteCallMatcherRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -42296,38 +42337,40 @@ }; /** - * Converts this DeleteDocumentRequest to JSON. + * Converts this DeleteCallMatcherRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest + * @memberof google.cloud.dialogflow.v2.DeleteCallMatcherRequest * @instance * @returns {Object.} JSON object */ - DeleteDocumentRequest.prototype.toJSON = function toJSON() { + DeleteCallMatcherRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteDocumentRequest; + return DeleteCallMatcherRequest; })(); - v2beta1.UpdateDocumentRequest = (function() { + v2.ListMessagesRequest = (function() { /** - * Properties of an UpdateDocumentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IUpdateDocumentRequest - * @property {google.cloud.dialogflow.v2beta1.IDocument|null} [document] UpdateDocumentRequest document - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDocumentRequest updateMask + * Properties of a ListMessagesRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IListMessagesRequest + * @property {string|null} [parent] ListMessagesRequest parent + * @property {string|null} [filter] ListMessagesRequest filter + * @property {number|null} [pageSize] ListMessagesRequest pageSize + * @property {string|null} [pageToken] ListMessagesRequest pageToken */ /** - * Constructs a new UpdateDocumentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an UpdateDocumentRequest. - * @implements IUpdateDocumentRequest + * Constructs a new ListMessagesRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListMessagesRequest. + * @implements IListMessagesRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListMessagesRequest=} [properties] Properties to set */ - function UpdateDocumentRequest(properties) { + function ListMessagesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42335,88 +42378,114 @@ } /** - * UpdateDocumentRequest document. - * @member {google.cloud.dialogflow.v2beta1.IDocument|null|undefined} document - * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest + * ListMessagesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest * @instance */ - UpdateDocumentRequest.prototype.document = null; + ListMessagesRequest.prototype.parent = ""; /** - * UpdateDocumentRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest + * ListMessagesRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest * @instance */ - UpdateDocumentRequest.prototype.updateMask = null; + ListMessagesRequest.prototype.filter = ""; /** - * Creates a new UpdateDocumentRequest instance using the specified properties. + * ListMessagesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.pageSize = 0; + + /** + * ListMessagesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListMessagesRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.UpdateDocumentRequest} UpdateDocumentRequest instance + * @param {google.cloud.dialogflow.v2.IListMessagesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListMessagesRequest} ListMessagesRequest instance */ - UpdateDocumentRequest.create = function create(properties) { - return new UpdateDocumentRequest(properties); + ListMessagesRequest.create = function create(properties) { + return new ListMessagesRequest(properties); }; /** - * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateDocumentRequest.verify|verify} messages. + * Encodes the specified ListMessagesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListMessagesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListMessagesRequest} message ListMessagesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDocumentRequest.encode = function encode(message, writer) { + ListMessagesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.document != null && Object.hasOwnProperty.call(message, "document")) - $root.google.cloud.dialogflow.v2beta1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); return writer; }; /** - * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateDocumentRequest.verify|verify} messages. + * Encodes the specified ListMessagesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListMessagesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListMessagesRequest} message ListMessagesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListMessagesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateDocumentRequest message from the specified reader or buffer. + * Decodes a ListMessagesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.UpdateDocumentRequest} UpdateDocumentRequest + * @returns {google.cloud.dialogflow.v2.ListMessagesRequest} ListMessagesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateDocumentRequest.decode = function decode(reader, length) { + ListMessagesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateDocumentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListMessagesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.document = $root.google.cloud.dialogflow.v2beta1.Document.decode(reader, reader.uint32()); + message.parent = reader.string(); + break; + case 4: + message.filter = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -42427,126 +42496,134 @@ }; /** - * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. + * Decodes a ListMessagesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.UpdateDocumentRequest} UpdateDocumentRequest + * @returns {google.cloud.dialogflow.v2.ListMessagesRequest} ListMessagesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + ListMessagesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateDocumentRequest message. + * Verifies a ListMessagesRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateDocumentRequest.verify = function verify(message) { + ListMessagesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.document != null && message.hasOwnProperty("document")) { - var error = $root.google.cloud.dialogflow.v2beta1.Document.verify(message.document); - if (error) - return "document." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListMessagesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.UpdateDocumentRequest} UpdateDocumentRequest + * @returns {google.cloud.dialogflow.v2.ListMessagesRequest} ListMessagesRequest */ - UpdateDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateDocumentRequest) + ListMessagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListMessagesRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.UpdateDocumentRequest(); - if (object.document != null) { - if (typeof object.document !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateDocumentRequest.document: object expected"); - message.document = $root.google.cloud.dialogflow.v2beta1.Document.fromObject(object.document); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateDocumentRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.dialogflow.v2.ListMessagesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListMessagesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.UpdateDocumentRequest} message UpdateDocumentRequest + * @param {google.cloud.dialogflow.v2.ListMessagesRequest} message ListMessagesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateDocumentRequest.toObject = function toObject(message, options) { + ListMessagesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.document = null; - object.updateMask = null; + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; } - if (message.document != null && message.hasOwnProperty("document")) - object.document = $root.google.cloud.dialogflow.v2beta1.Document.toObject(message.document, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; return object; }; /** - * Converts this UpdateDocumentRequest to JSON. + * Converts this ListMessagesRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest + * @memberof google.cloud.dialogflow.v2.ListMessagesRequest * @instance * @returns {Object.} JSON object */ - UpdateDocumentRequest.prototype.toJSON = function toJSON() { + ListMessagesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateDocumentRequest; + return ListMessagesRequest; })(); - v2beta1.KnowledgeOperationMetadata = (function() { + v2.ListMessagesResponse = (function() { /** - * Properties of a KnowledgeOperationMetadata. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IKnowledgeOperationMetadata - * @property {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State|null} [state] KnowledgeOperationMetadata state + * Properties of a ListMessagesResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IListMessagesResponse + * @property {Array.|null} [messages] ListMessagesResponse messages + * @property {string|null} [nextPageToken] ListMessagesResponse nextPageToken */ /** - * Constructs a new KnowledgeOperationMetadata. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a KnowledgeOperationMetadata. - * @implements IKnowledgeOperationMetadata + * Constructs a new ListMessagesResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListMessagesResponse. + * @implements IListMessagesResponse * @constructor - * @param {google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListMessagesResponse=} [properties] Properties to set */ - function KnowledgeOperationMetadata(properties) { + function ListMessagesResponse(properties) { + this.messages = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42554,75 +42631,91 @@ } /** - * KnowledgeOperationMetadata state. - * @member {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State} state - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata + * ListMessagesResponse messages. + * @member {Array.} messages + * @memberof google.cloud.dialogflow.v2.ListMessagesResponse * @instance */ - KnowledgeOperationMetadata.prototype.state = 0; + ListMessagesResponse.prototype.messages = $util.emptyArray; /** - * Creates a new KnowledgeOperationMetadata instance using the specified properties. + * ListMessagesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2.ListMessagesResponse + * @instance + */ + ListMessagesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListMessagesResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata + * @memberof google.cloud.dialogflow.v2.ListMessagesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata} KnowledgeOperationMetadata instance + * @param {google.cloud.dialogflow.v2.IListMessagesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListMessagesResponse} ListMessagesResponse instance */ - KnowledgeOperationMetadata.create = function create(properties) { - return new KnowledgeOperationMetadata(properties); + ListMessagesResponse.create = function create(properties) { + return new ListMessagesResponse(properties); }; /** - * Encodes the specified KnowledgeOperationMetadata message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.verify|verify} messages. + * Encodes the specified ListMessagesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListMessagesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata + * @memberof google.cloud.dialogflow.v2.ListMessagesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata} message KnowledgeOperationMetadata message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListMessagesResponse} message ListMessagesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KnowledgeOperationMetadata.encode = function encode(message, writer) { + ListMessagesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.dialogflow.v2.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified KnowledgeOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.verify|verify} messages. + * Encodes the specified ListMessagesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListMessagesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata + * @memberof google.cloud.dialogflow.v2.ListMessagesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata} message KnowledgeOperationMetadata message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListMessagesResponse} message ListMessagesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KnowledgeOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + ListMessagesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a KnowledgeOperationMetadata message from the specified reader or buffer. + * Decodes a ListMessagesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata + * @memberof google.cloud.dialogflow.v2.ListMessagesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata} KnowledgeOperationMetadata + * @returns {google.cloud.dialogflow.v2.ListMessagesResponse} ListMessagesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - KnowledgeOperationMetadata.decode = function decode(reader, length) { + ListMessagesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListMessagesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.state = reader.int32(); + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.dialogflow.v2.Message.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -42633,150 +42726,133 @@ }; /** - * Decodes a KnowledgeOperationMetadata message from the specified reader or buffer, length delimited. + * Decodes a ListMessagesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata + * @memberof google.cloud.dialogflow.v2.ListMessagesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata} KnowledgeOperationMetadata + * @returns {google.cloud.dialogflow.v2.ListMessagesResponse} ListMessagesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - KnowledgeOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + ListMessagesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a KnowledgeOperationMetadata message. + * Verifies a ListMessagesResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata + * @memberof google.cloud.dialogflow.v2.ListMessagesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - KnowledgeOperationMetadata.verify = function verify(message) { + ListMessagesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Message.verify(message.messages[i]); + if (error) + return "messages." + error; } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a KnowledgeOperationMetadata message from a plain object. Also converts values to their respective internal types. + * Creates a ListMessagesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata + * @memberof google.cloud.dialogflow.v2.ListMessagesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata} KnowledgeOperationMetadata + * @returns {google.cloud.dialogflow.v2.ListMessagesResponse} ListMessagesResponse */ - KnowledgeOperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata) + ListMessagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListMessagesResponse) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata(); - switch (object.state) { - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "PENDING": - case 1: - message.state = 1; - break; - case "RUNNING": - case 2: - message.state = 2; - break; - case "DONE": - case 3: - message.state = 3; - break; + var message = new $root.google.cloud.dialogflow.v2.ListMessagesResponse(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.dialogflow.v2.ListMessagesResponse.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListMessagesResponse.messages: object expected"); + message.messages[i] = $root.google.cloud.dialogflow.v2.Message.fromObject(object.messages[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a KnowledgeOperationMetadata message. Also converts values to other types if specified. + * Creates a plain object from a ListMessagesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata + * @memberof google.cloud.dialogflow.v2.ListMessagesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata} message KnowledgeOperationMetadata + * @param {google.cloud.dialogflow.v2.ListMessagesResponse} message ListMessagesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - KnowledgeOperationMetadata.toObject = function toObject(message, options) { + ListMessagesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.messages = []; if (options.defaults) - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State[message.state] : message.state; + object.nextPageToken = ""; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.dialogflow.v2.Message.toObject(message.messages[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this KnowledgeOperationMetadata to JSON. + * Converts this ListMessagesResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata + * @memberof google.cloud.dialogflow.v2.ListMessagesResponse * @instance * @returns {Object.} JSON object */ - KnowledgeOperationMetadata.prototype.toJSON = function toJSON() { + ListMessagesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * State enum. - * @name google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} PENDING=1 PENDING value - * @property {number} RUNNING=2 RUNNING value - * @property {number} DONE=3 DONE value - */ - KnowledgeOperationMetadata.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PENDING"] = 1; - values[valuesById[2] = "RUNNING"] = 2; - values[valuesById[3] = "DONE"] = 3; - return values; - })(); - - return KnowledgeOperationMetadata; + return ListMessagesResponse; })(); - v2beta1.ReloadDocumentRequest = (function() { + v2.ConversationPhoneNumber = (function() { /** - * Properties of a ReloadDocumentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IReloadDocumentRequest - * @property {string|null} [name] ReloadDocumentRequest name - * @property {google.cloud.dialogflow.v2beta1.IGcsSource|null} [gcsSource] ReloadDocumentRequest gcsSource - * @property {boolean|null} [importGcsCustomMetadata] ReloadDocumentRequest importGcsCustomMetadata + * Properties of a ConversationPhoneNumber. + * @memberof google.cloud.dialogflow.v2 + * @interface IConversationPhoneNumber + * @property {string|null} [phoneNumber] ConversationPhoneNumber phoneNumber */ /** - * Constructs a new ReloadDocumentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ReloadDocumentRequest. - * @implements IReloadDocumentRequest + * Constructs a new ConversationPhoneNumber. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ConversationPhoneNumber. + * @implements IConversationPhoneNumber * @constructor - * @param {google.cloud.dialogflow.v2beta1.IReloadDocumentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IConversationPhoneNumber=} [properties] Properties to set */ - function ReloadDocumentRequest(properties) { + function ConversationPhoneNumber(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -42784,115 +42860,75 @@ } /** - * ReloadDocumentRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest - * @instance - */ - ReloadDocumentRequest.prototype.name = ""; - - /** - * ReloadDocumentRequest gcsSource. - * @member {google.cloud.dialogflow.v2beta1.IGcsSource|null|undefined} gcsSource - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest - * @instance - */ - ReloadDocumentRequest.prototype.gcsSource = null; - - /** - * ReloadDocumentRequest importGcsCustomMetadata. - * @member {boolean} importGcsCustomMetadata - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest - * @instance - */ - ReloadDocumentRequest.prototype.importGcsCustomMetadata = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * ReloadDocumentRequest source. - * @member {"gcsSource"|undefined} source - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * ConversationPhoneNumber phoneNumber. + * @member {string} phoneNumber + * @memberof google.cloud.dialogflow.v2.ConversationPhoneNumber * @instance */ - Object.defineProperty(ReloadDocumentRequest.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), - set: $util.oneOfSetter($oneOfFields) - }); + ConversationPhoneNumber.prototype.phoneNumber = ""; /** - * Creates a new ReloadDocumentRequest instance using the specified properties. + * Creates a new ConversationPhoneNumber instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * @memberof google.cloud.dialogflow.v2.ConversationPhoneNumber * @static - * @param {google.cloud.dialogflow.v2beta1.IReloadDocumentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ReloadDocumentRequest} ReloadDocumentRequest instance + * @param {google.cloud.dialogflow.v2.IConversationPhoneNumber=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ConversationPhoneNumber} ConversationPhoneNumber instance */ - ReloadDocumentRequest.create = function create(properties) { - return new ReloadDocumentRequest(properties); + ConversationPhoneNumber.create = function create(properties) { + return new ConversationPhoneNumber(properties); }; /** - * Encodes the specified ReloadDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ReloadDocumentRequest.verify|verify} messages. + * Encodes the specified ConversationPhoneNumber message. Does not implicitly {@link google.cloud.dialogflow.v2.ConversationPhoneNumber.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * @memberof google.cloud.dialogflow.v2.ConversationPhoneNumber * @static - * @param {google.cloud.dialogflow.v2beta1.IReloadDocumentRequest} message ReloadDocumentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IConversationPhoneNumber} message ConversationPhoneNumber message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReloadDocumentRequest.encode = function encode(message, writer) { + ConversationPhoneNumber.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) - $root.google.cloud.dialogflow.v2beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.importGcsCustomMetadata != null && Object.hasOwnProperty.call(message, "importGcsCustomMetadata")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.importGcsCustomMetadata); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.phoneNumber); return writer; }; /** - * Encodes the specified ReloadDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ReloadDocumentRequest.verify|verify} messages. + * Encodes the specified ConversationPhoneNumber message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ConversationPhoneNumber.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * @memberof google.cloud.dialogflow.v2.ConversationPhoneNumber * @static - * @param {google.cloud.dialogflow.v2beta1.IReloadDocumentRequest} message ReloadDocumentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IConversationPhoneNumber} message ConversationPhoneNumber message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ReloadDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + ConversationPhoneNumber.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ReloadDocumentRequest message from the specified reader or buffer. + * Decodes a ConversationPhoneNumber message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * @memberof google.cloud.dialogflow.v2.ConversationPhoneNumber * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ReloadDocumentRequest} ReloadDocumentRequest + * @returns {google.cloud.dialogflow.v2.ConversationPhoneNumber} ConversationPhoneNumber * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReloadDocumentRequest.decode = function decode(reader, length) { + ConversationPhoneNumber.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ReloadDocumentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ConversationPhoneNumber(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; case 3: - message.gcsSource = $root.google.cloud.dialogflow.v2beta1.GcsSource.decode(reader, reader.uint32()); - break; - case 4: - message.importGcsCustomMetadata = reader.bool(); + message.phoneNumber = reader.string(); break; default: reader.skipType(tag & 7); @@ -42903,135 +42939,110 @@ }; /** - * Decodes a ReloadDocumentRequest message from the specified reader or buffer, length delimited. + * Decodes a ConversationPhoneNumber message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * @memberof google.cloud.dialogflow.v2.ConversationPhoneNumber * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ReloadDocumentRequest} ReloadDocumentRequest + * @returns {google.cloud.dialogflow.v2.ConversationPhoneNumber} ConversationPhoneNumber * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ReloadDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + ConversationPhoneNumber.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ReloadDocumentRequest message. + * Verifies a ConversationPhoneNumber message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * @memberof google.cloud.dialogflow.v2.ConversationPhoneNumber * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ReloadDocumentRequest.verify = function verify(message) { + ConversationPhoneNumber.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - properties.source = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.GcsSource.verify(message.gcsSource); - if (error) - return "gcsSource." + error; - } - } - if (message.importGcsCustomMetadata != null && message.hasOwnProperty("importGcsCustomMetadata")) - if (typeof message.importGcsCustomMetadata !== "boolean") - return "importGcsCustomMetadata: boolean expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; return null; }; /** - * Creates a ReloadDocumentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ConversationPhoneNumber message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * @memberof google.cloud.dialogflow.v2.ConversationPhoneNumber * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ReloadDocumentRequest} ReloadDocumentRequest + * @returns {google.cloud.dialogflow.v2.ConversationPhoneNumber} ConversationPhoneNumber */ - ReloadDocumentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ReloadDocumentRequest) + ConversationPhoneNumber.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ConversationPhoneNumber) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ReloadDocumentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.gcsSource != null) { - if (typeof object.gcsSource !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.ReloadDocumentRequest.gcsSource: object expected"); - message.gcsSource = $root.google.cloud.dialogflow.v2beta1.GcsSource.fromObject(object.gcsSource); - } - if (object.importGcsCustomMetadata != null) - message.importGcsCustomMetadata = Boolean(object.importGcsCustomMetadata); + var message = new $root.google.cloud.dialogflow.v2.ConversationPhoneNumber(); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); return message; }; /** - * Creates a plain object from a ReloadDocumentRequest message. Also converts values to other types if specified. + * Creates a plain object from a ConversationPhoneNumber message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * @memberof google.cloud.dialogflow.v2.ConversationPhoneNumber * @static - * @param {google.cloud.dialogflow.v2beta1.ReloadDocumentRequest} message ReloadDocumentRequest + * @param {google.cloud.dialogflow.v2.ConversationPhoneNumber} message ConversationPhoneNumber * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ReloadDocumentRequest.toObject = function toObject(message, options) { + ConversationPhoneNumber.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.importGcsCustomMetadata = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { - object.gcsSource = $root.google.cloud.dialogflow.v2beta1.GcsSource.toObject(message.gcsSource, options); - if (options.oneofs) - object.source = "gcsSource"; - } - if (message.importGcsCustomMetadata != null && message.hasOwnProperty("importGcsCustomMetadata")) - object.importGcsCustomMetadata = message.importGcsCustomMetadata; + if (options.defaults) + object.phoneNumber = ""; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; return object; }; /** - * Converts this ReloadDocumentRequest to JSON. + * Converts this ConversationPhoneNumber to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * @memberof google.cloud.dialogflow.v2.ConversationPhoneNumber * @instance * @returns {Object.} JSON object */ - ReloadDocumentRequest.prototype.toJSON = function toJSON() { + ConversationPhoneNumber.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ReloadDocumentRequest; + return ConversationPhoneNumber; })(); - v2beta1.GcsSource = (function() { + v2.ConversationEvent = (function() { /** - * Properties of a GcsSource. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IGcsSource - * @property {string|null} [uri] GcsSource uri + * Properties of a ConversationEvent. + * @memberof google.cloud.dialogflow.v2 + * @interface IConversationEvent + * @property {string|null} [conversation] ConversationEvent conversation + * @property {google.cloud.dialogflow.v2.ConversationEvent.Type|null} [type] ConversationEvent type + * @property {google.rpc.IStatus|null} [errorStatus] ConversationEvent errorStatus + * @property {google.cloud.dialogflow.v2.IMessage|null} [newMessagePayload] ConversationEvent newMessagePayload */ /** - * Constructs a new GcsSource. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a GcsSource. - * @implements IGcsSource + * Constructs a new ConversationEvent. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ConversationEvent. + * @implements IConversationEvent * @constructor - * @param {google.cloud.dialogflow.v2beta1.IGcsSource=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IConversationEvent=} [properties] Properties to set */ - function GcsSource(properties) { + function ConversationEvent(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -43039,75 +43050,128 @@ } /** - * GcsSource uri. - * @member {string} uri - * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * ConversationEvent conversation. + * @member {string} conversation + * @memberof google.cloud.dialogflow.v2.ConversationEvent * @instance */ - GcsSource.prototype.uri = ""; + ConversationEvent.prototype.conversation = ""; /** - * Creates a new GcsSource instance using the specified properties. + * ConversationEvent type. + * @member {google.cloud.dialogflow.v2.ConversationEvent.Type} type + * @memberof google.cloud.dialogflow.v2.ConversationEvent + * @instance + */ + ConversationEvent.prototype.type = 0; + + /** + * ConversationEvent errorStatus. + * @member {google.rpc.IStatus|null|undefined} errorStatus + * @memberof google.cloud.dialogflow.v2.ConversationEvent + * @instance + */ + ConversationEvent.prototype.errorStatus = null; + + /** + * ConversationEvent newMessagePayload. + * @member {google.cloud.dialogflow.v2.IMessage|null|undefined} newMessagePayload + * @memberof google.cloud.dialogflow.v2.ConversationEvent + * @instance + */ + ConversationEvent.prototype.newMessagePayload = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ConversationEvent payload. + * @member {"newMessagePayload"|undefined} payload + * @memberof google.cloud.dialogflow.v2.ConversationEvent + * @instance + */ + Object.defineProperty(ConversationEvent.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["newMessagePayload"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConversationEvent instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @memberof google.cloud.dialogflow.v2.ConversationEvent * @static - * @param {google.cloud.dialogflow.v2beta1.IGcsSource=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.GcsSource} GcsSource instance + * @param {google.cloud.dialogflow.v2.IConversationEvent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ConversationEvent} ConversationEvent instance */ - GcsSource.create = function create(properties) { - return new GcsSource(properties); + ConversationEvent.create = function create(properties) { + return new ConversationEvent(properties); }; /** - * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GcsSource.verify|verify} messages. + * Encodes the specified ConversationEvent message. Does not implicitly {@link google.cloud.dialogflow.v2.ConversationEvent.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @memberof google.cloud.dialogflow.v2.ConversationEvent * @static - * @param {google.cloud.dialogflow.v2beta1.IGcsSource} message GcsSource message or plain object to encode + * @param {google.cloud.dialogflow.v2.IConversationEvent} message ConversationEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsSource.encode = function encode(message, writer) { + ConversationEvent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.errorStatus != null && Object.hasOwnProperty.call(message, "errorStatus")) + $root.google.rpc.Status.encode(message.errorStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.newMessagePayload != null && Object.hasOwnProperty.call(message, "newMessagePayload")) + $root.google.cloud.dialogflow.v2.Message.encode(message.newMessagePayload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GcsSource.verify|verify} messages. + * Encodes the specified ConversationEvent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ConversationEvent.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @memberof google.cloud.dialogflow.v2.ConversationEvent * @static - * @param {google.cloud.dialogflow.v2beta1.IGcsSource} message GcsSource message or plain object to encode + * @param {google.cloud.dialogflow.v2.IConversationEvent} message ConversationEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + ConversationEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GcsSource message from the specified reader or buffer. + * Decodes a ConversationEvent message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @memberof google.cloud.dialogflow.v2.ConversationEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.GcsSource} GcsSource + * @returns {google.cloud.dialogflow.v2.ConversationEvent} ConversationEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsSource.decode = function decode(reader, length) { + ConversationEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GcsSource(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ConversationEvent(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.uri = reader.string(); + message.conversation = reader.string(); + break; + case 2: + message.type = reader.int32(); + break; + case 3: + message.errorStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 4: + message.newMessagePayload = $root.google.cloud.dialogflow.v2.Message.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -43118,600 +43182,595 @@ }; /** - * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * Decodes a ConversationEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @memberof google.cloud.dialogflow.v2.ConversationEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.GcsSource} GcsSource + * @returns {google.cloud.dialogflow.v2.ConversationEvent} ConversationEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GcsSource.decodeDelimited = function decodeDelimited(reader) { + ConversationEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GcsSource message. + * Verifies a ConversationEvent message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @memberof google.cloud.dialogflow.v2.ConversationEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GcsSource.verify = function verify(message) { + ConversationEvent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; + var properties = {}; + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 5: + case 4: + break; + } + if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) { + var error = $root.google.rpc.Status.verify(message.errorStatus); + if (error) + return "errorStatus." + error; + } + if (message.newMessagePayload != null && message.hasOwnProperty("newMessagePayload")) { + properties.payload = 1; + { + var error = $root.google.cloud.dialogflow.v2.Message.verify(message.newMessagePayload); + if (error) + return "newMessagePayload." + error; + } + } return null; }; /** - * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * Creates a ConversationEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @memberof google.cloud.dialogflow.v2.ConversationEvent * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.GcsSource} GcsSource + * @returns {google.cloud.dialogflow.v2.ConversationEvent} ConversationEvent */ - GcsSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.GcsSource) + ConversationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ConversationEvent) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.GcsSource(); - if (object.uri != null) - message.uri = String(object.uri); + var message = new $root.google.cloud.dialogflow.v2.ConversationEvent(); + if (object.conversation != null) + message.conversation = String(object.conversation); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "CONVERSATION_STARTED": + case 1: + message.type = 1; + break; + case "CONVERSATION_FINISHED": + case 2: + message.type = 2; + break; + case "HUMAN_INTERVENTION_NEEDED": + case 3: + message.type = 3; + break; + case "NEW_MESSAGE": + case 5: + message.type = 5; + break; + case "UNRECOVERABLE_ERROR": + case 4: + message.type = 4; + break; + } + if (object.errorStatus != null) { + if (typeof object.errorStatus !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationEvent.errorStatus: object expected"); + message.errorStatus = $root.google.rpc.Status.fromObject(object.errorStatus); + } + if (object.newMessagePayload != null) { + if (typeof object.newMessagePayload !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationEvent.newMessagePayload: object expected"); + message.newMessagePayload = $root.google.cloud.dialogflow.v2.Message.fromObject(object.newMessagePayload); + } return message; }; /** - * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * Creates a plain object from a ConversationEvent message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @memberof google.cloud.dialogflow.v2.ConversationEvent * @static - * @param {google.cloud.dialogflow.v2beta1.GcsSource} message GcsSource + * @param {google.cloud.dialogflow.v2.ConversationEvent} message ConversationEvent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GcsSource.toObject = function toObject(message, options) { + ConversationEvent.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.uri = ""; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; + if (options.defaults) { + object.conversation = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.errorStatus = null; + } + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.v2.ConversationEvent.Type[message.type] : message.type; + if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) + object.errorStatus = $root.google.rpc.Status.toObject(message.errorStatus, options); + if (message.newMessagePayload != null && message.hasOwnProperty("newMessagePayload")) { + object.newMessagePayload = $root.google.cloud.dialogflow.v2.Message.toObject(message.newMessagePayload, options); + if (options.oneofs) + object.payload = "newMessagePayload"; + } return object; }; /** - * Converts this GcsSource to JSON. + * Converts this ConversationEvent to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @memberof google.cloud.dialogflow.v2.ConversationEvent * @instance * @returns {Object.} JSON object */ - GcsSource.prototype.toJSON = function toJSON() { + ConversationEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GcsSource; + /** + * Type enum. + * @name google.cloud.dialogflow.v2.ConversationEvent.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} CONVERSATION_STARTED=1 CONVERSATION_STARTED value + * @property {number} CONVERSATION_FINISHED=2 CONVERSATION_FINISHED value + * @property {number} HUMAN_INTERVENTION_NEEDED=3 HUMAN_INTERVENTION_NEEDED value + * @property {number} NEW_MESSAGE=5 NEW_MESSAGE value + * @property {number} UNRECOVERABLE_ERROR=4 UNRECOVERABLE_ERROR value + */ + ConversationEvent.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONVERSATION_STARTED"] = 1; + values[valuesById[2] = "CONVERSATION_FINISHED"] = 2; + values[valuesById[3] = "HUMAN_INTERVENTION_NEEDED"] = 3; + values[valuesById[5] = "NEW_MESSAGE"] = 5; + values[valuesById[4] = "UNRECOVERABLE_ERROR"] = 4; + return values; + })(); + + return ConversationEvent; })(); - v2beta1.EntityTypes = (function() { + v2.ConversationProfiles = (function() { /** - * Constructs a new EntityTypes service. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an EntityTypes + * Constructs a new ConversationProfiles service. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ConversationProfiles * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function EntityTypes(rpcImpl, requestDelimited, responseDelimited) { + function ConversationProfiles(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - (EntityTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EntityTypes; + (ConversationProfiles.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ConversationProfiles; /** - * Creates new EntityTypes service using the specified rpc implementation. + * Creates new ConversationProfiles service using the specified rpc implementation. * @function create - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @memberof google.cloud.dialogflow.v2.ConversationProfiles * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {EntityTypes} RPC service. Useful where requests and/or responses are streamed. + * @returns {ConversationProfiles} RPC service. Useful where requests and/or responses are streamed. */ - EntityTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + ConversationProfiles.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#listEntityTypes}. - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @typedef ListEntityTypesCallback + * Callback as used by {@link google.cloud.dialogflow.v2.ConversationProfiles#listConversationProfiles}. + * @memberof google.cloud.dialogflow.v2.ConversationProfiles + * @typedef ListConversationProfilesCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.ListEntityTypesResponse} [response] ListEntityTypesResponse + * @param {google.cloud.dialogflow.v2.ListConversationProfilesResponse} [response] ListConversationProfilesResponse */ /** - * Calls ListEntityTypes. - * @function listEntityTypes - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * Calls ListConversationProfiles. + * @function listConversationProfiles + * @memberof google.cloud.dialogflow.v2.ConversationProfiles * @instance - * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesRequest} request ListEntityTypesRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.EntityTypes.ListEntityTypesCallback} callback Node-style callback called with the error, if any, and ListEntityTypesResponse + * @param {google.cloud.dialogflow.v2.IListConversationProfilesRequest} request ListConversationProfilesRequest message or plain object + * @param {google.cloud.dialogflow.v2.ConversationProfiles.ListConversationProfilesCallback} callback Node-style callback called with the error, if any, and ListConversationProfilesResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(EntityTypes.prototype.listEntityTypes = function listEntityTypes(request, callback) { - return this.rpcCall(listEntityTypes, $root.google.cloud.dialogflow.v2beta1.ListEntityTypesRequest, $root.google.cloud.dialogflow.v2beta1.ListEntityTypesResponse, request, callback); - }, "name", { value: "ListEntityTypes" }); + Object.defineProperty(ConversationProfiles.prototype.listConversationProfiles = function listConversationProfiles(request, callback) { + return this.rpcCall(listConversationProfiles, $root.google.cloud.dialogflow.v2.ListConversationProfilesRequest, $root.google.cloud.dialogflow.v2.ListConversationProfilesResponse, request, callback); + }, "name", { value: "ListConversationProfiles" }); /** - * Calls ListEntityTypes. - * @function listEntityTypes - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * Calls ListConversationProfiles. + * @function listConversationProfiles + * @memberof google.cloud.dialogflow.v2.ConversationProfiles * @instance - * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesRequest} request ListEntityTypesRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2.IListConversationProfilesRequest} request ListConversationProfilesRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#getEntityType}. - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @typedef GetEntityTypeCallback + * Callback as used by {@link google.cloud.dialogflow.v2.ConversationProfiles#getConversationProfile}. + * @memberof google.cloud.dialogflow.v2.ConversationProfiles + * @typedef GetConversationProfileCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.EntityType} [response] EntityType + * @param {google.cloud.dialogflow.v2.ConversationProfile} [response] ConversationProfile */ /** - * Calls GetEntityType. - * @function getEntityType - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * Calls GetConversationProfile. + * @function getConversationProfile + * @memberof google.cloud.dialogflow.v2.ConversationProfiles * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest} request GetEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.EntityTypes.GetEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @param {google.cloud.dialogflow.v2.IGetConversationProfileRequest} request GetConversationProfileRequest message or plain object + * @param {google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfileCallback} callback Node-style callback called with the error, if any, and ConversationProfile * @returns {undefined} * @variation 1 */ - Object.defineProperty(EntityTypes.prototype.getEntityType = function getEntityType(request, callback) { - return this.rpcCall(getEntityType, $root.google.cloud.dialogflow.v2beta1.GetEntityTypeRequest, $root.google.cloud.dialogflow.v2beta1.EntityType, request, callback); - }, "name", { value: "GetEntityType" }); + Object.defineProperty(ConversationProfiles.prototype.getConversationProfile = function getConversationProfile(request, callback) { + return this.rpcCall(getConversationProfile, $root.google.cloud.dialogflow.v2.GetConversationProfileRequest, $root.google.cloud.dialogflow.v2.ConversationProfile, request, callback); + }, "name", { value: "GetConversationProfile" }); /** - * Calls GetEntityType. - * @function getEntityType - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * Calls GetConversationProfile. + * @function getConversationProfile + * @memberof google.cloud.dialogflow.v2.ConversationProfiles * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest} request GetEntityTypeRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2.IGetConversationProfileRequest} request GetConversationProfileRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#createEntityType}. - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @typedef CreateEntityTypeCallback + * Callback as used by {@link google.cloud.dialogflow.v2.ConversationProfiles#createConversationProfile}. + * @memberof google.cloud.dialogflow.v2.ConversationProfiles + * @typedef CreateConversationProfileCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.EntityType} [response] EntityType + * @param {google.cloud.dialogflow.v2.ConversationProfile} [response] ConversationProfile */ /** - * Calls CreateEntityType. - * @function createEntityType - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * Calls CreateConversationProfile. + * @function createConversationProfile + * @memberof google.cloud.dialogflow.v2.ConversationProfiles * @instance - * @param {google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest} request CreateEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.EntityTypes.CreateEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @param {google.cloud.dialogflow.v2.ICreateConversationProfileRequest} request CreateConversationProfileRequest message or plain object + * @param {google.cloud.dialogflow.v2.ConversationProfiles.CreateConversationProfileCallback} callback Node-style callback called with the error, if any, and ConversationProfile * @returns {undefined} * @variation 1 */ - Object.defineProperty(EntityTypes.prototype.createEntityType = function createEntityType(request, callback) { - return this.rpcCall(createEntityType, $root.google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest, $root.google.cloud.dialogflow.v2beta1.EntityType, request, callback); - }, "name", { value: "CreateEntityType" }); + Object.defineProperty(ConversationProfiles.prototype.createConversationProfile = function createConversationProfile(request, callback) { + return this.rpcCall(createConversationProfile, $root.google.cloud.dialogflow.v2.CreateConversationProfileRequest, $root.google.cloud.dialogflow.v2.ConversationProfile, request, callback); + }, "name", { value: "CreateConversationProfile" }); /** - * Calls CreateEntityType. - * @function createEntityType - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * Calls CreateConversationProfile. + * @function createConversationProfile + * @memberof google.cloud.dialogflow.v2.ConversationProfiles * @instance - * @param {google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest} request CreateEntityTypeRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2.ICreateConversationProfileRequest} request CreateConversationProfileRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#updateEntityType}. - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @typedef UpdateEntityTypeCallback + * Callback as used by {@link google.cloud.dialogflow.v2.ConversationProfiles#updateConversationProfile}. + * @memberof google.cloud.dialogflow.v2.ConversationProfiles + * @typedef UpdateConversationProfileCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.EntityType} [response] EntityType + * @param {google.cloud.dialogflow.v2.ConversationProfile} [response] ConversationProfile */ /** - * Calls UpdateEntityType. - * @function updateEntityType - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * Calls UpdateConversationProfile. + * @function updateConversationProfile + * @memberof google.cloud.dialogflow.v2.ConversationProfiles * @instance - * @param {google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest} request UpdateEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.EntityTypes.UpdateEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @param {google.cloud.dialogflow.v2.IUpdateConversationProfileRequest} request UpdateConversationProfileRequest message or plain object + * @param {google.cloud.dialogflow.v2.ConversationProfiles.UpdateConversationProfileCallback} callback Node-style callback called with the error, if any, and ConversationProfile * @returns {undefined} * @variation 1 */ - Object.defineProperty(EntityTypes.prototype.updateEntityType = function updateEntityType(request, callback) { - return this.rpcCall(updateEntityType, $root.google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest, $root.google.cloud.dialogflow.v2beta1.EntityType, request, callback); - }, "name", { value: "UpdateEntityType" }); + Object.defineProperty(ConversationProfiles.prototype.updateConversationProfile = function updateConversationProfile(request, callback) { + return this.rpcCall(updateConversationProfile, $root.google.cloud.dialogflow.v2.UpdateConversationProfileRequest, $root.google.cloud.dialogflow.v2.ConversationProfile, request, callback); + }, "name", { value: "UpdateConversationProfile" }); /** - * Calls UpdateEntityType. - * @function updateEntityType - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * Calls UpdateConversationProfile. + * @function updateConversationProfile + * @memberof google.cloud.dialogflow.v2.ConversationProfiles * @instance - * @param {google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest} request UpdateEntityTypeRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2.IUpdateConversationProfileRequest} request UpdateConversationProfileRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#deleteEntityType}. - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @typedef DeleteEntityTypeCallback + * Callback as used by {@link google.cloud.dialogflow.v2.ConversationProfiles#deleteConversationProfile}. + * @memberof google.cloud.dialogflow.v2.ConversationProfiles + * @typedef DeleteConversationProfileCallback * @type {function} * @param {Error|null} error Error, if any * @param {google.protobuf.Empty} [response] Empty */ /** - * Calls DeleteEntityType. - * @function deleteEntityType - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * Calls DeleteConversationProfile. + * @function deleteConversationProfile + * @memberof google.cloud.dialogflow.v2.ConversationProfiles * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest} request DeleteEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.EntityTypes.DeleteEntityTypeCallback} callback Node-style callback called with the error, if any, and Empty + * @param {google.cloud.dialogflow.v2.IDeleteConversationProfileRequest} request DeleteConversationProfileRequest message or plain object + * @param {google.cloud.dialogflow.v2.ConversationProfiles.DeleteConversationProfileCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ - Object.defineProperty(EntityTypes.prototype.deleteEntityType = function deleteEntityType(request, callback) { - return this.rpcCall(deleteEntityType, $root.google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteEntityType" }); + Object.defineProperty(ConversationProfiles.prototype.deleteConversationProfile = function deleteConversationProfile(request, callback) { + return this.rpcCall(deleteConversationProfile, $root.google.cloud.dialogflow.v2.DeleteConversationProfileRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteConversationProfile" }); /** - * Calls DeleteEntityType. - * @function deleteEntityType - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * Calls DeleteConversationProfile. + * @function deleteConversationProfile + * @memberof google.cloud.dialogflow.v2.ConversationProfiles * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest} request DeleteEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2.IDeleteConversationProfileRequest} request DeleteConversationProfileRequest message or plain object * @returns {Promise} Promise * @variation 2 */ + return ConversationProfiles; + })(); + + v2.ConversationProfile = (function() { + /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchUpdateEntityTypes}. - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @typedef BatchUpdateEntityTypesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * Properties of a ConversationProfile. + * @memberof google.cloud.dialogflow.v2 + * @interface IConversationProfile + * @property {string|null} [name] ConversationProfile name + * @property {string|null} [displayName] ConversationProfile displayName + * @property {google.protobuf.ITimestamp|null} [createTime] ConversationProfile createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ConversationProfile updateTime + * @property {google.cloud.dialogflow.v2.IAutomatedAgentConfig|null} [automatedAgentConfig] ConversationProfile automatedAgentConfig + * @property {google.cloud.dialogflow.v2.IHumanAgentAssistantConfig|null} [humanAgentAssistantConfig] ConversationProfile humanAgentAssistantConfig + * @property {google.cloud.dialogflow.v2.IHumanAgentHandoffConfig|null} [humanAgentHandoffConfig] ConversationProfile humanAgentHandoffConfig + * @property {google.cloud.dialogflow.v2.INotificationConfig|null} [notificationConfig] ConversationProfile notificationConfig + * @property {google.cloud.dialogflow.v2.ILoggingConfig|null} [loggingConfig] ConversationProfile loggingConfig + * @property {google.cloud.dialogflow.v2.INotificationConfig|null} [newMessageEventNotificationConfig] ConversationProfile newMessageEventNotificationConfig + * @property {google.cloud.dialogflow.v2.ISpeechToTextConfig|null} [sttConfig] ConversationProfile sttConfig + * @property {string|null} [languageCode] ConversationProfile languageCode + */ + + /** + * Constructs a new ConversationProfile. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ConversationProfile. + * @implements IConversationProfile + * @constructor + * @param {google.cloud.dialogflow.v2.IConversationProfile=} [properties] Properties to set */ + function ConversationProfile(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * Calls BatchUpdateEntityTypes. - * @function batchUpdateEntityTypes - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * ConversationProfile name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest} request BatchUpdateEntityTypesRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.EntityTypes.BatchUpdateEntityTypesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(EntityTypes.prototype.batchUpdateEntityTypes = function batchUpdateEntityTypes(request, callback) { - return this.rpcCall(batchUpdateEntityTypes, $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchUpdateEntityTypes" }); + ConversationProfile.prototype.name = ""; /** - * Calls BatchUpdateEntityTypes. - * @function batchUpdateEntityTypes - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * ConversationProfile displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest} request BatchUpdateEntityTypesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 */ + ConversationProfile.prototype.displayName = ""; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchDeleteEntityTypes}. - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @typedef BatchDeleteEntityTypesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation + * ConversationProfile createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.v2.ConversationProfile + * @instance */ + ConversationProfile.prototype.createTime = null; /** - * Calls BatchDeleteEntityTypes. - * @function batchDeleteEntityTypes - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * ConversationProfile updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest} request BatchDeleteEntityTypesRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntityTypesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(EntityTypes.prototype.batchDeleteEntityTypes = function batchDeleteEntityTypes(request, callback) { - return this.rpcCall(batchDeleteEntityTypes, $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchDeleteEntityTypes" }); + ConversationProfile.prototype.updateTime = null; /** - * Calls BatchDeleteEntityTypes. - * @function batchDeleteEntityTypes - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest} request BatchDeleteEntityTypesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchCreateEntities}. - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @typedef BatchCreateEntitiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchCreateEntities. - * @function batchCreateEntities - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest} request BatchCreateEntitiesRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.EntityTypes.BatchCreateEntitiesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EntityTypes.prototype.batchCreateEntities = function batchCreateEntities(request, callback) { - return this.rpcCall(batchCreateEntities, $root.google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchCreateEntities" }); - - /** - * Calls BatchCreateEntities. - * @function batchCreateEntities - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest} request BatchCreateEntitiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchUpdateEntities}. - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @typedef BatchUpdateEntitiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchUpdateEntities. - * @function batchUpdateEntities - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest} request BatchUpdateEntitiesRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.EntityTypes.BatchUpdateEntitiesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(EntityTypes.prototype.batchUpdateEntities = function batchUpdateEntities(request, callback) { - return this.rpcCall(batchUpdateEntities, $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchUpdateEntities" }); - - /** - * Calls BatchUpdateEntities. - * @function batchUpdateEntities - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest} request BatchUpdateEntitiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchDeleteEntities}. - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes - * @typedef BatchDeleteEntitiesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls BatchDeleteEntities. - * @function batchDeleteEntities - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * ConversationProfile automatedAgentConfig. + * @member {google.cloud.dialogflow.v2.IAutomatedAgentConfig|null|undefined} automatedAgentConfig + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest} request BatchDeleteEntitiesRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntitiesCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 */ - Object.defineProperty(EntityTypes.prototype.batchDeleteEntities = function batchDeleteEntities(request, callback) { - return this.rpcCall(batchDeleteEntities, $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchDeleteEntities" }); + ConversationProfile.prototype.automatedAgentConfig = null; /** - * Calls BatchDeleteEntities. - * @function batchDeleteEntities - * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * ConversationProfile humanAgentAssistantConfig. + * @member {google.cloud.dialogflow.v2.IHumanAgentAssistantConfig|null|undefined} humanAgentAssistantConfig + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest} request BatchDeleteEntitiesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return EntityTypes; - })(); - - v2beta1.EntityType = (function() { - - /** - * Properties of an EntityType. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IEntityType - * @property {string|null} [name] EntityType name - * @property {string|null} [displayName] EntityType displayName - * @property {google.cloud.dialogflow.v2beta1.EntityType.Kind|null} [kind] EntityType kind - * @property {google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode|null} [autoExpansionMode] EntityType autoExpansionMode - * @property {Array.|null} [entities] EntityType entities - * @property {boolean|null} [enableFuzzyExtraction] EntityType enableFuzzyExtraction - */ - - /** - * Constructs a new EntityType. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an EntityType. - * @implements IEntityType - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IEntityType=} [properties] Properties to set */ - function EntityType(properties) { - this.entities = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + ConversationProfile.prototype.humanAgentAssistantConfig = null; /** - * EntityType name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * ConversationProfile humanAgentHandoffConfig. + * @member {google.cloud.dialogflow.v2.IHumanAgentHandoffConfig|null|undefined} humanAgentHandoffConfig + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @instance */ - EntityType.prototype.name = ""; + ConversationProfile.prototype.humanAgentHandoffConfig = null; /** - * EntityType displayName. - * @member {string} displayName - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * ConversationProfile notificationConfig. + * @member {google.cloud.dialogflow.v2.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @instance */ - EntityType.prototype.displayName = ""; + ConversationProfile.prototype.notificationConfig = null; /** - * EntityType kind. - * @member {google.cloud.dialogflow.v2beta1.EntityType.Kind} kind - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * ConversationProfile loggingConfig. + * @member {google.cloud.dialogflow.v2.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @instance */ - EntityType.prototype.kind = 0; + ConversationProfile.prototype.loggingConfig = null; /** - * EntityType autoExpansionMode. - * @member {google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode} autoExpansionMode - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * ConversationProfile newMessageEventNotificationConfig. + * @member {google.cloud.dialogflow.v2.INotificationConfig|null|undefined} newMessageEventNotificationConfig + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @instance */ - EntityType.prototype.autoExpansionMode = 0; + ConversationProfile.prototype.newMessageEventNotificationConfig = null; /** - * EntityType entities. - * @member {Array.} entities - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * ConversationProfile sttConfig. + * @member {google.cloud.dialogflow.v2.ISpeechToTextConfig|null|undefined} sttConfig + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @instance */ - EntityType.prototype.entities = $util.emptyArray; + ConversationProfile.prototype.sttConfig = null; /** - * EntityType enableFuzzyExtraction. - * @member {boolean} enableFuzzyExtraction - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * ConversationProfile languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @instance */ - EntityType.prototype.enableFuzzyExtraction = false; + ConversationProfile.prototype.languageCode = ""; /** - * Creates a new EntityType instance using the specified properties. + * Creates a new ConversationProfile instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @static - * @param {google.cloud.dialogflow.v2beta1.IEntityType=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.EntityType} EntityType instance + * @param {google.cloud.dialogflow.v2.IConversationProfile=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ConversationProfile} ConversationProfile instance */ - EntityType.create = function create(properties) { - return new EntityType(properties); + ConversationProfile.create = function create(properties) { + return new ConversationProfile(properties); }; /** - * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.verify|verify} messages. + * Encodes the specified ConversationProfile message. Does not implicitly {@link google.cloud.dialogflow.v2.ConversationProfile.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @static - * @param {google.cloud.dialogflow.v2beta1.IEntityType} message EntityType message or plain object to encode + * @param {google.cloud.dialogflow.v2.IConversationProfile} message ConversationProfile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EntityType.encode = function encode(message, writer) { + ConversationProfile.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.kind); - if (message.autoExpansionMode != null && Object.hasOwnProperty.call(message, "autoExpansionMode")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.autoExpansionMode); - if (message.entities != null && message.entities.length) - for (var i = 0; i < message.entities.length; ++i) - $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.enableFuzzyExtraction != null && Object.hasOwnProperty.call(message, "enableFuzzyExtraction")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableFuzzyExtraction); + if (message.automatedAgentConfig != null && Object.hasOwnProperty.call(message, "automatedAgentConfig")) + $root.google.cloud.dialogflow.v2.AutomatedAgentConfig.encode(message.automatedAgentConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.humanAgentAssistantConfig != null && Object.hasOwnProperty.call(message, "humanAgentAssistantConfig")) + $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.encode(message.humanAgentAssistantConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.humanAgentHandoffConfig != null && Object.hasOwnProperty.call(message, "humanAgentHandoffConfig")) + $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.encode(message.humanAgentHandoffConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.cloud.dialogflow.v2.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.cloud.dialogflow.v2.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.newMessageEventNotificationConfig != null && Object.hasOwnProperty.call(message, "newMessageEventNotificationConfig")) + $root.google.cloud.dialogflow.v2.NotificationConfig.encode(message.newMessageEventNotificationConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sttConfig != null && Object.hasOwnProperty.call(message, "sttConfig")) + $root.google.cloud.dialogflow.v2.SpeechToTextConfig.encode(message.sttConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.languageCode); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; /** - * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.verify|verify} messages. + * Encodes the specified ConversationProfile message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ConversationProfile.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @static - * @param {google.cloud.dialogflow.v2beta1.IEntityType} message EntityType message or plain object to encode + * @param {google.cloud.dialogflow.v2.IConversationProfile} message ConversationProfile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EntityType.encodeDelimited = function encodeDelimited(message, writer) { + ConversationProfile.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EntityType message from the specified reader or buffer. + * Decodes a ConversationProfile message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.EntityType} EntityType + * @returns {google.cloud.dialogflow.v2.ConversationProfile} ConversationProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EntityType.decode = function decode(reader, length) { + ConversationProfile.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.EntityType(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ConversationProfile(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -43721,19 +43780,35 @@ case 2: message.displayName = reader.string(); break; + case 11: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 12: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; case 3: - message.kind = reader.int32(); + message.automatedAgentConfig = $root.google.cloud.dialogflow.v2.AutomatedAgentConfig.decode(reader, reader.uint32()); break; case 4: - message.autoExpansionMode = reader.int32(); + message.humanAgentAssistantConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.decode(reader, reader.uint32()); + break; + case 5: + message.humanAgentHandoffConfig = $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.decode(reader, reader.uint32()); break; case 6: - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.dialogflow.v2beta1.EntityType.Entity.decode(reader, reader.uint32())); + message.notificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.decode(reader, reader.uint32()); break; case 7: - message.enableFuzzyExtraction = reader.bool(); + message.loggingConfig = $root.google.cloud.dialogflow.v2.LoggingConfig.decode(reader, reader.uint32()); + break; + case 8: + message.newMessageEventNotificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.decode(reader, reader.uint32()); + break; + case 9: + message.sttConfig = $root.google.cloud.dialogflow.v2.SpeechToTextConfig.decode(reader, reader.uint32()); + break; + case 10: + message.languageCode = reader.string(); break; default: reader.skipType(tag & 7); @@ -43744,30 +43819,30 @@ }; /** - * Decodes an EntityType message from the specified reader or buffer, length delimited. + * Decodes a ConversationProfile message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.EntityType} EntityType + * @returns {google.cloud.dialogflow.v2.ConversationProfile} ConversationProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EntityType.decodeDelimited = function decodeDelimited(reader) { + ConversationProfile.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EntityType message. + * Verifies a ConversationProfile message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EntityType.verify = function verify(message) { + ConversationProfile.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -43776,532 +43851,302 @@ if (message.displayName != null && message.hasOwnProperty("displayName")) if (!$util.isString(message.displayName)) return "displayName: string expected"; - if (message.kind != null && message.hasOwnProperty("kind")) - switch (message.kind) { - default: - return "kind: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.autoExpansionMode != null && message.hasOwnProperty("autoExpansionMode")) - switch (message.autoExpansionMode) { - default: - return "autoExpansionMode: enum value expected"; - case 0: - case 1: - break; - } - if (message.entities != null && message.hasOwnProperty("entities")) { - if (!Array.isArray(message.entities)) - return "entities: array expected"; - for (var i = 0; i < message.entities.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.verify(message.entities[i]); - if (error) - return "entities." + error; - } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; } - if (message.enableFuzzyExtraction != null && message.hasOwnProperty("enableFuzzyExtraction")) - if (typeof message.enableFuzzyExtraction !== "boolean") - return "enableFuzzyExtraction: boolean expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.automatedAgentConfig != null && message.hasOwnProperty("automatedAgentConfig")) { + var error = $root.google.cloud.dialogflow.v2.AutomatedAgentConfig.verify(message.automatedAgentConfig); + if (error) + return "automatedAgentConfig." + error; + } + if (message.humanAgentAssistantConfig != null && message.hasOwnProperty("humanAgentAssistantConfig")) { + var error = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.verify(message.humanAgentAssistantConfig); + if (error) + return "humanAgentAssistantConfig." + error; + } + if (message.humanAgentHandoffConfig != null && message.hasOwnProperty("humanAgentHandoffConfig")) { + var error = $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.verify(message.humanAgentHandoffConfig); + if (error) + return "humanAgentHandoffConfig." + error; + } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.dialogflow.v2.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.cloud.dialogflow.v2.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + if (message.newMessageEventNotificationConfig != null && message.hasOwnProperty("newMessageEventNotificationConfig")) { + var error = $root.google.cloud.dialogflow.v2.NotificationConfig.verify(message.newMessageEventNotificationConfig); + if (error) + return "newMessageEventNotificationConfig." + error; + } + if (message.sttConfig != null && message.hasOwnProperty("sttConfig")) { + var error = $root.google.cloud.dialogflow.v2.SpeechToTextConfig.verify(message.sttConfig); + if (error) + return "sttConfig." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; return null; }; /** - * Creates an EntityType message from a plain object. Also converts values to their respective internal types. + * Creates a ConversationProfile message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.EntityType} EntityType + * @returns {google.cloud.dialogflow.v2.ConversationProfile} ConversationProfile */ - EntityType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.EntityType) + ConversationProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ConversationProfile) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.EntityType(); + var message = new $root.google.cloud.dialogflow.v2.ConversationProfile(); if (object.name != null) message.name = String(object.name); if (object.displayName != null) message.displayName = String(object.displayName); - switch (object.kind) { - case "KIND_UNSPECIFIED": - case 0: - message.kind = 0; - break; - case "KIND_MAP": - case 1: - message.kind = 1; - break; - case "KIND_LIST": - case 2: - message.kind = 2; - break; - case "KIND_REGEXP": - case 3: - message.kind = 3; - break; + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationProfile.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - switch (object.autoExpansionMode) { - case "AUTO_EXPANSION_MODE_UNSPECIFIED": - case 0: - message.autoExpansionMode = 0; - break; - case "AUTO_EXPANSION_MODE_DEFAULT": - case 1: - message.autoExpansionMode = 1; - break; + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationProfile.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); } - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.dialogflow.v2beta1.EntityType.entities: array expected"); - message.entities = []; - for (var i = 0; i < object.entities.length; ++i) { - if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.EntityType.entities: object expected"); - message.entities[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.fromObject(object.entities[i]); - } + if (object.automatedAgentConfig != null) { + if (typeof object.automatedAgentConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationProfile.automatedAgentConfig: object expected"); + message.automatedAgentConfig = $root.google.cloud.dialogflow.v2.AutomatedAgentConfig.fromObject(object.automatedAgentConfig); + } + if (object.humanAgentAssistantConfig != null) { + if (typeof object.humanAgentAssistantConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationProfile.humanAgentAssistantConfig: object expected"); + message.humanAgentAssistantConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.fromObject(object.humanAgentAssistantConfig); + } + if (object.humanAgentHandoffConfig != null) { + if (typeof object.humanAgentHandoffConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationProfile.humanAgentHandoffConfig: object expected"); + message.humanAgentHandoffConfig = $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.fromObject(object.humanAgentHandoffConfig); + } + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationProfile.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationProfile.loggingConfig: object expected"); + message.loggingConfig = $root.google.cloud.dialogflow.v2.LoggingConfig.fromObject(object.loggingConfig); + } + if (object.newMessageEventNotificationConfig != null) { + if (typeof object.newMessageEventNotificationConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationProfile.newMessageEventNotificationConfig: object expected"); + message.newMessageEventNotificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.fromObject(object.newMessageEventNotificationConfig); + } + if (object.sttConfig != null) { + if (typeof object.sttConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ConversationProfile.sttConfig: object expected"); + message.sttConfig = $root.google.cloud.dialogflow.v2.SpeechToTextConfig.fromObject(object.sttConfig); } - if (object.enableFuzzyExtraction != null) - message.enableFuzzyExtraction = Boolean(object.enableFuzzyExtraction); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); return message; }; /** - * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * Creates a plain object from a ConversationProfile message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @static - * @param {google.cloud.dialogflow.v2beta1.EntityType} message EntityType + * @param {google.cloud.dialogflow.v2.ConversationProfile} message ConversationProfile * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EntityType.toObject = function toObject(message, options) { + ConversationProfile.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entities = []; if (options.defaults) { object.name = ""; object.displayName = ""; - object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; - object.autoExpansionMode = options.enums === String ? "AUTO_EXPANSION_MODE_UNSPECIFIED" : 0; - object.enableFuzzyExtraction = false; + object.automatedAgentConfig = null; + object.humanAgentAssistantConfig = null; + object.humanAgentHandoffConfig = null; + object.notificationConfig = null; + object.loggingConfig = null; + object.newMessageEventNotificationConfig = null; + object.sttConfig = null; + object.languageCode = ""; + object.createTime = null; + object.updateTime = null; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; if (message.displayName != null && message.hasOwnProperty("displayName")) object.displayName = message.displayName; - if (message.kind != null && message.hasOwnProperty("kind")) - object.kind = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.EntityType.Kind[message.kind] : message.kind; - if (message.autoExpansionMode != null && message.hasOwnProperty("autoExpansionMode")) - object.autoExpansionMode = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode[message.autoExpansionMode] : message.autoExpansionMode; - if (message.entities && message.entities.length) { - object.entities = []; - for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.toObject(message.entities[j], options); - } - if (message.enableFuzzyExtraction != null && message.hasOwnProperty("enableFuzzyExtraction")) - object.enableFuzzyExtraction = message.enableFuzzyExtraction; + if (message.automatedAgentConfig != null && message.hasOwnProperty("automatedAgentConfig")) + object.automatedAgentConfig = $root.google.cloud.dialogflow.v2.AutomatedAgentConfig.toObject(message.automatedAgentConfig, options); + if (message.humanAgentAssistantConfig != null && message.hasOwnProperty("humanAgentAssistantConfig")) + object.humanAgentAssistantConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.toObject(message.humanAgentAssistantConfig, options); + if (message.humanAgentHandoffConfig != null && message.hasOwnProperty("humanAgentHandoffConfig")) + object.humanAgentHandoffConfig = $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.toObject(message.humanAgentHandoffConfig, options); + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.toObject(message.notificationConfig, options); + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.cloud.dialogflow.v2.LoggingConfig.toObject(message.loggingConfig, options); + if (message.newMessageEventNotificationConfig != null && message.hasOwnProperty("newMessageEventNotificationConfig")) + object.newMessageEventNotificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.toObject(message.newMessageEventNotificationConfig, options); + if (message.sttConfig != null && message.hasOwnProperty("sttConfig")) + object.sttConfig = $root.google.cloud.dialogflow.v2.SpeechToTextConfig.toObject(message.sttConfig, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this EntityType to JSON. + * Converts this ConversationProfile to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @memberof google.cloud.dialogflow.v2.ConversationProfile * @instance * @returns {Object.} JSON object */ - EntityType.prototype.toJSON = function toJSON() { + ConversationProfile.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - EntityType.Entity = (function() { + return ConversationProfile; + })(); - /** - * Properties of an Entity. - * @memberof google.cloud.dialogflow.v2beta1.EntityType - * @interface IEntity - * @property {string|null} [value] Entity value - * @property {Array.|null} [synonyms] Entity synonyms - */ + v2.ListConversationProfilesRequest = (function() { - /** - * Constructs a new Entity. - * @memberof google.cloud.dialogflow.v2beta1.EntityType - * @classdesc Represents an Entity. - * @implements IEntity - * @constructor - * @param {google.cloud.dialogflow.v2beta1.EntityType.IEntity=} [properties] Properties to set - */ - function Entity(properties) { - this.synonyms = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a ListConversationProfilesRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IListConversationProfilesRequest + * @property {string|null} [parent] ListConversationProfilesRequest parent + * @property {number|null} [pageSize] ListConversationProfilesRequest pageSize + * @property {string|null} [pageToken] ListConversationProfilesRequest pageToken + */ - /** - * Entity value. - * @member {string} value - * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity - * @instance - */ - Entity.prototype.value = ""; + /** + * Constructs a new ListConversationProfilesRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListConversationProfilesRequest. + * @implements IListConversationProfilesRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IListConversationProfilesRequest=} [properties] Properties to set + */ + function ListConversationProfilesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Entity synonyms. - * @member {Array.} synonyms - * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity - * @instance - */ - Entity.prototype.synonyms = $util.emptyArray; + /** + * ListConversationProfilesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesRequest + * @instance + */ + ListConversationProfilesRequest.prototype.parent = ""; - /** - * Creates a new Entity instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity - * @static - * @param {google.cloud.dialogflow.v2beta1.EntityType.IEntity=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.EntityType.Entity} Entity instance - */ - Entity.create = function create(properties) { - return new Entity(properties); - }; + /** + * ListConversationProfilesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesRequest + * @instance + */ + ListConversationProfilesRequest.prototype.pageSize = 0; - /** - * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.Entity.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity - * @static - * @param {google.cloud.dialogflow.v2beta1.EntityType.IEntity} message Entity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Entity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - if (message.synonyms != null && message.synonyms.length) - for (var i = 0; i < message.synonyms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.synonyms[i]); - return writer; - }; + /** + * ListConversationProfilesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesRequest + * @instance + */ + ListConversationProfilesRequest.prototype.pageToken = ""; - /** - * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.Entity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity - * @static - * @param {google.cloud.dialogflow.v2beta1.EntityType.IEntity} message Entity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Entity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new ListConversationProfilesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesRequest + * @static + * @param {google.cloud.dialogflow.v2.IListConversationProfilesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListConversationProfilesRequest} ListConversationProfilesRequest instance + */ + ListConversationProfilesRequest.create = function create(properties) { + return new ListConversationProfilesRequest(properties); + }; - /** - * Decodes an Entity message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.EntityType.Entity} Entity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Entity.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.EntityType.Entity(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; - case 2: - if (!(message.synonyms && message.synonyms.length)) - message.synonyms = []; - message.synonyms.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Entity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.EntityType.Entity} Entity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Entity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Entity message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Entity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - if (message.synonyms != null && message.hasOwnProperty("synonyms")) { - if (!Array.isArray(message.synonyms)) - return "synonyms: array expected"; - for (var i = 0; i < message.synonyms.length; ++i) - if (!$util.isString(message.synonyms[i])) - return "synonyms: string[] expected"; - } - return null; - }; - - /** - * Creates an Entity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.EntityType.Entity} Entity - */ - Entity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.EntityType.Entity) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.EntityType.Entity(); - if (object.value != null) - message.value = String(object.value); - if (object.synonyms) { - if (!Array.isArray(object.synonyms)) - throw TypeError(".google.cloud.dialogflow.v2beta1.EntityType.Entity.synonyms: array expected"); - message.synonyms = []; - for (var i = 0; i < object.synonyms.length; ++i) - message.synonyms[i] = String(object.synonyms[i]); - } - return message; - }; - - /** - * Creates a plain object from an Entity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity - * @static - * @param {google.cloud.dialogflow.v2beta1.EntityType.Entity} message Entity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Entity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.synonyms = []; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.synonyms && message.synonyms.length) { - object.synonyms = []; - for (var j = 0; j < message.synonyms.length; ++j) - object.synonyms[j] = message.synonyms[j]; - } - return object; - }; - - /** - * Converts this Entity to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity - * @instance - * @returns {Object.} JSON object - */ - Entity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Entity; - })(); - - /** - * Kind enum. - * @name google.cloud.dialogflow.v2beta1.EntityType.Kind - * @enum {number} - * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value - * @property {number} KIND_MAP=1 KIND_MAP value - * @property {number} KIND_LIST=2 KIND_LIST value - * @property {number} KIND_REGEXP=3 KIND_REGEXP value - */ - EntityType.Kind = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; - values[valuesById[1] = "KIND_MAP"] = 1; - values[valuesById[2] = "KIND_LIST"] = 2; - values[valuesById[3] = "KIND_REGEXP"] = 3; - return values; - })(); - - /** - * AutoExpansionMode enum. - * @name google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode - * @enum {number} - * @property {number} AUTO_EXPANSION_MODE_UNSPECIFIED=0 AUTO_EXPANSION_MODE_UNSPECIFIED value - * @property {number} AUTO_EXPANSION_MODE_DEFAULT=1 AUTO_EXPANSION_MODE_DEFAULT value - */ - EntityType.AutoExpansionMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "AUTO_EXPANSION_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUTO_EXPANSION_MODE_DEFAULT"] = 1; - return values; - })(); - - return EntityType; - })(); - - v2beta1.ListEntityTypesRequest = (function() { - - /** - * Properties of a ListEntityTypesRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListEntityTypesRequest - * @property {string|null} [parent] ListEntityTypesRequest parent - * @property {string|null} [languageCode] ListEntityTypesRequest languageCode - * @property {number|null} [pageSize] ListEntityTypesRequest pageSize - * @property {string|null} [pageToken] ListEntityTypesRequest pageToken - */ - - /** - * Constructs a new ListEntityTypesRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListEntityTypesRequest. - * @implements IListEntityTypesRequest - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesRequest=} [properties] Properties to set - */ - function ListEntityTypesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListEntityTypesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest - * @instance - */ - ListEntityTypesRequest.prototype.parent = ""; - - /** - * ListEntityTypesRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest - * @instance - */ - ListEntityTypesRequest.prototype.languageCode = ""; - - /** - * ListEntityTypesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest - * @instance - */ - ListEntityTypesRequest.prototype.pageSize = 0; - - /** - * ListEntityTypesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest - * @instance - */ - ListEntityTypesRequest.prototype.pageToken = ""; - - /** - * Creates a new ListEntityTypesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesRequest} ListEntityTypesRequest instance - */ - ListEntityTypesRequest.create = function create(properties) { - return new ListEntityTypesRequest(properties); - }; - - /** - * Encodes the specified ListEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesRequest} message ListEntityTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListEntityTypesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - return writer; - }; + /** + * Encodes the specified ListConversationProfilesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationProfilesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesRequest + * @static + * @param {google.cloud.dialogflow.v2.IListConversationProfilesRequest} message ListConversationProfilesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationProfilesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; /** - * Encodes the specified ListEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesRequest.verify|verify} messages. + * Encodes the specified ListConversationProfilesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationProfilesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesRequest} message ListEntityTypesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListConversationProfilesRequest} message ListConversationProfilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListConversationProfilesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListEntityTypesRequest message from the specified reader or buffer. + * Decodes a ListConversationProfilesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesRequest} ListEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.ListConversationProfilesRequest} ListConversationProfilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEntityTypesRequest.decode = function decode(reader, length) { + ListConversationProfilesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListEntityTypesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListConversationProfilesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -44309,12 +44154,9 @@ message.parent = reader.string(); break; case 2: - message.languageCode = reader.string(); - break; - case 3: message.pageSize = reader.int32(); break; - case 4: + case 3: message.pageToken = reader.string(); break; default: @@ -44326,38 +44168,35 @@ }; /** - * Decodes a ListEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListConversationProfilesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesRequest} ListEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.ListConversationProfilesRequest} ListConversationProfilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + ListConversationProfilesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListEntityTypesRequest message. + * Verifies a ListConversationProfilesRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListEntityTypesRequest.verify = function verify(message) { + ListConversationProfilesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; if (message.pageSize != null && message.hasOwnProperty("pageSize")) if (!$util.isInteger(message.pageSize)) return "pageSize: integer expected"; @@ -44368,21 +44207,19 @@ }; /** - * Creates a ListEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListConversationProfilesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesRequest} ListEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.ListConversationProfilesRequest} ListConversationProfilesRequest */ - ListEntityTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListEntityTypesRequest) + ListConversationProfilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListConversationProfilesRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListEntityTypesRequest(); + var message = new $root.google.cloud.dialogflow.v2.ListConversationProfilesRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) @@ -44391,28 +44228,25 @@ }; /** - * Creates a plain object from a ListEntityTypesRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListConversationProfilesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ListEntityTypesRequest} message ListEntityTypesRequest + * @param {google.cloud.dialogflow.v2.ListConversationProfilesRequest} message ListConversationProfilesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListEntityTypesRequest.toObject = function toObject(message, options) { + ListConversationProfilesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.languageCode = ""; object.pageSize = 0; object.pageToken = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; if (message.pageSize != null && message.hasOwnProperty("pageSize")) object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) @@ -44421,39 +44255,39 @@ }; /** - * Converts this ListEntityTypesRequest to JSON. + * Converts this ListConversationProfilesRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesRequest * @instance * @returns {Object.} JSON object */ - ListEntityTypesRequest.prototype.toJSON = function toJSON() { + ListConversationProfilesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListEntityTypesRequest; + return ListConversationProfilesRequest; })(); - v2beta1.ListEntityTypesResponse = (function() { + v2.ListConversationProfilesResponse = (function() { /** - * Properties of a ListEntityTypesResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListEntityTypesResponse - * @property {Array.|null} [entityTypes] ListEntityTypesResponse entityTypes - * @property {string|null} [nextPageToken] ListEntityTypesResponse nextPageToken + * Properties of a ListConversationProfilesResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IListConversationProfilesResponse + * @property {Array.|null} [conversationProfiles] ListConversationProfilesResponse conversationProfiles + * @property {string|null} [nextPageToken] ListConversationProfilesResponse nextPageToken */ /** - * Constructs a new ListEntityTypesResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListEntityTypesResponse. - * @implements IListEntityTypesResponse + * Constructs a new ListConversationProfilesResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListConversationProfilesResponse. + * @implements IListConversationProfilesResponse * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IListConversationProfilesResponse=} [properties] Properties to set */ - function ListEntityTypesResponse(properties) { - this.entityTypes = []; + function ListConversationProfilesResponse(properties) { + this.conversationProfiles = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44461,88 +44295,88 @@ } /** - * ListEntityTypesResponse entityTypes. - * @member {Array.} entityTypes - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * ListConversationProfilesResponse conversationProfiles. + * @member {Array.} conversationProfiles + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesResponse * @instance */ - ListEntityTypesResponse.prototype.entityTypes = $util.emptyArray; + ListConversationProfilesResponse.prototype.conversationProfiles = $util.emptyArray; /** - * ListEntityTypesResponse nextPageToken. + * ListConversationProfilesResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesResponse * @instance */ - ListEntityTypesResponse.prototype.nextPageToken = ""; + ListConversationProfilesResponse.prototype.nextPageToken = ""; /** - * Creates a new ListEntityTypesResponse instance using the specified properties. + * Creates a new ListConversationProfilesResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesResponse} ListEntityTypesResponse instance + * @param {google.cloud.dialogflow.v2.IListConversationProfilesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListConversationProfilesResponse} ListConversationProfilesResponse instance */ - ListEntityTypesResponse.create = function create(properties) { - return new ListEntityTypesResponse(properties); + ListConversationProfilesResponse.create = function create(properties) { + return new ListConversationProfilesResponse(properties); }; /** - * Encodes the specified ListEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesResponse.verify|verify} messages. + * Encodes the specified ListConversationProfilesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationProfilesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesResponse} message ListEntityTypesResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListConversationProfilesResponse} message ListConversationProfilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEntityTypesResponse.encode = function encode(message, writer) { + ListConversationProfilesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.entityTypes != null && message.entityTypes.length) - for (var i = 0; i < message.entityTypes.length; ++i) - $root.google.cloud.dialogflow.v2beta1.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.conversationProfiles != null && message.conversationProfiles.length) + for (var i = 0; i < message.conversationProfiles.length; ++i) + $root.google.cloud.dialogflow.v2.ConversationProfile.encode(message.conversationProfiles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ListEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesResponse.verify|verify} messages. + * Encodes the specified ListConversationProfilesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListConversationProfilesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesResponse} message ListEntityTypesResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IListConversationProfilesResponse} message ListConversationProfilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListConversationProfilesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListEntityTypesResponse message from the specified reader or buffer. + * Decodes a ListConversationProfilesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesResponse} ListEntityTypesResponse + * @returns {google.cloud.dialogflow.v2.ListConversationProfilesResponse} ListConversationProfilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEntityTypesResponse.decode = function decode(reader, length) { + ListConversationProfilesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListEntityTypesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListConversationProfilesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.entityTypes && message.entityTypes.length)) - message.entityTypes = []; - message.entityTypes.push($root.google.cloud.dialogflow.v2beta1.EntityType.decode(reader, reader.uint32())); + if (!(message.conversationProfiles && message.conversationProfiles.length)) + message.conversationProfiles = []; + message.conversationProfiles.push($root.google.cloud.dialogflow.v2.ConversationProfile.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); @@ -44556,39 +44390,39 @@ }; /** - * Decodes a ListEntityTypesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListConversationProfilesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesResponse} ListEntityTypesResponse + * @returns {google.cloud.dialogflow.v2.ListConversationProfilesResponse} ListConversationProfilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + ListConversationProfilesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListEntityTypesResponse message. + * Verifies a ListConversationProfilesResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListEntityTypesResponse.verify = function verify(message) { + ListConversationProfilesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { - if (!Array.isArray(message.entityTypes)) - return "entityTypes: array expected"; - for (var i = 0; i < message.entityTypes.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.EntityType.verify(message.entityTypes[i]); + if (message.conversationProfiles != null && message.hasOwnProperty("conversationProfiles")) { + if (!Array.isArray(message.conversationProfiles)) + return "conversationProfiles: array expected"; + for (var i = 0; i < message.conversationProfiles.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.ConversationProfile.verify(message.conversationProfiles[i]); if (error) - return "entityTypes." + error; + return "conversationProfiles." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -44598,25 +44432,25 @@ }; /** - * Creates a ListEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListConversationProfilesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesResponse} ListEntityTypesResponse + * @returns {google.cloud.dialogflow.v2.ListConversationProfilesResponse} ListConversationProfilesResponse */ - ListEntityTypesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListEntityTypesResponse) + ListConversationProfilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListConversationProfilesResponse) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListEntityTypesResponse(); - if (object.entityTypes) { - if (!Array.isArray(object.entityTypes)) - throw TypeError(".google.cloud.dialogflow.v2beta1.ListEntityTypesResponse.entityTypes: array expected"); - message.entityTypes = []; - for (var i = 0; i < object.entityTypes.length; ++i) { - if (typeof object.entityTypes[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.ListEntityTypesResponse.entityTypes: object expected"); - message.entityTypes[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.fromObject(object.entityTypes[i]); + var message = new $root.google.cloud.dialogflow.v2.ListConversationProfilesResponse(); + if (object.conversationProfiles) { + if (!Array.isArray(object.conversationProfiles)) + throw TypeError(".google.cloud.dialogflow.v2.ListConversationProfilesResponse.conversationProfiles: array expected"); + message.conversationProfiles = []; + for (var i = 0; i < object.conversationProfiles.length; ++i) { + if (typeof object.conversationProfiles[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListConversationProfilesResponse.conversationProfiles: object expected"); + message.conversationProfiles[i] = $root.google.cloud.dialogflow.v2.ConversationProfile.fromObject(object.conversationProfiles[i]); } } if (object.nextPageToken != null) @@ -44625,26 +44459,26 @@ }; /** - * Creates a plain object from a ListEntityTypesResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListConversationProfilesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.ListEntityTypesResponse} message ListEntityTypesResponse + * @param {google.cloud.dialogflow.v2.ListConversationProfilesResponse} message ListConversationProfilesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListEntityTypesResponse.toObject = function toObject(message, options) { + ListConversationProfilesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.entityTypes = []; + object.conversationProfiles = []; if (options.defaults) object.nextPageToken = ""; - if (message.entityTypes && message.entityTypes.length) { - object.entityTypes = []; - for (var j = 0; j < message.entityTypes.length; ++j) - object.entityTypes[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.toObject(message.entityTypes[j], options); + if (message.conversationProfiles && message.conversationProfiles.length) { + object.conversationProfiles = []; + for (var j = 0; j < message.conversationProfiles.length; ++j) + object.conversationProfiles[j] = $root.google.cloud.dialogflow.v2.ConversationProfile.toObject(message.conversationProfiles[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -44652,38 +44486,37 @@ }; /** - * Converts this ListEntityTypesResponse to JSON. + * Converts this ListConversationProfilesResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.ListConversationProfilesResponse * @instance * @returns {Object.} JSON object */ - ListEntityTypesResponse.prototype.toJSON = function toJSON() { + ListConversationProfilesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListEntityTypesResponse; + return ListConversationProfilesResponse; })(); - v2beta1.GetEntityTypeRequest = (function() { + v2.GetConversationProfileRequest = (function() { /** - * Properties of a GetEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IGetEntityTypeRequest - * @property {string|null} [name] GetEntityTypeRequest name - * @property {string|null} [languageCode] GetEntityTypeRequest languageCode + * Properties of a GetConversationProfileRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IGetConversationProfileRequest + * @property {string|null} [name] GetConversationProfileRequest name */ /** - * Constructs a new GetEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a GetEntityTypeRequest. - * @implements IGetEntityTypeRequest + * Constructs a new GetConversationProfileRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a GetConversationProfileRequest. + * @implements IGetConversationProfileRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IGetConversationProfileRequest=} [properties] Properties to set */ - function GetEntityTypeRequest(properties) { + function GetConversationProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44691,89 +44524,76 @@ } /** - * GetEntityTypeRequest name. + * GetConversationProfileRequest name. * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest - * @instance - */ - GetEntityTypeRequest.prototype.name = ""; - - /** - * GetEntityTypeRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.GetConversationProfileRequest * @instance */ - GetEntityTypeRequest.prototype.languageCode = ""; + GetConversationProfileRequest.prototype.name = ""; /** - * Creates a new GetEntityTypeRequest instance using the specified properties. + * Creates a new GetConversationProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.GetConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.GetEntityTypeRequest} GetEntityTypeRequest instance + * @param {google.cloud.dialogflow.v2.IGetConversationProfileRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.GetConversationProfileRequest} GetConversationProfileRequest instance */ - GetEntityTypeRequest.create = function create(properties) { - return new GetEntityTypeRequest(properties); + GetConversationProfileRequest.create = function create(properties) { + return new GetConversationProfileRequest(properties); }; /** - * Encodes the specified GetEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetEntityTypeRequest.verify|verify} messages. + * Encodes the specified GetConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetConversationProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.GetConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest} message GetEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IGetConversationProfileRequest} message GetConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetEntityTypeRequest.encode = function encode(message, writer) { + GetConversationProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); return writer; }; /** - * Encodes the specified GetEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetEntityTypeRequest.verify|verify} messages. + * Encodes the specified GetConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetConversationProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.GetConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest} message GetEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IGetConversationProfileRequest} message GetConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetConversationProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetEntityTypeRequest message from the specified reader or buffer. + * Decodes a GetConversationProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.GetConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.GetEntityTypeRequest} GetEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.GetConversationProfileRequest} GetConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetEntityTypeRequest.decode = function decode(reader, length) { + GetConversationProfileRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetEntityTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetConversationProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; - case 2: - message.languageCode = reader.string(); - break; default: reader.skipType(tag & 7); break; @@ -44783,118 +44603,108 @@ }; /** - * Decodes a GetEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a GetConversationProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.GetConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.GetEntityTypeRequest} GetEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.GetConversationProfileRequest} GetConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + GetConversationProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetEntityTypeRequest message. + * Verifies a GetConversationProfileRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.GetConversationProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetEntityTypeRequest.verify = function verify(message) { + GetConversationProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; return null; }; /** - * Creates a GetEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetConversationProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.GetConversationProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.GetEntityTypeRequest} GetEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.GetConversationProfileRequest} GetConversationProfileRequest */ - GetEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetEntityTypeRequest) + GetConversationProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.GetConversationProfileRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.GetEntityTypeRequest(); + var message = new $root.google.cloud.dialogflow.v2.GetConversationProfileRequest(); if (object.name != null) message.name = String(object.name); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); return message; }; /** - * Creates a plain object from a GetEntityTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetConversationProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.GetConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.GetEntityTypeRequest} message GetEntityTypeRequest + * @param {google.cloud.dialogflow.v2.GetConversationProfileRequest} message GetConversationProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetEntityTypeRequest.toObject = function toObject(message, options) { + GetConversationProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.languageCode = ""; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; return object; }; /** - * Converts this GetEntityTypeRequest to JSON. + * Converts this GetConversationProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.GetConversationProfileRequest * @instance * @returns {Object.} JSON object */ - GetEntityTypeRequest.prototype.toJSON = function toJSON() { + GetConversationProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetEntityTypeRequest; + return GetConversationProfileRequest; })(); - v2beta1.CreateEntityTypeRequest = (function() { + v2.CreateConversationProfileRequest = (function() { /** - * Properties of a CreateEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface ICreateEntityTypeRequest - * @property {string|null} [parent] CreateEntityTypeRequest parent - * @property {google.cloud.dialogflow.v2beta1.IEntityType|null} [entityType] CreateEntityTypeRequest entityType - * @property {string|null} [languageCode] CreateEntityTypeRequest languageCode + * Properties of a CreateConversationProfileRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface ICreateConversationProfileRequest + * @property {string|null} [parent] CreateConversationProfileRequest parent + * @property {google.cloud.dialogflow.v2.IConversationProfile|null} [conversationProfile] CreateConversationProfileRequest conversationProfile */ /** - * Constructs a new CreateEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a CreateEntityTypeRequest. - * @implements ICreateEntityTypeRequest + * Constructs a new CreateConversationProfileRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a CreateConversationProfileRequest. + * @implements ICreateConversationProfileRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.ICreateConversationProfileRequest=} [properties] Properties to set */ - function CreateEntityTypeRequest(properties) { + function CreateConversationProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -44902,90 +44712,80 @@ } /** - * CreateEntityTypeRequest parent. + * CreateConversationProfileRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest - * @instance - */ - CreateEntityTypeRequest.prototype.parent = ""; - - /** - * CreateEntityTypeRequest entityType. - * @member {google.cloud.dialogflow.v2beta1.IEntityType|null|undefined} entityType - * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationProfileRequest * @instance */ - CreateEntityTypeRequest.prototype.entityType = null; + CreateConversationProfileRequest.prototype.parent = ""; /** - * CreateEntityTypeRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * CreateConversationProfileRequest conversationProfile. + * @member {google.cloud.dialogflow.v2.IConversationProfile|null|undefined} conversationProfile + * @memberof google.cloud.dialogflow.v2.CreateConversationProfileRequest * @instance */ - CreateEntityTypeRequest.prototype.languageCode = ""; + CreateConversationProfileRequest.prototype.conversationProfile = null; /** - * Creates a new CreateEntityTypeRequest instance using the specified properties. + * Creates a new CreateConversationProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest} CreateEntityTypeRequest instance + * @param {google.cloud.dialogflow.v2.ICreateConversationProfileRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CreateConversationProfileRequest} CreateConversationProfileRequest instance */ - CreateEntityTypeRequest.create = function create(properties) { - return new CreateEntityTypeRequest(properties); + CreateConversationProfileRequest.create = function create(properties) { + return new CreateConversationProfileRequest(properties); }; /** - * Encodes the specified CreateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest.verify|verify} messages. + * Encodes the specified CreateConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateConversationProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest} message CreateEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateConversationProfileRequest} message CreateConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateEntityTypeRequest.encode = function encode(message, writer) { + CreateConversationProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) - $root.google.cloud.dialogflow.v2beta1.EntityType.encode(message.entityType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.conversationProfile != null && Object.hasOwnProperty.call(message, "conversationProfile")) + $root.google.cloud.dialogflow.v2.ConversationProfile.encode(message.conversationProfile, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest.verify|verify} messages. + * Encodes the specified CreateConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateConversationProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest} message CreateEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.ICreateConversationProfileRequest} message CreateConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateConversationProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateEntityTypeRequest message from the specified reader or buffer. + * Decodes a CreateConversationProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest} CreateEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.CreateConversationProfileRequest} CreateConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateEntityTypeRequest.decode = function decode(reader, length) { + CreateConversationProfileRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateConversationProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -44993,10 +44793,7 @@ message.parent = reader.string(); break; case 2: - message.entityType = $root.google.cloud.dialogflow.v2beta1.EntityType.decode(reader, reader.uint32()); - break; - case 3: - message.languageCode = reader.string(); + message.conversationProfile = $root.google.cloud.dialogflow.v2.ConversationProfile.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -45007,131 +44804,122 @@ }; /** - * Decodes a CreateEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateConversationProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest} CreateEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.CreateConversationProfileRequest} CreateConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + CreateConversationProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateEntityTypeRequest message. + * Verifies a CreateConversationProfileRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateEntityTypeRequest.verify = function verify(message) { + CreateConversationProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.entityType != null && message.hasOwnProperty("entityType")) { - var error = $root.google.cloud.dialogflow.v2beta1.EntityType.verify(message.entityType); + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) { + var error = $root.google.cloud.dialogflow.v2.ConversationProfile.verify(message.conversationProfile); if (error) - return "entityType." + error; + return "conversationProfile." + error; } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; return null; }; /** - * Creates a CreateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateConversationProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest} CreateEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.CreateConversationProfileRequest} CreateConversationProfileRequest */ - CreateEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest) + CreateConversationProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CreateConversationProfileRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest(); + var message = new $root.google.cloud.dialogflow.v2.CreateConversationProfileRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.entityType != null) { - if (typeof object.entityType !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest.entityType: object expected"); - message.entityType = $root.google.cloud.dialogflow.v2beta1.EntityType.fromObject(object.entityType); + if (object.conversationProfile != null) { + if (typeof object.conversationProfile !== "object") + throw TypeError(".google.cloud.dialogflow.v2.CreateConversationProfileRequest.conversationProfile: object expected"); + message.conversationProfile = $root.google.cloud.dialogflow.v2.ConversationProfile.fromObject(object.conversationProfile); } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); return message; }; /** - * Creates a plain object from a CreateEntityTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateConversationProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest} message CreateEntityTypeRequest + * @param {google.cloud.dialogflow.v2.CreateConversationProfileRequest} message CreateConversationProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateEntityTypeRequest.toObject = function toObject(message, options) { + CreateConversationProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.entityType = null; - object.languageCode = ""; + object.conversationProfile = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.entityType != null && message.hasOwnProperty("entityType")) - object.entityType = $root.google.cloud.dialogflow.v2beta1.EntityType.toObject(message.entityType, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) + object.conversationProfile = $root.google.cloud.dialogflow.v2.ConversationProfile.toObject(message.conversationProfile, options); return object; }; /** - * Converts this CreateEntityTypeRequest to JSON. + * Converts this CreateConversationProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.CreateConversationProfileRequest * @instance * @returns {Object.} JSON object */ - CreateEntityTypeRequest.prototype.toJSON = function toJSON() { + CreateConversationProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateEntityTypeRequest; + return CreateConversationProfileRequest; })(); - v2beta1.UpdateEntityTypeRequest = (function() { + v2.UpdateConversationProfileRequest = (function() { /** - * Properties of an UpdateEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IUpdateEntityTypeRequest - * @property {google.cloud.dialogflow.v2beta1.IEntityType|null} [entityType] UpdateEntityTypeRequest entityType - * @property {string|null} [languageCode] UpdateEntityTypeRequest languageCode - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEntityTypeRequest updateMask + * Properties of an UpdateConversationProfileRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IUpdateConversationProfileRequest + * @property {google.cloud.dialogflow.v2.IConversationProfile|null} [conversationProfile] UpdateConversationProfileRequest conversationProfile + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateConversationProfileRequest updateMask */ /** - * Constructs a new UpdateEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an UpdateEntityTypeRequest. - * @implements IUpdateEntityTypeRequest + * Constructs a new UpdateConversationProfileRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an UpdateConversationProfileRequest. + * @implements IUpdateConversationProfileRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IUpdateConversationProfileRequest=} [properties] Properties to set */ - function UpdateEntityTypeRequest(properties) { + function UpdateConversationProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45139,100 +44927,87 @@ } /** - * UpdateEntityTypeRequest entityType. - * @member {google.cloud.dialogflow.v2beta1.IEntityType|null|undefined} entityType - * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest - * @instance - */ - UpdateEntityTypeRequest.prototype.entityType = null; - - /** - * UpdateEntityTypeRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * UpdateConversationProfileRequest conversationProfile. + * @member {google.cloud.dialogflow.v2.IConversationProfile|null|undefined} conversationProfile + * @memberof google.cloud.dialogflow.v2.UpdateConversationProfileRequest * @instance */ - UpdateEntityTypeRequest.prototype.languageCode = ""; + UpdateConversationProfileRequest.prototype.conversationProfile = null; /** - * UpdateEntityTypeRequest updateMask. + * UpdateConversationProfileRequest updateMask. * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.UpdateConversationProfileRequest * @instance */ - UpdateEntityTypeRequest.prototype.updateMask = null; + UpdateConversationProfileRequest.prototype.updateMask = null; /** - * Creates a new UpdateEntityTypeRequest instance using the specified properties. + * Creates a new UpdateConversationProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.UpdateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest} UpdateEntityTypeRequest instance + * @param {google.cloud.dialogflow.v2.IUpdateConversationProfileRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.UpdateConversationProfileRequest} UpdateConversationProfileRequest instance */ - UpdateEntityTypeRequest.create = function create(properties) { - return new UpdateEntityTypeRequest(properties); + UpdateConversationProfileRequest.create = function create(properties) { + return new UpdateConversationProfileRequest(properties); }; /** - * Encodes the specified UpdateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest.verify|verify} messages. + * Encodes the specified UpdateConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateConversationProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.UpdateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest} message UpdateEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IUpdateConversationProfileRequest} message UpdateConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateEntityTypeRequest.encode = function encode(message, writer) { + UpdateConversationProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) - $root.google.cloud.dialogflow.v2beta1.EntityType.encode(message.entityType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.conversationProfile != null && Object.hasOwnProperty.call(message, "conversationProfile")) + $root.google.cloud.dialogflow.v2.ConversationProfile.encode(message.conversationProfile, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest.verify|verify} messages. + * Encodes the specified UpdateConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateConversationProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.UpdateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest} message UpdateEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IUpdateConversationProfileRequest} message UpdateConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateConversationProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer. + * Decodes an UpdateConversationProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.UpdateConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest} UpdateEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.UpdateConversationProfileRequest} UpdateConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateEntityTypeRequest.decode = function decode(reader, length) { + UpdateConversationProfileRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateConversationProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.entityType = $root.google.cloud.dialogflow.v2beta1.EntityType.decode(reader, reader.uint32()); + message.conversationProfile = $root.google.cloud.dialogflow.v2.ConversationProfile.decode(reader, reader.uint32()); break; case 2: - message.languageCode = reader.string(); - break; - case 3: message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: @@ -45244,40 +45019,37 @@ }; /** - * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateConversationProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.UpdateConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest} UpdateEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.UpdateConversationProfileRequest} UpdateConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateConversationProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateEntityTypeRequest message. + * Verifies an UpdateConversationProfileRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.UpdateConversationProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateEntityTypeRequest.verify = function verify(message) { + UpdateConversationProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.entityType != null && message.hasOwnProperty("entityType")) { - var error = $root.google.cloud.dialogflow.v2beta1.EntityType.verify(message.entityType); + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) { + var error = $root.google.cloud.dialogflow.v2.ConversationProfile.verify(message.conversationProfile); if (error) - return "entityType." + error; + return "conversationProfile." + error; } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; if (message.updateMask != null && message.hasOwnProperty("updateMask")) { var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) @@ -45287,91 +45059,86 @@ }; /** - * Creates an UpdateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateConversationProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.UpdateConversationProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest} UpdateEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.UpdateConversationProfileRequest} UpdateConversationProfileRequest */ - UpdateEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest) + UpdateConversationProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.UpdateConversationProfileRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest(); - if (object.entityType != null) { - if (typeof object.entityType !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest.entityType: object expected"); - message.entityType = $root.google.cloud.dialogflow.v2beta1.EntityType.fromObject(object.entityType); + var message = new $root.google.cloud.dialogflow.v2.UpdateConversationProfileRequest(); + if (object.conversationProfile != null) { + if (typeof object.conversationProfile !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateConversationProfileRequest.conversationProfile: object expected"); + message.conversationProfile = $root.google.cloud.dialogflow.v2.ConversationProfile.fromObject(object.conversationProfile); } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); if (object.updateMask != null) { if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest.updateMask: object expected"); + throw TypeError(".google.cloud.dialogflow.v2.UpdateConversationProfileRequest.updateMask: object expected"); message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } return message; }; /** - * Creates a plain object from an UpdateEntityTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateConversationProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.UpdateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest} message UpdateEntityTypeRequest + * @param {google.cloud.dialogflow.v2.UpdateConversationProfileRequest} message UpdateConversationProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateEntityTypeRequest.toObject = function toObject(message, options) { + UpdateConversationProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.entityType = null; - object.languageCode = ""; + object.conversationProfile = null; object.updateMask = null; } - if (message.entityType != null && message.hasOwnProperty("entityType")) - object.entityType = $root.google.cloud.dialogflow.v2beta1.EntityType.toObject(message.entityType, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) + object.conversationProfile = $root.google.cloud.dialogflow.v2.ConversationProfile.toObject(message.conversationProfile, options); if (message.updateMask != null && message.hasOwnProperty("updateMask")) object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this UpdateEntityTypeRequest to JSON. + * Converts this UpdateConversationProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.UpdateConversationProfileRequest * @instance * @returns {Object.} JSON object */ - UpdateEntityTypeRequest.prototype.toJSON = function toJSON() { + UpdateConversationProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateEntityTypeRequest; + return UpdateConversationProfileRequest; })(); - v2beta1.DeleteEntityTypeRequest = (function() { + v2.DeleteConversationProfileRequest = (function() { /** - * Properties of a DeleteEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IDeleteEntityTypeRequest - * @property {string|null} [name] DeleteEntityTypeRequest name + * Properties of a DeleteConversationProfileRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IDeleteConversationProfileRequest + * @property {string|null} [name] DeleteConversationProfileRequest name */ /** - * Constructs a new DeleteEntityTypeRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a DeleteEntityTypeRequest. - * @implements IDeleteEntityTypeRequest + * Constructs a new DeleteConversationProfileRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a DeleteConversationProfileRequest. + * @implements IDeleteConversationProfileRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IDeleteConversationProfileRequest=} [properties] Properties to set */ - function DeleteEntityTypeRequest(properties) { + function DeleteConversationProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45379,35 +45146,35 @@ } /** - * DeleteEntityTypeRequest name. + * DeleteConversationProfileRequest name. * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.DeleteConversationProfileRequest * @instance */ - DeleteEntityTypeRequest.prototype.name = ""; + DeleteConversationProfileRequest.prototype.name = ""; /** - * Creates a new DeleteEntityTypeRequest instance using the specified properties. + * Creates a new DeleteConversationProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.DeleteConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest instance + * @param {google.cloud.dialogflow.v2.IDeleteConversationProfileRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.DeleteConversationProfileRequest} DeleteConversationProfileRequest instance */ - DeleteEntityTypeRequest.create = function create(properties) { - return new DeleteEntityTypeRequest(properties); + DeleteConversationProfileRequest.create = function create(properties) { + return new DeleteConversationProfileRequest(properties); }; /** - * Encodes the specified DeleteEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest.verify|verify} messages. + * Encodes the specified DeleteConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteConversationProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.DeleteConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest} message DeleteEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IDeleteConversationProfileRequest} message DeleteConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteEntityTypeRequest.encode = function encode(message, writer) { + DeleteConversationProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -45416,33 +45183,33 @@ }; /** - * Encodes the specified DeleteEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest.verify|verify} messages. + * Encodes the specified DeleteConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteConversationProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.DeleteConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest} message DeleteEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IDeleteConversationProfileRequest} message DeleteConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteConversationProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer. + * Decodes a DeleteConversationProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.DeleteConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.DeleteConversationProfileRequest} DeleteConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteEntityTypeRequest.decode = function decode(reader, length) { + DeleteConversationProfileRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteConversationProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -45458,30 +45225,30 @@ }; /** - * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteConversationProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.DeleteConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.DeleteConversationProfileRequest} DeleteConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteConversationProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteEntityTypeRequest message. + * Verifies a DeleteConversationProfileRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.DeleteConversationProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteEntityTypeRequest.verify = function verify(message) { + DeleteConversationProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -45491,32 +45258,32 @@ }; /** - * Creates a DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteConversationProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.DeleteConversationProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest + * @returns {google.cloud.dialogflow.v2.DeleteConversationProfileRequest} DeleteConversationProfileRequest */ - DeleteEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest) + DeleteConversationProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.DeleteConversationProfileRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest(); + var message = new $root.google.cloud.dialogflow.v2.DeleteConversationProfileRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteConversationProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.DeleteConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest} message DeleteEntityTypeRequest + * @param {google.cloud.dialogflow.v2.DeleteConversationProfileRequest} message DeleteConversationProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteEntityTypeRequest.toObject = function toObject(message, options) { + DeleteConversationProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -45528,41 +45295,37 @@ }; /** - * Converts this DeleteEntityTypeRequest to JSON. + * Converts this DeleteConversationProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @memberof google.cloud.dialogflow.v2.DeleteConversationProfileRequest * @instance * @returns {Object.} JSON object */ - DeleteEntityTypeRequest.prototype.toJSON = function toJSON() { + DeleteConversationProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteEntityTypeRequest; + return DeleteConversationProfileRequest; })(); - v2beta1.BatchUpdateEntityTypesRequest = (function() { + v2.AutomatedAgentConfig = (function() { /** - * Properties of a BatchUpdateEntityTypesRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IBatchUpdateEntityTypesRequest - * @property {string|null} [parent] BatchUpdateEntityTypesRequest parent - * @property {string|null} [entityTypeBatchUri] BatchUpdateEntityTypesRequest entityTypeBatchUri - * @property {google.cloud.dialogflow.v2beta1.IEntityTypeBatch|null} [entityTypeBatchInline] BatchUpdateEntityTypesRequest entityTypeBatchInline - * @property {string|null} [languageCode] BatchUpdateEntityTypesRequest languageCode - * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateEntityTypesRequest updateMask + * Properties of an AutomatedAgentConfig. + * @memberof google.cloud.dialogflow.v2 + * @interface IAutomatedAgentConfig + * @property {string|null} [agent] AutomatedAgentConfig agent */ /** - * Constructs a new BatchUpdateEntityTypesRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a BatchUpdateEntityTypesRequest. - * @implements IBatchUpdateEntityTypesRequest + * Constructs a new AutomatedAgentConfig. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an AutomatedAgentConfig. + * @implements IAutomatedAgentConfig * @constructor - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IAutomatedAgentConfig=} [properties] Properties to set */ - function BatchUpdateEntityTypesRequest(properties) { + function AutomatedAgentConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45570,141 +45333,75 @@ } /** - * BatchUpdateEntityTypesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest - * @instance - */ - BatchUpdateEntityTypesRequest.prototype.parent = ""; - - /** - * BatchUpdateEntityTypesRequest entityTypeBatchUri. - * @member {string} entityTypeBatchUri - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest - * @instance - */ - BatchUpdateEntityTypesRequest.prototype.entityTypeBatchUri = ""; - - /** - * BatchUpdateEntityTypesRequest entityTypeBatchInline. - * @member {google.cloud.dialogflow.v2beta1.IEntityTypeBatch|null|undefined} entityTypeBatchInline - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest - * @instance - */ - BatchUpdateEntityTypesRequest.prototype.entityTypeBatchInline = null; - - /** - * BatchUpdateEntityTypesRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest - * @instance - */ - BatchUpdateEntityTypesRequest.prototype.languageCode = ""; - - /** - * BatchUpdateEntityTypesRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest - * @instance - */ - BatchUpdateEntityTypesRequest.prototype.updateMask = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BatchUpdateEntityTypesRequest entityTypeBatch. - * @member {"entityTypeBatchUri"|"entityTypeBatchInline"|undefined} entityTypeBatch - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * AutomatedAgentConfig agent. + * @member {string} agent + * @memberof google.cloud.dialogflow.v2.AutomatedAgentConfig * @instance */ - Object.defineProperty(BatchUpdateEntityTypesRequest.prototype, "entityTypeBatch", { - get: $util.oneOfGetter($oneOfFields = ["entityTypeBatchUri", "entityTypeBatchInline"]), - set: $util.oneOfSetter($oneOfFields) - }); + AutomatedAgentConfig.prototype.agent = ""; /** - * Creates a new BatchUpdateEntityTypesRequest instance using the specified properties. + * Creates a new AutomatedAgentConfig instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.AutomatedAgentConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest instance + * @param {google.cloud.dialogflow.v2.IAutomatedAgentConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.AutomatedAgentConfig} AutomatedAgentConfig instance */ - BatchUpdateEntityTypesRequest.create = function create(properties) { - return new BatchUpdateEntityTypesRequest(properties); + AutomatedAgentConfig.create = function create(properties) { + return new AutomatedAgentConfig(properties); }; /** - * Encodes the specified BatchUpdateEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.verify|verify} messages. + * Encodes the specified AutomatedAgentConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.AutomatedAgentConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.AutomatedAgentConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest} message BatchUpdateEntityTypesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAutomatedAgentConfig} message AutomatedAgentConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchUpdateEntityTypesRequest.encode = function encode(message, writer) { + AutomatedAgentConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.entityTypeBatchUri != null && Object.hasOwnProperty.call(message, "entityTypeBatchUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityTypeBatchUri); - if (message.entityTypeBatchInline != null && Object.hasOwnProperty.call(message, "entityTypeBatchInline")) - $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch.encode(message.entityTypeBatchInline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); return writer; }; /** - * Encodes the specified BatchUpdateEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.verify|verify} messages. + * Encodes the specified AutomatedAgentConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.AutomatedAgentConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.AutomatedAgentConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest} message BatchUpdateEntityTypesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2.IAutomatedAgentConfig} message AutomatedAgentConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchUpdateEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + AutomatedAgentConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer. + * Decodes an AutomatedAgentConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.AutomatedAgentConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.AutomatedAgentConfig} AutomatedAgentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchUpdateEntityTypesRequest.decode = function decode(reader, length) { + AutomatedAgentConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.AutomatedAgentConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); - break; - case 2: - message.entityTypeBatchUri = reader.string(); - break; - case 3: - message.entityTypeBatchInline = $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch.decode(reader, reader.uint32()); - break; - case 4: - message.languageCode = reader.string(); - break; - case 5: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.agent = reader.string(); break; default: reader.skipType(tag & 7); @@ -45715,163 +45412,110 @@ }; /** - * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes an AutomatedAgentConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.AutomatedAgentConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.AutomatedAgentConfig} AutomatedAgentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchUpdateEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + AutomatedAgentConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchUpdateEntityTypesRequest message. + * Verifies an AutomatedAgentConfig message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.AutomatedAgentConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchUpdateEntityTypesRequest.verify = function verify(message) { + AutomatedAgentConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.entityTypeBatchUri != null && message.hasOwnProperty("entityTypeBatchUri")) { - properties.entityTypeBatch = 1; - if (!$util.isString(message.entityTypeBatchUri)) - return "entityTypeBatchUri: string expected"; - } - if (message.entityTypeBatchInline != null && message.hasOwnProperty("entityTypeBatchInline")) { - if (properties.entityTypeBatch === 1) - return "entityTypeBatch: multiple values"; - properties.entityTypeBatch = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch.verify(message.entityTypeBatchInline); - if (error) - return "entityTypeBatchInline." + error; - } - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; return null; }; /** - * Creates a BatchUpdateEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AutomatedAgentConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.AutomatedAgentConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest + * @returns {google.cloud.dialogflow.v2.AutomatedAgentConfig} AutomatedAgentConfig */ - BatchUpdateEntityTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest) + AutomatedAgentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.AutomatedAgentConfig) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.entityTypeBatchUri != null) - message.entityTypeBatchUri = String(object.entityTypeBatchUri); - if (object.entityTypeBatchInline != null) { - if (typeof object.entityTypeBatchInline !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.entityTypeBatchInline: object expected"); - message.entityTypeBatchInline = $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch.fromObject(object.entityTypeBatchInline); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.dialogflow.v2.AutomatedAgentConfig(); + if (object.agent != null) + message.agent = String(object.agent); return message; }; /** - * Creates a plain object from a BatchUpdateEntityTypesRequest message. Also converts values to other types if specified. + * Creates a plain object from an AutomatedAgentConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.AutomatedAgentConfig * @static - * @param {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest} message BatchUpdateEntityTypesRequest + * @param {google.cloud.dialogflow.v2.AutomatedAgentConfig} message AutomatedAgentConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchUpdateEntityTypesRequest.toObject = function toObject(message, options) { + AutomatedAgentConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.languageCode = ""; - object.updateMask = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.entityTypeBatchUri != null && message.hasOwnProperty("entityTypeBatchUri")) { - object.entityTypeBatchUri = message.entityTypeBatchUri; - if (options.oneofs) - object.entityTypeBatch = "entityTypeBatchUri"; - } - if (message.entityTypeBatchInline != null && message.hasOwnProperty("entityTypeBatchInline")) { - object.entityTypeBatchInline = $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch.toObject(message.entityTypeBatchInline, options); - if (options.oneofs) - object.entityTypeBatch = "entityTypeBatchInline"; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (options.defaults) + object.agent = ""; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; return object; }; /** - * Converts this BatchUpdateEntityTypesRequest to JSON. + * Converts this AutomatedAgentConfig to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @memberof google.cloud.dialogflow.v2.AutomatedAgentConfig * @instance * @returns {Object.} JSON object */ - BatchUpdateEntityTypesRequest.prototype.toJSON = function toJSON() { + AutomatedAgentConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchUpdateEntityTypesRequest; + return AutomatedAgentConfig; })(); - v2beta1.BatchUpdateEntityTypesResponse = (function() { + v2.HumanAgentAssistantConfig = (function() { /** - * Properties of a BatchUpdateEntityTypesResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IBatchUpdateEntityTypesResponse - * @property {Array.|null} [entityTypes] BatchUpdateEntityTypesResponse entityTypes + * Properties of a HumanAgentAssistantConfig. + * @memberof google.cloud.dialogflow.v2 + * @interface IHumanAgentAssistantConfig + * @property {google.cloud.dialogflow.v2.INotificationConfig|null} [notificationConfig] HumanAgentAssistantConfig notificationConfig + * @property {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig|null} [humanAgentSuggestionConfig] HumanAgentAssistantConfig humanAgentSuggestionConfig + * @property {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig|null} [endUserSuggestionConfig] HumanAgentAssistantConfig endUserSuggestionConfig + * @property {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IMessageAnalysisConfig|null} [messageAnalysisConfig] HumanAgentAssistantConfig messageAnalysisConfig */ /** - * Constructs a new BatchUpdateEntityTypesResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a BatchUpdateEntityTypesResponse. - * @implements IBatchUpdateEntityTypesResponse + * Constructs a new HumanAgentAssistantConfig. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a HumanAgentAssistantConfig. + * @implements IHumanAgentAssistantConfig * @constructor - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.IHumanAgentAssistantConfig=} [properties] Properties to set */ - function BatchUpdateEntityTypesResponse(properties) { - this.entityTypes = []; + function HumanAgentAssistantConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -45879,78 +45523,114 @@ } /** - * BatchUpdateEntityTypesResponse entityTypes. - * @member {Array.} entityTypes - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * HumanAgentAssistantConfig notificationConfig. + * @member {google.cloud.dialogflow.v2.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig * @instance */ - BatchUpdateEntityTypesResponse.prototype.entityTypes = $util.emptyArray; + HumanAgentAssistantConfig.prototype.notificationConfig = null; /** - * Creates a new BatchUpdateEntityTypesResponse instance using the specified properties. + * HumanAgentAssistantConfig humanAgentSuggestionConfig. + * @member {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig|null|undefined} humanAgentSuggestionConfig + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @instance + */ + HumanAgentAssistantConfig.prototype.humanAgentSuggestionConfig = null; + + /** + * HumanAgentAssistantConfig endUserSuggestionConfig. + * @member {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig|null|undefined} endUserSuggestionConfig + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @instance + */ + HumanAgentAssistantConfig.prototype.endUserSuggestionConfig = null; + + /** + * HumanAgentAssistantConfig messageAnalysisConfig. + * @member {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IMessageAnalysisConfig|null|undefined} messageAnalysisConfig + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @instance + */ + HumanAgentAssistantConfig.prototype.messageAnalysisConfig = null; + + /** + * Creates a new HumanAgentAssistantConfig instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse instance + * @param {google.cloud.dialogflow.v2.IHumanAgentAssistantConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig} HumanAgentAssistantConfig instance */ - BatchUpdateEntityTypesResponse.create = function create(properties) { - return new BatchUpdateEntityTypesResponse(properties); + HumanAgentAssistantConfig.create = function create(properties) { + return new HumanAgentAssistantConfig(properties); }; /** - * Encodes the specified BatchUpdateEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse.verify|verify} messages. + * Encodes the specified HumanAgentAssistantConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse} message BatchUpdateEntityTypesResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IHumanAgentAssistantConfig} message HumanAgentAssistantConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchUpdateEntityTypesResponse.encode = function encode(message, writer) { + HumanAgentAssistantConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.entityTypes != null && message.entityTypes.length) - for (var i = 0; i < message.entityTypes.length; ++i) - $root.google.cloud.dialogflow.v2beta1.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.cloud.dialogflow.v2.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.humanAgentSuggestionConfig != null && Object.hasOwnProperty.call(message, "humanAgentSuggestionConfig")) + $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.encode(message.humanAgentSuggestionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endUserSuggestionConfig != null && Object.hasOwnProperty.call(message, "endUserSuggestionConfig")) + $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.encode(message.endUserSuggestionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.messageAnalysisConfig != null && Object.hasOwnProperty.call(message, "messageAnalysisConfig")) + $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig.encode(message.messageAnalysisConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified BatchUpdateEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse.verify|verify} messages. + * Encodes the specified HumanAgentAssistantConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse} message BatchUpdateEntityTypesResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2.IHumanAgentAssistantConfig} message HumanAgentAssistantConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - BatchUpdateEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + HumanAgentAssistantConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer. + * Decodes a HumanAgentAssistantConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig} HumanAgentAssistantConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchUpdateEntityTypesResponse.decode = function decode(reader, length) { + HumanAgentAssistantConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.entityTypes && message.entityTypes.length)) - message.entityTypes = []; - message.entityTypes.push($root.google.cloud.dialogflow.v2beta1.EntityType.decode(reader, reader.uint32())); + case 2: + message.notificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.decode(reader, reader.uint32()); + break; + case 3: + message.humanAgentSuggestionConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.decode(reader, reader.uint32()); + break; + case 4: + message.endUserSuggestionConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.decode(reader, reader.uint32()); + break; + case 5: + message.messageAnalysisConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -45961,1990 +45641,2567 @@ }; /** - * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer, length delimited. + * Decodes a HumanAgentAssistantConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig} HumanAgentAssistantConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - BatchUpdateEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + HumanAgentAssistantConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a BatchUpdateEntityTypesResponse message. + * Verifies a HumanAgentAssistantConfig message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - BatchUpdateEntityTypesResponse.verify = function verify(message) { + HumanAgentAssistantConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { - if (!Array.isArray(message.entityTypes)) - return "entityTypes: array expected"; - for (var i = 0; i < message.entityTypes.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.EntityType.verify(message.entityTypes[i]); - if (error) - return "entityTypes." + error; - } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.dialogflow.v2.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + if (message.humanAgentSuggestionConfig != null && message.hasOwnProperty("humanAgentSuggestionConfig")) { + var error = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.verify(message.humanAgentSuggestionConfig); + if (error) + return "humanAgentSuggestionConfig." + error; + } + if (message.endUserSuggestionConfig != null && message.hasOwnProperty("endUserSuggestionConfig")) { + var error = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.verify(message.endUserSuggestionConfig); + if (error) + return "endUserSuggestionConfig." + error; + } + if (message.messageAnalysisConfig != null && message.hasOwnProperty("messageAnalysisConfig")) { + var error = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig.verify(message.messageAnalysisConfig); + if (error) + return "messageAnalysisConfig." + error; } return null; }; /** - * Creates a BatchUpdateEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a HumanAgentAssistantConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig} HumanAgentAssistantConfig */ - BatchUpdateEntityTypesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse) + HumanAgentAssistantConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse(); - if (object.entityTypes) { - if (!Array.isArray(object.entityTypes)) - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse.entityTypes: array expected"); - message.entityTypes = []; - for (var i = 0; i < object.entityTypes.length; ++i) { - if (typeof object.entityTypes[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse.entityTypes: object expected"); - message.entityTypes[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.fromObject(object.entityTypes[i]); - } + var message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig(); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.humanAgentSuggestionConfig != null) { + if (typeof object.humanAgentSuggestionConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.humanAgentSuggestionConfig: object expected"); + message.humanAgentSuggestionConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.fromObject(object.humanAgentSuggestionConfig); + } + if (object.endUserSuggestionConfig != null) { + if (typeof object.endUserSuggestionConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.endUserSuggestionConfig: object expected"); + message.endUserSuggestionConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.fromObject(object.endUserSuggestionConfig); + } + if (object.messageAnalysisConfig != null) { + if (typeof object.messageAnalysisConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.messageAnalysisConfig: object expected"); + message.messageAnalysisConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig.fromObject(object.messageAnalysisConfig); } return message; }; /** - * Creates a plain object from a BatchUpdateEntityTypesResponse message. Also converts values to other types if specified. + * Creates a plain object from a HumanAgentAssistantConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig * @static - * @param {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse} message BatchUpdateEntityTypesResponse + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig} message HumanAgentAssistantConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - BatchUpdateEntityTypesResponse.toObject = function toObject(message, options) { + HumanAgentAssistantConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entityTypes = []; - if (message.entityTypes && message.entityTypes.length) { - object.entityTypes = []; - for (var j = 0; j < message.entityTypes.length; ++j) - object.entityTypes[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.toObject(message.entityTypes[j], options); - } + if (options.defaults) { + object.notificationConfig = null; + object.humanAgentSuggestionConfig = null; + object.endUserSuggestionConfig = null; + object.messageAnalysisConfig = null; + } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.dialogflow.v2.NotificationConfig.toObject(message.notificationConfig, options); + if (message.humanAgentSuggestionConfig != null && message.hasOwnProperty("humanAgentSuggestionConfig")) + object.humanAgentSuggestionConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.toObject(message.humanAgentSuggestionConfig, options); + if (message.endUserSuggestionConfig != null && message.hasOwnProperty("endUserSuggestionConfig")) + object.endUserSuggestionConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.toObject(message.endUserSuggestionConfig, options); + if (message.messageAnalysisConfig != null && message.hasOwnProperty("messageAnalysisConfig")) + object.messageAnalysisConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig.toObject(message.messageAnalysisConfig, options); return object; }; /** - * Converts this BatchUpdateEntityTypesResponse to JSON. + * Converts this HumanAgentAssistantConfig to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig * @instance * @returns {Object.} JSON object */ - BatchUpdateEntityTypesResponse.prototype.toJSON = function toJSON() { + HumanAgentAssistantConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return BatchUpdateEntityTypesResponse; - })(); + HumanAgentAssistantConfig.SuggestionTriggerSettings = (function() { - v2beta1.BatchDeleteEntityTypesRequest = (function() { + /** + * Properties of a SuggestionTriggerSettings. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @interface ISuggestionTriggerSettings + * @property {boolean|null} [noSmalltalk] SuggestionTriggerSettings noSmalltalk + * @property {boolean|null} [onlyEndUser] SuggestionTriggerSettings onlyEndUser + */ - /** - * Properties of a BatchDeleteEntityTypesRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IBatchDeleteEntityTypesRequest - * @property {string|null} [parent] BatchDeleteEntityTypesRequest parent - * @property {Array.|null} [entityTypeNames] BatchDeleteEntityTypesRequest entityTypeNames - */ + /** + * Constructs a new SuggestionTriggerSettings. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @classdesc Represents a SuggestionTriggerSettings. + * @implements ISuggestionTriggerSettings + * @constructor + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionTriggerSettings=} [properties] Properties to set + */ + function SuggestionTriggerSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new BatchDeleteEntityTypesRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a BatchDeleteEntityTypesRequest. - * @implements IBatchDeleteEntityTypesRequest - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest=} [properties] Properties to set - */ - function BatchDeleteEntityTypesRequest(properties) { - this.entityTypeNames = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BatchDeleteEntityTypesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest - * @instance - */ - BatchDeleteEntityTypesRequest.prototype.parent = ""; + /** + * SuggestionTriggerSettings noSmalltalk. + * @member {boolean} noSmalltalk + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @instance + */ + SuggestionTriggerSettings.prototype.noSmalltalk = false; - /** - * BatchDeleteEntityTypesRequest entityTypeNames. - * @member {Array.} entityTypeNames - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest - * @instance - */ - BatchDeleteEntityTypesRequest.prototype.entityTypeNames = $util.emptyArray; + /** + * SuggestionTriggerSettings onlyEndUser. + * @member {boolean} onlyEndUser + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @instance + */ + SuggestionTriggerSettings.prototype.onlyEndUser = false; - /** - * Creates a new BatchDeleteEntityTypesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest instance - */ - BatchDeleteEntityTypesRequest.create = function create(properties) { - return new BatchDeleteEntityTypesRequest(properties); - }; + /** + * Creates a new SuggestionTriggerSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionTriggerSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings} SuggestionTriggerSettings instance + */ + SuggestionTriggerSettings.create = function create(properties) { + return new SuggestionTriggerSettings(properties); + }; - /** - * Encodes the specified BatchDeleteEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest} message BatchDeleteEntityTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteEntityTypesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.entityTypeNames != null && message.entityTypeNames.length) - for (var i = 0; i < message.entityTypeNames.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityTypeNames[i]); - return writer; - }; + /** + * Encodes the specified SuggestionTriggerSettings message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionTriggerSettings} message SuggestionTriggerSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionTriggerSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.noSmalltalk != null && Object.hasOwnProperty.call(message, "noSmalltalk")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.noSmalltalk); + if (message.onlyEndUser != null && Object.hasOwnProperty.call(message, "onlyEndUser")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.onlyEndUser); + return writer; + }; - /** - * Encodes the specified BatchDeleteEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest} message BatchDeleteEntityTypesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified SuggestionTriggerSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionTriggerSettings} message SuggestionTriggerSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionTriggerSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteEntityTypesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - if (!(message.entityTypeNames && message.entityTypeNames.length)) - message.entityTypeNames = []; - message.entityTypeNames.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a SuggestionTriggerSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings} SuggestionTriggerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionTriggerSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.noSmalltalk = reader.bool(); + break; + case 2: + message.onlyEndUser = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SuggestionTriggerSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings} SuggestionTriggerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionTriggerSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a BatchDeleteEntityTypesRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDeleteEntityTypesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.entityTypeNames != null && message.hasOwnProperty("entityTypeNames")) { - if (!Array.isArray(message.entityTypeNames)) - return "entityTypeNames: array expected"; - for (var i = 0; i < message.entityTypeNames.length; ++i) - if (!$util.isString(message.entityTypeNames[i])) - return "entityTypeNames: string[] expected"; - } - return null; - }; + /** + * Verifies a SuggestionTriggerSettings message. + * @function verify + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionTriggerSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.noSmalltalk != null && message.hasOwnProperty("noSmalltalk")) + if (typeof message.noSmalltalk !== "boolean") + return "noSmalltalk: boolean expected"; + if (message.onlyEndUser != null && message.hasOwnProperty("onlyEndUser")) + if (typeof message.onlyEndUser !== "boolean") + return "onlyEndUser: boolean expected"; + return null; + }; - /** - * Creates a BatchDeleteEntityTypesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest - */ - BatchDeleteEntityTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest) + /** + * Creates a SuggestionTriggerSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings} SuggestionTriggerSettings + */ + SuggestionTriggerSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings) + return object; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings(); + if (object.noSmalltalk != null) + message.noSmalltalk = Boolean(object.noSmalltalk); + if (object.onlyEndUser != null) + message.onlyEndUser = Boolean(object.onlyEndUser); + return message; + }; + + /** + * Creates a plain object from a SuggestionTriggerSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings} message SuggestionTriggerSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionTriggerSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.noSmalltalk = false; + object.onlyEndUser = false; + } + if (message.noSmalltalk != null && message.hasOwnProperty("noSmalltalk")) + object.noSmalltalk = message.noSmalltalk; + if (message.onlyEndUser != null && message.hasOwnProperty("onlyEndUser")) + object.onlyEndUser = message.onlyEndUser; return object; - var message = new $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.entityTypeNames) { - if (!Array.isArray(object.entityTypeNames)) - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest.entityTypeNames: array expected"); - message.entityTypeNames = []; - for (var i = 0; i < object.entityTypeNames.length; ++i) - message.entityTypeNames[i] = String(object.entityTypeNames[i]); - } - return message; - }; + }; - /** - * Creates a plain object from a BatchDeleteEntityTypesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest} message BatchDeleteEntityTypesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDeleteEntityTypesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entityTypeNames = []; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.entityTypeNames && message.entityTypeNames.length) { - object.entityTypeNames = []; - for (var j = 0; j < message.entityTypeNames.length; ++j) - object.entityTypeNames[j] = message.entityTypeNames[j]; - } - return object; - }; + /** + * Converts this SuggestionTriggerSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @instance + * @returns {Object.} JSON object + */ + SuggestionTriggerSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this BatchDeleteEntityTypesRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest - * @instance - * @returns {Object.} JSON object - */ - BatchDeleteEntityTypesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return SuggestionTriggerSettings; + })(); - return BatchDeleteEntityTypesRequest; - })(); + HumanAgentAssistantConfig.SuggestionFeatureConfig = (function() { - v2beta1.BatchCreateEntitiesRequest = (function() { + /** + * Properties of a SuggestionFeatureConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @interface ISuggestionFeatureConfig + * @property {google.cloud.dialogflow.v2.ISuggestionFeature|null} [suggestionFeature] SuggestionFeatureConfig suggestionFeature + * @property {boolean|null} [enableEventBasedSuggestion] SuggestionFeatureConfig enableEventBasedSuggestion + * @property {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionTriggerSettings|null} [suggestionTriggerSettings] SuggestionFeatureConfig suggestionTriggerSettings + * @property {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionQueryConfig|null} [queryConfig] SuggestionFeatureConfig queryConfig + * @property {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IConversationModelConfig|null} [conversationModelConfig] SuggestionFeatureConfig conversationModelConfig + */ - /** - * Properties of a BatchCreateEntitiesRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IBatchCreateEntitiesRequest - * @property {string|null} [parent] BatchCreateEntitiesRequest parent - * @property {Array.|null} [entities] BatchCreateEntitiesRequest entities - * @property {string|null} [languageCode] BatchCreateEntitiesRequest languageCode - */ + /** + * Constructs a new SuggestionFeatureConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @classdesc Represents a SuggestionFeatureConfig. + * @implements ISuggestionFeatureConfig + * @constructor + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionFeatureConfig=} [properties] Properties to set + */ + function SuggestionFeatureConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new BatchCreateEntitiesRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a BatchCreateEntitiesRequest. - * @implements IBatchCreateEntitiesRequest - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest=} [properties] Properties to set - */ - function BatchCreateEntitiesRequest(properties) { - this.entities = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * SuggestionFeatureConfig suggestionFeature. + * @member {google.cloud.dialogflow.v2.ISuggestionFeature|null|undefined} suggestionFeature + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @instance + */ + SuggestionFeatureConfig.prototype.suggestionFeature = null; - /** - * BatchCreateEntitiesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest - * @instance - */ - BatchCreateEntitiesRequest.prototype.parent = ""; + /** + * SuggestionFeatureConfig enableEventBasedSuggestion. + * @member {boolean} enableEventBasedSuggestion + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @instance + */ + SuggestionFeatureConfig.prototype.enableEventBasedSuggestion = false; - /** - * BatchCreateEntitiesRequest entities. - * @member {Array.} entities - * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest - * @instance - */ - BatchCreateEntitiesRequest.prototype.entities = $util.emptyArray; + /** + * SuggestionFeatureConfig suggestionTriggerSettings. + * @member {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionTriggerSettings|null|undefined} suggestionTriggerSettings + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @instance + */ + SuggestionFeatureConfig.prototype.suggestionTriggerSettings = null; - /** - * BatchCreateEntitiesRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest - * @instance - */ - BatchCreateEntitiesRequest.prototype.languageCode = ""; + /** + * SuggestionFeatureConfig queryConfig. + * @member {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionQueryConfig|null|undefined} queryConfig + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @instance + */ + SuggestionFeatureConfig.prototype.queryConfig = null; - /** - * Creates a new BatchCreateEntitiesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest instance - */ - BatchCreateEntitiesRequest.create = function create(properties) { - return new BatchCreateEntitiesRequest(properties); - }; + /** + * SuggestionFeatureConfig conversationModelConfig. + * @member {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IConversationModelConfig|null|undefined} conversationModelConfig + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @instance + */ + SuggestionFeatureConfig.prototype.conversationModelConfig = null; - /** - * Encodes the specified BatchCreateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest} message BatchCreateEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateEntitiesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.entities != null && message.entities.length) - for (var i = 0; i < message.entities.length; ++i) - $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); - return writer; - }; + /** + * Creates a new SuggestionFeatureConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionFeatureConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig} SuggestionFeatureConfig instance + */ + SuggestionFeatureConfig.create = function create(properties) { + return new SuggestionFeatureConfig(properties); + }; - /** - * Encodes the specified BatchCreateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest} message BatchCreateEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchCreateEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified SuggestionFeatureConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionFeatureConfig} message SuggestionFeatureConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionFeatureConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableEventBasedSuggestion != null && Object.hasOwnProperty.call(message, "enableEventBasedSuggestion")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableEventBasedSuggestion); + if (message.suggestionFeature != null && Object.hasOwnProperty.call(message, "suggestionFeature")) + $root.google.cloud.dialogflow.v2.SuggestionFeature.encode(message.suggestionFeature, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.queryConfig != null && Object.hasOwnProperty.call(message, "queryConfig")) + $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.encode(message.queryConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.conversationModelConfig != null && Object.hasOwnProperty.call(message, "conversationModelConfig")) + $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.encode(message.conversationModelConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.suggestionTriggerSettings != null && Object.hasOwnProperty.call(message, "suggestionTriggerSettings")) + $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings.encode(message.suggestionTriggerSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; - /** - * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateEntitiesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.dialogflow.v2beta1.EntityType.Entity.decode(reader, reader.uint32())); - break; - case 3: - message.languageCode = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Encodes the specified SuggestionFeatureConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionFeatureConfig} message SuggestionFeatureConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionFeatureConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestionFeatureConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig} SuggestionFeatureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionFeatureConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + message.suggestionFeature = $root.google.cloud.dialogflow.v2.SuggestionFeature.decode(reader, reader.uint32()); + break; + case 3: + message.enableEventBasedSuggestion = reader.bool(); + break; + case 10: + message.suggestionTriggerSettings = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings.decode(reader, reader.uint32()); + break; + case 6: + message.queryConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.decode(reader, reader.uint32()); + break; + case 7: + message.conversationModelConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchCreateEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SuggestionFeatureConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig} SuggestionFeatureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionFeatureConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a BatchCreateEntitiesRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchCreateEntitiesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.entities != null && message.hasOwnProperty("entities")) { - if (!Array.isArray(message.entities)) - return "entities: array expected"; - for (var i = 0; i < message.entities.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.verify(message.entities[i]); + /** + * Verifies a SuggestionFeatureConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionFeatureConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestionFeature != null && message.hasOwnProperty("suggestionFeature")) { + var error = $root.google.cloud.dialogflow.v2.SuggestionFeature.verify(message.suggestionFeature); if (error) - return "entities." + error; + return "suggestionFeature." + error; } - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - return null; - }; + if (message.enableEventBasedSuggestion != null && message.hasOwnProperty("enableEventBasedSuggestion")) + if (typeof message.enableEventBasedSuggestion !== "boolean") + return "enableEventBasedSuggestion: boolean expected"; + if (message.suggestionTriggerSettings != null && message.hasOwnProperty("suggestionTriggerSettings")) { + var error = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings.verify(message.suggestionTriggerSettings); + if (error) + return "suggestionTriggerSettings." + error; + } + if (message.queryConfig != null && message.hasOwnProperty("queryConfig")) { + var error = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.verify(message.queryConfig); + if (error) + return "queryConfig." + error; + } + if (message.conversationModelConfig != null && message.hasOwnProperty("conversationModelConfig")) { + var error = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.verify(message.conversationModelConfig); + if (error) + return "conversationModelConfig." + error; + } + return null; + }; - /** - * Creates a BatchCreateEntitiesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest - */ - BatchCreateEntitiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest.entities: array expected"); - message.entities = []; - for (var i = 0; i < object.entities.length; ++i) { - if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest.entities: object expected"); - message.entities[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.fromObject(object.entities[i]); + /** + * Creates a SuggestionFeatureConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig} SuggestionFeatureConfig + */ + SuggestionFeatureConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig(); + if (object.suggestionFeature != null) { + if (typeof object.suggestionFeature !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.suggestionFeature: object expected"); + message.suggestionFeature = $root.google.cloud.dialogflow.v2.SuggestionFeature.fromObject(object.suggestionFeature); + } + if (object.enableEventBasedSuggestion != null) + message.enableEventBasedSuggestion = Boolean(object.enableEventBasedSuggestion); + if (object.suggestionTriggerSettings != null) { + if (typeof object.suggestionTriggerSettings !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.suggestionTriggerSettings: object expected"); + message.suggestionTriggerSettings = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings.fromObject(object.suggestionTriggerSettings); + } + if (object.queryConfig != null) { + if (typeof object.queryConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.queryConfig: object expected"); + message.queryConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.fromObject(object.queryConfig); + } + if (object.conversationModelConfig != null) { + if (typeof object.conversationModelConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.conversationModelConfig: object expected"); + message.conversationModelConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.fromObject(object.conversationModelConfig); } - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - return message; - }; + return message; + }; - /** - * Creates a plain object from a BatchCreateEntitiesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest} message BatchCreateEntitiesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchCreateEntitiesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entities = []; - if (options.defaults) { - object.parent = ""; - object.languageCode = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.entities && message.entities.length) { - object.entities = []; - for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.toObject(message.entities[j], options); - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - return object; - }; + /** + * Creates a plain object from a SuggestionFeatureConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig} message SuggestionFeatureConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionFeatureConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableEventBasedSuggestion = false; + object.suggestionFeature = null; + object.queryConfig = null; + object.conversationModelConfig = null; + object.suggestionTriggerSettings = null; + } + if (message.enableEventBasedSuggestion != null && message.hasOwnProperty("enableEventBasedSuggestion")) + object.enableEventBasedSuggestion = message.enableEventBasedSuggestion; + if (message.suggestionFeature != null && message.hasOwnProperty("suggestionFeature")) + object.suggestionFeature = $root.google.cloud.dialogflow.v2.SuggestionFeature.toObject(message.suggestionFeature, options); + if (message.queryConfig != null && message.hasOwnProperty("queryConfig")) + object.queryConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.toObject(message.queryConfig, options); + if (message.conversationModelConfig != null && message.hasOwnProperty("conversationModelConfig")) + object.conversationModelConfig = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.toObject(message.conversationModelConfig, options); + if (message.suggestionTriggerSettings != null && message.hasOwnProperty("suggestionTriggerSettings")) + object.suggestionTriggerSettings = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionTriggerSettings.toObject(message.suggestionTriggerSettings, options); + return object; + }; - /** - * Converts this BatchCreateEntitiesRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest - * @instance - * @returns {Object.} JSON object - */ - BatchCreateEntitiesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this SuggestionFeatureConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @instance + * @returns {Object.} JSON object + */ + SuggestionFeatureConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return BatchCreateEntitiesRequest; - })(); + return SuggestionFeatureConfig; + })(); - v2beta1.BatchUpdateEntitiesRequest = (function() { + HumanAgentAssistantConfig.SuggestionConfig = (function() { - /** - * Properties of a BatchUpdateEntitiesRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IBatchUpdateEntitiesRequest - * @property {string|null} [parent] BatchUpdateEntitiesRequest parent - * @property {Array.|null} [entities] BatchUpdateEntitiesRequest entities - * @property {string|null} [languageCode] BatchUpdateEntitiesRequest languageCode - * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateEntitiesRequest updateMask - */ + /** + * Properties of a SuggestionConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @interface ISuggestionConfig + * @property {Array.|null} [featureConfigs] SuggestionConfig featureConfigs + * @property {boolean|null} [groupSuggestionResponses] SuggestionConfig groupSuggestionResponses + */ - /** - * Constructs a new BatchUpdateEntitiesRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a BatchUpdateEntitiesRequest. - * @implements IBatchUpdateEntitiesRequest - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest=} [properties] Properties to set - */ - function BatchUpdateEntitiesRequest(properties) { - this.entities = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new SuggestionConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @classdesc Represents a SuggestionConfig. + * @implements ISuggestionConfig + * @constructor + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig=} [properties] Properties to set + */ + function SuggestionConfig(properties) { + this.featureConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * BatchUpdateEntitiesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @instance - */ - BatchUpdateEntitiesRequest.prototype.parent = ""; + /** + * SuggestionConfig featureConfigs. + * @member {Array.} featureConfigs + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + * @instance + */ + SuggestionConfig.prototype.featureConfigs = $util.emptyArray; - /** - * BatchUpdateEntitiesRequest entities. - * @member {Array.} entities - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @instance - */ - BatchUpdateEntitiesRequest.prototype.entities = $util.emptyArray; + /** + * SuggestionConfig groupSuggestionResponses. + * @member {boolean} groupSuggestionResponses + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + * @instance + */ + SuggestionConfig.prototype.groupSuggestionResponses = false; - /** - * BatchUpdateEntitiesRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @instance - */ - BatchUpdateEntitiesRequest.prototype.languageCode = ""; + /** + * Creates a new SuggestionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig} SuggestionConfig instance + */ + SuggestionConfig.create = function create(properties) { + return new SuggestionConfig(properties); + }; - /** - * BatchUpdateEntitiesRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @instance - */ - BatchUpdateEntitiesRequest.prototype.updateMask = null; + /** + * Encodes the specified SuggestionConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig} message SuggestionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.featureConfigs != null && message.featureConfigs.length) + for (var i = 0; i < message.featureConfigs.length; ++i) + $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.encode(message.featureConfigs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.groupSuggestionResponses != null && Object.hasOwnProperty.call(message, "groupSuggestionResponses")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.groupSuggestionResponses); + return writer; + }; - /** - * Creates a new BatchUpdateEntitiesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest instance - */ - BatchUpdateEntitiesRequest.create = function create(properties) { - return new BatchUpdateEntitiesRequest(properties); - }; + /** + * Encodes the specified SuggestionConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionConfig} message SuggestionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified BatchUpdateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest} message BatchUpdateEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchUpdateEntitiesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.entities != null && message.entities.length) - for (var i = 0; i < message.entities.length; ++i) - $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Decodes a SuggestionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig} SuggestionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.featureConfigs && message.featureConfigs.length)) + message.featureConfigs = []; + message.featureConfigs.push($root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.decode(reader, reader.uint32())); + break; + case 3: + message.groupSuggestionResponses = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified BatchUpdateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest} message BatchUpdateEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchUpdateEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a SuggestionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig} SuggestionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchUpdateEntitiesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.dialogflow.v2beta1.EntityType.Entity.decode(reader, reader.uint32())); - break; - case 3: - message.languageCode = reader.string(); - break; - case 4: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Verifies a SuggestionConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.featureConfigs != null && message.hasOwnProperty("featureConfigs")) { + if (!Array.isArray(message.featureConfigs)) + return "featureConfigs: array expected"; + for (var i = 0; i < message.featureConfigs.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.verify(message.featureConfigs[i]); + if (error) + return "featureConfigs." + error; + } } - } - return message; - }; - - /** - * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchUpdateEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + if (message.groupSuggestionResponses != null && message.hasOwnProperty("groupSuggestionResponses")) + if (typeof message.groupSuggestionResponses !== "boolean") + return "groupSuggestionResponses: boolean expected"; + return null; + }; - /** - * Verifies a BatchUpdateEntitiesRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchUpdateEntitiesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.entities != null && message.hasOwnProperty("entities")) { - if (!Array.isArray(message.entities)) - return "entities: array expected"; - for (var i = 0; i < message.entities.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.verify(message.entities[i]); - if (error) - return "entities." + error; + /** + * Creates a SuggestionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig} SuggestionConfig + */ + SuggestionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig(); + if (object.featureConfigs) { + if (!Array.isArray(object.featureConfigs)) + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.featureConfigs: array expected"); + message.featureConfigs = []; + for (var i = 0; i < object.featureConfigs.length; ++i) { + if (typeof object.featureConfigs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig.featureConfigs: object expected"); + message.featureConfigs[i] = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.fromObject(object.featureConfigs[i]); + } } - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - return null; - }; + if (object.groupSuggestionResponses != null) + message.groupSuggestionResponses = Boolean(object.groupSuggestionResponses); + return message; + }; - /** - * Creates a BatchUpdateEntitiesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest - */ - BatchUpdateEntitiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest) + /** + * Creates a plain object from a SuggestionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig} message SuggestionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.featureConfigs = []; + if (options.defaults) + object.groupSuggestionResponses = false; + if (message.featureConfigs && message.featureConfigs.length) { + object.featureConfigs = []; + for (var j = 0; j < message.featureConfigs.length; ++j) + object.featureConfigs[j] = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionFeatureConfig.toObject(message.featureConfigs[j], options); + } + if (message.groupSuggestionResponses != null && message.hasOwnProperty("groupSuggestionResponses")) + object.groupSuggestionResponses = message.groupSuggestionResponses; return object; - var message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.entities: array expected"); - message.entities = []; - for (var i = 0; i < object.entities.length; ++i) { - if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.entities: object expected"); - message.entities[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.fromObject(object.entities[i]); - } - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + }; + + /** + * Converts this SuggestionConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionConfig + * @instance + * @returns {Object.} JSON object + */ + SuggestionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SuggestionConfig; + })(); + + HumanAgentAssistantConfig.SuggestionQueryConfig = (function() { + + /** + * Properties of a SuggestionQueryConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @interface ISuggestionQueryConfig + * @property {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource|null} [knowledgeBaseQuerySource] SuggestionQueryConfig knowledgeBaseQuerySource + * @property {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource|null} [documentQuerySource] SuggestionQueryConfig documentQuerySource + * @property {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource|null} [dialogflowQuerySource] SuggestionQueryConfig dialogflowQuerySource + * @property {number|null} [maxResults] SuggestionQueryConfig maxResults + * @property {number|null} [confidenceThreshold] SuggestionQueryConfig confidenceThreshold + * @property {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings|null} [contextFilterSettings] SuggestionQueryConfig contextFilterSettings + */ + + /** + * Constructs a new SuggestionQueryConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @classdesc Represents a SuggestionQueryConfig. + * @implements ISuggestionQueryConfig + * @constructor + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionQueryConfig=} [properties] Properties to set + */ + function SuggestionQueryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Creates a plain object from a BatchUpdateEntitiesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest} message BatchUpdateEntitiesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchUpdateEntitiesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entities = []; - if (options.defaults) { - object.parent = ""; - object.languageCode = ""; - object.updateMask = null; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.entities && message.entities.length) { - object.entities = []; - for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.toObject(message.entities[j], options); - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this BatchUpdateEntitiesRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest - * @instance - * @returns {Object.} JSON object - */ - BatchUpdateEntitiesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * SuggestionQueryConfig knowledgeBaseQuerySource. + * @member {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource|null|undefined} knowledgeBaseQuerySource + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + SuggestionQueryConfig.prototype.knowledgeBaseQuerySource = null; - return BatchUpdateEntitiesRequest; - })(); + /** + * SuggestionQueryConfig documentQuerySource. + * @member {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource|null|undefined} documentQuerySource + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + SuggestionQueryConfig.prototype.documentQuerySource = null; - v2beta1.BatchDeleteEntitiesRequest = (function() { + /** + * SuggestionQueryConfig dialogflowQuerySource. + * @member {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource|null|undefined} dialogflowQuerySource + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + SuggestionQueryConfig.prototype.dialogflowQuerySource = null; - /** - * Properties of a BatchDeleteEntitiesRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IBatchDeleteEntitiesRequest - * @property {string|null} [parent] BatchDeleteEntitiesRequest parent - * @property {Array.|null} [entityValues] BatchDeleteEntitiesRequest entityValues - * @property {string|null} [languageCode] BatchDeleteEntitiesRequest languageCode - */ + /** + * SuggestionQueryConfig maxResults. + * @member {number} maxResults + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + SuggestionQueryConfig.prototype.maxResults = 0; - /** - * Constructs a new BatchDeleteEntitiesRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a BatchDeleteEntitiesRequest. - * @implements IBatchDeleteEntitiesRequest - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest=} [properties] Properties to set - */ - function BatchDeleteEntitiesRequest(properties) { - this.entityValues = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * SuggestionQueryConfig confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + SuggestionQueryConfig.prototype.confidenceThreshold = 0; - /** - * BatchDeleteEntitiesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest - * @instance - */ - BatchDeleteEntitiesRequest.prototype.parent = ""; + /** + * SuggestionQueryConfig contextFilterSettings. + * @member {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings|null|undefined} contextFilterSettings + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + SuggestionQueryConfig.prototype.contextFilterSettings = null; - /** - * BatchDeleteEntitiesRequest entityValues. - * @member {Array.} entityValues - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest - * @instance - */ - BatchDeleteEntitiesRequest.prototype.entityValues = $util.emptyArray; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * BatchDeleteEntitiesRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest - * @instance - */ - BatchDeleteEntitiesRequest.prototype.languageCode = ""; + /** + * SuggestionQueryConfig querySource. + * @member {"knowledgeBaseQuerySource"|"documentQuerySource"|"dialogflowQuerySource"|undefined} querySource + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + Object.defineProperty(SuggestionQueryConfig.prototype, "querySource", { + get: $util.oneOfGetter($oneOfFields = ["knowledgeBaseQuerySource", "documentQuerySource", "dialogflowQuerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Creates a new BatchDeleteEntitiesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest instance - */ - BatchDeleteEntitiesRequest.create = function create(properties) { - return new BatchDeleteEntitiesRequest(properties); - }; + /** + * Creates a new SuggestionQueryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionQueryConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig} SuggestionQueryConfig instance + */ + SuggestionQueryConfig.create = function create(properties) { + return new SuggestionQueryConfig(properties); + }; - /** - * Encodes the specified BatchDeleteEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest} message BatchDeleteEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteEntitiesRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.entityValues != null && message.entityValues.length) - for (var i = 0; i < message.entityValues.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityValues[i]); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); - return writer; - }; + /** + * Encodes the specified SuggestionQueryConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionQueryConfig} message SuggestionQueryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionQueryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.knowledgeBaseQuerySource != null && Object.hasOwnProperty.call(message, "knowledgeBaseQuerySource")) + $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.encode(message.knowledgeBaseQuerySource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.documentQuerySource != null && Object.hasOwnProperty.call(message, "documentQuerySource")) + $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.encode(message.documentQuerySource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dialogflowQuerySource != null && Object.hasOwnProperty.call(message, "dialogflowQuerySource")) + $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.encode(message.dialogflowQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxResults); + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidenceThreshold); + if (message.contextFilterSettings != null && Object.hasOwnProperty.call(message, "contextFilterSettings")) + $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.encode(message.contextFilterSettings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified BatchDeleteEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest} message BatchDeleteEntitiesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified SuggestionQueryConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ISuggestionQueryConfig} message SuggestionQueryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionQueryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteEntitiesRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - if (!(message.entityValues && message.entityValues.length)) - message.entityValues = []; - message.entityValues.push(reader.string()); - break; - case 3: - message.languageCode = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a SuggestionQueryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig} SuggestionQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionQueryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.knowledgeBaseQuerySource = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.decode(reader, reader.uint32()); + break; + case 2: + message.documentQuerySource = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.decode(reader, reader.uint32()); + break; + case 3: + message.dialogflowQuerySource = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.decode(reader, reader.uint32()); + break; + case 4: + message.maxResults = reader.int32(); + break; + case 5: + message.confidenceThreshold = reader.float(); + break; + case 7: + message.contextFilterSettings = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SuggestionQueryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig} SuggestionQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionQueryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a BatchDeleteEntitiesRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDeleteEntitiesRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.entityValues != null && message.hasOwnProperty("entityValues")) { - if (!Array.isArray(message.entityValues)) - return "entityValues: array expected"; - for (var i = 0; i < message.entityValues.length; ++i) - if (!$util.isString(message.entityValues[i])) - return "entityValues: string[] expected"; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - return null; - }; + /** + * Verifies a SuggestionQueryConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionQueryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.knowledgeBaseQuerySource != null && message.hasOwnProperty("knowledgeBaseQuerySource")) { + properties.querySource = 1; + { + var error = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.verify(message.knowledgeBaseQuerySource); + if (error) + return "knowledgeBaseQuerySource." + error; + } + } + if (message.documentQuerySource != null && message.hasOwnProperty("documentQuerySource")) { + if (properties.querySource === 1) + return "querySource: multiple values"; + properties.querySource = 1; + { + var error = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.verify(message.documentQuerySource); + if (error) + return "documentQuerySource." + error; + } + } + if (message.dialogflowQuerySource != null && message.hasOwnProperty("dialogflowQuerySource")) { + if (properties.querySource === 1) + return "querySource: multiple values"; + properties.querySource = 1; + { + var error = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.verify(message.dialogflowQuerySource); + if (error) + return "dialogflowQuerySource." + error; + } + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.contextFilterSettings != null && message.hasOwnProperty("contextFilterSettings")) { + var error = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.verify(message.contextFilterSettings); + if (error) + return "contextFilterSettings." + error; + } + return null; + }; - /** - * Creates a BatchDeleteEntitiesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest - */ - BatchDeleteEntitiesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.entityValues) { - if (!Array.isArray(object.entityValues)) - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest.entityValues: array expected"); - message.entityValues = []; - for (var i = 0; i < object.entityValues.length; ++i) - message.entityValues[i] = String(object.entityValues[i]); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - return message; - }; + /** + * Creates a SuggestionQueryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig} SuggestionQueryConfig + */ + SuggestionQueryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig(); + if (object.knowledgeBaseQuerySource != null) { + if (typeof object.knowledgeBaseQuerySource !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.knowledgeBaseQuerySource: object expected"); + message.knowledgeBaseQuerySource = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.fromObject(object.knowledgeBaseQuerySource); + } + if (object.documentQuerySource != null) { + if (typeof object.documentQuerySource !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.documentQuerySource: object expected"); + message.documentQuerySource = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.fromObject(object.documentQuerySource); + } + if (object.dialogflowQuerySource != null) { + if (typeof object.dialogflowQuerySource !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.dialogflowQuerySource: object expected"); + message.dialogflowQuerySource = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.fromObject(object.dialogflowQuerySource); + } + if (object.maxResults != null) + message.maxResults = object.maxResults | 0; + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.contextFilterSettings != null) { + if (typeof object.contextFilterSettings !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.contextFilterSettings: object expected"); + message.contextFilterSettings = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.fromObject(object.contextFilterSettings); + } + return message; + }; - /** - * Creates a plain object from a BatchDeleteEntitiesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest} message BatchDeleteEntitiesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDeleteEntitiesRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entityValues = []; - if (options.defaults) { - object.parent = ""; - object.languageCode = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.entityValues && message.entityValues.length) { - object.entityValues = []; - for (var j = 0; j < message.entityValues.length; ++j) - object.entityValues[j] = message.entityValues[j]; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - return object; - }; + /** + * Creates a plain object from a SuggestionQueryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig} message SuggestionQueryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionQueryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxResults = 0; + object.confidenceThreshold = 0; + object.contextFilterSettings = null; + } + if (message.knowledgeBaseQuerySource != null && message.hasOwnProperty("knowledgeBaseQuerySource")) { + object.knowledgeBaseQuerySource = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.toObject(message.knowledgeBaseQuerySource, options); + if (options.oneofs) + object.querySource = "knowledgeBaseQuerySource"; + } + if (message.documentQuerySource != null && message.hasOwnProperty("documentQuerySource")) { + object.documentQuerySource = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.toObject(message.documentQuerySource, options); + if (options.oneofs) + object.querySource = "documentQuerySource"; + } + if (message.dialogflowQuerySource != null && message.hasOwnProperty("dialogflowQuerySource")) { + object.dialogflowQuerySource = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.toObject(message.dialogflowQuerySource, options); + if (options.oneofs) + object.querySource = "dialogflowQuerySource"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + object.maxResults = message.maxResults; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.contextFilterSettings != null && message.hasOwnProperty("contextFilterSettings")) + object.contextFilterSettings = $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.toObject(message.contextFilterSettings, options); + return object; + }; - /** - * Converts this BatchDeleteEntitiesRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest - * @instance - * @returns {Object.} JSON object - */ - BatchDeleteEntitiesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this SuggestionQueryConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + * @returns {Object.} JSON object + */ + SuggestionQueryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return BatchDeleteEntitiesRequest; - })(); + SuggestionQueryConfig.KnowledgeBaseQuerySource = (function() { - v2beta1.EntityTypeBatch = (function() { + /** + * Properties of a KnowledgeBaseQuerySource. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @interface IKnowledgeBaseQuerySource + * @property {Array.|null} [knowledgeBases] KnowledgeBaseQuerySource knowledgeBases + */ - /** - * Properties of an EntityTypeBatch. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IEntityTypeBatch - * @property {Array.|null} [entityTypes] EntityTypeBatch entityTypes - */ + /** + * Constructs a new KnowledgeBaseQuerySource. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @classdesc Represents a KnowledgeBaseQuerySource. + * @implements IKnowledgeBaseQuerySource + * @constructor + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource=} [properties] Properties to set + */ + function KnowledgeBaseQuerySource(properties) { + this.knowledgeBases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new EntityTypeBatch. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an EntityTypeBatch. - * @implements IEntityTypeBatch - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IEntityTypeBatch=} [properties] Properties to set - */ - function EntityTypeBatch(properties) { - this.entityTypes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * KnowledgeBaseQuerySource knowledgeBases. + * @member {Array.} knowledgeBases + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @instance + */ + KnowledgeBaseQuerySource.prototype.knowledgeBases = $util.emptyArray; - /** - * EntityTypeBatch entityTypes. - * @member {Array.} entityTypes - * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch - * @instance - */ - EntityTypeBatch.prototype.entityTypes = $util.emptyArray; + /** + * Creates a new KnowledgeBaseQuerySource instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource} KnowledgeBaseQuerySource instance + */ + KnowledgeBaseQuerySource.create = function create(properties) { + return new KnowledgeBaseQuerySource(properties); + }; - /** - * Creates a new EntityTypeBatch instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch - * @static - * @param {google.cloud.dialogflow.v2beta1.IEntityTypeBatch=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.EntityTypeBatch} EntityTypeBatch instance - */ - EntityTypeBatch.create = function create(properties) { - return new EntityTypeBatch(properties); - }; + /** + * Encodes the specified KnowledgeBaseQuerySource message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource} message KnowledgeBaseQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeBaseQuerySource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.knowledgeBases != null && message.knowledgeBases.length) + for (var i = 0; i < message.knowledgeBases.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.knowledgeBases[i]); + return writer; + }; - /** - * Encodes the specified EntityTypeBatch message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityTypeBatch.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch - * @static - * @param {google.cloud.dialogflow.v2beta1.IEntityTypeBatch} message EntityTypeBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityTypeBatch.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.entityTypes != null && message.entityTypes.length) - for (var i = 0; i < message.entityTypes.length; ++i) - $root.google.cloud.dialogflow.v2beta1.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified KnowledgeBaseQuerySource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource} message KnowledgeBaseQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeBaseQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified EntityTypeBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityTypeBatch.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch - * @static - * @param {google.cloud.dialogflow.v2beta1.IEntityTypeBatch} message EntityTypeBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EntityTypeBatch.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a KnowledgeBaseQuerySource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource} KnowledgeBaseQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeBaseQuerySource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.knowledgeBases && message.knowledgeBases.length)) + message.knowledgeBases = []; + message.knowledgeBases.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an EntityTypeBatch message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.EntityTypeBatch} EntityTypeBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityTypeBatch.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.entityTypes && message.entityTypes.length)) - message.entityTypes = []; - message.entityTypes.push($root.google.cloud.dialogflow.v2beta1.EntityType.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a KnowledgeBaseQuerySource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource} KnowledgeBaseQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeBaseQuerySource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an EntityTypeBatch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.EntityTypeBatch} EntityTypeBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EntityTypeBatch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a KnowledgeBaseQuerySource message. + * @function verify + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KnowledgeBaseQuerySource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.knowledgeBases != null && message.hasOwnProperty("knowledgeBases")) { + if (!Array.isArray(message.knowledgeBases)) + return "knowledgeBases: array expected"; + for (var i = 0; i < message.knowledgeBases.length; ++i) + if (!$util.isString(message.knowledgeBases[i])) + return "knowledgeBases: string[] expected"; + } + return null; + }; - /** - * Verifies an EntityTypeBatch message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EntityTypeBatch.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { - if (!Array.isArray(message.entityTypes)) - return "entityTypes: array expected"; - for (var i = 0; i < message.entityTypes.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.EntityType.verify(message.entityTypes[i]); - if (error) - return "entityTypes." + error; - } - } - return null; - }; + /** + * Creates a KnowledgeBaseQuerySource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource} KnowledgeBaseQuerySource + */ + KnowledgeBaseQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource) + return object; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource(); + if (object.knowledgeBases) { + if (!Array.isArray(object.knowledgeBases)) + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.knowledgeBases: array expected"); + message.knowledgeBases = []; + for (var i = 0; i < object.knowledgeBases.length; ++i) + message.knowledgeBases[i] = String(object.knowledgeBases[i]); + } + return message; + }; - /** - * Creates an EntityTypeBatch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.EntityTypeBatch} EntityTypeBatch - */ - EntityTypeBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch(); - if (object.entityTypes) { - if (!Array.isArray(object.entityTypes)) - throw TypeError(".google.cloud.dialogflow.v2beta1.EntityTypeBatch.entityTypes: array expected"); - message.entityTypes = []; - for (var i = 0; i < object.entityTypes.length; ++i) { - if (typeof object.entityTypes[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.EntityTypeBatch.entityTypes: object expected"); - message.entityTypes[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.fromObject(object.entityTypes[i]); - } - } - return message; - }; + /** + * Creates a plain object from a KnowledgeBaseQuerySource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource} message KnowledgeBaseQuerySource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KnowledgeBaseQuerySource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.knowledgeBases = []; + if (message.knowledgeBases && message.knowledgeBases.length) { + object.knowledgeBases = []; + for (var j = 0; j < message.knowledgeBases.length; ++j) + object.knowledgeBases[j] = message.knowledgeBases[j]; + } + return object; + }; - /** - * Creates a plain object from an EntityTypeBatch message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch - * @static - * @param {google.cloud.dialogflow.v2beta1.EntityTypeBatch} message EntityTypeBatch - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EntityTypeBatch.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.entityTypes = []; - if (message.entityTypes && message.entityTypes.length) { - object.entityTypes = []; - for (var j = 0; j < message.entityTypes.length; ++j) - object.entityTypes[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.toObject(message.entityTypes[j], options); - } - return object; - }; + /** + * Converts this KnowledgeBaseQuerySource to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @instance + * @returns {Object.} JSON object + */ + KnowledgeBaseQuerySource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this EntityTypeBatch to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch - * @instance - * @returns {Object.} JSON object - */ - EntityTypeBatch.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return KnowledgeBaseQuerySource; + })(); - return EntityTypeBatch; - })(); + SuggestionQueryConfig.DocumentQuerySource = (function() { - v2beta1.Intents = (function() { + /** + * Properties of a DocumentQuerySource. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @interface IDocumentQuerySource + * @property {Array.|null} [documents] DocumentQuerySource documents + */ - /** - * Constructs a new Intents service. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an Intents - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Intents(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } + /** + * Constructs a new DocumentQuerySource. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @classdesc Represents a DocumentQuerySource. + * @implements IDocumentQuerySource + * @constructor + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource=} [properties] Properties to set + */ + function DocumentQuerySource(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - (Intents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Intents; + /** + * DocumentQuerySource documents. + * @member {Array.} documents + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @instance + */ + DocumentQuerySource.prototype.documents = $util.emptyArray; - /** - * Creates new Intents service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Intents} RPC service. Useful where requests and/or responses are streamed. - */ - Intents.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; + /** + * Creates a new DocumentQuerySource instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource} DocumentQuerySource instance + */ + DocumentQuerySource.create = function create(properties) { + return new DocumentQuerySource(properties); + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#listIntents}. - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @typedef ListIntentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.ListIntentsResponse} [response] ListIntentsResponse - */ + /** + * Encodes the specified DocumentQuerySource message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource} message DocumentQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentQuerySource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documents[i]); + return writer; + }; - /** - * Calls ListIntents. - * @function listIntents - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IListIntentsRequest} request ListIntentsRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Intents.ListIntentsCallback} callback Node-style callback called with the error, if any, and ListIntentsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Intents.prototype.listIntents = function listIntents(request, callback) { - return this.rpcCall(listIntents, $root.google.cloud.dialogflow.v2beta1.ListIntentsRequest, $root.google.cloud.dialogflow.v2beta1.ListIntentsResponse, request, callback); - }, "name", { value: "ListIntents" }); + /** + * Encodes the specified DocumentQuerySource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource} message DocumentQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls ListIntents. - * @function listIntents - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IListIntentsRequest} request ListIntentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a DocumentQuerySource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource} DocumentQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentQuerySource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#getIntent}. - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @typedef GetIntentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.Intent} [response] Intent - */ + /** + * Decodes a DocumentQuerySource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource} DocumentQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentQuerySource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls GetIntent. - * @function getIntent - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetIntentRequest} request GetIntentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Intents.GetIntentCallback} callback Node-style callback called with the error, if any, and Intent - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Intents.prototype.getIntent = function getIntent(request, callback) { - return this.rpcCall(getIntent, $root.google.cloud.dialogflow.v2beta1.GetIntentRequest, $root.google.cloud.dialogflow.v2beta1.Intent, request, callback); - }, "name", { value: "GetIntent" }); + /** + * Verifies a DocumentQuerySource message. + * @function verify + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentQuerySource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!$util.isString(message.documents[i])) + return "documents: string[] expected"; + } + return null; + }; - /** - * Calls GetIntent. - * @function getIntent - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetIntentRequest} request GetIntentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a DocumentQuerySource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource} DocumentQuerySource + */ + DocumentQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource) + return object; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + message.documents[i] = String(object.documents[i]); + } + return message; + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#createIntent}. - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @typedef CreateIntentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.Intent} [response] Intent - */ + /** + * Creates a plain object from a DocumentQuerySource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource} message DocumentQuerySource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentQuerySource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = message.documents[j]; + } + return object; + }; - /** - * Calls CreateIntent. - * @function createIntent - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.ICreateIntentRequest} request CreateIntentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Intents.CreateIntentCallback} callback Node-style callback called with the error, if any, and Intent - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Intents.prototype.createIntent = function createIntent(request, callback) { - return this.rpcCall(createIntent, $root.google.cloud.dialogflow.v2beta1.CreateIntentRequest, $root.google.cloud.dialogflow.v2beta1.Intent, request, callback); - }, "name", { value: "CreateIntent" }); + /** + * Converts this DocumentQuerySource to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @instance + * @returns {Object.} JSON object + */ + DocumentQuerySource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls CreateIntent. - * @function createIntent - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.ICreateIntentRequest} request CreateIntentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return DocumentQuerySource; + })(); - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#updateIntent}. - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @typedef UpdateIntentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.Intent} [response] Intent - */ + SuggestionQueryConfig.DialogflowQuerySource = (function() { - /** - * Calls UpdateIntent. - * @function updateIntent - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IUpdateIntentRequest} request UpdateIntentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Intents.UpdateIntentCallback} callback Node-style callback called with the error, if any, and Intent - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Intents.prototype.updateIntent = function updateIntent(request, callback) { - return this.rpcCall(updateIntent, $root.google.cloud.dialogflow.v2beta1.UpdateIntentRequest, $root.google.cloud.dialogflow.v2beta1.Intent, request, callback); - }, "name", { value: "UpdateIntent" }); + /** + * Properties of a DialogflowQuerySource. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @interface IDialogflowQuerySource + * @property {string|null} [agent] DialogflowQuerySource agent + */ - /** - * Calls UpdateIntent. - * @function updateIntent - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IUpdateIntentRequest} request UpdateIntentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Constructs a new DialogflowQuerySource. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @classdesc Represents a DialogflowQuerySource. + * @implements IDialogflowQuerySource + * @constructor + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource=} [properties] Properties to set + */ + function DialogflowQuerySource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#deleteIntent}. - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @typedef DeleteIntentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ + /** + * DialogflowQuerySource agent. + * @member {string} agent + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @instance + */ + DialogflowQuerySource.prototype.agent = ""; - /** - * Calls DeleteIntent. - * @function deleteIntent - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteIntentRequest} request DeleteIntentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Intents.DeleteIntentCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Intents.prototype.deleteIntent = function deleteIntent(request, callback) { - return this.rpcCall(deleteIntent, $root.google.cloud.dialogflow.v2beta1.DeleteIntentRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteIntent" }); + /** + * Creates a new DialogflowQuerySource instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource} DialogflowQuerySource instance + */ + DialogflowQuerySource.create = function create(properties) { + return new DialogflowQuerySource(properties); + }; - /** - * Calls DeleteIntent. - * @function deleteIntent - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteIntentRequest} request DeleteIntentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Encodes the specified DialogflowQuerySource message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource} message DialogflowQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DialogflowQuerySource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); + return writer; + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#batchUpdateIntents}. - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @typedef BatchUpdateIntentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Encodes the specified DialogflowQuerySource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource} message DialogflowQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DialogflowQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls BatchUpdateIntents. - * @function batchUpdateIntents - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest} request BatchUpdateIntentsRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Intents.BatchUpdateIntentsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Intents.prototype.batchUpdateIntents = function batchUpdateIntents(request, callback) { - return this.rpcCall(batchUpdateIntents, $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchUpdateIntents" }); + /** + * Decodes a DialogflowQuerySource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource} DialogflowQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DialogflowQuerySource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.agent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Calls BatchUpdateIntents. - * @function batchUpdateIntents - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest} request BatchUpdateIntentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a DialogflowQuerySource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource} DialogflowQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DialogflowQuerySource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#batchDeleteIntents}. - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @typedef BatchDeleteIntentsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ + /** + * Verifies a DialogflowQuerySource message. + * @function verify + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DialogflowQuerySource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + return null; + }; - /** - * Calls BatchDeleteIntents. - * @function batchDeleteIntents - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest} request BatchDeleteIntentsRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Intents.BatchDeleteIntentsCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Intents.prototype.batchDeleteIntents = function batchDeleteIntents(request, callback) { - return this.rpcCall(batchDeleteIntents, $root.google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "BatchDeleteIntents" }); + /** + * Creates a DialogflowQuerySource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource} DialogflowQuerySource + */ + DialogflowQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource) + return object; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource(); + if (object.agent != null) + message.agent = String(object.agent); + return message; + }; - /** - * Calls BatchDeleteIntents. - * @function batchDeleteIntents - * @memberof google.cloud.dialogflow.v2beta1.Intents - * @instance - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest} request BatchDeleteIntentsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a plain object from a DialogflowQuerySource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource} message DialogflowQuerySource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DialogflowQuerySource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.agent = ""; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + return object; + }; - return Intents; - })(); + /** + * Converts this DialogflowQuerySource to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @instance + * @returns {Object.} JSON object + */ + DialogflowQuerySource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - v2beta1.Intent = (function() { + return DialogflowQuerySource; + })(); - /** - * Properties of an Intent. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IIntent - * @property {string|null} [name] Intent name - * @property {string|null} [displayName] Intent displayName - * @property {google.cloud.dialogflow.v2beta1.Intent.WebhookState|null} [webhookState] Intent webhookState - * @property {number|null} [priority] Intent priority - * @property {boolean|null} [isFallback] Intent isFallback - * @property {boolean|null} [mlEnabled] Intent mlEnabled - * @property {boolean|null} [mlDisabled] Intent mlDisabled - * @property {boolean|null} [endInteraction] Intent endInteraction - * @property {Array.|null} [inputContextNames] Intent inputContextNames - * @property {Array.|null} [events] Intent events - * @property {Array.|null} [trainingPhrases] Intent trainingPhrases - * @property {string|null} [action] Intent action - * @property {Array.|null} [outputContexts] Intent outputContexts - * @property {boolean|null} [resetContexts] Intent resetContexts - * @property {Array.|null} [parameters] Intent parameters - * @property {Array.|null} [messages] Intent messages - * @property {Array.|null} [defaultResponsePlatforms] Intent defaultResponsePlatforms - * @property {string|null} [rootFollowupIntentName] Intent rootFollowupIntentName - * @property {string|null} [parentFollowupIntentName] Intent parentFollowupIntentName - * @property {Array.|null} [followupIntentInfo] Intent followupIntentInfo - */ + SuggestionQueryConfig.ContextFilterSettings = (function() { - /** - * Constructs a new Intent. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an Intent. - * @implements IIntent - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IIntent=} [properties] Properties to set - */ - function Intent(properties) { - this.inputContextNames = []; - this.events = []; - this.trainingPhrases = []; - this.outputContexts = []; - this.parameters = []; - this.messages = []; - this.defaultResponsePlatforms = []; - this.followupIntentInfo = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a ContextFilterSettings. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @interface IContextFilterSettings + * @property {boolean|null} [dropHandoffMessages] ContextFilterSettings dropHandoffMessages + * @property {boolean|null} [dropVirtualAgentMessages] ContextFilterSettings dropVirtualAgentMessages + * @property {boolean|null} [dropIvrMessages] ContextFilterSettings dropIvrMessages + */ - /** - * Intent name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.name = ""; + /** + * Constructs a new ContextFilterSettings. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig + * @classdesc Represents a ContextFilterSettings. + * @implements IContextFilterSettings + * @constructor + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings=} [properties] Properties to set + */ + function ContextFilterSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Intent displayName. - * @member {string} displayName - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.displayName = ""; + /** + * ContextFilterSettings dropHandoffMessages. + * @member {boolean} dropHandoffMessages + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @instance + */ + ContextFilterSettings.prototype.dropHandoffMessages = false; - /** - * Intent webhookState. - * @member {google.cloud.dialogflow.v2beta1.Intent.WebhookState} webhookState - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.webhookState = 0; + /** + * ContextFilterSettings dropVirtualAgentMessages. + * @member {boolean} dropVirtualAgentMessages + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @instance + */ + ContextFilterSettings.prototype.dropVirtualAgentMessages = false; - /** - * Intent priority. - * @member {number} priority - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.priority = 0; + /** + * ContextFilterSettings dropIvrMessages. + * @member {boolean} dropIvrMessages + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @instance + */ + ContextFilterSettings.prototype.dropIvrMessages = false; - /** - * Intent isFallback. - * @member {boolean} isFallback - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.isFallback = false; + /** + * Creates a new ContextFilterSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings} ContextFilterSettings instance + */ + ContextFilterSettings.create = function create(properties) { + return new ContextFilterSettings(properties); + }; - /** - * Intent mlEnabled. - * @member {boolean} mlEnabled - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.mlEnabled = false; + /** + * Encodes the specified ContextFilterSettings message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings} message ContextFilterSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextFilterSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dropHandoffMessages != null && Object.hasOwnProperty.call(message, "dropHandoffMessages")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.dropHandoffMessages); + if (message.dropVirtualAgentMessages != null && Object.hasOwnProperty.call(message, "dropVirtualAgentMessages")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.dropVirtualAgentMessages); + if (message.dropIvrMessages != null && Object.hasOwnProperty.call(message, "dropIvrMessages")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dropIvrMessages); + return writer; + }; - /** - * Intent mlDisabled. - * @member {boolean} mlDisabled - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.mlDisabled = false; + /** + * Encodes the specified ContextFilterSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings} message ContextFilterSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextFilterSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Intent endInteraction. - * @member {boolean} endInteraction - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.endInteraction = false; + /** + * Decodes a ContextFilterSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings} ContextFilterSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextFilterSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dropHandoffMessages = reader.bool(); + break; + case 2: + message.dropVirtualAgentMessages = reader.bool(); + break; + case 3: + message.dropIvrMessages = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Intent inputContextNames. - * @member {Array.} inputContextNames - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.inputContextNames = $util.emptyArray; + /** + * Decodes a ContextFilterSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings} ContextFilterSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextFilterSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Intent events. - * @member {Array.} events - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.events = $util.emptyArray; + /** + * Verifies a ContextFilterSettings message. + * @function verify + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContextFilterSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dropHandoffMessages != null && message.hasOwnProperty("dropHandoffMessages")) + if (typeof message.dropHandoffMessages !== "boolean") + return "dropHandoffMessages: boolean expected"; + if (message.dropVirtualAgentMessages != null && message.hasOwnProperty("dropVirtualAgentMessages")) + if (typeof message.dropVirtualAgentMessages !== "boolean") + return "dropVirtualAgentMessages: boolean expected"; + if (message.dropIvrMessages != null && message.hasOwnProperty("dropIvrMessages")) + if (typeof message.dropIvrMessages !== "boolean") + return "dropIvrMessages: boolean expected"; + return null; + }; - /** - * Intent trainingPhrases. - * @member {Array.} trainingPhrases - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.trainingPhrases = $util.emptyArray; + /** + * Creates a ContextFilterSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings} ContextFilterSettings + */ + ContextFilterSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings) + return object; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings(); + if (object.dropHandoffMessages != null) + message.dropHandoffMessages = Boolean(object.dropHandoffMessages); + if (object.dropVirtualAgentMessages != null) + message.dropVirtualAgentMessages = Boolean(object.dropVirtualAgentMessages); + if (object.dropIvrMessages != null) + message.dropIvrMessages = Boolean(object.dropIvrMessages); + return message; + }; - /** - * Intent action. - * @member {string} action - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.action = ""; + /** + * Creates a plain object from a ContextFilterSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings} message ContextFilterSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContextFilterSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dropHandoffMessages = false; + object.dropVirtualAgentMessages = false; + object.dropIvrMessages = false; + } + if (message.dropHandoffMessages != null && message.hasOwnProperty("dropHandoffMessages")) + object.dropHandoffMessages = message.dropHandoffMessages; + if (message.dropVirtualAgentMessages != null && message.hasOwnProperty("dropVirtualAgentMessages")) + object.dropVirtualAgentMessages = message.dropVirtualAgentMessages; + if (message.dropIvrMessages != null && message.hasOwnProperty("dropIvrMessages")) + object.dropIvrMessages = message.dropIvrMessages; + return object; + }; - /** - * Intent outputContexts. - * @member {Array.} outputContexts - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.outputContexts = $util.emptyArray; + /** + * Converts this ContextFilterSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @instance + * @returns {Object.} JSON object + */ + ContextFilterSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Intent resetContexts. - * @member {boolean} resetContexts - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.resetContexts = false; + return ContextFilterSettings; + })(); - /** - * Intent parameters. - * @member {Array.} parameters - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.parameters = $util.emptyArray; + return SuggestionQueryConfig; + })(); - /** - * Intent messages. - * @member {Array.} messages - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.messages = $util.emptyArray; + HumanAgentAssistantConfig.ConversationModelConfig = (function() { - /** - * Intent defaultResponsePlatforms. - * @member {Array.} defaultResponsePlatforms - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.defaultResponsePlatforms = $util.emptyArray; + /** + * Properties of a ConversationModelConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @interface IConversationModelConfig + * @property {string|null} [model] ConversationModelConfig model + */ - /** - * Intent rootFollowupIntentName. - * @member {string} rootFollowupIntentName - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.rootFollowupIntentName = ""; + /** + * Constructs a new ConversationModelConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @classdesc Represents a ConversationModelConfig. + * @implements IConversationModelConfig + * @constructor + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IConversationModelConfig=} [properties] Properties to set + */ + function ConversationModelConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Intent parentFollowupIntentName. - * @member {string} parentFollowupIntentName - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.parentFollowupIntentName = ""; + /** + * ConversationModelConfig model. + * @member {string} model + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig + * @instance + */ + ConversationModelConfig.prototype.model = ""; - /** - * Intent followupIntentInfo. - * @member {Array.} followupIntentInfo - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @instance - */ - Intent.prototype.followupIntentInfo = $util.emptyArray; + /** + * Creates a new ConversationModelConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IConversationModelConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig} ConversationModelConfig instance + */ + ConversationModelConfig.create = function create(properties) { + return new ConversationModelConfig(properties); + }; - /** - * Creates a new Intent instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @static - * @param {google.cloud.dialogflow.v2beta1.IIntent=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent} Intent instance - */ - Intent.create = function create(properties) { - return new Intent(properties); - }; + /** + * Encodes the specified ConversationModelConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IConversationModelConfig} message ConversationModelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationModelConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; - /** - * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @static - * @param {google.cloud.dialogflow.v2beta1.IIntent} message Intent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Intent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.priority); - if (message.isFallback != null && Object.hasOwnProperty.call(message, "isFallback")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isFallback); - if (message.mlEnabled != null && Object.hasOwnProperty.call(message, "mlEnabled")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.mlEnabled); - if (message.webhookState != null && Object.hasOwnProperty.call(message, "webhookState")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.webhookState); - if (message.inputContextNames != null && message.inputContextNames.length) - for (var i = 0; i < message.inputContextNames.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.inputContextNames[i]); - if (message.events != null && message.events.length) - for (var i = 0; i < message.events.length; ++i) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.events[i]); - if (message.trainingPhrases != null && message.trainingPhrases.length) - for (var i = 0; i < message.trainingPhrases.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.encode(message.trainingPhrases[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.action); - if (message.outputContexts != null && message.outputContexts.length) - for (var i = 0; i < message.outputContexts.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Context.encode(message.outputContexts[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.resetContexts != null && Object.hasOwnProperty.call(message, "resetContexts")) - writer.uint32(/* id 12, wireType 0 =*/96).bool(message.resetContexts); - if (message.parameters != null && message.parameters.length) - for (var i = 0; i < message.parameters.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Parameter.encode(message.parameters[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.messages != null && message.messages.length) - for (var i = 0; i < message.messages.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.encode(message.messages[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.defaultResponsePlatforms != null && message.defaultResponsePlatforms.length) { - writer.uint32(/* id 15, wireType 2 =*/122).fork(); - for (var i = 0; i < message.defaultResponsePlatforms.length; ++i) - writer.int32(message.defaultResponsePlatforms[i]); - writer.ldelim(); + /** + * Encodes the specified ConversationModelConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IConversationModelConfig} message ConversationModelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationModelConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConversationModelConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig} ConversationModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationModelConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.model = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConversationModelConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig} ConversationModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationModelConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversationModelConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationModelConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; + + /** + * Creates a ConversationModelConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig} ConversationModelConfig + */ + ConversationModelConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; + + /** + * Creates a plain object from a ConversationModelConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig} message ConversationModelConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationModelConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; + + /** + * Converts this ConversationModelConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.ConversationModelConfig + * @instance + * @returns {Object.} JSON object + */ + ConversationModelConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConversationModelConfig; + })(); + + HumanAgentAssistantConfig.MessageAnalysisConfig = (function() { + + /** + * Properties of a MessageAnalysisConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @interface IMessageAnalysisConfig + * @property {boolean|null} [enableEntityExtraction] MessageAnalysisConfig enableEntityExtraction + * @property {boolean|null} [enableSentimentAnalysis] MessageAnalysisConfig enableSentimentAnalysis + */ + + /** + * Constructs a new MessageAnalysisConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig + * @classdesc Represents a MessageAnalysisConfig. + * @implements IMessageAnalysisConfig + * @constructor + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IMessageAnalysisConfig=} [properties] Properties to set + */ + function MessageAnalysisConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - if (message.rootFollowupIntentName != null && Object.hasOwnProperty.call(message, "rootFollowupIntentName")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.rootFollowupIntentName); - if (message.parentFollowupIntentName != null && Object.hasOwnProperty.call(message, "parentFollowupIntentName")) - writer.uint32(/* id 17, wireType 2 =*/138).string(message.parentFollowupIntentName); - if (message.followupIntentInfo != null && message.followupIntentInfo.length) - for (var i = 0; i < message.followupIntentInfo.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.encode(message.followupIntentInfo[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.mlDisabled != null && Object.hasOwnProperty.call(message, "mlDisabled")) - writer.uint32(/* id 19, wireType 0 =*/152).bool(message.mlDisabled); - if (message.endInteraction != null && Object.hasOwnProperty.call(message, "endInteraction")) - writer.uint32(/* id 21, wireType 0 =*/168).bool(message.endInteraction); + + /** + * MessageAnalysisConfig enableEntityExtraction. + * @member {boolean} enableEntityExtraction + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + * @instance + */ + MessageAnalysisConfig.prototype.enableEntityExtraction = false; + + /** + * MessageAnalysisConfig enableSentimentAnalysis. + * @member {boolean} enableSentimentAnalysis + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + * @instance + */ + MessageAnalysisConfig.prototype.enableSentimentAnalysis = false; + + /** + * Creates a new MessageAnalysisConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IMessageAnalysisConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig} MessageAnalysisConfig instance + */ + MessageAnalysisConfig.create = function create(properties) { + return new MessageAnalysisConfig(properties); + }; + + /** + * Encodes the specified MessageAnalysisConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IMessageAnalysisConfig} message MessageAnalysisConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageAnalysisConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableEntityExtraction != null && Object.hasOwnProperty.call(message, "enableEntityExtraction")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableEntityExtraction); + if (message.enableSentimentAnalysis != null && Object.hasOwnProperty.call(message, "enableSentimentAnalysis")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableSentimentAnalysis); + return writer; + }; + + /** + * Encodes the specified MessageAnalysisConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.IMessageAnalysisConfig} message MessageAnalysisConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageAnalysisConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageAnalysisConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig} MessageAnalysisConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageAnalysisConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.enableEntityExtraction = reader.bool(); + break; + case 3: + message.enableSentimentAnalysis = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageAnalysisConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig} MessageAnalysisConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageAnalysisConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageAnalysisConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageAnalysisConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableEntityExtraction != null && message.hasOwnProperty("enableEntityExtraction")) + if (typeof message.enableEntityExtraction !== "boolean") + return "enableEntityExtraction: boolean expected"; + if (message.enableSentimentAnalysis != null && message.hasOwnProperty("enableSentimentAnalysis")) + if (typeof message.enableSentimentAnalysis !== "boolean") + return "enableSentimentAnalysis: boolean expected"; + return null; + }; + + /** + * Creates a MessageAnalysisConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig} MessageAnalysisConfig + */ + MessageAnalysisConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig(); + if (object.enableEntityExtraction != null) + message.enableEntityExtraction = Boolean(object.enableEntityExtraction); + if (object.enableSentimentAnalysis != null) + message.enableSentimentAnalysis = Boolean(object.enableSentimentAnalysis); + return message; + }; + + /** + * Creates a plain object from a MessageAnalysisConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig} message MessageAnalysisConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageAnalysisConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableEntityExtraction = false; + object.enableSentimentAnalysis = false; + } + if (message.enableEntityExtraction != null && message.hasOwnProperty("enableEntityExtraction")) + object.enableEntityExtraction = message.enableEntityExtraction; + if (message.enableSentimentAnalysis != null && message.hasOwnProperty("enableSentimentAnalysis")) + object.enableSentimentAnalysis = message.enableSentimentAnalysis; + return object; + }; + + /** + * Converts this MessageAnalysisConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantConfig.MessageAnalysisConfig + * @instance + * @returns {Object.} JSON object + */ + MessageAnalysisConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MessageAnalysisConfig; + })(); + + return HumanAgentAssistantConfig; + })(); + + v2.HumanAgentHandoffConfig = (function() { + + /** + * Properties of a HumanAgentHandoffConfig. + * @memberof google.cloud.dialogflow.v2 + * @interface IHumanAgentHandoffConfig + * @property {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ILivePersonConfig|null} [livePersonConfig] HumanAgentHandoffConfig livePersonConfig + * @property {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig|null} [salesforceLiveAgentConfig] HumanAgentHandoffConfig salesforceLiveAgentConfig + */ + + /** + * Constructs a new HumanAgentHandoffConfig. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a HumanAgentHandoffConfig. + * @implements IHumanAgentHandoffConfig + * @constructor + * @param {google.cloud.dialogflow.v2.IHumanAgentHandoffConfig=} [properties] Properties to set + */ + function HumanAgentHandoffConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HumanAgentHandoffConfig livePersonConfig. + * @member {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ILivePersonConfig|null|undefined} livePersonConfig + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig + * @instance + */ + HumanAgentHandoffConfig.prototype.livePersonConfig = null; + + /** + * HumanAgentHandoffConfig salesforceLiveAgentConfig. + * @member {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig|null|undefined} salesforceLiveAgentConfig + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig + * @instance + */ + HumanAgentHandoffConfig.prototype.salesforceLiveAgentConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HumanAgentHandoffConfig agentService. + * @member {"livePersonConfig"|"salesforceLiveAgentConfig"|undefined} agentService + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig + * @instance + */ + Object.defineProperty(HumanAgentHandoffConfig.prototype, "agentService", { + get: $util.oneOfGetter($oneOfFields = ["livePersonConfig", "salesforceLiveAgentConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HumanAgentHandoffConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig + * @static + * @param {google.cloud.dialogflow.v2.IHumanAgentHandoffConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentHandoffConfig} HumanAgentHandoffConfig instance + */ + HumanAgentHandoffConfig.create = function create(properties) { + return new HumanAgentHandoffConfig(properties); + }; + + /** + * Encodes the specified HumanAgentHandoffConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentHandoffConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig + * @static + * @param {google.cloud.dialogflow.v2.IHumanAgentHandoffConfig} message HumanAgentHandoffConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanAgentHandoffConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.livePersonConfig != null && Object.hasOwnProperty.call(message, "livePersonConfig")) + $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig.encode(message.livePersonConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.salesforceLiveAgentConfig != null && Object.hasOwnProperty.call(message, "salesforceLiveAgentConfig")) + $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.encode(message.salesforceLiveAgentConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.verify|verify} messages. + * Encodes the specified HumanAgentHandoffConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentHandoffConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IIntent} message Intent message or plain object to encode + * @param {google.cloud.dialogflow.v2.IHumanAgentHandoffConfig} message HumanAgentHandoffConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Intent.encodeDelimited = function encodeDelimited(message, writer) { + HumanAgentHandoffConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an Intent message from the specified reader or buffer. + * Decodes a HumanAgentHandoffConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent} Intent + * @returns {google.cloud.dialogflow.v2.HumanAgentHandoffConfig} HumanAgentHandoffConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Intent.decode = function decode(reader, length) { + HumanAgentHandoffConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.livePersonConfig = $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig.decode(reader, reader.uint32()); break; case 2: - message.displayName = reader.string(); - break; - case 6: - message.webhookState = reader.int32(); - break; - case 3: - message.priority = reader.int32(); - break; - case 4: - message.isFallback = reader.bool(); - break; - case 5: - message.mlEnabled = reader.bool(); - break; - case 19: - message.mlDisabled = reader.bool(); - break; - case 21: - message.endInteraction = reader.bool(); - break; - case 7: - if (!(message.inputContextNames && message.inputContextNames.length)) - message.inputContextNames = []; - message.inputContextNames.push(reader.string()); - break; - case 8: - if (!(message.events && message.events.length)) - message.events = []; - message.events.push(reader.string()); - break; - case 9: - if (!(message.trainingPhrases && message.trainingPhrases.length)) - message.trainingPhrases = []; - message.trainingPhrases.push($root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.decode(reader, reader.uint32())); - break; - case 10: - message.action = reader.string(); - break; - case 11: - if (!(message.outputContexts && message.outputContexts.length)) - message.outputContexts = []; - message.outputContexts.push($root.google.cloud.dialogflow.v2beta1.Context.decode(reader, reader.uint32())); - break; - case 12: - message.resetContexts = reader.bool(); - break; - case 13: - if (!(message.parameters && message.parameters.length)) - message.parameters = []; - message.parameters.push($root.google.cloud.dialogflow.v2beta1.Intent.Parameter.decode(reader, reader.uint32())); - break; - case 14: - if (!(message.messages && message.messages.length)) - message.messages = []; - message.messages.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.decode(reader, reader.uint32())); - break; - case 15: - if (!(message.defaultResponsePlatforms && message.defaultResponsePlatforms.length)) - message.defaultResponsePlatforms = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.defaultResponsePlatforms.push(reader.int32()); - } else - message.defaultResponsePlatforms.push(reader.int32()); - break; - case 16: - message.rootFollowupIntentName = reader.string(); - break; - case 17: - message.parentFollowupIntentName = reader.string(); - break; - case 18: - if (!(message.followupIntentInfo && message.followupIntentInfo.length)) - message.followupIntentInfo = []; - message.followupIntentInfo.push($root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.decode(reader, reader.uint32())); + message.salesforceLiveAgentConfig = $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -47955,462 +48212,134 @@ }; /** - * Decodes an Intent message from the specified reader or buffer, length delimited. + * Decodes a HumanAgentHandoffConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent} Intent + * @returns {google.cloud.dialogflow.v2.HumanAgentHandoffConfig} HumanAgentHandoffConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Intent.decodeDelimited = function decodeDelimited(reader) { + HumanAgentHandoffConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an Intent message. + * Verifies a HumanAgentHandoffConfig message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Intent.verify = function verify(message) { + HumanAgentHandoffConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.webhookState != null && message.hasOwnProperty("webhookState")) - switch (message.webhookState) { - default: - return "webhookState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.priority != null && message.hasOwnProperty("priority")) - if (!$util.isInteger(message.priority)) - return "priority: integer expected"; - if (message.isFallback != null && message.hasOwnProperty("isFallback")) - if (typeof message.isFallback !== "boolean") - return "isFallback: boolean expected"; - if (message.mlEnabled != null && message.hasOwnProperty("mlEnabled")) - if (typeof message.mlEnabled !== "boolean") - return "mlEnabled: boolean expected"; - if (message.mlDisabled != null && message.hasOwnProperty("mlDisabled")) - if (typeof message.mlDisabled !== "boolean") - return "mlDisabled: boolean expected"; - if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) - if (typeof message.endInteraction !== "boolean") - return "endInteraction: boolean expected"; - if (message.inputContextNames != null && message.hasOwnProperty("inputContextNames")) { - if (!Array.isArray(message.inputContextNames)) - return "inputContextNames: array expected"; - for (var i = 0; i < message.inputContextNames.length; ++i) - if (!$util.isString(message.inputContextNames[i])) - return "inputContextNames: string[] expected"; - } - if (message.events != null && message.hasOwnProperty("events")) { - if (!Array.isArray(message.events)) - return "events: array expected"; - for (var i = 0; i < message.events.length; ++i) - if (!$util.isString(message.events[i])) - return "events: string[] expected"; - } - if (message.trainingPhrases != null && message.hasOwnProperty("trainingPhrases")) { - if (!Array.isArray(message.trainingPhrases)) - return "trainingPhrases: array expected"; - for (var i = 0; i < message.trainingPhrases.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.verify(message.trainingPhrases[i]); + var properties = {}; + if (message.livePersonConfig != null && message.hasOwnProperty("livePersonConfig")) { + properties.agentService = 1; + { + var error = $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig.verify(message.livePersonConfig); if (error) - return "trainingPhrases." + error; + return "livePersonConfig." + error; } } - if (message.action != null && message.hasOwnProperty("action")) - if (!$util.isString(message.action)) - return "action: string expected"; - if (message.outputContexts != null && message.hasOwnProperty("outputContexts")) { - if (!Array.isArray(message.outputContexts)) - return "outputContexts: array expected"; - for (var i = 0; i < message.outputContexts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Context.verify(message.outputContexts[i]); + if (message.salesforceLiveAgentConfig != null && message.hasOwnProperty("salesforceLiveAgentConfig")) { + if (properties.agentService === 1) + return "agentService: multiple values"; + properties.agentService = 1; + { + var error = $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.verify(message.salesforceLiveAgentConfig); if (error) - return "outputContexts." + error; + return "salesforceLiveAgentConfig." + error; } } - if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) - if (typeof message.resetContexts !== "boolean") - return "resetContexts: boolean expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - if (!Array.isArray(message.parameters)) - return "parameters: array expected"; - for (var i = 0; i < message.parameters.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Parameter.verify(message.parameters[i]); - if (error) - return "parameters." + error; - } + return null; + }; + + /** + * Creates a HumanAgentHandoffConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.HumanAgentHandoffConfig} HumanAgentHandoffConfig + */ + HumanAgentHandoffConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig(); + if (object.livePersonConfig != null) { + if (typeof object.livePersonConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentHandoffConfig.livePersonConfig: object expected"); + message.livePersonConfig = $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig.fromObject(object.livePersonConfig); } - if (message.messages != null && message.hasOwnProperty("messages")) { - if (!Array.isArray(message.messages)) - return "messages: array expected"; - for (var i = 0; i < message.messages.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.verify(message.messages[i]); - if (error) - return "messages." + error; - } - } - if (message.defaultResponsePlatforms != null && message.hasOwnProperty("defaultResponsePlatforms")) { - if (!Array.isArray(message.defaultResponsePlatforms)) - return "defaultResponsePlatforms: array expected"; - for (var i = 0; i < message.defaultResponsePlatforms.length; ++i) - switch (message.defaultResponsePlatforms[i]) { - default: - return "defaultResponsePlatforms: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 10: - case 11: - break; - } - } - if (message.rootFollowupIntentName != null && message.hasOwnProperty("rootFollowupIntentName")) - if (!$util.isString(message.rootFollowupIntentName)) - return "rootFollowupIntentName: string expected"; - if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) - if (!$util.isString(message.parentFollowupIntentName)) - return "parentFollowupIntentName: string expected"; - if (message.followupIntentInfo != null && message.hasOwnProperty("followupIntentInfo")) { - if (!Array.isArray(message.followupIntentInfo)) - return "followupIntentInfo: array expected"; - for (var i = 0; i < message.followupIntentInfo.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.verify(message.followupIntentInfo[i]); - if (error) - return "followupIntentInfo." + error; - } - } - return null; - }; - - /** - * Creates an Intent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent} Intent - */ - Intent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - switch (object.webhookState) { - case "WEBHOOK_STATE_UNSPECIFIED": - case 0: - message.webhookState = 0; - break; - case "WEBHOOK_STATE_ENABLED": - case 1: - message.webhookState = 1; - break; - case "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING": - case 2: - message.webhookState = 2; - break; - } - if (object.priority != null) - message.priority = object.priority | 0; - if (object.isFallback != null) - message.isFallback = Boolean(object.isFallback); - if (object.mlEnabled != null) - message.mlEnabled = Boolean(object.mlEnabled); - if (object.mlDisabled != null) - message.mlDisabled = Boolean(object.mlDisabled); - if (object.endInteraction != null) - message.endInteraction = Boolean(object.endInteraction); - if (object.inputContextNames) { - if (!Array.isArray(object.inputContextNames)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.inputContextNames: array expected"); - message.inputContextNames = []; - for (var i = 0; i < object.inputContextNames.length; ++i) - message.inputContextNames[i] = String(object.inputContextNames[i]); - } - if (object.events) { - if (!Array.isArray(object.events)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.events: array expected"); - message.events = []; - for (var i = 0; i < object.events.length; ++i) - message.events[i] = String(object.events[i]); - } - if (object.trainingPhrases) { - if (!Array.isArray(object.trainingPhrases)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.trainingPhrases: array expected"); - message.trainingPhrases = []; - for (var i = 0; i < object.trainingPhrases.length; ++i) { - if (typeof object.trainingPhrases[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.trainingPhrases: object expected"); - message.trainingPhrases[i] = $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.fromObject(object.trainingPhrases[i]); - } - } - if (object.action != null) - message.action = String(object.action); - if (object.outputContexts) { - if (!Array.isArray(object.outputContexts)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.outputContexts: array expected"); - message.outputContexts = []; - for (var i = 0; i < object.outputContexts.length; ++i) { - if (typeof object.outputContexts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.outputContexts: object expected"); - message.outputContexts[i] = $root.google.cloud.dialogflow.v2beta1.Context.fromObject(object.outputContexts[i]); - } - } - if (object.resetContexts != null) - message.resetContexts = Boolean(object.resetContexts); - if (object.parameters) { - if (!Array.isArray(object.parameters)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.parameters: array expected"); - message.parameters = []; - for (var i = 0; i < object.parameters.length; ++i) { - if (typeof object.parameters[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.parameters: object expected"); - message.parameters[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Parameter.fromObject(object.parameters[i]); - } - } - if (object.messages) { - if (!Array.isArray(object.messages)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.messages: array expected"); - message.messages = []; - for (var i = 0; i < object.messages.length; ++i) { - if (typeof object.messages[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.messages: object expected"); - message.messages[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.fromObject(object.messages[i]); - } - } - if (object.defaultResponsePlatforms) { - if (!Array.isArray(object.defaultResponsePlatforms)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.defaultResponsePlatforms: array expected"); - message.defaultResponsePlatforms = []; - for (var i = 0; i < object.defaultResponsePlatforms.length; ++i) - switch (object.defaultResponsePlatforms[i]) { - default: - case "PLATFORM_UNSPECIFIED": - case 0: - message.defaultResponsePlatforms[i] = 0; - break; - case "FACEBOOK": - case 1: - message.defaultResponsePlatforms[i] = 1; - break; - case "SLACK": - case 2: - message.defaultResponsePlatforms[i] = 2; - break; - case "TELEGRAM": - case 3: - message.defaultResponsePlatforms[i] = 3; - break; - case "KIK": - case 4: - message.defaultResponsePlatforms[i] = 4; - break; - case "SKYPE": - case 5: - message.defaultResponsePlatforms[i] = 5; - break; - case "LINE": - case 6: - message.defaultResponsePlatforms[i] = 6; - break; - case "VIBER": - case 7: - message.defaultResponsePlatforms[i] = 7; - break; - case "ACTIONS_ON_GOOGLE": - case 8: - message.defaultResponsePlatforms[i] = 8; - break; - case "TELEPHONY": - case 10: - message.defaultResponsePlatforms[i] = 10; - break; - case "GOOGLE_HANGOUTS": - case 11: - message.defaultResponsePlatforms[i] = 11; - break; - } - } - if (object.rootFollowupIntentName != null) - message.rootFollowupIntentName = String(object.rootFollowupIntentName); - if (object.parentFollowupIntentName != null) - message.parentFollowupIntentName = String(object.parentFollowupIntentName); - if (object.followupIntentInfo) { - if (!Array.isArray(object.followupIntentInfo)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.followupIntentInfo: array expected"); - message.followupIntentInfo = []; - for (var i = 0; i < object.followupIntentInfo.length; ++i) { - if (typeof object.followupIntentInfo[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.followupIntentInfo: object expected"); - message.followupIntentInfo[i] = $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.fromObject(object.followupIntentInfo[i]); - } + if (object.salesforceLiveAgentConfig != null) { + if (typeof object.salesforceLiveAgentConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentHandoffConfig.salesforceLiveAgentConfig: object expected"); + message.salesforceLiveAgentConfig = $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.fromObject(object.salesforceLiveAgentConfig); } return message; }; /** - * Creates a plain object from an Intent message. Also converts values to other types if specified. + * Creates a plain object from a HumanAgentHandoffConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig * @static - * @param {google.cloud.dialogflow.v2beta1.Intent} message Intent + * @param {google.cloud.dialogflow.v2.HumanAgentHandoffConfig} message HumanAgentHandoffConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Intent.toObject = function toObject(message, options) { + HumanAgentHandoffConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.inputContextNames = []; - object.events = []; - object.trainingPhrases = []; - object.outputContexts = []; - object.parameters = []; - object.messages = []; - object.defaultResponsePlatforms = []; - object.followupIntentInfo = []; - } - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.priority = 0; - object.isFallback = false; - object.mlEnabled = false; - object.webhookState = options.enums === String ? "WEBHOOK_STATE_UNSPECIFIED" : 0; - object.action = ""; - object.resetContexts = false; - object.rootFollowupIntentName = ""; - object.parentFollowupIntentName = ""; - object.mlDisabled = false; - object.endInteraction = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.priority != null && message.hasOwnProperty("priority")) - object.priority = message.priority; - if (message.isFallback != null && message.hasOwnProperty("isFallback")) - object.isFallback = message.isFallback; - if (message.mlEnabled != null && message.hasOwnProperty("mlEnabled")) - object.mlEnabled = message.mlEnabled; - if (message.webhookState != null && message.hasOwnProperty("webhookState")) - object.webhookState = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.WebhookState[message.webhookState] : message.webhookState; - if (message.inputContextNames && message.inputContextNames.length) { - object.inputContextNames = []; - for (var j = 0; j < message.inputContextNames.length; ++j) - object.inputContextNames[j] = message.inputContextNames[j]; - } - if (message.events && message.events.length) { - object.events = []; - for (var j = 0; j < message.events.length; ++j) - object.events[j] = message.events[j]; - } - if (message.trainingPhrases && message.trainingPhrases.length) { - object.trainingPhrases = []; - for (var j = 0; j < message.trainingPhrases.length; ++j) - object.trainingPhrases[j] = $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.toObject(message.trainingPhrases[j], options); - } - if (message.action != null && message.hasOwnProperty("action")) - object.action = message.action; - if (message.outputContexts && message.outputContexts.length) { - object.outputContexts = []; - for (var j = 0; j < message.outputContexts.length; ++j) - object.outputContexts[j] = $root.google.cloud.dialogflow.v2beta1.Context.toObject(message.outputContexts[j], options); - } - if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) - object.resetContexts = message.resetContexts; - if (message.parameters && message.parameters.length) { - object.parameters = []; - for (var j = 0; j < message.parameters.length; ++j) - object.parameters[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Parameter.toObject(message.parameters[j], options); - } - if (message.messages && message.messages.length) { - object.messages = []; - for (var j = 0; j < message.messages.length; ++j) - object.messages[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.toObject(message.messages[j], options); - } - if (message.defaultResponsePlatforms && message.defaultResponsePlatforms.length) { - object.defaultResponsePlatforms = []; - for (var j = 0; j < message.defaultResponsePlatforms.length; ++j) - object.defaultResponsePlatforms[j] = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.Platform[message.defaultResponsePlatforms[j]] : message.defaultResponsePlatforms[j]; + if (message.livePersonConfig != null && message.hasOwnProperty("livePersonConfig")) { + object.livePersonConfig = $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig.toObject(message.livePersonConfig, options); + if (options.oneofs) + object.agentService = "livePersonConfig"; } - if (message.rootFollowupIntentName != null && message.hasOwnProperty("rootFollowupIntentName")) - object.rootFollowupIntentName = message.rootFollowupIntentName; - if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) - object.parentFollowupIntentName = message.parentFollowupIntentName; - if (message.followupIntentInfo && message.followupIntentInfo.length) { - object.followupIntentInfo = []; - for (var j = 0; j < message.followupIntentInfo.length; ++j) - object.followupIntentInfo[j] = $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.toObject(message.followupIntentInfo[j], options); + if (message.salesforceLiveAgentConfig != null && message.hasOwnProperty("salesforceLiveAgentConfig")) { + object.salesforceLiveAgentConfig = $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.toObject(message.salesforceLiveAgentConfig, options); + if (options.oneofs) + object.agentService = "salesforceLiveAgentConfig"; } - if (message.mlDisabled != null && message.hasOwnProperty("mlDisabled")) - object.mlDisabled = message.mlDisabled; - if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) - object.endInteraction = message.endInteraction; return object; }; /** - * Converts this Intent to JSON. + * Converts this HumanAgentHandoffConfig to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig * @instance * @returns {Object.} JSON object */ - Intent.prototype.toJSON = function toJSON() { + HumanAgentHandoffConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - Intent.TrainingPhrase = (function() { + HumanAgentHandoffConfig.LivePersonConfig = (function() { /** - * Properties of a TrainingPhrase. - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @interface ITrainingPhrase - * @property {string|null} [name] TrainingPhrase name - * @property {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type|null} [type] TrainingPhrase type - * @property {Array.|null} [parts] TrainingPhrase parts - * @property {number|null} [timesAddedCount] TrainingPhrase timesAddedCount + * Properties of a LivePersonConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig + * @interface ILivePersonConfig + * @property {string|null} [accountNumber] LivePersonConfig accountNumber */ /** - * Constructs a new TrainingPhrase. - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @classdesc Represents a TrainingPhrase. - * @implements ITrainingPhrase + * Constructs a new LivePersonConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig + * @classdesc Represents a LivePersonConfig. + * @implements ILivePersonConfig * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ILivePersonConfig=} [properties] Properties to set */ - function TrainingPhrase(properties) { - this.parts = []; + function LivePersonConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -48418,117 +48347,75 @@ } /** - * TrainingPhrase name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase - * @instance - */ - TrainingPhrase.prototype.name = ""; - - /** - * TrainingPhrase type. - * @member {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type} type - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase - * @instance - */ - TrainingPhrase.prototype.type = 0; - - /** - * TrainingPhrase parts. - * @member {Array.} parts - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase - * @instance - */ - TrainingPhrase.prototype.parts = $util.emptyArray; - - /** - * TrainingPhrase timesAddedCount. - * @member {number} timesAddedCount - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * LivePersonConfig accountNumber. + * @member {string} accountNumber + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig * @instance */ - TrainingPhrase.prototype.timesAddedCount = 0; + LivePersonConfig.prototype.accountNumber = ""; /** - * Creates a new TrainingPhrase instance using the specified properties. + * Creates a new LivePersonConfig instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase} TrainingPhrase instance + * @param {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ILivePersonConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig} LivePersonConfig instance */ - TrainingPhrase.create = function create(properties) { - return new TrainingPhrase(properties); + LivePersonConfig.create = function create(properties) { + return new LivePersonConfig(properties); }; /** - * Encodes the specified TrainingPhrase message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.verify|verify} messages. + * Encodes the specified LivePersonConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase} message TrainingPhrase message or plain object to encode + * @param {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ILivePersonConfig} message LivePersonConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TrainingPhrase.encode = function encode(message, writer) { + LivePersonConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); - if (message.parts != null && message.parts.length) - for (var i = 0; i < message.parts.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.encode(message.parts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.timesAddedCount != null && Object.hasOwnProperty.call(message, "timesAddedCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.timesAddedCount); + if (message.accountNumber != null && Object.hasOwnProperty.call(message, "accountNumber")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accountNumber); return writer; }; /** - * Encodes the specified TrainingPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.verify|verify} messages. + * Encodes the specified LivePersonConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase} message TrainingPhrase message or plain object to encode + * @param {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ILivePersonConfig} message LivePersonConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TrainingPhrase.encodeDelimited = function encodeDelimited(message, writer) { + LivePersonConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TrainingPhrase message from the specified reader or buffer. + * Decodes a LivePersonConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase} TrainingPhrase + * @returns {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig} LivePersonConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TrainingPhrase.decode = function decode(reader, length) { + LivePersonConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - message.type = reader.int32(); - break; - case 3: - if (!(message.parts && message.parts.length)) - message.parts = []; - message.parts.push($root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.decode(reader, reader.uint32())); - break; - case 4: - message.timesAddedCount = reader.int32(); + message.accountNumber = reader.string(); break; default: reader.skipType(tag & 7); @@ -48539,616 +48426,225 @@ }; /** - * Decodes a TrainingPhrase message from the specified reader or buffer, length delimited. + * Decodes a LivePersonConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase} TrainingPhrase + * @returns {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig} LivePersonConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TrainingPhrase.decodeDelimited = function decodeDelimited(reader) { + LivePersonConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TrainingPhrase message. + * Verifies a LivePersonConfig message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TrainingPhrase.verify = function verify(message) { + LivePersonConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.parts != null && message.hasOwnProperty("parts")) { - if (!Array.isArray(message.parts)) - return "parts: array expected"; - for (var i = 0; i < message.parts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.verify(message.parts[i]); - if (error) - return "parts." + error; - } - } - if (message.timesAddedCount != null && message.hasOwnProperty("timesAddedCount")) - if (!$util.isInteger(message.timesAddedCount)) - return "timesAddedCount: integer expected"; + if (message.accountNumber != null && message.hasOwnProperty("accountNumber")) + if (!$util.isString(message.accountNumber)) + return "accountNumber: string expected"; return null; }; /** - * Creates a TrainingPhrase message from a plain object. Also converts values to their respective internal types. + * Creates a LivePersonConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase} TrainingPhrase + * @returns {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig} LivePersonConfig */ - TrainingPhrase.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase) + LivePersonConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase(); - if (object.name != null) - message.name = String(object.name); - switch (object.type) { - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "EXAMPLE": - case 1: - message.type = 1; - break; - case "TEMPLATE": - case 2: - message.type = 2; - break; - } - if (object.parts) { - if (!Array.isArray(object.parts)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.parts: array expected"); - message.parts = []; - for (var i = 0; i < object.parts.length; ++i) { - if (typeof object.parts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.parts: object expected"); - message.parts[i] = $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.fromObject(object.parts[i]); - } - } - if (object.timesAddedCount != null) - message.timesAddedCount = object.timesAddedCount | 0; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig(); + if (object.accountNumber != null) + message.accountNumber = String(object.accountNumber); return message; }; /** - * Creates a plain object from a TrainingPhrase message. Also converts values to other types if specified. + * Creates a plain object from a LivePersonConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase} message TrainingPhrase + * @param {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig} message LivePersonConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TrainingPhrase.toObject = function toObject(message, options) { + LivePersonConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.parts = []; - if (options.defaults) { - object.name = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.timesAddedCount = 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type[message.type] : message.type; - if (message.parts && message.parts.length) { - object.parts = []; - for (var j = 0; j < message.parts.length; ++j) - object.parts[j] = $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.toObject(message.parts[j], options); - } - if (message.timesAddedCount != null && message.hasOwnProperty("timesAddedCount")) - object.timesAddedCount = message.timesAddedCount; + if (options.defaults) + object.accountNumber = ""; + if (message.accountNumber != null && message.hasOwnProperty("accountNumber")) + object.accountNumber = message.accountNumber; return object; }; /** - * Converts this TrainingPhrase to JSON. + * Converts this LivePersonConfig to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.LivePersonConfig * @instance * @returns {Object.} JSON object */ - TrainingPhrase.prototype.toJSON = function toJSON() { + LivePersonConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - TrainingPhrase.Part = (function() { + return LivePersonConfig; + })(); - /** - * Properties of a Part. - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase - * @interface IPart - * @property {string|null} [text] Part text - * @property {string|null} [entityType] Part entityType - * @property {string|null} [alias] Part alias - * @property {boolean|null} [userDefined] Part userDefined - */ + HumanAgentHandoffConfig.SalesforceLiveAgentConfig = (function() { - /** - * Constructs a new Part. - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase - * @classdesc Represents a Part. - * @implements IPart - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart=} [properties] Properties to set - */ - function Part(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a SalesforceLiveAgentConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig + * @interface ISalesforceLiveAgentConfig + * @property {string|null} [organizationId] SalesforceLiveAgentConfig organizationId + * @property {string|null} [deploymentId] SalesforceLiveAgentConfig deploymentId + * @property {string|null} [buttonId] SalesforceLiveAgentConfig buttonId + * @property {string|null} [endpointDomain] SalesforceLiveAgentConfig endpointDomain + */ - /** - * Part text. - * @member {string} text - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @instance - */ - Part.prototype.text = ""; + /** + * Constructs a new SalesforceLiveAgentConfig. + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig + * @classdesc Represents a SalesforceLiveAgentConfig. + * @implements ISalesforceLiveAgentConfig + * @constructor + * @param {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig=} [properties] Properties to set + */ + function SalesforceLiveAgentConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Part entityType. - * @member {string} entityType - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @instance - */ - Part.prototype.entityType = ""; - - /** - * Part alias. - * @member {string} alias - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @instance - */ - Part.prototype.alias = ""; - - /** - * Part userDefined. - * @member {boolean} userDefined - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @instance - */ - Part.prototype.userDefined = false; - - /** - * Creates a new Part instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part} Part instance - */ - Part.create = function create(properties) { - return new Part(properties); - }; - - /** - * Encodes the specified Part message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityType); - if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.alias); - if (message.userDefined != null && Object.hasOwnProperty.call(message, "userDefined")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.userDefined); - return writer; - }; - - /** - * Encodes the specified Part message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart} message Part message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Part.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Part message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = reader.string(); - break; - case 2: - message.entityType = reader.string(); - break; - case 3: - message.alias = reader.string(); - break; - case 4: - message.userDefined = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Part message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part} Part - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Part.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Part message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Part.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.entityType != null && message.hasOwnProperty("entityType")) - if (!$util.isString(message.entityType)) - return "entityType: string expected"; - if (message.alias != null && message.hasOwnProperty("alias")) - if (!$util.isString(message.alias)) - return "alias: string expected"; - if (message.userDefined != null && message.hasOwnProperty("userDefined")) - if (typeof message.userDefined !== "boolean") - return "userDefined: boolean expected"; - return null; - }; - - /** - * Creates a Part message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part} Part - */ - Part.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part(); - if (object.text != null) - message.text = String(object.text); - if (object.entityType != null) - message.entityType = String(object.entityType); - if (object.alias != null) - message.alias = String(object.alias); - if (object.userDefined != null) - message.userDefined = Boolean(object.userDefined); - return message; - }; - - /** - * Creates a plain object from a Part message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part} message Part - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Part.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.entityType = ""; - object.alias = ""; - object.userDefined = false; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.entityType != null && message.hasOwnProperty("entityType")) - object.entityType = message.entityType; - if (message.alias != null && message.hasOwnProperty("alias")) - object.alias = message.alias; - if (message.userDefined != null && message.hasOwnProperty("userDefined")) - object.userDefined = message.userDefined; - return object; - }; - - /** - * Converts this Part to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part - * @instance - * @returns {Object.} JSON object - */ - Part.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Part; - })(); - - /** - * Type enum. - * @name google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} EXAMPLE=1 EXAMPLE value - * @property {number} TEMPLATE=2 TEMPLATE value - */ - TrainingPhrase.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "EXAMPLE"] = 1; - values[valuesById[2] = "TEMPLATE"] = 2; - return values; - })(); - - return TrainingPhrase; - })(); - - Intent.Parameter = (function() { - - /** - * Properties of a Parameter. - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @interface IParameter - * @property {string|null} [name] Parameter name - * @property {string|null} [displayName] Parameter displayName - * @property {string|null} [value] Parameter value - * @property {string|null} [defaultValue] Parameter defaultValue - * @property {string|null} [entityTypeDisplayName] Parameter entityTypeDisplayName - * @property {boolean|null} [mandatory] Parameter mandatory - * @property {Array.|null} [prompts] Parameter prompts - * @property {boolean|null} [isList] Parameter isList - */ - - /** - * Constructs a new Parameter. - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @classdesc Represents a Parameter. - * @implements IParameter - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.IParameter=} [properties] Properties to set - */ - function Parameter(properties) { - this.prompts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Parameter name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter - * @instance - */ - Parameter.prototype.name = ""; - - /** - * Parameter displayName. - * @member {string} displayName - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter - * @instance - */ - Parameter.prototype.displayName = ""; - - /** - * Parameter value. - * @member {string} value - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter - * @instance - */ - Parameter.prototype.value = ""; - - /** - * Parameter defaultValue. - * @member {string} defaultValue - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter - * @instance - */ - Parameter.prototype.defaultValue = ""; - - /** - * Parameter entityTypeDisplayName. - * @member {string} entityTypeDisplayName - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter - * @instance - */ - Parameter.prototype.entityTypeDisplayName = ""; + /** + * SalesforceLiveAgentConfig organizationId. + * @member {string} organizationId + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @instance + */ + SalesforceLiveAgentConfig.prototype.organizationId = ""; /** - * Parameter mandatory. - * @member {boolean} mandatory - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * SalesforceLiveAgentConfig deploymentId. + * @member {string} deploymentId + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig * @instance */ - Parameter.prototype.mandatory = false; + SalesforceLiveAgentConfig.prototype.deploymentId = ""; /** - * Parameter prompts. - * @member {Array.} prompts - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * SalesforceLiveAgentConfig buttonId. + * @member {string} buttonId + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig * @instance */ - Parameter.prototype.prompts = $util.emptyArray; + SalesforceLiveAgentConfig.prototype.buttonId = ""; /** - * Parameter isList. - * @member {boolean} isList - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * SalesforceLiveAgentConfig endpointDomain. + * @member {string} endpointDomain + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig * @instance */ - Parameter.prototype.isList = false; + SalesforceLiveAgentConfig.prototype.endpointDomain = ""; /** - * Creates a new Parameter instance using the specified properties. + * Creates a new SalesforceLiveAgentConfig instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.IParameter=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Parameter} Parameter instance + * @param {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig} SalesforceLiveAgentConfig instance */ - Parameter.create = function create(properties) { - return new Parameter(properties); + SalesforceLiveAgentConfig.create = function create(properties) { + return new SalesforceLiveAgentConfig(properties); }; /** - * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Parameter.verify|verify} messages. + * Encodes the specified SalesforceLiveAgentConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.IParameter} message Parameter message or plain object to encode + * @param {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig} message SalesforceLiveAgentConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Parameter.encode = function encode(message, writer) { + SalesforceLiveAgentConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.value); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.defaultValue); - if (message.entityTypeDisplayName != null && Object.hasOwnProperty.call(message, "entityTypeDisplayName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.entityTypeDisplayName); - if (message.mandatory != null && Object.hasOwnProperty.call(message, "mandatory")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.mandatory); - if (message.prompts != null && message.prompts.length) - for (var i = 0; i < message.prompts.length; ++i) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.prompts[i]); - if (message.isList != null && Object.hasOwnProperty.call(message, "isList")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.isList); + if (message.organizationId != null && Object.hasOwnProperty.call(message, "organizationId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.organizationId); + if (message.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deploymentId); + if (message.buttonId != null && Object.hasOwnProperty.call(message, "buttonId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.buttonId); + if (message.endpointDomain != null && Object.hasOwnProperty.call(message, "endpointDomain")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.endpointDomain); return writer; }; /** - * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Parameter.verify|verify} messages. + * Encodes the specified SalesforceLiveAgentConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.IParameter} message Parameter message or plain object to encode + * @param {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig} message SalesforceLiveAgentConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Parameter.encodeDelimited = function encodeDelimited(message, writer) { + SalesforceLiveAgentConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Parameter message from the specified reader or buffer. + * Decodes a SalesforceLiveAgentConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Parameter} Parameter + * @returns {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig} SalesforceLiveAgentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Parameter.decode = function decode(reader, length) { + SalesforceLiveAgentConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Parameter(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.organizationId = reader.string(); break; case 2: - message.displayName = reader.string(); + message.deploymentId = reader.string(); break; case 3: - message.value = reader.string(); + message.buttonId = reader.string(); break; case 4: - message.defaultValue = reader.string(); - break; - case 5: - message.entityTypeDisplayName = reader.string(); - break; - case 6: - message.mandatory = reader.bool(); - break; - case 7: - if (!(message.prompts && message.prompts.length)) - message.prompts = []; - message.prompts.push(reader.string()); - break; - case 8: - message.isList = reader.bool(); + message.endpointDomain = reader.string(); break; default: reader.skipType(tag & 7); @@ -49159,11164 +48655,61716 @@ }; /** - * Decodes a Parameter message from the specified reader or buffer, length delimited. + * Decodes a SalesforceLiveAgentConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Parameter} Parameter + * @returns {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig} SalesforceLiveAgentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Parameter.decodeDelimited = function decodeDelimited(reader) { + SalesforceLiveAgentConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Parameter message. + * Verifies a SalesforceLiveAgentConfig message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Parameter.verify = function verify(message) { + SalesforceLiveAgentConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.entityTypeDisplayName != null && message.hasOwnProperty("entityTypeDisplayName")) - if (!$util.isString(message.entityTypeDisplayName)) - return "entityTypeDisplayName: string expected"; - if (message.mandatory != null && message.hasOwnProperty("mandatory")) - if (typeof message.mandatory !== "boolean") - return "mandatory: boolean expected"; - if (message.prompts != null && message.hasOwnProperty("prompts")) { - if (!Array.isArray(message.prompts)) - return "prompts: array expected"; - for (var i = 0; i < message.prompts.length; ++i) - if (!$util.isString(message.prompts[i])) - return "prompts: string[] expected"; - } - if (message.isList != null && message.hasOwnProperty("isList")) - if (typeof message.isList !== "boolean") - return "isList: boolean expected"; + if (message.organizationId != null && message.hasOwnProperty("organizationId")) + if (!$util.isString(message.organizationId)) + return "organizationId: string expected"; + if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + if (!$util.isString(message.deploymentId)) + return "deploymentId: string expected"; + if (message.buttonId != null && message.hasOwnProperty("buttonId")) + if (!$util.isString(message.buttonId)) + return "buttonId: string expected"; + if (message.endpointDomain != null && message.hasOwnProperty("endpointDomain")) + if (!$util.isString(message.endpointDomain)) + return "endpointDomain: string expected"; return null; }; /** - * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * Creates a SalesforceLiveAgentConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Parameter} Parameter + * @returns {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig} SalesforceLiveAgentConfig */ - Parameter.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Parameter) + SalesforceLiveAgentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Parameter(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.value != null) - message.value = String(object.value); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.entityTypeDisplayName != null) - message.entityTypeDisplayName = String(object.entityTypeDisplayName); - if (object.mandatory != null) - message.mandatory = Boolean(object.mandatory); - if (object.prompts) { - if (!Array.isArray(object.prompts)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Parameter.prompts: array expected"); - message.prompts = []; - for (var i = 0; i < object.prompts.length; ++i) - message.prompts[i] = String(object.prompts[i]); - } - if (object.isList != null) - message.isList = Boolean(object.isList); + var message = new $root.google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig(); + if (object.organizationId != null) + message.organizationId = String(object.organizationId); + if (object.deploymentId != null) + message.deploymentId = String(object.deploymentId); + if (object.buttonId != null) + message.buttonId = String(object.buttonId); + if (object.endpointDomain != null) + message.endpointDomain = String(object.endpointDomain); return message; }; /** - * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * Creates a plain object from a SalesforceLiveAgentConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Parameter} message Parameter + * @param {google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig} message SalesforceLiveAgentConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Parameter.toObject = function toObject(message, options) { + SalesforceLiveAgentConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.prompts = []; if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.value = ""; - object.defaultValue = ""; - object.entityTypeDisplayName = ""; - object.mandatory = false; - object.isList = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.entityTypeDisplayName != null && message.hasOwnProperty("entityTypeDisplayName")) - object.entityTypeDisplayName = message.entityTypeDisplayName; - if (message.mandatory != null && message.hasOwnProperty("mandatory")) - object.mandatory = message.mandatory; - if (message.prompts && message.prompts.length) { - object.prompts = []; - for (var j = 0; j < message.prompts.length; ++j) - object.prompts[j] = message.prompts[j]; - } - if (message.isList != null && message.hasOwnProperty("isList")) - object.isList = message.isList; + object.organizationId = ""; + object.deploymentId = ""; + object.buttonId = ""; + object.endpointDomain = ""; + } + if (message.organizationId != null && message.hasOwnProperty("organizationId")) + object.organizationId = message.organizationId; + if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + object.deploymentId = message.deploymentId; + if (message.buttonId != null && message.hasOwnProperty("buttonId")) + object.buttonId = message.buttonId; + if (message.endpointDomain != null && message.hasOwnProperty("endpointDomain")) + object.endpointDomain = message.endpointDomain; return object; }; /** - * Converts this Parameter to JSON. + * Converts this SalesforceLiveAgentConfig to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @memberof google.cloud.dialogflow.v2.HumanAgentHandoffConfig.SalesforceLiveAgentConfig * @instance * @returns {Object.} JSON object */ - Parameter.prototype.toJSON = function toJSON() { + SalesforceLiveAgentConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Parameter; + return SalesforceLiveAgentConfig; })(); - Intent.Message = (function() { + return HumanAgentHandoffConfig; + })(); - /** - * Properties of a Message. - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @interface IMessage - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IText|null} [text] Message text - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [image] Message image - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies|null} [quickReplies] Message quickReplies - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ICard|null} [card] Message card - * @property {google.protobuf.IStruct|null} [payload] Message payload - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses|null} [simpleResponses] Message simpleResponses - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard|null} [basicCard] Message basicCard - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions|null} [suggestions] Message suggestions - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion|null} [linkOutSuggestion] Message linkOutSuggestion - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect|null} [listSelect] Message listSelect - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect|null} [carouselSelect] Message carouselSelect - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio|null} [telephonyPlayAudio] Message telephonyPlayAudio - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech|null} [telephonySynthesizeSpeech] Message telephonySynthesizeSpeech - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall|null} [telephonyTransferCall] Message telephonyTransferCall - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText|null} [rbmText] Message rbmText - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard|null} [rbmStandaloneRichCard] Message rbmStandaloneRichCard - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard|null} [rbmCarouselRichCard] Message rbmCarouselRichCard - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard|null} [browseCarouselCard] Message browseCarouselCard - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard|null} [tableCard] Message tableCard - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent|null} [mediaContent] Message mediaContent - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.Platform|null} [platform] Message platform - */ + v2.NotificationConfig = (function() { - /** - * Constructs a new Message. - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @classdesc Represents a Message. - * @implements IMessage - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.IMessage=} [properties] Properties to set - */ - function Message(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a NotificationConfig. + * @memberof google.cloud.dialogflow.v2 + * @interface INotificationConfig + * @property {string|null} [topic] NotificationConfig topic + * @property {google.cloud.dialogflow.v2.NotificationConfig.MessageFormat|null} [messageFormat] NotificationConfig messageFormat + */ - /** - * Message text. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IText|null|undefined} text - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.text = null; + /** + * Constructs a new NotificationConfig. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig + * @constructor + * @param {google.cloud.dialogflow.v2.INotificationConfig=} [properties] Properties to set + */ + function NotificationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Message image. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} image - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.image = null; + /** + * NotificationConfig topic. + * @member {string} topic + * @memberof google.cloud.dialogflow.v2.NotificationConfig + * @instance + */ + NotificationConfig.prototype.topic = ""; - /** - * Message quickReplies. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies|null|undefined} quickReplies - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.quickReplies = null; + /** + * NotificationConfig messageFormat. + * @member {google.cloud.dialogflow.v2.NotificationConfig.MessageFormat} messageFormat + * @memberof google.cloud.dialogflow.v2.NotificationConfig + * @instance + */ + NotificationConfig.prototype.messageFormat = 0; - /** - * Message card. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ICard|null|undefined} card - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.card = null; + /** + * Creates a new NotificationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.NotificationConfig + * @static + * @param {google.cloud.dialogflow.v2.INotificationConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.NotificationConfig} NotificationConfig instance + */ + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); + }; - /** - * Message payload. - * @member {google.protobuf.IStruct|null|undefined} payload - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.payload = null; + /** + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.NotificationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.NotificationConfig + * @static + * @param {google.cloud.dialogflow.v2.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.messageFormat != null && Object.hasOwnProperty.call(message, "messageFormat")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.messageFormat); + return writer; + }; - /** - * Message simpleResponses. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses|null|undefined} simpleResponses - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.simpleResponses = null; + /** + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.NotificationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.NotificationConfig + * @static + * @param {google.cloud.dialogflow.v2.INotificationConfig} message NotificationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Message basicCard. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard|null|undefined} basicCard - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.basicCard = null; + /** + * Decodes a NotificationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.NotificationConfig} NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.NotificationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.topic = reader.string(); + break; + case 2: + message.messageFormat = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Message suggestions. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions|null|undefined} suggestions - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.suggestions = null; + /** + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.NotificationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.NotificationConfig} NotificationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NotificationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Message linkOutSuggestion. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion|null|undefined} linkOutSuggestion - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.linkOutSuggestion = null; + /** + * Verifies a NotificationConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2.NotificationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NotificationConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.messageFormat != null && message.hasOwnProperty("messageFormat")) + switch (message.messageFormat) { + default: + return "messageFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; - /** - * Message listSelect. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect|null|undefined} listSelect - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.listSelect = null; + /** + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.NotificationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.NotificationConfig} NotificationConfig + */ + NotificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.NotificationConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2.NotificationConfig(); + if (object.topic != null) + message.topic = String(object.topic); + switch (object.messageFormat) { + case "MESSAGE_FORMAT_UNSPECIFIED": + case 0: + message.messageFormat = 0; + break; + case "PROTO": + case 1: + message.messageFormat = 1; + break; + case "JSON": + case 2: + message.messageFormat = 2; + break; + } + return message; + }; - /** - * Message carouselSelect. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect|null|undefined} carouselSelect - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.carouselSelect = null; + /** + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.NotificationConfig + * @static + * @param {google.cloud.dialogflow.v2.NotificationConfig} message NotificationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NotificationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.topic = ""; + object.messageFormat = options.enums === String ? "MESSAGE_FORMAT_UNSPECIFIED" : 0; + } + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.messageFormat != null && message.hasOwnProperty("messageFormat")) + object.messageFormat = options.enums === String ? $root.google.cloud.dialogflow.v2.NotificationConfig.MessageFormat[message.messageFormat] : message.messageFormat; + return object; + }; - /** - * Message telephonyPlayAudio. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio|null|undefined} telephonyPlayAudio - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.telephonyPlayAudio = null; + /** + * Converts this NotificationConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.NotificationConfig + * @instance + * @returns {Object.} JSON object + */ + NotificationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Message telephonySynthesizeSpeech. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech|null|undefined} telephonySynthesizeSpeech - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.telephonySynthesizeSpeech = null; + /** + * MessageFormat enum. + * @name google.cloud.dialogflow.v2.NotificationConfig.MessageFormat + * @enum {number} + * @property {number} MESSAGE_FORMAT_UNSPECIFIED=0 MESSAGE_FORMAT_UNSPECIFIED value + * @property {number} PROTO=1 PROTO value + * @property {number} JSON=2 JSON value + */ + NotificationConfig.MessageFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROTO"] = 1; + values[valuesById[2] = "JSON"] = 2; + return values; + })(); - /** - * Message telephonyTransferCall. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall|null|undefined} telephonyTransferCall - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.telephonyTransferCall = null; + return NotificationConfig; + })(); - /** - * Message rbmText. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText|null|undefined} rbmText - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.rbmText = null; + v2.LoggingConfig = (function() { - /** - * Message rbmStandaloneRichCard. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard|null|undefined} rbmStandaloneRichCard - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.rbmStandaloneRichCard = null; + /** + * Properties of a LoggingConfig. + * @memberof google.cloud.dialogflow.v2 + * @interface ILoggingConfig + * @property {boolean|null} [enableStackdriverLogging] LoggingConfig enableStackdriverLogging + */ - /** - * Message rbmCarouselRichCard. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard|null|undefined} rbmCarouselRichCard - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.rbmCarouselRichCard = null; + /** + * Constructs a new LoggingConfig. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a LoggingConfig. + * @implements ILoggingConfig + * @constructor + * @param {google.cloud.dialogflow.v2.ILoggingConfig=} [properties] Properties to set + */ + function LoggingConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Message browseCarouselCard. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard|null|undefined} browseCarouselCard - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.browseCarouselCard = null; + /** + * LoggingConfig enableStackdriverLogging. + * @member {boolean} enableStackdriverLogging + * @memberof google.cloud.dialogflow.v2.LoggingConfig + * @instance + */ + LoggingConfig.prototype.enableStackdriverLogging = false; - /** - * Message tableCard. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard|null|undefined} tableCard - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.tableCard = null; + /** + * Creates a new LoggingConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.LoggingConfig + * @static + * @param {google.cloud.dialogflow.v2.ILoggingConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.LoggingConfig} LoggingConfig instance + */ + LoggingConfig.create = function create(properties) { + return new LoggingConfig(properties); + }; - /** - * Message mediaContent. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent|null|undefined} mediaContent - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.mediaContent = null; + /** + * Encodes the specified LoggingConfig message. Does not implicitly {@link google.cloud.dialogflow.v2.LoggingConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.LoggingConfig + * @static + * @param {google.cloud.dialogflow.v2.ILoggingConfig} message LoggingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableStackdriverLogging != null && Object.hasOwnProperty.call(message, "enableStackdriverLogging")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableStackdriverLogging); + return writer; + }; - /** - * Message platform. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.Platform} platform - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Message.prototype.platform = 0; + /** + * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.LoggingConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.LoggingConfig + * @static + * @param {google.cloud.dialogflow.v2.ILoggingConfig} message LoggingConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LoggingConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Decodes a LoggingConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.LoggingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.LoggingConfig} LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.LoggingConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.enableStackdriverLogging = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Message message. - * @member {"text"|"image"|"quickReplies"|"card"|"payload"|"simpleResponses"|"basicCard"|"suggestions"|"linkOutSuggestion"|"listSelect"|"carouselSelect"|"telephonyPlayAudio"|"telephonySynthesizeSpeech"|"telephonyTransferCall"|"rbmText"|"rbmStandaloneRichCard"|"rbmCarouselRichCard"|"browseCarouselCard"|"tableCard"|"mediaContent"|undefined} message - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - */ - Object.defineProperty(Message.prototype, "message", { - get: $util.oneOfGetter($oneOfFields = ["text", "image", "quickReplies", "card", "payload", "simpleResponses", "basicCard", "suggestions", "linkOutSuggestion", "listSelect", "carouselSelect", "telephonyPlayAudio", "telephonySynthesizeSpeech", "telephonyTransferCall", "rbmText", "rbmStandaloneRichCard", "rbmCarouselRichCard", "browseCarouselCard", "tableCard", "mediaContent"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.LoggingConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.LoggingConfig} LoggingConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LoggingConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new Message instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.IMessage=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message} Message instance - */ - Message.create = function create(properties) { - return new Message(properties); - }; + /** + * Verifies a LoggingConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2.LoggingConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LoggingConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + if (typeof message.enableStackdriverLogging !== "boolean") + return "enableStackdriverLogging: boolean expected"; + return null; + }; - /** - * Encodes the specified Message message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.image, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.quickReplies != null && Object.hasOwnProperty.call(message, "quickReplies")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.encode(message.quickReplies, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.card != null && Object.hasOwnProperty.call(message, "card")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.encode(message.card, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.platform != null && Object.hasOwnProperty.call(message, "platform")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.platform); - if (message.simpleResponses != null && Object.hasOwnProperty.call(message, "simpleResponses")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.encode(message.simpleResponses, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.basicCard != null && Object.hasOwnProperty.call(message, "basicCard")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.encode(message.basicCard, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.suggestions != null && Object.hasOwnProperty.call(message, "suggestions")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.encode(message.suggestions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.linkOutSuggestion != null && Object.hasOwnProperty.call(message, "linkOutSuggestion")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.encode(message.linkOutSuggestion, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.listSelect != null && Object.hasOwnProperty.call(message, "listSelect")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.encode(message.listSelect, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.carouselSelect != null && Object.hasOwnProperty.call(message, "carouselSelect")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.encode(message.carouselSelect, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.telephonyPlayAudio != null && Object.hasOwnProperty.call(message, "telephonyPlayAudio")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.encode(message.telephonyPlayAudio, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.telephonySynthesizeSpeech != null && Object.hasOwnProperty.call(message, "telephonySynthesizeSpeech")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.encode(message.telephonySynthesizeSpeech, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.telephonyTransferCall != null && Object.hasOwnProperty.call(message, "telephonyTransferCall")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.encode(message.telephonyTransferCall, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.rbmText != null && Object.hasOwnProperty.call(message, "rbmText")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.encode(message.rbmText, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.rbmStandaloneRichCard != null && Object.hasOwnProperty.call(message, "rbmStandaloneRichCard")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.encode(message.rbmStandaloneRichCard, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.rbmCarouselRichCard != null && Object.hasOwnProperty.call(message, "rbmCarouselRichCard")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.encode(message.rbmCarouselRichCard, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.browseCarouselCard != null && Object.hasOwnProperty.call(message, "browseCarouselCard")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.encode(message.browseCarouselCard, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.tableCard != null && Object.hasOwnProperty.call(message, "tableCard")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.encode(message.tableCard, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.mediaContent != null && Object.hasOwnProperty.call(message, "mediaContent")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.encode(message.mediaContent, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - return writer; - }; + /** + * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.LoggingConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.LoggingConfig} LoggingConfig + */ + LoggingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.LoggingConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2.LoggingConfig(); + if (object.enableStackdriverLogging != null) + message.enableStackdriverLogging = Boolean(object.enableStackdriverLogging); + return message; + }; - /** - * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.IMessage} message Message message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Message.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.LoggingConfig + * @static + * @param {google.cloud.dialogflow.v2.LoggingConfig} message LoggingConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LoggingConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.enableStackdriverLogging = false; + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + object.enableStackdriverLogging = message.enableStackdriverLogging; + return object; + }; - /** - * Decodes a Message message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text.decode(reader, reader.uint32()); - break; - case 2: - message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); - break; - case 3: - message.quickReplies = $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.decode(reader, reader.uint32()); - break; - case 4: - message.card = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.decode(reader, reader.uint32()); - break; - case 5: - message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 7: - message.simpleResponses = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.decode(reader, reader.uint32()); - break; - case 8: - message.basicCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.decode(reader, reader.uint32()); - break; - case 9: - message.suggestions = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.decode(reader, reader.uint32()); - break; - case 10: - message.linkOutSuggestion = $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.decode(reader, reader.uint32()); - break; - case 11: - message.listSelect = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.decode(reader, reader.uint32()); - break; - case 12: - message.carouselSelect = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.decode(reader, reader.uint32()); - break; - case 13: - message.telephonyPlayAudio = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.decode(reader, reader.uint32()); - break; - case 14: - message.telephonySynthesizeSpeech = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.decode(reader, reader.uint32()); - break; - case 15: - message.telephonyTransferCall = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.decode(reader, reader.uint32()); - break; - case 18: - message.rbmText = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.decode(reader, reader.uint32()); - break; - case 19: - message.rbmStandaloneRichCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.decode(reader, reader.uint32()); - break; - case 20: - message.rbmCarouselRichCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.decode(reader, reader.uint32()); - break; - case 22: - message.browseCarouselCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.decode(reader, reader.uint32()); - break; - case 23: - message.tableCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.decode(reader, reader.uint32()); - break; - case 24: - message.mediaContent = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.decode(reader, reader.uint32()); - break; - case 6: - message.platform = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Converts this LoggingConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.LoggingConfig + * @instance + * @returns {Object.} JSON object + */ + LoggingConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a Message message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message} Message - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Message.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return LoggingConfig; + })(); - /** - * Verifies a Message message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Message.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.text != null && message.hasOwnProperty("text")) { - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text.verify(message.text); - if (error) - return "text." + error; - } - } - if (message.image != null && message.hasOwnProperty("image")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.image); - if (error) - return "image." + error; - } - } - if (message.quickReplies != null && message.hasOwnProperty("quickReplies")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.verify(message.quickReplies); - if (error) - return "quickReplies." + error; - } - } - if (message.card != null && message.hasOwnProperty("card")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.verify(message.card); - if (error) - return "card." + error; - } - } - if (message.payload != null && message.hasOwnProperty("payload")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.protobuf.Struct.verify(message.payload); - if (error) - return "payload." + error; - } - } - if (message.simpleResponses != null && message.hasOwnProperty("simpleResponses")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.verify(message.simpleResponses); - if (error) - return "simpleResponses." + error; - } - } - if (message.basicCard != null && message.hasOwnProperty("basicCard")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.verify(message.basicCard); - if (error) - return "basicCard." + error; - } - } - if (message.suggestions != null && message.hasOwnProperty("suggestions")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.verify(message.suggestions); - if (error) - return "suggestions." + error; - } - } - if (message.linkOutSuggestion != null && message.hasOwnProperty("linkOutSuggestion")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.verify(message.linkOutSuggestion); - if (error) - return "linkOutSuggestion." + error; - } - } - if (message.listSelect != null && message.hasOwnProperty("listSelect")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.verify(message.listSelect); - if (error) - return "listSelect." + error; - } - } - if (message.carouselSelect != null && message.hasOwnProperty("carouselSelect")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.verify(message.carouselSelect); - if (error) - return "carouselSelect." + error; - } - } - if (message.telephonyPlayAudio != null && message.hasOwnProperty("telephonyPlayAudio")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.verify(message.telephonyPlayAudio); - if (error) - return "telephonyPlayAudio." + error; - } - } - if (message.telephonySynthesizeSpeech != null && message.hasOwnProperty("telephonySynthesizeSpeech")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.verify(message.telephonySynthesizeSpeech); - if (error) - return "telephonySynthesizeSpeech." + error; - } - } - if (message.telephonyTransferCall != null && message.hasOwnProperty("telephonyTransferCall")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.verify(message.telephonyTransferCall); - if (error) - return "telephonyTransferCall." + error; - } - } - if (message.rbmText != null && message.hasOwnProperty("rbmText")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.verify(message.rbmText); - if (error) - return "rbmText." + error; - } - } - if (message.rbmStandaloneRichCard != null && message.hasOwnProperty("rbmStandaloneRichCard")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.verify(message.rbmStandaloneRichCard); - if (error) - return "rbmStandaloneRichCard." + error; - } - } - if (message.rbmCarouselRichCard != null && message.hasOwnProperty("rbmCarouselRichCard")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.verify(message.rbmCarouselRichCard); - if (error) - return "rbmCarouselRichCard." + error; - } - } - if (message.browseCarouselCard != null && message.hasOwnProperty("browseCarouselCard")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.verify(message.browseCarouselCard); - if (error) - return "browseCarouselCard." + error; - } - } - if (message.tableCard != null && message.hasOwnProperty("tableCard")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.verify(message.tableCard); - if (error) - return "tableCard." + error; - } + v2.SuggestionFeature = (function() { + + /** + * Properties of a SuggestionFeature. + * @memberof google.cloud.dialogflow.v2 + * @interface ISuggestionFeature + * @property {google.cloud.dialogflow.v2.SuggestionFeature.Type|null} [type] SuggestionFeature type + */ + + /** + * Constructs a new SuggestionFeature. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a SuggestionFeature. + * @implements ISuggestionFeature + * @constructor + * @param {google.cloud.dialogflow.v2.ISuggestionFeature=} [properties] Properties to set + */ + function SuggestionFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestionFeature type. + * @member {google.cloud.dialogflow.v2.SuggestionFeature.Type} type + * @memberof google.cloud.dialogflow.v2.SuggestionFeature + * @instance + */ + SuggestionFeature.prototype.type = 0; + + /** + * Creates a new SuggestionFeature instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.SuggestionFeature + * @static + * @param {google.cloud.dialogflow.v2.ISuggestionFeature=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.SuggestionFeature} SuggestionFeature instance + */ + SuggestionFeature.create = function create(properties) { + return new SuggestionFeature(properties); + }; + + /** + * Encodes the specified SuggestionFeature message. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestionFeature.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.SuggestionFeature + * @static + * @param {google.cloud.dialogflow.v2.ISuggestionFeature} message SuggestionFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + return writer; + }; + + /** + * Encodes the specified SuggestionFeature message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.SuggestionFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.SuggestionFeature + * @static + * @param {google.cloud.dialogflow.v2.ISuggestionFeature} message SuggestionFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestionFeature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.SuggestionFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.SuggestionFeature} SuggestionFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionFeature.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.SuggestionFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.mediaContent != null && message.hasOwnProperty("mediaContent")) { - if (properties.message === 1) - return "message: multiple values"; - properties.message = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.verify(message.mediaContent); - if (error) - return "mediaContent." + error; - } + } + return message; + }; + + /** + * Decodes a SuggestionFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.SuggestionFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.SuggestionFeature} SuggestionFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestionFeature message. + * @function verify + * @memberof google.cloud.dialogflow.v2.SuggestionFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; } - if (message.platform != null && message.hasOwnProperty("platform")) - switch (message.platform) { - default: - return "platform: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 10: - case 11: - break; - } - return null; - }; + return null; + }; + + /** + * Creates a SuggestionFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.SuggestionFeature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.SuggestionFeature} SuggestionFeature + */ + SuggestionFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.SuggestionFeature) + return object; + var message = new $root.google.cloud.dialogflow.v2.SuggestionFeature(); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ARTICLE_SUGGESTION": + case 1: + message.type = 1; + break; + case "FAQ": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a SuggestionFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.SuggestionFeature + * @static + * @param {google.cloud.dialogflow.v2.SuggestionFeature} message SuggestionFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionFeature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.v2.SuggestionFeature.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this SuggestionFeature to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.SuggestionFeature + * @instance + * @returns {Object.} JSON object + */ + SuggestionFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.dialogflow.v2.SuggestionFeature.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ARTICLE_SUGGESTION=1 ARTICLE_SUGGESTION value + * @property {number} FAQ=2 FAQ value + */ + SuggestionFeature.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ARTICLE_SUGGESTION"] = 1; + values[valuesById[2] = "FAQ"] = 2; + return values; + })(); + + return SuggestionFeature; + })(); + + v2.Documents = (function() { + + /** + * Constructs a new Documents service. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a Documents + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Documents(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Documents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Documents; + + /** + * Creates new Documents service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2.Documents + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Documents} RPC service. Useful where requests and/or responses are streamed. + */ + Documents.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Documents#listDocuments}. + * @memberof google.cloud.dialogflow.v2.Documents + * @typedef ListDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.ListDocumentsResponse} [response] ListDocumentsResponse + */ + + /** + * Calls ListDocuments. + * @function listDocuments + * @memberof google.cloud.dialogflow.v2.Documents + * @instance + * @param {google.cloud.dialogflow.v2.IListDocumentsRequest} request ListDocumentsRequest message or plain object + * @param {google.cloud.dialogflow.v2.Documents.ListDocumentsCallback} callback Node-style callback called with the error, if any, and ListDocumentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Documents.prototype.listDocuments = function listDocuments(request, callback) { + return this.rpcCall(listDocuments, $root.google.cloud.dialogflow.v2.ListDocumentsRequest, $root.google.cloud.dialogflow.v2.ListDocumentsResponse, request, callback); + }, "name", { value: "ListDocuments" }); + + /** + * Calls ListDocuments. + * @function listDocuments + * @memberof google.cloud.dialogflow.v2.Documents + * @instance + * @param {google.cloud.dialogflow.v2.IListDocumentsRequest} request ListDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Documents#getDocument}. + * @memberof google.cloud.dialogflow.v2.Documents + * @typedef GetDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.Document} [response] Document + */ + + /** + * Calls GetDocument. + * @function getDocument + * @memberof google.cloud.dialogflow.v2.Documents + * @instance + * @param {google.cloud.dialogflow.v2.IGetDocumentRequest} request GetDocumentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Documents.GetDocumentCallback} callback Node-style callback called with the error, if any, and Document + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Documents.prototype.getDocument = function getDocument(request, callback) { + return this.rpcCall(getDocument, $root.google.cloud.dialogflow.v2.GetDocumentRequest, $root.google.cloud.dialogflow.v2.Document, request, callback); + }, "name", { value: "GetDocument" }); + + /** + * Calls GetDocument. + * @function getDocument + * @memberof google.cloud.dialogflow.v2.Documents + * @instance + * @param {google.cloud.dialogflow.v2.IGetDocumentRequest} request GetDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Documents#createDocument}. + * @memberof google.cloud.dialogflow.v2.Documents + * @typedef CreateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateDocument. + * @function createDocument + * @memberof google.cloud.dialogflow.v2.Documents + * @instance + * @param {google.cloud.dialogflow.v2.ICreateDocumentRequest} request CreateDocumentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Documents.CreateDocumentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Documents.prototype.createDocument = function createDocument(request, callback) { + return this.rpcCall(createDocument, $root.google.cloud.dialogflow.v2.CreateDocumentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDocument" }); + + /** + * Calls CreateDocument. + * @function createDocument + * @memberof google.cloud.dialogflow.v2.Documents + * @instance + * @param {google.cloud.dialogflow.v2.ICreateDocumentRequest} request CreateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Documents#deleteDocument}. + * @memberof google.cloud.dialogflow.v2.Documents + * @typedef DeleteDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteDocument. + * @function deleteDocument + * @memberof google.cloud.dialogflow.v2.Documents + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Documents.DeleteDocumentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Documents.prototype.deleteDocument = function deleteDocument(request, callback) { + return this.rpcCall(deleteDocument, $root.google.cloud.dialogflow.v2.DeleteDocumentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDocument" }); + + /** + * Calls DeleteDocument. + * @function deleteDocument + * @memberof google.cloud.dialogflow.v2.Documents + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Documents#updateDocument}. + * @memberof google.cloud.dialogflow.v2.Documents + * @typedef UpdateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDocument. + * @function updateDocument + * @memberof google.cloud.dialogflow.v2.Documents + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Documents.UpdateDocumentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Documents.prototype.updateDocument = function updateDocument(request, callback) { + return this.rpcCall(updateDocument, $root.google.cloud.dialogflow.v2.UpdateDocumentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDocument" }); + + /** + * Calls UpdateDocument. + * @function updateDocument + * @memberof google.cloud.dialogflow.v2.Documents + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Documents#reloadDocument}. + * @memberof google.cloud.dialogflow.v2.Documents + * @typedef ReloadDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ReloadDocument. + * @function reloadDocument + * @memberof google.cloud.dialogflow.v2.Documents + * @instance + * @param {google.cloud.dialogflow.v2.IReloadDocumentRequest} request ReloadDocumentRequest message or plain object + * @param {google.cloud.dialogflow.v2.Documents.ReloadDocumentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Documents.prototype.reloadDocument = function reloadDocument(request, callback) { + return this.rpcCall(reloadDocument, $root.google.cloud.dialogflow.v2.ReloadDocumentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ReloadDocument" }); + + /** + * Calls ReloadDocument. + * @function reloadDocument + * @memberof google.cloud.dialogflow.v2.Documents + * @instance + * @param {google.cloud.dialogflow.v2.IReloadDocumentRequest} request ReloadDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Documents; + })(); + + v2.Document = (function() { + + /** + * Properties of a Document. + * @memberof google.cloud.dialogflow.v2 + * @interface IDocument + * @property {string|null} [name] Document name + * @property {string|null} [displayName] Document displayName + * @property {string|null} [mimeType] Document mimeType + * @property {Array.|null} [knowledgeTypes] Document knowledgeTypes + * @property {string|null} [contentUri] Document contentUri + * @property {Uint8Array|null} [rawContent] Document rawContent + * @property {boolean|null} [enableAutoReload] Document enableAutoReload + * @property {google.cloud.dialogflow.v2.Document.IReloadStatus|null} [latestReloadStatus] Document latestReloadStatus + * @property {Object.|null} [metadata] Document metadata + */ + + /** + * Constructs a new Document. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a Document. + * @implements IDocument + * @constructor + * @param {google.cloud.dialogflow.v2.IDocument=} [properties] Properties to set + */ + function Document(properties) { + this.knowledgeTypes = []; + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Document name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.Document + * @instance + */ + Document.prototype.name = ""; + + /** + * Document displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2.Document + * @instance + */ + Document.prototype.displayName = ""; + + /** + * Document mimeType. + * @member {string} mimeType + * @memberof google.cloud.dialogflow.v2.Document + * @instance + */ + Document.prototype.mimeType = ""; + + /** + * Document knowledgeTypes. + * @member {Array.} knowledgeTypes + * @memberof google.cloud.dialogflow.v2.Document + * @instance + */ + Document.prototype.knowledgeTypes = $util.emptyArray; + + /** + * Document contentUri. + * @member {string} contentUri + * @memberof google.cloud.dialogflow.v2.Document + * @instance + */ + Document.prototype.contentUri = ""; + + /** + * Document rawContent. + * @member {Uint8Array} rawContent + * @memberof google.cloud.dialogflow.v2.Document + * @instance + */ + Document.prototype.rawContent = $util.newBuffer([]); + + /** + * Document enableAutoReload. + * @member {boolean} enableAutoReload + * @memberof google.cloud.dialogflow.v2.Document + * @instance + */ + Document.prototype.enableAutoReload = false; + + /** + * Document latestReloadStatus. + * @member {google.cloud.dialogflow.v2.Document.IReloadStatus|null|undefined} latestReloadStatus + * @memberof google.cloud.dialogflow.v2.Document + * @instance + */ + Document.prototype.latestReloadStatus = null; + + /** + * Document metadata. + * @member {Object.} metadata + * @memberof google.cloud.dialogflow.v2.Document + * @instance + */ + Document.prototype.metadata = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Document source. + * @member {"contentUri"|"rawContent"|undefined} source + * @memberof google.cloud.dialogflow.v2.Document + * @instance + */ + Object.defineProperty(Document.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["contentUri", "rawContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Document instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Document + * @static + * @param {google.cloud.dialogflow.v2.IDocument=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Document} Document instance + */ + Document.create = function create(properties) { + return new Document(properties); + }; + + /** + * Encodes the specified Document message. Does not implicitly {@link google.cloud.dialogflow.v2.Document.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Document + * @static + * @param {google.cloud.dialogflow.v2.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); + if (message.knowledgeTypes != null && message.knowledgeTypes.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.knowledgeTypes.length; ++i) + writer.int32(message.knowledgeTypes[i]); + writer.ldelim(); + } + if (message.contentUri != null && Object.hasOwnProperty.call(message, "contentUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.contentUri); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.rawContent != null && Object.hasOwnProperty.call(message, "rawContent")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.rawContent); + if (message.enableAutoReload != null && Object.hasOwnProperty.call(message, "enableAutoReload")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableAutoReload); + if (message.latestReloadStatus != null && Object.hasOwnProperty.call(message, "latestReloadStatus")) + $root.google.cloud.dialogflow.v2.Document.ReloadStatus.encode(message.latestReloadStatus, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Document.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Document + * @static + * @param {google.cloud.dialogflow.v2.IDocument} message Document message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Document.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Document message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Document(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.mimeType = reader.string(); + break; + case 4: + if (!(message.knowledgeTypes && message.knowledgeTypes.length)) + message.knowledgeTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.knowledgeTypes.push(reader.int32()); + } else + message.knowledgeTypes.push(reader.int32()); + break; + case 5: + message.contentUri = reader.string(); + break; + case 9: + message.rawContent = reader.bytes(); + break; + case 11: + message.enableAutoReload = reader.bool(); + break; + case 12: + message.latestReloadStatus = $root.google.cloud.dialogflow.v2.Document.ReloadStatus.decode(reader, reader.uint32()); + break; + case 7: + if (message.metadata === $util.emptyObject) + message.metadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Document message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Document + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Document} Document + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Document.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Document message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Document + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Document.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.knowledgeTypes != null && message.hasOwnProperty("knowledgeTypes")) { + if (!Array.isArray(message.knowledgeTypes)) + return "knowledgeTypes: array expected"; + for (var i = 0; i < message.knowledgeTypes.length; ++i) + switch (message.knowledgeTypes[i]) { + default: + return "knowledgeTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.contentUri != null && message.hasOwnProperty("contentUri")) { + properties.source = 1; + if (!$util.isString(message.contentUri)) + return "contentUri: string expected"; + } + if (message.rawContent != null && message.hasOwnProperty("rawContent")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!(message.rawContent && typeof message.rawContent.length === "number" || $util.isString(message.rawContent))) + return "rawContent: buffer expected"; + } + if (message.enableAutoReload != null && message.hasOwnProperty("enableAutoReload")) + if (typeof message.enableAutoReload !== "boolean") + return "enableAutoReload: boolean expected"; + if (message.latestReloadStatus != null && message.hasOwnProperty("latestReloadStatus")) { + var error = $root.google.cloud.dialogflow.v2.Document.ReloadStatus.verify(message.latestReloadStatus); + if (error) + return "latestReloadStatus." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a Document message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Document + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Document} Document + */ + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Document) + return object; + var message = new $root.google.cloud.dialogflow.v2.Document(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.knowledgeTypes) { + if (!Array.isArray(object.knowledgeTypes)) + throw TypeError(".google.cloud.dialogflow.v2.Document.knowledgeTypes: array expected"); + message.knowledgeTypes = []; + for (var i = 0; i < object.knowledgeTypes.length; ++i) + switch (object.knowledgeTypes[i]) { + default: + case "KNOWLEDGE_TYPE_UNSPECIFIED": + case 0: + message.knowledgeTypes[i] = 0; + break; + case "FAQ": + case 1: + message.knowledgeTypes[i] = 1; + break; + case "EXTRACTIVE_QA": + case 2: + message.knowledgeTypes[i] = 2; + break; + case "ARTICLE_SUGGESTION": + case 3: + message.knowledgeTypes[i] = 3; + break; + } + } + if (object.contentUri != null) + message.contentUri = String(object.contentUri); + if (object.rawContent != null) + if (typeof object.rawContent === "string") + $util.base64.decode(object.rawContent, message.rawContent = $util.newBuffer($util.base64.length(object.rawContent)), 0); + else if (object.rawContent.length) + message.rawContent = object.rawContent; + if (object.enableAutoReload != null) + message.enableAutoReload = Boolean(object.enableAutoReload); + if (object.latestReloadStatus != null) { + if (typeof object.latestReloadStatus !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Document.latestReloadStatus: object expected"); + message.latestReloadStatus = $root.google.cloud.dialogflow.v2.Document.ReloadStatus.fromObject(object.latestReloadStatus); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Document.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Document + * @static + * @param {google.cloud.dialogflow.v2.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.knowledgeTypes = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.mimeType = ""; + object.enableAutoReload = false; + object.latestReloadStatus = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.knowledgeTypes && message.knowledgeTypes.length) { + object.knowledgeTypes = []; + for (var j = 0; j < message.knowledgeTypes.length; ++j) + object.knowledgeTypes[j] = options.enums === String ? $root.google.cloud.dialogflow.v2.Document.KnowledgeType[message.knowledgeTypes[j]] : message.knowledgeTypes[j]; + } + if (message.contentUri != null && message.hasOwnProperty("contentUri")) { + object.contentUri = message.contentUri; + if (options.oneofs) + object.source = "contentUri"; + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.rawContent != null && message.hasOwnProperty("rawContent")) { + object.rawContent = options.bytes === String ? $util.base64.encode(message.rawContent, 0, message.rawContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawContent) : message.rawContent; + if (options.oneofs) + object.source = "rawContent"; + } + if (message.enableAutoReload != null && message.hasOwnProperty("enableAutoReload")) + object.enableAutoReload = message.enableAutoReload; + if (message.latestReloadStatus != null && message.hasOwnProperty("latestReloadStatus")) + object.latestReloadStatus = $root.google.cloud.dialogflow.v2.Document.ReloadStatus.toObject(message.latestReloadStatus, options); + return object; + }; + + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Document.ReloadStatus = (function() { + + /** + * Properties of a ReloadStatus. + * @memberof google.cloud.dialogflow.v2.Document + * @interface IReloadStatus + * @property {google.protobuf.ITimestamp|null} [time] ReloadStatus time + * @property {google.rpc.IStatus|null} [status] ReloadStatus status + */ + + /** + * Constructs a new ReloadStatus. + * @memberof google.cloud.dialogflow.v2.Document + * @classdesc Represents a ReloadStatus. + * @implements IReloadStatus + * @constructor + * @param {google.cloud.dialogflow.v2.Document.IReloadStatus=} [properties] Properties to set + */ + function ReloadStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReloadStatus time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof google.cloud.dialogflow.v2.Document.ReloadStatus + * @instance + */ + ReloadStatus.prototype.time = null; + + /** + * ReloadStatus status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.dialogflow.v2.Document.ReloadStatus + * @instance + */ + ReloadStatus.prototype.status = null; + + /** + * Creates a new ReloadStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Document.ReloadStatus + * @static + * @param {google.cloud.dialogflow.v2.Document.IReloadStatus=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Document.ReloadStatus} ReloadStatus instance + */ + ReloadStatus.create = function create(properties) { + return new ReloadStatus(properties); + }; + + /** + * Encodes the specified ReloadStatus message. Does not implicitly {@link google.cloud.dialogflow.v2.Document.ReloadStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Document.ReloadStatus + * @static + * @param {google.cloud.dialogflow.v2.Document.IReloadStatus} message ReloadStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReloadStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReloadStatus message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Document.ReloadStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Document.ReloadStatus + * @static + * @param {google.cloud.dialogflow.v2.Document.IReloadStatus} message ReloadStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReloadStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReloadStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Document.ReloadStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Document.ReloadStatus} ReloadStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReloadStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Document.ReloadStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReloadStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Document.ReloadStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Document.ReloadStatus} ReloadStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReloadStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReloadStatus message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Document.ReloadStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReloadStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a ReloadStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Document.ReloadStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Document.ReloadStatus} ReloadStatus + */ + ReloadStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Document.ReloadStatus) + return object; + var message = new $root.google.cloud.dialogflow.v2.Document.ReloadStatus(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Document.ReloadStatus.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Document.ReloadStatus.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a ReloadStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Document.ReloadStatus + * @static + * @param {google.cloud.dialogflow.v2.Document.ReloadStatus} message ReloadStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReloadStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.time = null; + object.status = null; + } + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this ReloadStatus to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Document.ReloadStatus + * @instance + * @returns {Object.} JSON object + */ + ReloadStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReloadStatus; + })(); + + /** + * KnowledgeType enum. + * @name google.cloud.dialogflow.v2.Document.KnowledgeType + * @enum {number} + * @property {number} KNOWLEDGE_TYPE_UNSPECIFIED=0 KNOWLEDGE_TYPE_UNSPECIFIED value + * @property {number} FAQ=1 FAQ value + * @property {number} EXTRACTIVE_QA=2 EXTRACTIVE_QA value + * @property {number} ARTICLE_SUGGESTION=3 ARTICLE_SUGGESTION value + */ + Document.KnowledgeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KNOWLEDGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FAQ"] = 1; + values[valuesById[2] = "EXTRACTIVE_QA"] = 2; + values[valuesById[3] = "ARTICLE_SUGGESTION"] = 3; + return values; + })(); + + return Document; + })(); + + v2.GetDocumentRequest = (function() { + + /** + * Properties of a GetDocumentRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IGetDocumentRequest + * @property {string|null} [name] GetDocumentRequest name + */ + + /** + * Constructs a new GetDocumentRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a GetDocumentRequest. + * @implements IGetDocumentRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IGetDocumentRequest=} [properties] Properties to set + */ + function GetDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.GetDocumentRequest + * @instance + */ + GetDocumentRequest.prototype.name = ""; + + /** + * Creates a new GetDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.GetDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.IGetDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.GetDocumentRequest} GetDocumentRequest instance + */ + GetDocumentRequest.create = function create(properties) { + return new GetDocumentRequest(properties); + }; + + /** + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.GetDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.GetDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.GetDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.GetDocumentRequest} GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.GetDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.GetDocumentRequest} GetDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.GetDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.GetDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.GetDocumentRequest} GetDocumentRequest + */ + GetDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.GetDocumentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.GetDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.GetDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.GetDocumentRequest} message GetDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.GetDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + GetDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDocumentRequest; + })(); + + v2.ListDocumentsRequest = (function() { + + /** + * Properties of a ListDocumentsRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IListDocumentsRequest + * @property {string|null} [parent] ListDocumentsRequest parent + * @property {number|null} [pageSize] ListDocumentsRequest pageSize + * @property {string|null} [pageToken] ListDocumentsRequest pageToken + */ + + /** + * Constructs a new ListDocumentsRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListDocumentsRequest. + * @implements IListDocumentsRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IListDocumentsRequest=} [properties] Properties to set + */ + function ListDocumentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDocumentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.parent = ""; + + /** + * ListDocumentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.pageSize = 0; + + /** + * ListDocumentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListDocumentsRequest + * @instance + */ + ListDocumentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListDocumentsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListDocumentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListDocumentsRequest} ListDocumentsRequest instance + */ + ListDocumentsRequest.create = function create(properties) { + return new ListDocumentsRequest(properties); + }; + + /** + * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListDocumentsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.ListDocumentsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.ListDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.ListDocumentsRequest} ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.ListDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.ListDocumentsRequest} ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDocumentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.ListDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.ListDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.ListDocumentsRequest} ListDocumentsRequest + */ + ListDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListDocumentsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.ListDocumentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.ListDocumentsRequest + * @static + * @param {google.cloud.dialogflow.v2.ListDocumentsRequest} message ListDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListDocumentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.ListDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListDocumentsRequest; + })(); + + v2.ListDocumentsResponse = (function() { + + /** + * Properties of a ListDocumentsResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IListDocumentsResponse + * @property {Array.|null} [documents] ListDocumentsResponse documents + * @property {string|null} [nextPageToken] ListDocumentsResponse nextPageToken + */ + + /** + * Constructs a new ListDocumentsResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListDocumentsResponse. + * @implements IListDocumentsResponse + * @constructor + * @param {google.cloud.dialogflow.v2.IListDocumentsResponse=} [properties] Properties to set + */ + function ListDocumentsResponse(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDocumentsResponse documents. + * @member {Array.} documents + * @memberof google.cloud.dialogflow.v2.ListDocumentsResponse + * @instance + */ + ListDocumentsResponse.prototype.documents = $util.emptyArray; + + /** + * ListDocumentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2.ListDocumentsResponse + * @instance + */ + ListDocumentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListDocumentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListDocumentsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListDocumentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListDocumentsResponse} ListDocumentsResponse instance + */ + ListDocumentsResponse.create = function create(properties) { + return new ListDocumentsResponse(properties); + }; + + /** + * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListDocumentsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + $root.google.cloud.dialogflow.v2.Document.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.ListDocumentsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.ListDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.ListDocumentsResponse} ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push($root.google.cloud.dialogflow.v2.Document.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.ListDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.ListDocumentsResponse} ListDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDocumentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2.ListDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Document.verify(message.documents[i]); + if (error) + return "documents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.ListDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.ListDocumentsResponse} ListDocumentsResponse + */ + ListDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListDocumentsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2.ListDocumentsResponse(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.dialogflow.v2.ListDocumentsResponse.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListDocumentsResponse.documents: object expected"); + message.documents[i] = $root.google.cloud.dialogflow.v2.Document.fromObject(object.documents[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.ListDocumentsResponse + * @static + * @param {google.cloud.dialogflow.v2.ListDocumentsResponse} message ListDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.cloud.dialogflow.v2.Document.toObject(message.documents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListDocumentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.ListDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListDocumentsResponse; + })(); + + v2.CreateDocumentRequest = (function() { + + /** + * Properties of a CreateDocumentRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface ICreateDocumentRequest + * @property {string|null} [parent] CreateDocumentRequest parent + * @property {google.cloud.dialogflow.v2.IDocument|null} [document] CreateDocumentRequest document + */ + + /** + * Constructs a new CreateDocumentRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a CreateDocumentRequest. + * @implements ICreateDocumentRequest + * @constructor + * @param {google.cloud.dialogflow.v2.ICreateDocumentRequest=} [properties] Properties to set + */ + function CreateDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateDocumentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.parent = ""; + + /** + * CreateDocumentRequest document. + * @member {google.cloud.dialogflow.v2.IDocument|null|undefined} document + * @memberof google.cloud.dialogflow.v2.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.document = null; + + /** + * Creates a new CreateDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.CreateDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.ICreateDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CreateDocumentRequest} CreateDocumentRequest instance + */ + CreateDocumentRequest.create = function create(properties) { + return new CreateDocumentRequest(properties); + }; + + /** + * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.CreateDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.dialogflow.v2.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.CreateDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.CreateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.CreateDocumentRequest} CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.document = $root.google.cloud.dialogflow.v2.Document.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.CreateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.CreateDocumentRequest} CreateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateDocumentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.CreateDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.dialogflow.v2.Document.verify(message.document); + if (error) + return "document." + error; + } + return null; + }; + + /** + * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.CreateDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.CreateDocumentRequest} CreateDocumentRequest + */ + CreateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CreateDocumentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.CreateDocumentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.dialogflow.v2.CreateDocumentRequest.document: object expected"); + message.document = $root.google.cloud.dialogflow.v2.Document.fromObject(object.document); + } + return message; + }; + + /** + * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.CreateDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.CreateDocumentRequest} message CreateDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.document = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.dialogflow.v2.Document.toObject(message.document, options); + return object; + }; + + /** + * Converts this CreateDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.CreateDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateDocumentRequest; + })(); + + v2.DeleteDocumentRequest = (function() { + + /** + * Properties of a DeleteDocumentRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IDeleteDocumentRequest + * @property {string|null} [name] DeleteDocumentRequest name + */ + + /** + * Constructs a new DeleteDocumentRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a DeleteDocumentRequest. + * @implements IDeleteDocumentRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IDeleteDocumentRequest=} [properties] Properties to set + */ + function DeleteDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteDocumentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.DeleteDocumentRequest + * @instance + */ + DeleteDocumentRequest.prototype.name = ""; + + /** + * Creates a new DeleteDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.DeleteDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.DeleteDocumentRequest} DeleteDocumentRequest instance + */ + DeleteDocumentRequest.create = function create(properties) { + return new DeleteDocumentRequest(properties); + }; + + /** + * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.DeleteDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.DeleteDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.DeleteDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.DeleteDocumentRequest} DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.DeleteDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.DeleteDocumentRequest} DeleteDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteDocumentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.DeleteDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.DeleteDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.DeleteDocumentRequest} DeleteDocumentRequest + */ + DeleteDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.DeleteDocumentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.DeleteDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.DeleteDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.DeleteDocumentRequest} message DeleteDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.DeleteDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteDocumentRequest; + })(); + + v2.UpdateDocumentRequest = (function() { + + /** + * Properties of an UpdateDocumentRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IUpdateDocumentRequest + * @property {google.cloud.dialogflow.v2.IDocument|null} [document] UpdateDocumentRequest document + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDocumentRequest updateMask + */ + + /** + * Constructs a new UpdateDocumentRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an UpdateDocumentRequest. + * @implements IUpdateDocumentRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IUpdateDocumentRequest=} [properties] Properties to set + */ + function UpdateDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDocumentRequest document. + * @member {google.cloud.dialogflow.v2.IDocument|null|undefined} document + * @memberof google.cloud.dialogflow.v2.UpdateDocumentRequest + * @instance + */ + UpdateDocumentRequest.prototype.document = null; + + /** + * UpdateDocumentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2.UpdateDocumentRequest + * @instance + */ + UpdateDocumentRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.UpdateDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.IUpdateDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.UpdateDocumentRequest} UpdateDocumentRequest instance + */ + UpdateDocumentRequest.create = function create(properties) { + return new UpdateDocumentRequest(properties); + }; + + /** + * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.UpdateDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.dialogflow.v2.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.UpdateDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.UpdateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.UpdateDocumentRequest} UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.document = $root.google.cloud.dialogflow.v2.Document.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.UpdateDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.UpdateDocumentRequest} UpdateDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDocumentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.UpdateDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.dialogflow.v2.Document.verify(message.document); + if (error) + return "document." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.UpdateDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.UpdateDocumentRequest} UpdateDocumentRequest + */ + UpdateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.UpdateDocumentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.UpdateDocumentRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateDocumentRequest.document: object expected"); + message.document = $root.google.cloud.dialogflow.v2.Document.fromObject(object.document); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateDocumentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.UpdateDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.UpdateDocumentRequest} message UpdateDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.document = null; + object.updateMask = null; + } + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.dialogflow.v2.Document.toObject(message.document, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.UpdateDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateDocumentRequest; + })(); + + v2.ReloadDocumentRequest = (function() { + + /** + * Properties of a ReloadDocumentRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IReloadDocumentRequest + * @property {string|null} [name] ReloadDocumentRequest name + * @property {string|null} [contentUri] ReloadDocumentRequest contentUri + */ + + /** + * Constructs a new ReloadDocumentRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ReloadDocumentRequest. + * @implements IReloadDocumentRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IReloadDocumentRequest=} [properties] Properties to set + */ + function ReloadDocumentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReloadDocumentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.ReloadDocumentRequest + * @instance + */ + ReloadDocumentRequest.prototype.name = ""; + + /** + * ReloadDocumentRequest contentUri. + * @member {string} contentUri + * @memberof google.cloud.dialogflow.v2.ReloadDocumentRequest + * @instance + */ + ReloadDocumentRequest.prototype.contentUri = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReloadDocumentRequest source. + * @member {"contentUri"|undefined} source + * @memberof google.cloud.dialogflow.v2.ReloadDocumentRequest + * @instance + */ + Object.defineProperty(ReloadDocumentRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["contentUri"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReloadDocumentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ReloadDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.IReloadDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ReloadDocumentRequest} ReloadDocumentRequest instance + */ + ReloadDocumentRequest.create = function create(properties) { + return new ReloadDocumentRequest(properties); + }; + + /** + * Encodes the specified ReloadDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ReloadDocumentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ReloadDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.IReloadDocumentRequest} message ReloadDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReloadDocumentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.contentUri != null && Object.hasOwnProperty.call(message, "contentUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.contentUri); + return writer; + }; + + /** + * Encodes the specified ReloadDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ReloadDocumentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.ReloadDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.IReloadDocumentRequest} message ReloadDocumentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReloadDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReloadDocumentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.ReloadDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.ReloadDocumentRequest} ReloadDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReloadDocumentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ReloadDocumentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.contentUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReloadDocumentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.ReloadDocumentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.ReloadDocumentRequest} ReloadDocumentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReloadDocumentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReloadDocumentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.ReloadDocumentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReloadDocumentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.contentUri != null && message.hasOwnProperty("contentUri")) { + properties.source = 1; + if (!$util.isString(message.contentUri)) + return "contentUri: string expected"; + } + return null; + }; + + /** + * Creates a ReloadDocumentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.ReloadDocumentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.ReloadDocumentRequest} ReloadDocumentRequest + */ + ReloadDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ReloadDocumentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.ReloadDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.contentUri != null) + message.contentUri = String(object.contentUri); + return message; + }; + + /** + * Creates a plain object from a ReloadDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.ReloadDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2.ReloadDocumentRequest} message ReloadDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReloadDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.contentUri != null && message.hasOwnProperty("contentUri")) { + object.contentUri = message.contentUri; + if (options.oneofs) + object.source = "contentUri"; + } + return object; + }; + + /** + * Converts this ReloadDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.ReloadDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + ReloadDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReloadDocumentRequest; + })(); + + v2.KnowledgeOperationMetadata = (function() { + + /** + * Properties of a KnowledgeOperationMetadata. + * @memberof google.cloud.dialogflow.v2 + * @interface IKnowledgeOperationMetadata + * @property {google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State|null} [state] KnowledgeOperationMetadata state + */ + + /** + * Constructs a new KnowledgeOperationMetadata. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a KnowledgeOperationMetadata. + * @implements IKnowledgeOperationMetadata + * @constructor + * @param {google.cloud.dialogflow.v2.IKnowledgeOperationMetadata=} [properties] Properties to set + */ + function KnowledgeOperationMetadata(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KnowledgeOperationMetadata state. + * @member {google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State} state + * @memberof google.cloud.dialogflow.v2.KnowledgeOperationMetadata + * @instance + */ + KnowledgeOperationMetadata.prototype.state = 0; + + /** + * Creates a new KnowledgeOperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.KnowledgeOperationMetadata + * @static + * @param {google.cloud.dialogflow.v2.IKnowledgeOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.KnowledgeOperationMetadata} KnowledgeOperationMetadata instance + */ + KnowledgeOperationMetadata.create = function create(properties) { + return new KnowledgeOperationMetadata(properties); + }; + + /** + * Encodes the specified KnowledgeOperationMetadata message. Does not implicitly {@link google.cloud.dialogflow.v2.KnowledgeOperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.KnowledgeOperationMetadata + * @static + * @param {google.cloud.dialogflow.v2.IKnowledgeOperationMetadata} message KnowledgeOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeOperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); + return writer; + }; + + /** + * Encodes the specified KnowledgeOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.KnowledgeOperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.KnowledgeOperationMetadata + * @static + * @param {google.cloud.dialogflow.v2.IKnowledgeOperationMetadata} message KnowledgeOperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KnowledgeOperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.KnowledgeOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.KnowledgeOperationMetadata} KnowledgeOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeOperationMetadata.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.KnowledgeOperationMetadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.state = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KnowledgeOperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.KnowledgeOperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.KnowledgeOperationMetadata} KnowledgeOperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeOperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KnowledgeOperationMetadata message. + * @function verify + * @memberof google.cloud.dialogflow.v2.KnowledgeOperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KnowledgeOperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a KnowledgeOperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.KnowledgeOperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.KnowledgeOperationMetadata} KnowledgeOperationMetadata + */ + KnowledgeOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.KnowledgeOperationMetadata) + return object; + var message = new $root.google.cloud.dialogflow.v2.KnowledgeOperationMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "DONE": + case 3: + message.state = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a KnowledgeOperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.KnowledgeOperationMetadata + * @static + * @param {google.cloud.dialogflow.v2.KnowledgeOperationMetadata} message KnowledgeOperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KnowledgeOperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State[message.state] : message.state; + return object; + }; + + /** + * Converts this KnowledgeOperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.KnowledgeOperationMetadata + * @instance + * @returns {Object.} JSON object + */ + KnowledgeOperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.dialogflow.v2.KnowledgeOperationMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} DONE=3 DONE value + */ + KnowledgeOperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "DONE"] = 3; + return values; + })(); + + return KnowledgeOperationMetadata; + })(); + + v2.Environments = (function() { + + /** + * Constructs a new Environments service. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an Environments + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Environments(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Environments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Environments; + + /** + * Creates new Environments service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2.Environments + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Environments} RPC service. Useful where requests and/or responses are streamed. + */ + Environments.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.Environments#listEnvironments}. + * @memberof google.cloud.dialogflow.v2.Environments + * @typedef ListEnvironmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.ListEnvironmentsResponse} [response] ListEnvironmentsResponse + */ + + /** + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.dialogflow.v2.Environments + * @instance + * @param {google.cloud.dialogflow.v2.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @param {google.cloud.dialogflow.v2.Environments.ListEnvironmentsCallback} callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.listEnvironments = function listEnvironments(request, callback) { + return this.rpcCall(listEnvironments, $root.google.cloud.dialogflow.v2.ListEnvironmentsRequest, $root.google.cloud.dialogflow.v2.ListEnvironmentsResponse, request, callback); + }, "name", { value: "ListEnvironments" }); + + /** + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.dialogflow.v2.Environments + * @instance + * @param {google.cloud.dialogflow.v2.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Environments; + })(); + + v2.Environment = (function() { + + /** + * Properties of an Environment. + * @memberof google.cloud.dialogflow.v2 + * @interface IEnvironment + * @property {string|null} [name] Environment name + * @property {string|null} [description] Environment description + * @property {string|null} [agentVersion] Environment agentVersion + * @property {google.cloud.dialogflow.v2.Environment.State|null} [state] Environment state + * @property {google.protobuf.ITimestamp|null} [updateTime] Environment updateTime + */ + + /** + * Constructs a new Environment. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an Environment. + * @implements IEnvironment + * @constructor + * @param {google.cloud.dialogflow.v2.IEnvironment=} [properties] Properties to set + */ + function Environment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Environment name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.Environment + * @instance + */ + Environment.prototype.name = ""; + + /** + * Environment description. + * @member {string} description + * @memberof google.cloud.dialogflow.v2.Environment + * @instance + */ + Environment.prototype.description = ""; + + /** + * Environment agentVersion. + * @member {string} agentVersion + * @memberof google.cloud.dialogflow.v2.Environment + * @instance + */ + Environment.prototype.agentVersion = ""; + + /** + * Environment state. + * @member {google.cloud.dialogflow.v2.Environment.State} state + * @memberof google.cloud.dialogflow.v2.Environment + * @instance + */ + Environment.prototype.state = 0; + + /** + * Environment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.v2.Environment + * @instance + */ + Environment.prototype.updateTime = null; + + /** + * Creates a new Environment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.Environment + * @static + * @param {google.cloud.dialogflow.v2.IEnvironment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.Environment} Environment instance + */ + Environment.create = function create(properties) { + return new Environment(properties); + }; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dialogflow.v2.Environment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.Environment + * @static + * @param {google.cloud.dialogflow.v2.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.agentVersion != null && Object.hasOwnProperty.call(message, "agentVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.agentVersion); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.Environment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.Environment + * @static + * @param {google.cloud.dialogflow.v2.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.Environment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.agentVersion = reader.string(); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Environment message. + * @function verify + * @memberof google.cloud.dialogflow.v2.Environment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Environment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.agentVersion != null && message.hasOwnProperty("agentVersion")) + if (!$util.isString(message.agentVersion)) + return "agentVersion: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.Environment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.Environment} Environment + */ + Environment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.Environment) + return object; + var message = new $root.google.cloud.dialogflow.v2.Environment(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.agentVersion != null) + message.agentVersion = String(object.agentVersion); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "STOPPED": + case 1: + message.state = 1; + break; + case "LOADING": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2.Environment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.Environment + * @static + * @param {google.cloud.dialogflow.v2.Environment} message Environment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Environment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.agentVersion = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.agentVersion != null && message.hasOwnProperty("agentVersion")) + object.agentVersion = message.agentVersion; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.v2.Environment.State[message.state] : message.state; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Environment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.Environment + * @instance + * @returns {Object.} JSON object + */ + Environment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.dialogflow.v2.Environment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} STOPPED=1 STOPPED value + * @property {number} LOADING=2 LOADING value + * @property {number} RUNNING=3 RUNNING value + */ + Environment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STOPPED"] = 1; + values[valuesById[2] = "LOADING"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + return values; + })(); + + return Environment; + })(); + + v2.ListEnvironmentsRequest = (function() { + + /** + * Properties of a ListEnvironmentsRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IListEnvironmentsRequest + * @property {string|null} [parent] ListEnvironmentsRequest parent + * @property {number|null} [pageSize] ListEnvironmentsRequest pageSize + * @property {string|null} [pageToken] ListEnvironmentsRequest pageToken + */ + + /** + * Constructs a new ListEnvironmentsRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListEnvironmentsRequest. + * @implements IListEnvironmentsRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IListEnvironmentsRequest=} [properties] Properties to set + */ + function ListEnvironmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEnvironmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.parent = ""; + + /** + * ListEnvironmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.pageSize = 0; + + /** + * ListEnvironmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEnvironmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListEnvironmentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListEnvironmentsRequest} ListEnvironmentsRequest instance + */ + ListEnvironmentsRequest.create = function create(properties) { + return new ListEnvironmentsRequest(properties); + }; + + /** + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.v2.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.ListEnvironmentsRequest} ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListEnvironmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.ListEnvironmentsRequest} ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEnvironmentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEnvironmentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.ListEnvironmentsRequest} ListEnvironmentsRequest + */ + ListEnvironmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListEnvironmentsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.ListEnvironmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.v2.ListEnvironmentsRequest} message ListEnvironmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEnvironmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListEnvironmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEnvironmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListEnvironmentsRequest; + })(); + + v2.ListEnvironmentsResponse = (function() { + + /** + * Properties of a ListEnvironmentsResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IListEnvironmentsResponse + * @property {Array.|null} [environments] ListEnvironmentsResponse environments + * @property {string|null} [nextPageToken] ListEnvironmentsResponse nextPageToken + */ + + /** + * Constructs a new ListEnvironmentsResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListEnvironmentsResponse. + * @implements IListEnvironmentsResponse + * @constructor + * @param {google.cloud.dialogflow.v2.IListEnvironmentsResponse=} [properties] Properties to set + */ + function ListEnvironmentsResponse(properties) { + this.environments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEnvironmentsResponse environments. + * @member {Array.} environments + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @instance + */ + ListEnvironmentsResponse.prototype.environments = $util.emptyArray; + + /** + * ListEnvironmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @instance + */ + ListEnvironmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEnvironmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListEnvironmentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListEnvironmentsResponse} ListEnvironmentsResponse instance + */ + ListEnvironmentsResponse.create = function create(properties) { + return new ListEnvironmentsResponse(properties); + }; + + /** + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environments != null && message.environments.length) + for (var i = 0; i < message.environments.length; ++i) + $root.google.cloud.dialogflow.v2.Environment.encode(message.environments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListEnvironmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.v2.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.ListEnvironmentsResponse} ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListEnvironmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.environments && message.environments.length)) + message.environments = []; + message.environments.push($root.google.cloud.dialogflow.v2.Environment.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.ListEnvironmentsResponse} ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEnvironmentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEnvironmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!Array.isArray(message.environments)) + return "environments: array expected"; + for (var i = 0; i < message.environments.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Environment.verify(message.environments[i]); + if (error) + return "environments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.ListEnvironmentsResponse} ListEnvironmentsResponse + */ + ListEnvironmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListEnvironmentsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2.ListEnvironmentsResponse(); + if (object.environments) { + if (!Array.isArray(object.environments)) + throw TypeError(".google.cloud.dialogflow.v2.ListEnvironmentsResponse.environments: array expected"); + message.environments = []; + for (var i = 0; i < object.environments.length; ++i) { + if (typeof object.environments[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListEnvironmentsResponse.environments: object expected"); + message.environments[i] = $root.google.cloud.dialogflow.v2.Environment.fromObject(object.environments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.v2.ListEnvironmentsResponse} message ListEnvironmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEnvironmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.environments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.environments && message.environments.length) { + object.environments = []; + for (var j = 0; j < message.environments.length; ++j) + object.environments[j] = $root.google.cloud.dialogflow.v2.Environment.toObject(message.environments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEnvironmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.ListEnvironmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEnvironmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListEnvironmentsResponse; + })(); + + v2.HumanAgentAssistantEvent = (function() { + + /** + * Properties of a HumanAgentAssistantEvent. + * @memberof google.cloud.dialogflow.v2 + * @interface IHumanAgentAssistantEvent + * @property {string|null} [conversation] HumanAgentAssistantEvent conversation + * @property {string|null} [participant] HumanAgentAssistantEvent participant + * @property {Array.|null} [suggestionResults] HumanAgentAssistantEvent suggestionResults + */ + + /** + * Constructs a new HumanAgentAssistantEvent. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a HumanAgentAssistantEvent. + * @implements IHumanAgentAssistantEvent + * @constructor + * @param {google.cloud.dialogflow.v2.IHumanAgentAssistantEvent=} [properties] Properties to set + */ + function HumanAgentAssistantEvent(properties) { + this.suggestionResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * HumanAgentAssistantEvent conversation. + * @member {string} conversation + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantEvent + * @instance + */ + HumanAgentAssistantEvent.prototype.conversation = ""; + + /** + * HumanAgentAssistantEvent participant. + * @member {string} participant + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantEvent + * @instance + */ + HumanAgentAssistantEvent.prototype.participant = ""; + + /** + * HumanAgentAssistantEvent suggestionResults. + * @member {Array.} suggestionResults + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantEvent + * @instance + */ + HumanAgentAssistantEvent.prototype.suggestionResults = $util.emptyArray; + + /** + * Creates a new HumanAgentAssistantEvent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantEvent + * @static + * @param {google.cloud.dialogflow.v2.IHumanAgentAssistantEvent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantEvent} HumanAgentAssistantEvent instance + */ + HumanAgentAssistantEvent.create = function create(properties) { + return new HumanAgentAssistantEvent(properties); + }; + + /** + * Encodes the specified HumanAgentAssistantEvent message. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantEvent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantEvent + * @static + * @param {google.cloud.dialogflow.v2.IHumanAgentAssistantEvent} message HumanAgentAssistantEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanAgentAssistantEvent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.participant); + if (message.suggestionResults != null && message.suggestionResults.length) + for (var i = 0; i < message.suggestionResults.length; ++i) + $root.google.cloud.dialogflow.v2.SuggestionResult.encode(message.suggestionResults[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified HumanAgentAssistantEvent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.HumanAgentAssistantEvent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantEvent + * @static + * @param {google.cloud.dialogflow.v2.IHumanAgentAssistantEvent} message HumanAgentAssistantEvent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + HumanAgentAssistantEvent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a HumanAgentAssistantEvent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantEvent} HumanAgentAssistantEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HumanAgentAssistantEvent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantEvent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.conversation = reader.string(); + break; + case 3: + message.participant = reader.string(); + break; + case 5: + if (!(message.suggestionResults && message.suggestionResults.length)) + message.suggestionResults = []; + message.suggestionResults.push($root.google.cloud.dialogflow.v2.SuggestionResult.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a HumanAgentAssistantEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantEvent} HumanAgentAssistantEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + HumanAgentAssistantEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a HumanAgentAssistantEvent message. + * @function verify + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + HumanAgentAssistantEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + if (message.suggestionResults != null && message.hasOwnProperty("suggestionResults")) { + if (!Array.isArray(message.suggestionResults)) + return "suggestionResults: array expected"; + for (var i = 0; i < message.suggestionResults.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.SuggestionResult.verify(message.suggestionResults[i]); + if (error) + return "suggestionResults." + error; + } + } + return null; + }; + + /** + * Creates a HumanAgentAssistantEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.HumanAgentAssistantEvent} HumanAgentAssistantEvent + */ + HumanAgentAssistantEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.HumanAgentAssistantEvent) + return object; + var message = new $root.google.cloud.dialogflow.v2.HumanAgentAssistantEvent(); + if (object.conversation != null) + message.conversation = String(object.conversation); + if (object.participant != null) + message.participant = String(object.participant); + if (object.suggestionResults) { + if (!Array.isArray(object.suggestionResults)) + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantEvent.suggestionResults: array expected"); + message.suggestionResults = []; + for (var i = 0; i < object.suggestionResults.length; ++i) { + if (typeof object.suggestionResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.HumanAgentAssistantEvent.suggestionResults: object expected"); + message.suggestionResults[i] = $root.google.cloud.dialogflow.v2.SuggestionResult.fromObject(object.suggestionResults[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a HumanAgentAssistantEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantEvent + * @static + * @param {google.cloud.dialogflow.v2.HumanAgentAssistantEvent} message HumanAgentAssistantEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + HumanAgentAssistantEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.suggestionResults = []; + if (options.defaults) { + object.conversation = ""; + object.participant = ""; + } + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + if (message.suggestionResults && message.suggestionResults.length) { + object.suggestionResults = []; + for (var j = 0; j < message.suggestionResults.length; ++j) + object.suggestionResults[j] = $root.google.cloud.dialogflow.v2.SuggestionResult.toObject(message.suggestionResults[j], options); + } + return object; + }; + + /** + * Converts this HumanAgentAssistantEvent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.HumanAgentAssistantEvent + * @instance + * @returns {Object.} JSON object + */ + HumanAgentAssistantEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return HumanAgentAssistantEvent; + })(); + + v2.KnowledgeBases = (function() { + + /** + * Constructs a new KnowledgeBases service. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a KnowledgeBases + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function KnowledgeBases(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (KnowledgeBases.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = KnowledgeBases; + + /** + * Creates new KnowledgeBases service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {KnowledgeBases} RPC service. Useful where requests and/or responses are streamed. + */ + KnowledgeBases.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.KnowledgeBases#listKnowledgeBases}. + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @typedef ListKnowledgeBasesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.ListKnowledgeBasesResponse} [response] ListKnowledgeBasesResponse + */ + + /** + * Calls ListKnowledgeBases. + * @function listKnowledgeBases + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @instance + * @param {google.cloud.dialogflow.v2.IListKnowledgeBasesRequest} request ListKnowledgeBasesRequest message or plain object + * @param {google.cloud.dialogflow.v2.KnowledgeBases.ListKnowledgeBasesCallback} callback Node-style callback called with the error, if any, and ListKnowledgeBasesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KnowledgeBases.prototype.listKnowledgeBases = function listKnowledgeBases(request, callback) { + return this.rpcCall(listKnowledgeBases, $root.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest, $root.google.cloud.dialogflow.v2.ListKnowledgeBasesResponse, request, callback); + }, "name", { value: "ListKnowledgeBases" }); + + /** + * Calls ListKnowledgeBases. + * @function listKnowledgeBases + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @instance + * @param {google.cloud.dialogflow.v2.IListKnowledgeBasesRequest} request ListKnowledgeBasesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.KnowledgeBases#getKnowledgeBase}. + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @typedef GetKnowledgeBaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.KnowledgeBase} [response] KnowledgeBase + */ + + /** + * Calls GetKnowledgeBase. + * @function getKnowledgeBase + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @instance + * @param {google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest} request GetKnowledgeBaseRequest message or plain object + * @param {google.cloud.dialogflow.v2.KnowledgeBases.GetKnowledgeBaseCallback} callback Node-style callback called with the error, if any, and KnowledgeBase + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KnowledgeBases.prototype.getKnowledgeBase = function getKnowledgeBase(request, callback) { + return this.rpcCall(getKnowledgeBase, $root.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest, $root.google.cloud.dialogflow.v2.KnowledgeBase, request, callback); + }, "name", { value: "GetKnowledgeBase" }); + + /** + * Calls GetKnowledgeBase. + * @function getKnowledgeBase + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @instance + * @param {google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest} request GetKnowledgeBaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.KnowledgeBases#createKnowledgeBase}. + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @typedef CreateKnowledgeBaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.KnowledgeBase} [response] KnowledgeBase + */ + + /** + * Calls CreateKnowledgeBase. + * @function createKnowledgeBase + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @instance + * @param {google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest} request CreateKnowledgeBaseRequest message or plain object + * @param {google.cloud.dialogflow.v2.KnowledgeBases.CreateKnowledgeBaseCallback} callback Node-style callback called with the error, if any, and KnowledgeBase + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KnowledgeBases.prototype.createKnowledgeBase = function createKnowledgeBase(request, callback) { + return this.rpcCall(createKnowledgeBase, $root.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest, $root.google.cloud.dialogflow.v2.KnowledgeBase, request, callback); + }, "name", { value: "CreateKnowledgeBase" }); + + /** + * Calls CreateKnowledgeBase. + * @function createKnowledgeBase + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @instance + * @param {google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest} request CreateKnowledgeBaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.KnowledgeBases#deleteKnowledgeBase}. + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @typedef DeleteKnowledgeBaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteKnowledgeBase. + * @function deleteKnowledgeBase + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest} request DeleteKnowledgeBaseRequest message or plain object + * @param {google.cloud.dialogflow.v2.KnowledgeBases.DeleteKnowledgeBaseCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KnowledgeBases.prototype.deleteKnowledgeBase = function deleteKnowledgeBase(request, callback) { + return this.rpcCall(deleteKnowledgeBase, $root.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteKnowledgeBase" }); + + /** + * Calls DeleteKnowledgeBase. + * @function deleteKnowledgeBase + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @instance + * @param {google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest} request DeleteKnowledgeBaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2.KnowledgeBases#updateKnowledgeBase}. + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @typedef UpdateKnowledgeBaseCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2.KnowledgeBase} [response] KnowledgeBase + */ + + /** + * Calls UpdateKnowledgeBase. + * @function updateKnowledgeBase + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest} request UpdateKnowledgeBaseRequest message or plain object + * @param {google.cloud.dialogflow.v2.KnowledgeBases.UpdateKnowledgeBaseCallback} callback Node-style callback called with the error, if any, and KnowledgeBase + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(KnowledgeBases.prototype.updateKnowledgeBase = function updateKnowledgeBase(request, callback) { + return this.rpcCall(updateKnowledgeBase, $root.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest, $root.google.cloud.dialogflow.v2.KnowledgeBase, request, callback); + }, "name", { value: "UpdateKnowledgeBase" }); + + /** + * Calls UpdateKnowledgeBase. + * @function updateKnowledgeBase + * @memberof google.cloud.dialogflow.v2.KnowledgeBases + * @instance + * @param {google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest} request UpdateKnowledgeBaseRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return KnowledgeBases; + })(); + + v2.KnowledgeBase = (function() { + + /** + * Properties of a KnowledgeBase. + * @memberof google.cloud.dialogflow.v2 + * @interface IKnowledgeBase + * @property {string|null} [name] KnowledgeBase name + * @property {string|null} [displayName] KnowledgeBase displayName + * @property {string|null} [languageCode] KnowledgeBase languageCode + */ + + /** + * Constructs a new KnowledgeBase. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a KnowledgeBase. + * @implements IKnowledgeBase + * @constructor + * @param {google.cloud.dialogflow.v2.IKnowledgeBase=} [properties] Properties to set + */ + function KnowledgeBase(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KnowledgeBase name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.KnowledgeBase + * @instance + */ + KnowledgeBase.prototype.name = ""; + + /** + * KnowledgeBase displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2.KnowledgeBase + * @instance + */ + KnowledgeBase.prototype.displayName = ""; + + /** + * KnowledgeBase languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2.KnowledgeBase + * @instance + */ + KnowledgeBase.prototype.languageCode = ""; + + /** + * Creates a new KnowledgeBase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.KnowledgeBase + * @static + * @param {google.cloud.dialogflow.v2.IKnowledgeBase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.KnowledgeBase} KnowledgeBase instance + */ + KnowledgeBase.create = function create(properties) { + return new KnowledgeBase(properties); + }; + + /** + * Encodes the specified KnowledgeBase message. Does not implicitly {@link google.cloud.dialogflow.v2.KnowledgeBase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.KnowledgeBase + * @static + * @param {google.cloud.dialogflow.v2.IKnowledgeBase} message KnowledgeBase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeBase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified KnowledgeBase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.KnowledgeBase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.KnowledgeBase + * @static + * @param {google.cloud.dialogflow.v2.IKnowledgeBase} message KnowledgeBase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeBase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KnowledgeBase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.KnowledgeBase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.KnowledgeBase} KnowledgeBase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeBase.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.KnowledgeBase(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 4: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KnowledgeBase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.KnowledgeBase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.KnowledgeBase} KnowledgeBase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeBase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KnowledgeBase message. + * @function verify + * @memberof google.cloud.dialogflow.v2.KnowledgeBase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KnowledgeBase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a KnowledgeBase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.KnowledgeBase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.KnowledgeBase} KnowledgeBase + */ + KnowledgeBase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.KnowledgeBase) + return object; + var message = new $root.google.cloud.dialogflow.v2.KnowledgeBase(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a KnowledgeBase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.KnowledgeBase + * @static + * @param {google.cloud.dialogflow.v2.KnowledgeBase} message KnowledgeBase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KnowledgeBase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this KnowledgeBase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.KnowledgeBase + * @instance + * @returns {Object.} JSON object + */ + KnowledgeBase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return KnowledgeBase; + })(); + + v2.ListKnowledgeBasesRequest = (function() { + + /** + * Properties of a ListKnowledgeBasesRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IListKnowledgeBasesRequest + * @property {string|null} [parent] ListKnowledgeBasesRequest parent + * @property {number|null} [pageSize] ListKnowledgeBasesRequest pageSize + * @property {string|null} [pageToken] ListKnowledgeBasesRequest pageToken + */ + + /** + * Constructs a new ListKnowledgeBasesRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListKnowledgeBasesRequest. + * @implements IListKnowledgeBasesRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IListKnowledgeBasesRequest=} [properties] Properties to set + */ + function ListKnowledgeBasesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListKnowledgeBasesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + * @instance + */ + ListKnowledgeBasesRequest.prototype.parent = ""; + + /** + * ListKnowledgeBasesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + * @instance + */ + ListKnowledgeBasesRequest.prototype.pageSize = 0; + + /** + * ListKnowledgeBasesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + * @instance + */ + ListKnowledgeBasesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListKnowledgeBasesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + * @static + * @param {google.cloud.dialogflow.v2.IListKnowledgeBasesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListKnowledgeBasesRequest} ListKnowledgeBasesRequest instance + */ + ListKnowledgeBasesRequest.create = function create(properties) { + return new ListKnowledgeBasesRequest(properties); + }; + + /** + * Encodes the specified ListKnowledgeBasesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.ListKnowledgeBasesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + * @static + * @param {google.cloud.dialogflow.v2.IListKnowledgeBasesRequest} message ListKnowledgeBasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKnowledgeBasesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListKnowledgeBasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListKnowledgeBasesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + * @static + * @param {google.cloud.dialogflow.v2.IListKnowledgeBasesRequest} message ListKnowledgeBasesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKnowledgeBasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListKnowledgeBasesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.ListKnowledgeBasesRequest} ListKnowledgeBasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKnowledgeBasesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListKnowledgeBasesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.ListKnowledgeBasesRequest} ListKnowledgeBasesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKnowledgeBasesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListKnowledgeBasesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListKnowledgeBasesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListKnowledgeBasesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.ListKnowledgeBasesRequest} ListKnowledgeBasesRequest + */ + ListKnowledgeBasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListKnowledgeBasesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + * @static + * @param {google.cloud.dialogflow.v2.ListKnowledgeBasesRequest} message ListKnowledgeBasesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListKnowledgeBasesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListKnowledgeBasesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesRequest + * @instance + * @returns {Object.} JSON object + */ + ListKnowledgeBasesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListKnowledgeBasesRequest; + })(); + + v2.ListKnowledgeBasesResponse = (function() { + + /** + * Properties of a ListKnowledgeBasesResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IListKnowledgeBasesResponse + * @property {Array.|null} [knowledgeBases] ListKnowledgeBasesResponse knowledgeBases + * @property {string|null} [nextPageToken] ListKnowledgeBasesResponse nextPageToken + */ + + /** + * Constructs a new ListKnowledgeBasesResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a ListKnowledgeBasesResponse. + * @implements IListKnowledgeBasesResponse + * @constructor + * @param {google.cloud.dialogflow.v2.IListKnowledgeBasesResponse=} [properties] Properties to set + */ + function ListKnowledgeBasesResponse(properties) { + this.knowledgeBases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListKnowledgeBasesResponse knowledgeBases. + * @member {Array.} knowledgeBases + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + * @instance + */ + ListKnowledgeBasesResponse.prototype.knowledgeBases = $util.emptyArray; + + /** + * ListKnowledgeBasesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + * @instance + */ + ListKnowledgeBasesResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListKnowledgeBasesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + * @static + * @param {google.cloud.dialogflow.v2.IListKnowledgeBasesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.ListKnowledgeBasesResponse} ListKnowledgeBasesResponse instance + */ + ListKnowledgeBasesResponse.create = function create(properties) { + return new ListKnowledgeBasesResponse(properties); + }; + + /** + * Encodes the specified ListKnowledgeBasesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.ListKnowledgeBasesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + * @static + * @param {google.cloud.dialogflow.v2.IListKnowledgeBasesResponse} message ListKnowledgeBasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKnowledgeBasesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.knowledgeBases != null && message.knowledgeBases.length) + for (var i = 0; i < message.knowledgeBases.length; ++i) + $root.google.cloud.dialogflow.v2.KnowledgeBase.encode(message.knowledgeBases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListKnowledgeBasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.ListKnowledgeBasesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + * @static + * @param {google.cloud.dialogflow.v2.IListKnowledgeBasesResponse} message ListKnowledgeBasesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListKnowledgeBasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListKnowledgeBasesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.ListKnowledgeBasesResponse} ListKnowledgeBasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKnowledgeBasesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.ListKnowledgeBasesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.knowledgeBases && message.knowledgeBases.length)) + message.knowledgeBases = []; + message.knowledgeBases.push($root.google.cloud.dialogflow.v2.KnowledgeBase.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListKnowledgeBasesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.ListKnowledgeBasesResponse} ListKnowledgeBasesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListKnowledgeBasesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListKnowledgeBasesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListKnowledgeBasesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.knowledgeBases != null && message.hasOwnProperty("knowledgeBases")) { + if (!Array.isArray(message.knowledgeBases)) + return "knowledgeBases: array expected"; + for (var i = 0; i < message.knowledgeBases.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.KnowledgeBase.verify(message.knowledgeBases[i]); + if (error) + return "knowledgeBases." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListKnowledgeBasesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.ListKnowledgeBasesResponse} ListKnowledgeBasesResponse + */ + ListKnowledgeBasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.ListKnowledgeBasesResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2.ListKnowledgeBasesResponse(); + if (object.knowledgeBases) { + if (!Array.isArray(object.knowledgeBases)) + throw TypeError(".google.cloud.dialogflow.v2.ListKnowledgeBasesResponse.knowledgeBases: array expected"); + message.knowledgeBases = []; + for (var i = 0; i < object.knowledgeBases.length; ++i) { + if (typeof object.knowledgeBases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.ListKnowledgeBasesResponse.knowledgeBases: object expected"); + message.knowledgeBases[i] = $root.google.cloud.dialogflow.v2.KnowledgeBase.fromObject(object.knowledgeBases[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListKnowledgeBasesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + * @static + * @param {google.cloud.dialogflow.v2.ListKnowledgeBasesResponse} message ListKnowledgeBasesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListKnowledgeBasesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.knowledgeBases = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.knowledgeBases && message.knowledgeBases.length) { + object.knowledgeBases = []; + for (var j = 0; j < message.knowledgeBases.length; ++j) + object.knowledgeBases[j] = $root.google.cloud.dialogflow.v2.KnowledgeBase.toObject(message.knowledgeBases[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListKnowledgeBasesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.ListKnowledgeBasesResponse + * @instance + * @returns {Object.} JSON object + */ + ListKnowledgeBasesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListKnowledgeBasesResponse; + })(); + + v2.GetKnowledgeBaseRequest = (function() { + + /** + * Properties of a GetKnowledgeBaseRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IGetKnowledgeBaseRequest + * @property {string|null} [name] GetKnowledgeBaseRequest name + */ + + /** + * Constructs a new GetKnowledgeBaseRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a GetKnowledgeBaseRequest. + * @implements IGetKnowledgeBaseRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest=} [properties] Properties to set + */ + function GetKnowledgeBaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetKnowledgeBaseRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.GetKnowledgeBaseRequest + * @instance + */ + GetKnowledgeBaseRequest.prototype.name = ""; + + /** + * Creates a new GetKnowledgeBaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.GetKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.GetKnowledgeBaseRequest} GetKnowledgeBaseRequest instance + */ + GetKnowledgeBaseRequest.create = function create(properties) { + return new GetKnowledgeBaseRequest(properties); + }; + + /** + * Encodes the specified GetKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.GetKnowledgeBaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.GetKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest} message GetKnowledgeBaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetKnowledgeBaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.GetKnowledgeBaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.GetKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest} message GetKnowledgeBaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetKnowledgeBaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetKnowledgeBaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.GetKnowledgeBaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.GetKnowledgeBaseRequest} GetKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetKnowledgeBaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.GetKnowledgeBaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.GetKnowledgeBaseRequest} GetKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetKnowledgeBaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetKnowledgeBaseRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.GetKnowledgeBaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetKnowledgeBaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.GetKnowledgeBaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.GetKnowledgeBaseRequest} GetKnowledgeBaseRequest + */ + GetKnowledgeBaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetKnowledgeBaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.GetKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.GetKnowledgeBaseRequest} message GetKnowledgeBaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetKnowledgeBaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetKnowledgeBaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.GetKnowledgeBaseRequest + * @instance + * @returns {Object.} JSON object + */ + GetKnowledgeBaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetKnowledgeBaseRequest; + })(); + + v2.CreateKnowledgeBaseRequest = (function() { + + /** + * Properties of a CreateKnowledgeBaseRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface ICreateKnowledgeBaseRequest + * @property {string|null} [parent] CreateKnowledgeBaseRequest parent + * @property {google.cloud.dialogflow.v2.IKnowledgeBase|null} [knowledgeBase] CreateKnowledgeBaseRequest knowledgeBase + */ + + /** + * Constructs a new CreateKnowledgeBaseRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a CreateKnowledgeBaseRequest. + * @implements ICreateKnowledgeBaseRequest + * @constructor + * @param {google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest=} [properties] Properties to set + */ + function CreateKnowledgeBaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateKnowledgeBaseRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + * @instance + */ + CreateKnowledgeBaseRequest.prototype.parent = ""; + + /** + * CreateKnowledgeBaseRequest knowledgeBase. + * @member {google.cloud.dialogflow.v2.IKnowledgeBase|null|undefined} knowledgeBase + * @memberof google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + * @instance + */ + CreateKnowledgeBaseRequest.prototype.knowledgeBase = null; + + /** + * Creates a new CreateKnowledgeBaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest} CreateKnowledgeBaseRequest instance + */ + CreateKnowledgeBaseRequest.create = function create(properties) { + return new CreateKnowledgeBaseRequest(properties); + }; + + /** + * Encodes the specified CreateKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest} message CreateKnowledgeBaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateKnowledgeBaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.knowledgeBase != null && Object.hasOwnProperty.call(message, "knowledgeBase")) + $root.google.cloud.dialogflow.v2.KnowledgeBase.encode(message.knowledgeBase, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest} message CreateKnowledgeBaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateKnowledgeBaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateKnowledgeBaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest} CreateKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateKnowledgeBaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.knowledgeBase = $root.google.cloud.dialogflow.v2.KnowledgeBase.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest} CreateKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateKnowledgeBaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateKnowledgeBaseRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateKnowledgeBaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.knowledgeBase != null && message.hasOwnProperty("knowledgeBase")) { + var error = $root.google.cloud.dialogflow.v2.KnowledgeBase.verify(message.knowledgeBase); + if (error) + return "knowledgeBase." + error; + } + return null; + }; + + /** + * Creates a CreateKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest} CreateKnowledgeBaseRequest + */ + CreateKnowledgeBaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.knowledgeBase != null) { + if (typeof object.knowledgeBase !== "object") + throw TypeError(".google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest.knowledgeBase: object expected"); + message.knowledgeBase = $root.google.cloud.dialogflow.v2.KnowledgeBase.fromObject(object.knowledgeBase); + } + return message; + }; + + /** + * Creates a plain object from a CreateKnowledgeBaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest} message CreateKnowledgeBaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateKnowledgeBaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.knowledgeBase = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.knowledgeBase != null && message.hasOwnProperty("knowledgeBase")) + object.knowledgeBase = $root.google.cloud.dialogflow.v2.KnowledgeBase.toObject(message.knowledgeBase, options); + return object; + }; + + /** + * Converts this CreateKnowledgeBaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest + * @instance + * @returns {Object.} JSON object + */ + CreateKnowledgeBaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateKnowledgeBaseRequest; + })(); + + v2.DeleteKnowledgeBaseRequest = (function() { + + /** + * Properties of a DeleteKnowledgeBaseRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IDeleteKnowledgeBaseRequest + * @property {string|null} [name] DeleteKnowledgeBaseRequest name + * @property {boolean|null} [force] DeleteKnowledgeBaseRequest force + */ + + /** + * Constructs a new DeleteKnowledgeBaseRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a DeleteKnowledgeBaseRequest. + * @implements IDeleteKnowledgeBaseRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest=} [properties] Properties to set + */ + function DeleteKnowledgeBaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteKnowledgeBaseRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + * @instance + */ + DeleteKnowledgeBaseRequest.prototype.name = ""; + + /** + * DeleteKnowledgeBaseRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + * @instance + */ + DeleteKnowledgeBaseRequest.prototype.force = false; + + /** + * Creates a new DeleteKnowledgeBaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest} DeleteKnowledgeBaseRequest instance + */ + DeleteKnowledgeBaseRequest.create = function create(properties) { + return new DeleteKnowledgeBaseRequest(properties); + }; + + /** + * Encodes the specified DeleteKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest} message DeleteKnowledgeBaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteKnowledgeBaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); + return writer; + }; + + /** + * Encodes the specified DeleteKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest} message DeleteKnowledgeBaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteKnowledgeBaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteKnowledgeBaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest} DeleteKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteKnowledgeBaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.force = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest} DeleteKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteKnowledgeBaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteKnowledgeBaseRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteKnowledgeBaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + return null; + }; + + /** + * Creates a DeleteKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest} DeleteKnowledgeBaseRequest + */ + DeleteKnowledgeBaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); + return message; + }; + + /** + * Creates a plain object from a DeleteKnowledgeBaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest} message DeleteKnowledgeBaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteKnowledgeBaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.force = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + return object; + }; + + /** + * Converts this DeleteKnowledgeBaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteKnowledgeBaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteKnowledgeBaseRequest; + })(); + + v2.UpdateKnowledgeBaseRequest = (function() { + + /** + * Properties of an UpdateKnowledgeBaseRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IUpdateKnowledgeBaseRequest + * @property {google.cloud.dialogflow.v2.IKnowledgeBase|null} [knowledgeBase] UpdateKnowledgeBaseRequest knowledgeBase + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateKnowledgeBaseRequest updateMask + */ + + /** + * Constructs a new UpdateKnowledgeBaseRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an UpdateKnowledgeBaseRequest. + * @implements IUpdateKnowledgeBaseRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest=} [properties] Properties to set + */ + function UpdateKnowledgeBaseRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateKnowledgeBaseRequest knowledgeBase. + * @member {google.cloud.dialogflow.v2.IKnowledgeBase|null|undefined} knowledgeBase + * @memberof google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + * @instance + */ + UpdateKnowledgeBaseRequest.prototype.knowledgeBase = null; + + /** + * UpdateKnowledgeBaseRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + * @instance + */ + UpdateKnowledgeBaseRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateKnowledgeBaseRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest} UpdateKnowledgeBaseRequest instance + */ + UpdateKnowledgeBaseRequest.create = function create(properties) { + return new UpdateKnowledgeBaseRequest(properties); + }; + + /** + * Encodes the specified UpdateKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest} message UpdateKnowledgeBaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateKnowledgeBaseRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.knowledgeBase != null && Object.hasOwnProperty.call(message, "knowledgeBase")) + $root.google.cloud.dialogflow.v2.KnowledgeBase.encode(message.knowledgeBase, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest} message UpdateKnowledgeBaseRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateKnowledgeBaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateKnowledgeBaseRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest} UpdateKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateKnowledgeBaseRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.knowledgeBase = $root.google.cloud.dialogflow.v2.KnowledgeBase.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest} UpdateKnowledgeBaseRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateKnowledgeBaseRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateKnowledgeBaseRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateKnowledgeBaseRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.knowledgeBase != null && message.hasOwnProperty("knowledgeBase")) { + var error = $root.google.cloud.dialogflow.v2.KnowledgeBase.verify(message.knowledgeBase); + if (error) + return "knowledgeBase." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest} UpdateKnowledgeBaseRequest + */ + UpdateKnowledgeBaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest(); + if (object.knowledgeBase != null) { + if (typeof object.knowledgeBase !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest.knowledgeBase: object expected"); + message.knowledgeBase = $root.google.cloud.dialogflow.v2.KnowledgeBase.fromObject(object.knowledgeBase); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateKnowledgeBaseRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + * @static + * @param {google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest} message UpdateKnowledgeBaseRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateKnowledgeBaseRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.knowledgeBase = null; + object.updateMask = null; + } + if (message.knowledgeBase != null && message.hasOwnProperty("knowledgeBase")) + object.knowledgeBase = $root.google.cloud.dialogflow.v2.KnowledgeBase.toObject(message.knowledgeBase, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateKnowledgeBaseRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateKnowledgeBaseRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateKnowledgeBaseRequest; + })(); + + v2.WebhookRequest = (function() { + + /** + * Properties of a WebhookRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IWebhookRequest + * @property {string|null} [session] WebhookRequest session + * @property {string|null} [responseId] WebhookRequest responseId + * @property {google.cloud.dialogflow.v2.IQueryResult|null} [queryResult] WebhookRequest queryResult + * @property {google.cloud.dialogflow.v2.IOriginalDetectIntentRequest|null} [originalDetectIntentRequest] WebhookRequest originalDetectIntentRequest + */ + + /** + * Constructs a new WebhookRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a WebhookRequest. + * @implements IWebhookRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IWebhookRequest=} [properties] Properties to set + */ + function WebhookRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebhookRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @instance + */ + WebhookRequest.prototype.session = ""; + + /** + * WebhookRequest responseId. + * @member {string} responseId + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @instance + */ + WebhookRequest.prototype.responseId = ""; + + /** + * WebhookRequest queryResult. + * @member {google.cloud.dialogflow.v2.IQueryResult|null|undefined} queryResult + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @instance + */ + WebhookRequest.prototype.queryResult = null; + + /** + * WebhookRequest originalDetectIntentRequest. + * @member {google.cloud.dialogflow.v2.IOriginalDetectIntentRequest|null|undefined} originalDetectIntentRequest + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @instance + */ + WebhookRequest.prototype.originalDetectIntentRequest = null; + + /** + * Creates a new WebhookRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @static + * @param {google.cloud.dialogflow.v2.IWebhookRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.WebhookRequest} WebhookRequest instance + */ + WebhookRequest.create = function create(properties) { + return new WebhookRequest(properties); + }; + + /** + * Encodes the specified WebhookRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @static + * @param {google.cloud.dialogflow.v2.IWebhookRequest} message WebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) + $root.google.cloud.dialogflow.v2.QueryResult.encode(message.queryResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.originalDetectIntentRequest != null && Object.hasOwnProperty.call(message, "originalDetectIntentRequest")) + $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest.encode(message.originalDetectIntentRequest, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.session); + return writer; + }; + + /** + * Encodes the specified WebhookRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @static + * @param {google.cloud.dialogflow.v2.IWebhookRequest} message WebhookRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebhookRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.WebhookRequest} WebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.WebhookRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 4: + message.session = reader.string(); + break; + case 1: + message.responseId = reader.string(); + break; + case 2: + message.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.decode(reader, reader.uint32()); + break; + case 3: + message.originalDetectIntentRequest = $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebhookRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.WebhookRequest} WebhookRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebhookRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebhookRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + var error = $root.google.cloud.dialogflow.v2.QueryResult.verify(message.queryResult); + if (error) + return "queryResult." + error; + } + if (message.originalDetectIntentRequest != null && message.hasOwnProperty("originalDetectIntentRequest")) { + var error = $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest.verify(message.originalDetectIntentRequest); + if (error) + return "originalDetectIntentRequest." + error; + } + return null; + }; + + /** + * Creates a WebhookRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.WebhookRequest} WebhookRequest + */ + WebhookRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.WebhookRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.WebhookRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.responseId != null) + message.responseId = String(object.responseId); + if (object.queryResult != null) { + if (typeof object.queryResult !== "object") + throw TypeError(".google.cloud.dialogflow.v2.WebhookRequest.queryResult: object expected"); + message.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.fromObject(object.queryResult); + } + if (object.originalDetectIntentRequest != null) { + if (typeof object.originalDetectIntentRequest !== "object") + throw TypeError(".google.cloud.dialogflow.v2.WebhookRequest.originalDetectIntentRequest: object expected"); + message.originalDetectIntentRequest = $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest.fromObject(object.originalDetectIntentRequest); + } + return message; + }; + + /** + * Creates a plain object from a WebhookRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @static + * @param {google.cloud.dialogflow.v2.WebhookRequest} message WebhookRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebhookRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.responseId = ""; + object.queryResult = null; + object.originalDetectIntentRequest = null; + object.session = ""; + } + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) + object.queryResult = $root.google.cloud.dialogflow.v2.QueryResult.toObject(message.queryResult, options); + if (message.originalDetectIntentRequest != null && message.hasOwnProperty("originalDetectIntentRequest")) + object.originalDetectIntentRequest = $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest.toObject(message.originalDetectIntentRequest, options); + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + return object; + }; + + /** + * Converts this WebhookRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.WebhookRequest + * @instance + * @returns {Object.} JSON object + */ + WebhookRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebhookRequest; + })(); + + v2.WebhookResponse = (function() { + + /** + * Properties of a WebhookResponse. + * @memberof google.cloud.dialogflow.v2 + * @interface IWebhookResponse + * @property {string|null} [fulfillmentText] WebhookResponse fulfillmentText + * @property {Array.|null} [fulfillmentMessages] WebhookResponse fulfillmentMessages + * @property {string|null} [source] WebhookResponse source + * @property {google.protobuf.IStruct|null} [payload] WebhookResponse payload + * @property {Array.|null} [outputContexts] WebhookResponse outputContexts + * @property {google.cloud.dialogflow.v2.IEventInput|null} [followupEventInput] WebhookResponse followupEventInput + * @property {Array.|null} [sessionEntityTypes] WebhookResponse sessionEntityTypes + */ + + /** + * Constructs a new WebhookResponse. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents a WebhookResponse. + * @implements IWebhookResponse + * @constructor + * @param {google.cloud.dialogflow.v2.IWebhookResponse=} [properties] Properties to set + */ + function WebhookResponse(properties) { + this.fulfillmentMessages = []; + this.outputContexts = []; + this.sessionEntityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WebhookResponse fulfillmentText. + * @member {string} fulfillmentText + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @instance + */ + WebhookResponse.prototype.fulfillmentText = ""; + + /** + * WebhookResponse fulfillmentMessages. + * @member {Array.} fulfillmentMessages + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @instance + */ + WebhookResponse.prototype.fulfillmentMessages = $util.emptyArray; + + /** + * WebhookResponse source. + * @member {string} source + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @instance + */ + WebhookResponse.prototype.source = ""; + + /** + * WebhookResponse payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @instance + */ + WebhookResponse.prototype.payload = null; + + /** + * WebhookResponse outputContexts. + * @member {Array.} outputContexts + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @instance + */ + WebhookResponse.prototype.outputContexts = $util.emptyArray; + + /** + * WebhookResponse followupEventInput. + * @member {google.cloud.dialogflow.v2.IEventInput|null|undefined} followupEventInput + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @instance + */ + WebhookResponse.prototype.followupEventInput = null; + + /** + * WebhookResponse sessionEntityTypes. + * @member {Array.} sessionEntityTypes + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @instance + */ + WebhookResponse.prototype.sessionEntityTypes = $util.emptyArray; + + /** + * Creates a new WebhookResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @static + * @param {google.cloud.dialogflow.v2.IWebhookResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.WebhookResponse} WebhookResponse instance + */ + WebhookResponse.create = function create(properties) { + return new WebhookResponse(properties); + }; + + /** + * Encodes the specified WebhookResponse message. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @static + * @param {google.cloud.dialogflow.v2.IWebhookResponse} message WebhookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fulfillmentText != null && Object.hasOwnProperty.call(message, "fulfillmentText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fulfillmentText); + if (message.fulfillmentMessages != null && message.fulfillmentMessages.length) + for (var i = 0; i < message.fulfillmentMessages.length; ++i) + $root.google.cloud.dialogflow.v2.Intent.Message.encode(message.fulfillmentMessages[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.source); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outputContexts != null && message.outputContexts.length) + for (var i = 0; i < message.outputContexts.length; ++i) + $root.google.cloud.dialogflow.v2.Context.encode(message.outputContexts[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.followupEventInput != null && Object.hasOwnProperty.call(message, "followupEventInput")) + $root.google.cloud.dialogflow.v2.EventInput.encode(message.followupEventInput, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) + for (var i = 0; i < message.sessionEntityTypes.length; ++i) + $root.google.cloud.dialogflow.v2.SessionEntityType.encode(message.sessionEntityTypes[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WebhookResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.WebhookResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @static + * @param {google.cloud.dialogflow.v2.IWebhookResponse} message WebhookResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WebhookResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WebhookResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.WebhookResponse} WebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.WebhookResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fulfillmentText = reader.string(); + break; + case 2: + if (!(message.fulfillmentMessages && message.fulfillmentMessages.length)) + message.fulfillmentMessages = []; + message.fulfillmentMessages.push($root.google.cloud.dialogflow.v2.Intent.Message.decode(reader, reader.uint32())); + break; + case 3: + message.source = reader.string(); + break; + case 4: + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.outputContexts && message.outputContexts.length)) + message.outputContexts = []; + message.outputContexts.push($root.google.cloud.dialogflow.v2.Context.decode(reader, reader.uint32())); + break; + case 6: + message.followupEventInput = $root.google.cloud.dialogflow.v2.EventInput.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) + message.sessionEntityTypes = []; + message.sessionEntityTypes.push($root.google.cloud.dialogflow.v2.SessionEntityType.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WebhookResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.WebhookResponse} WebhookResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WebhookResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WebhookResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WebhookResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) + if (!$util.isString(message.fulfillmentText)) + return "fulfillmentText: string expected"; + if (message.fulfillmentMessages != null && message.hasOwnProperty("fulfillmentMessages")) { + if (!Array.isArray(message.fulfillmentMessages)) + return "fulfillmentMessages: array expected"; + for (var i = 0; i < message.fulfillmentMessages.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Intent.Message.verify(message.fulfillmentMessages[i]); + if (error) + return "fulfillmentMessages." + error; + } + } + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + if (message.outputContexts != null && message.hasOwnProperty("outputContexts")) { + if (!Array.isArray(message.outputContexts)) + return "outputContexts: array expected"; + for (var i = 0; i < message.outputContexts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.Context.verify(message.outputContexts[i]); + if (error) + return "outputContexts." + error; + } + } + if (message.followupEventInput != null && message.hasOwnProperty("followupEventInput")) { + var error = $root.google.cloud.dialogflow.v2.EventInput.verify(message.followupEventInput); + if (error) + return "followupEventInput." + error; + } + if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { + if (!Array.isArray(message.sessionEntityTypes)) + return "sessionEntityTypes: array expected"; + for (var i = 0; i < message.sessionEntityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.v2.SessionEntityType.verify(message.sessionEntityTypes[i]); + if (error) + return "sessionEntityTypes." + error; + } + } + return null; + }; + + /** + * Creates a WebhookResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.WebhookResponse} WebhookResponse + */ + WebhookResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.WebhookResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2.WebhookResponse(); + if (object.fulfillmentText != null) + message.fulfillmentText = String(object.fulfillmentText); + if (object.fulfillmentMessages) { + if (!Array.isArray(object.fulfillmentMessages)) + throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.fulfillmentMessages: array expected"); + message.fulfillmentMessages = []; + for (var i = 0; i < object.fulfillmentMessages.length; ++i) { + if (typeof object.fulfillmentMessages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.fulfillmentMessages: object expected"); + message.fulfillmentMessages[i] = $root.google.cloud.dialogflow.v2.Intent.Message.fromObject(object.fulfillmentMessages[i]); + } + } + if (object.source != null) + message.source = String(object.source); + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.outputContexts) { + if (!Array.isArray(object.outputContexts)) + throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.outputContexts: array expected"); + message.outputContexts = []; + for (var i = 0; i < object.outputContexts.length; ++i) { + if (typeof object.outputContexts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.outputContexts: object expected"); + message.outputContexts[i] = $root.google.cloud.dialogflow.v2.Context.fromObject(object.outputContexts[i]); + } + } + if (object.followupEventInput != null) { + if (typeof object.followupEventInput !== "object") + throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.followupEventInput: object expected"); + message.followupEventInput = $root.google.cloud.dialogflow.v2.EventInput.fromObject(object.followupEventInput); + } + if (object.sessionEntityTypes) { + if (!Array.isArray(object.sessionEntityTypes)) + throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.sessionEntityTypes: array expected"); + message.sessionEntityTypes = []; + for (var i = 0; i < object.sessionEntityTypes.length; ++i) { + if (typeof object.sessionEntityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2.WebhookResponse.sessionEntityTypes: object expected"); + message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.v2.SessionEntityType.fromObject(object.sessionEntityTypes[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a WebhookResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @static + * @param {google.cloud.dialogflow.v2.WebhookResponse} message WebhookResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WebhookResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fulfillmentMessages = []; + object.outputContexts = []; + object.sessionEntityTypes = []; + } + if (options.defaults) { + object.fulfillmentText = ""; + object.source = ""; + object.payload = null; + object.followupEventInput = null; + } + if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) + object.fulfillmentText = message.fulfillmentText; + if (message.fulfillmentMessages && message.fulfillmentMessages.length) { + object.fulfillmentMessages = []; + for (var j = 0; j < message.fulfillmentMessages.length; ++j) + object.fulfillmentMessages[j] = $root.google.cloud.dialogflow.v2.Intent.Message.toObject(message.fulfillmentMessages[j], options); + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.outputContexts && message.outputContexts.length) { + object.outputContexts = []; + for (var j = 0; j < message.outputContexts.length; ++j) + object.outputContexts[j] = $root.google.cloud.dialogflow.v2.Context.toObject(message.outputContexts[j], options); + } + if (message.followupEventInput != null && message.hasOwnProperty("followupEventInput")) + object.followupEventInput = $root.google.cloud.dialogflow.v2.EventInput.toObject(message.followupEventInput, options); + if (message.sessionEntityTypes && message.sessionEntityTypes.length) { + object.sessionEntityTypes = []; + for (var j = 0; j < message.sessionEntityTypes.length; ++j) + object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.v2.SessionEntityType.toObject(message.sessionEntityTypes[j], options); + } + return object; + }; + + /** + * Converts this WebhookResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.WebhookResponse + * @instance + * @returns {Object.} JSON object + */ + WebhookResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WebhookResponse; + })(); + + v2.OriginalDetectIntentRequest = (function() { + + /** + * Properties of an OriginalDetectIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @interface IOriginalDetectIntentRequest + * @property {string|null} [source] OriginalDetectIntentRequest source + * @property {string|null} [version] OriginalDetectIntentRequest version + * @property {google.protobuf.IStruct|null} [payload] OriginalDetectIntentRequest payload + */ + + /** + * Constructs a new OriginalDetectIntentRequest. + * @memberof google.cloud.dialogflow.v2 + * @classdesc Represents an OriginalDetectIntentRequest. + * @implements IOriginalDetectIntentRequest + * @constructor + * @param {google.cloud.dialogflow.v2.IOriginalDetectIntentRequest=} [properties] Properties to set + */ + function OriginalDetectIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OriginalDetectIntentRequest source. + * @member {string} source + * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @instance + */ + OriginalDetectIntentRequest.prototype.source = ""; + + /** + * OriginalDetectIntentRequest version. + * @member {string} version + * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @instance + */ + OriginalDetectIntentRequest.prototype.version = ""; + + /** + * OriginalDetectIntentRequest payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @instance + */ + OriginalDetectIntentRequest.prototype.payload = null; + + /** + * Creates a new OriginalDetectIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.IOriginalDetectIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2.OriginalDetectIntentRequest} OriginalDetectIntentRequest instance + */ + OriginalDetectIntentRequest.create = function create(properties) { + return new OriginalDetectIntentRequest(properties); + }; + + /** + * Encodes the specified OriginalDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2.OriginalDetectIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.IOriginalDetectIntentRequest} message OriginalDetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OriginalDetectIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.source); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.version); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OriginalDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2.OriginalDetectIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.IOriginalDetectIntentRequest} message OriginalDetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OriginalDetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OriginalDetectIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2.OriginalDetectIntentRequest} OriginalDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OriginalDetectIntentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.source = reader.string(); + break; + case 2: + message.version = reader.string(); + break; + case 3: + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OriginalDetectIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2.OriginalDetectIntentRequest} OriginalDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OriginalDetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OriginalDetectIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OriginalDetectIntentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!$util.isString(message.version)) + return "version: string expected"; + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + return null; + }; + + /** + * Creates an OriginalDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2.OriginalDetectIntentRequest} OriginalDetectIntentRequest + */ + OriginalDetectIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2.OriginalDetectIntentRequest(); + if (object.source != null) + message.source = String(object.source); + if (object.version != null) + message.version = String(object.version); + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.v2.OriginalDetectIntentRequest.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + return message; + }; + + /** + * Creates a plain object from an OriginalDetectIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2.OriginalDetectIntentRequest} message OriginalDetectIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OriginalDetectIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = ""; + object.version = ""; + object.payload = null; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.version != null && message.hasOwnProperty("version")) + object.version = message.version; + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + return object; + }; + + /** + * Converts this OriginalDetectIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2.OriginalDetectIntentRequest + * @instance + * @returns {Object.} JSON object + */ + OriginalDetectIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OriginalDetectIntentRequest; + })(); + + return v2; + })(); + + dialogflow.v2beta1 = (function() { + + /** + * Namespace v2beta1. + * @memberof google.cloud.dialogflow + * @namespace + */ + var v2beta1 = {}; + + v2beta1.Agents = (function() { + + /** + * Constructs a new Agents service. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an Agents + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Agents(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Agents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Agents; + + /** + * Creates new Agents service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Agents} RPC service. Useful where requests and/or responses are streamed. + */ + Agents.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#getAgent}. + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @typedef GetAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Agent} [response] Agent + */ + + /** + * Calls GetAgent. + * @function getAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetAgentRequest} request GetAgentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Agents.GetAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.getAgent = function getAgent(request, callback) { + return this.rpcCall(getAgent, $root.google.cloud.dialogflow.v2beta1.GetAgentRequest, $root.google.cloud.dialogflow.v2beta1.Agent, request, callback); + }, "name", { value: "GetAgent" }); + + /** + * Calls GetAgent. + * @function getAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetAgentRequest} request GetAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#setAgent}. + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @typedef SetAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Agent} [response] Agent + */ + + /** + * Calls SetAgent. + * @function setAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.ISetAgentRequest} request SetAgentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Agents.SetAgentCallback} callback Node-style callback called with the error, if any, and Agent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.setAgent = function setAgent(request, callback) { + return this.rpcCall(setAgent, $root.google.cloud.dialogflow.v2beta1.SetAgentRequest, $root.google.cloud.dialogflow.v2beta1.Agent, request, callback); + }, "name", { value: "SetAgent" }); + + /** + * Calls SetAgent. + * @function setAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.ISetAgentRequest} request SetAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#deleteAgent}. + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @typedef DeleteAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAgent. + * @function deleteAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteAgentRequest} request DeleteAgentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Agents.DeleteAgentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.deleteAgent = function deleteAgent(request, callback) { + return this.rpcCall(deleteAgent, $root.google.cloud.dialogflow.v2beta1.DeleteAgentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAgent" }); + + /** + * Calls DeleteAgent. + * @function deleteAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteAgentRequest} request DeleteAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#searchAgents}. + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @typedef SearchAgentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.SearchAgentsResponse} [response] SearchAgentsResponse + */ + + /** + * Calls SearchAgents. + * @function searchAgents + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsRequest} request SearchAgentsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Agents.SearchAgentsCallback} callback Node-style callback called with the error, if any, and SearchAgentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.searchAgents = function searchAgents(request, callback) { + return this.rpcCall(searchAgents, $root.google.cloud.dialogflow.v2beta1.SearchAgentsRequest, $root.google.cloud.dialogflow.v2beta1.SearchAgentsResponse, request, callback); + }, "name", { value: "SearchAgents" }); + + /** + * Calls SearchAgents. + * @function searchAgents + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsRequest} request SearchAgentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#trainAgent}. + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @typedef TrainAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls TrainAgent. + * @function trainAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.ITrainAgentRequest} request TrainAgentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Agents.TrainAgentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.trainAgent = function trainAgent(request, callback) { + return this.rpcCall(trainAgent, $root.google.cloud.dialogflow.v2beta1.TrainAgentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "TrainAgent" }); + + /** + * Calls TrainAgent. + * @function trainAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.ITrainAgentRequest} request TrainAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#exportAgent}. + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @typedef ExportAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ExportAgent. + * @function exportAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IExportAgentRequest} request ExportAgentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Agents.ExportAgentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.exportAgent = function exportAgent(request, callback) { + return this.rpcCall(exportAgent, $root.google.cloud.dialogflow.v2beta1.ExportAgentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ExportAgent" }); + + /** + * Calls ExportAgent. + * @function exportAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IExportAgentRequest} request ExportAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#importAgent}. + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @typedef ImportAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportAgent. + * @function importAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IImportAgentRequest} request ImportAgentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Agents.ImportAgentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.importAgent = function importAgent(request, callback) { + return this.rpcCall(importAgent, $root.google.cloud.dialogflow.v2beta1.ImportAgentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportAgent" }); + + /** + * Calls ImportAgent. + * @function importAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IImportAgentRequest} request ImportAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#restoreAgent}. + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @typedef RestoreAgentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreAgent. + * @function restoreAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IRestoreAgentRequest} request RestoreAgentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Agents.RestoreAgentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.restoreAgent = function restoreAgent(request, callback) { + return this.rpcCall(restoreAgent, $root.google.cloud.dialogflow.v2beta1.RestoreAgentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreAgent" }); + + /** + * Calls RestoreAgent. + * @function restoreAgent + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IRestoreAgentRequest} request RestoreAgentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Agents#getValidationResult}. + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @typedef GetValidationResultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ValidationResult} [response] ValidationResult + */ + + /** + * Calls GetValidationResult. + * @function getValidationResult + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetValidationResultRequest} request GetValidationResultRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Agents.GetValidationResultCallback} callback Node-style callback called with the error, if any, and ValidationResult + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Agents.prototype.getValidationResult = function getValidationResult(request, callback) { + return this.rpcCall(getValidationResult, $root.google.cloud.dialogflow.v2beta1.GetValidationResultRequest, $root.google.cloud.dialogflow.v2beta1.ValidationResult, request, callback); + }, "name", { value: "GetValidationResult" }); + + /** + * Calls GetValidationResult. + * @function getValidationResult + * @memberof google.cloud.dialogflow.v2beta1.Agents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetValidationResultRequest} request GetValidationResultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Agents; + })(); + + v2beta1.Agent = (function() { + + /** + * Properties of an Agent. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IAgent + * @property {string|null} [parent] Agent parent + * @property {string|null} [displayName] Agent displayName + * @property {string|null} [defaultLanguageCode] Agent defaultLanguageCode + * @property {Array.|null} [supportedLanguageCodes] Agent supportedLanguageCodes + * @property {string|null} [timeZone] Agent timeZone + * @property {string|null} [description] Agent description + * @property {string|null} [avatarUri] Agent avatarUri + * @property {boolean|null} [enableLogging] Agent enableLogging + * @property {google.cloud.dialogflow.v2beta1.Agent.MatchMode|null} [matchMode] Agent matchMode + * @property {number|null} [classificationThreshold] Agent classificationThreshold + * @property {google.cloud.dialogflow.v2beta1.Agent.ApiVersion|null} [apiVersion] Agent apiVersion + * @property {google.cloud.dialogflow.v2beta1.Agent.Tier|null} [tier] Agent tier + */ + + /** + * Constructs a new Agent. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an Agent. + * @implements IAgent + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IAgent=} [properties] Properties to set + */ + function Agent(properties) { + this.supportedLanguageCodes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Agent parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + */ + Agent.prototype.parent = ""; + + /** + * Agent displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + */ + Agent.prototype.displayName = ""; + + /** + * Agent defaultLanguageCode. + * @member {string} defaultLanguageCode + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + */ + Agent.prototype.defaultLanguageCode = ""; + + /** + * Agent supportedLanguageCodes. + * @member {Array.} supportedLanguageCodes + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + */ + Agent.prototype.supportedLanguageCodes = $util.emptyArray; + + /** + * Agent timeZone. + * @member {string} timeZone + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + */ + Agent.prototype.timeZone = ""; + + /** + * Agent description. + * @member {string} description + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + */ + Agent.prototype.description = ""; + + /** + * Agent avatarUri. + * @member {string} avatarUri + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + */ + Agent.prototype.avatarUri = ""; + + /** + * Agent enableLogging. + * @member {boolean} enableLogging + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + */ + Agent.prototype.enableLogging = false; + + /** + * Agent matchMode. + * @member {google.cloud.dialogflow.v2beta1.Agent.MatchMode} matchMode + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + */ + Agent.prototype.matchMode = 0; + + /** + * Agent classificationThreshold. + * @member {number} classificationThreshold + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + */ + Agent.prototype.classificationThreshold = 0; + + /** + * Agent apiVersion. + * @member {google.cloud.dialogflow.v2beta1.Agent.ApiVersion} apiVersion + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + */ + Agent.prototype.apiVersion = 0; + + /** + * Agent tier. + * @member {google.cloud.dialogflow.v2beta1.Agent.Tier} tier + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + */ + Agent.prototype.tier = 0; + + /** + * Creates a new Agent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @static + * @param {google.cloud.dialogflow.v2beta1.IAgent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Agent} Agent instance + */ + Agent.create = function create(properties) { + return new Agent(properties); + }; + + /** + * Encodes the specified Agent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Agent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @static + * @param {google.cloud.dialogflow.v2beta1.IAgent} message Agent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Agent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.defaultLanguageCode != null && Object.hasOwnProperty.call(message, "defaultLanguageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.defaultLanguageCode); + if (message.supportedLanguageCodes != null && message.supportedLanguageCodes.length) + for (var i = 0; i < message.supportedLanguageCodes.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.supportedLanguageCodes[i]); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.timeZone); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.avatarUri != null && Object.hasOwnProperty.call(message, "avatarUri")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.avatarUri); + if (message.enableLogging != null && Object.hasOwnProperty.call(message, "enableLogging")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.enableLogging); + if (message.matchMode != null && Object.hasOwnProperty.call(message, "matchMode")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.matchMode); + if (message.classificationThreshold != null && Object.hasOwnProperty.call(message, "classificationThreshold")) + writer.uint32(/* id 10, wireType 5 =*/85).float(message.classificationThreshold); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.apiVersion); + if (message.tier != null && Object.hasOwnProperty.call(message, "tier")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.tier); + return writer; + }; + + /** + * Encodes the specified Agent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Agent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @static + * @param {google.cloud.dialogflow.v2beta1.IAgent} message Agent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Agent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Agent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Agent} Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Agent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Agent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.defaultLanguageCode = reader.string(); + break; + case 4: + if (!(message.supportedLanguageCodes && message.supportedLanguageCodes.length)) + message.supportedLanguageCodes = []; + message.supportedLanguageCodes.push(reader.string()); + break; + case 5: + message.timeZone = reader.string(); + break; + case 6: + message.description = reader.string(); + break; + case 7: + message.avatarUri = reader.string(); + break; + case 8: + message.enableLogging = reader.bool(); + break; + case 9: + message.matchMode = reader.int32(); + break; + case 10: + message.classificationThreshold = reader.float(); + break; + case 14: + message.apiVersion = reader.int32(); + break; + case 15: + message.tier = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Agent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Agent} Agent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Agent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Agent message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Agent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) + if (!$util.isString(message.defaultLanguageCode)) + return "defaultLanguageCode: string expected"; + if (message.supportedLanguageCodes != null && message.hasOwnProperty("supportedLanguageCodes")) { + if (!Array.isArray(message.supportedLanguageCodes)) + return "supportedLanguageCodes: array expected"; + for (var i = 0; i < message.supportedLanguageCodes.length; ++i) + if (!$util.isString(message.supportedLanguageCodes[i])) + return "supportedLanguageCodes: string[] expected"; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.avatarUri != null && message.hasOwnProperty("avatarUri")) + if (!$util.isString(message.avatarUri)) + return "avatarUri: string expected"; + if (message.enableLogging != null && message.hasOwnProperty("enableLogging")) + if (typeof message.enableLogging !== "boolean") + return "enableLogging: boolean expected"; + if (message.matchMode != null && message.hasOwnProperty("matchMode")) + switch (message.matchMode) { + default: + return "matchMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.classificationThreshold != null && message.hasOwnProperty("classificationThreshold")) + if (typeof message.classificationThreshold !== "number") + return "classificationThreshold: number expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + switch (message.apiVersion) { + default: + return "apiVersion: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.tier != null && message.hasOwnProperty("tier")) + switch (message.tier) { + default: + return "tier: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates an Agent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Agent} Agent + */ + Agent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Agent) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Agent(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.defaultLanguageCode != null) + message.defaultLanguageCode = String(object.defaultLanguageCode); + if (object.supportedLanguageCodes) { + if (!Array.isArray(object.supportedLanguageCodes)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Agent.supportedLanguageCodes: array expected"); + message.supportedLanguageCodes = []; + for (var i = 0; i < object.supportedLanguageCodes.length; ++i) + message.supportedLanguageCodes[i] = String(object.supportedLanguageCodes[i]); + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.description != null) + message.description = String(object.description); + if (object.avatarUri != null) + message.avatarUri = String(object.avatarUri); + if (object.enableLogging != null) + message.enableLogging = Boolean(object.enableLogging); + switch (object.matchMode) { + case "MATCH_MODE_UNSPECIFIED": + case 0: + message.matchMode = 0; + break; + case "MATCH_MODE_HYBRID": + case 1: + message.matchMode = 1; + break; + case "MATCH_MODE_ML_ONLY": + case 2: + message.matchMode = 2; + break; + } + if (object.classificationThreshold != null) + message.classificationThreshold = Number(object.classificationThreshold); + switch (object.apiVersion) { + case "API_VERSION_UNSPECIFIED": + case 0: + message.apiVersion = 0; + break; + case "API_VERSION_V1": + case 1: + message.apiVersion = 1; + break; + case "API_VERSION_V2": + case 2: + message.apiVersion = 2; + break; + case "API_VERSION_V2_BETA_1": + case 3: + message.apiVersion = 3; + break; + } + switch (object.tier) { + case "TIER_UNSPECIFIED": + case 0: + message.tier = 0; + break; + case "TIER_STANDARD": + case 1: + message.tier = 1; + break; + case "TIER_ENTERPRISE": + case 2: + message.tier = 2; + break; + case "TIER_ENTERPRISE_PLUS": + case 3: + message.tier = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from an Agent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @static + * @param {google.cloud.dialogflow.v2beta1.Agent} message Agent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Agent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.supportedLanguageCodes = []; + if (options.defaults) { + object.parent = ""; + object.displayName = ""; + object.defaultLanguageCode = ""; + object.timeZone = ""; + object.description = ""; + object.avatarUri = ""; + object.enableLogging = false; + object.matchMode = options.enums === String ? "MATCH_MODE_UNSPECIFIED" : 0; + object.classificationThreshold = 0; + object.apiVersion = options.enums === String ? "API_VERSION_UNSPECIFIED" : 0; + object.tier = options.enums === String ? "TIER_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.defaultLanguageCode != null && message.hasOwnProperty("defaultLanguageCode")) + object.defaultLanguageCode = message.defaultLanguageCode; + if (message.supportedLanguageCodes && message.supportedLanguageCodes.length) { + object.supportedLanguageCodes = []; + for (var j = 0; j < message.supportedLanguageCodes.length; ++j) + object.supportedLanguageCodes[j] = message.supportedLanguageCodes[j]; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.avatarUri != null && message.hasOwnProperty("avatarUri")) + object.avatarUri = message.avatarUri; + if (message.enableLogging != null && message.hasOwnProperty("enableLogging")) + object.enableLogging = message.enableLogging; + if (message.matchMode != null && message.hasOwnProperty("matchMode")) + object.matchMode = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Agent.MatchMode[message.matchMode] : message.matchMode; + if (message.classificationThreshold != null && message.hasOwnProperty("classificationThreshold")) + object.classificationThreshold = options.json && !isFinite(message.classificationThreshold) ? String(message.classificationThreshold) : message.classificationThreshold; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Agent.ApiVersion[message.apiVersion] : message.apiVersion; + if (message.tier != null && message.hasOwnProperty("tier")) + object.tier = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Agent.Tier[message.tier] : message.tier; + return object; + }; + + /** + * Converts this Agent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Agent + * @instance + * @returns {Object.} JSON object + */ + Agent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * MatchMode enum. + * @name google.cloud.dialogflow.v2beta1.Agent.MatchMode + * @enum {number} + * @property {number} MATCH_MODE_UNSPECIFIED=0 MATCH_MODE_UNSPECIFIED value + * @property {number} MATCH_MODE_HYBRID=1 MATCH_MODE_HYBRID value + * @property {number} MATCH_MODE_ML_ONLY=2 MATCH_MODE_ML_ONLY value + */ + Agent.MatchMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MATCH_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "MATCH_MODE_HYBRID"] = 1; + values[valuesById[2] = "MATCH_MODE_ML_ONLY"] = 2; + return values; + })(); + + /** + * ApiVersion enum. + * @name google.cloud.dialogflow.v2beta1.Agent.ApiVersion + * @enum {number} + * @property {number} API_VERSION_UNSPECIFIED=0 API_VERSION_UNSPECIFIED value + * @property {number} API_VERSION_V1=1 API_VERSION_V1 value + * @property {number} API_VERSION_V2=2 API_VERSION_V2 value + * @property {number} API_VERSION_V2_BETA_1=3 API_VERSION_V2_BETA_1 value + */ + Agent.ApiVersion = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "API_VERSION_UNSPECIFIED"] = 0; + values[valuesById[1] = "API_VERSION_V1"] = 1; + values[valuesById[2] = "API_VERSION_V2"] = 2; + values[valuesById[3] = "API_VERSION_V2_BETA_1"] = 3; + return values; + })(); + + /** + * Tier enum. + * @name google.cloud.dialogflow.v2beta1.Agent.Tier + * @enum {number} + * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value + * @property {number} TIER_STANDARD=1 TIER_STANDARD value + * @property {number} TIER_ENTERPRISE=2 TIER_ENTERPRISE value + * @property {number} TIER_ENTERPRISE_PLUS=3 TIER_ENTERPRISE_PLUS value + */ + Agent.Tier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "TIER_STANDARD"] = 1; + values[valuesById[2] = "TIER_ENTERPRISE"] = 2; + values[valuesById[3] = "TIER_ENTERPRISE_PLUS"] = 3; + return values; + })(); + + return Agent; + })(); + + v2beta1.GetAgentRequest = (function() { + + /** + * Properties of a GetAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IGetAgentRequest + * @property {string|null} [parent] GetAgentRequest parent + */ + + /** + * Constructs a new GetAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a GetAgentRequest. + * @implements IGetAgentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IGetAgentRequest=} [properties] Properties to set + */ + function GetAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAgentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @instance + */ + GetAgentRequest.prototype.parent = ""; + + /** + * Creates a new GetAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GetAgentRequest} GetAgentRequest instance + */ + GetAgentRequest.create = function create(properties) { + return new GetAgentRequest(properties); + }; + + /** + * Encodes the specified GetAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified GetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetAgentRequest} message GetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.GetAgentRequest} GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.GetAgentRequest} GetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a GetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.GetAgentRequest} GetAgentRequest + */ + GetAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetAgentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.GetAgentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a GetAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.GetAgentRequest} message GetAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this GetAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.GetAgentRequest + * @instance + * @returns {Object.} JSON object + */ + GetAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetAgentRequest; + })(); + + v2beta1.SetAgentRequest = (function() { + + /** + * Properties of a SetAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISetAgentRequest + * @property {google.cloud.dialogflow.v2beta1.IAgent|null} [agent] SetAgentRequest agent + * @property {google.protobuf.IFieldMask|null} [updateMask] SetAgentRequest updateMask + */ + + /** + * Constructs a new SetAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SetAgentRequest. + * @implements ISetAgentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISetAgentRequest=} [properties] Properties to set + */ + function SetAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SetAgentRequest agent. + * @member {google.cloud.dialogflow.v2beta1.IAgent|null|undefined} agent + * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @instance + */ + SetAgentRequest.prototype.agent = null; + + /** + * SetAgentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @instance + */ + SetAgentRequest.prototype.updateMask = null; + + /** + * Creates a new SetAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISetAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SetAgentRequest} SetAgentRequest instance + */ + SetAgentRequest.create = function create(properties) { + return new SetAgentRequest(properties); + }; + + /** + * Encodes the specified SetAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SetAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISetAgentRequest} message SetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + $root.google.cloud.dialogflow.v2beta1.Agent.encode(message.agent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SetAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SetAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISetAgentRequest} message SetAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SetAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SetAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SetAgentRequest} SetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetAgentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SetAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.agent = $root.google.cloud.dialogflow.v2beta1.Agent.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SetAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SetAgentRequest} SetAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SetAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SetAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SetAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agent != null && message.hasOwnProperty("agent")) { + var error = $root.google.cloud.dialogflow.v2beta1.Agent.verify(message.agent); + if (error) + return "agent." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates a SetAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SetAgentRequest} SetAgentRequest + */ + SetAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SetAgentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SetAgentRequest(); + if (object.agent != null) { + if (typeof object.agent !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SetAgentRequest.agent: object expected"); + message.agent = $root.google.cloud.dialogflow.v2beta1.Agent.fromObject(object.agent); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SetAgentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from a SetAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.SetAgentRequest} message SetAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SetAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.agent = null; + object.updateMask = null; + } + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = $root.google.cloud.dialogflow.v2beta1.Agent.toObject(message.agent, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this SetAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SetAgentRequest + * @instance + * @returns {Object.} JSON object + */ + SetAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SetAgentRequest; + })(); + + v2beta1.DeleteAgentRequest = (function() { + + /** + * Properties of a DeleteAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IDeleteAgentRequest + * @property {string|null} [parent] DeleteAgentRequest parent + */ + + /** + * Constructs a new DeleteAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a DeleteAgentRequest. + * @implements IDeleteAgentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IDeleteAgentRequest=} [properties] Properties to set + */ + function DeleteAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAgentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @instance + */ + DeleteAgentRequest.prototype.parent = ""; + + /** + * Creates a new DeleteAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DeleteAgentRequest} DeleteAgentRequest instance + */ + DeleteAgentRequest.create = function create(properties) { + return new DeleteAgentRequest(properties); + }; + + /** + * Encodes the specified DeleteAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified DeleteAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteAgentRequest} message DeleteAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.DeleteAgentRequest} DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.DeleteAgentRequest} DeleteAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a DeleteAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.DeleteAgentRequest} DeleteAgentRequest + */ + DeleteAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteAgentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.DeleteAgentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a DeleteAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.DeleteAgentRequest} message DeleteAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this DeleteAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.DeleteAgentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteAgentRequest; + })(); + + v2beta1.SubAgent = (function() { + + /** + * Properties of a SubAgent. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISubAgent + * @property {string|null} [project] SubAgent project + * @property {string|null} [environment] SubAgent environment + */ + + /** + * Constructs a new SubAgent. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SubAgent. + * @implements ISubAgent + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISubAgent=} [properties] Properties to set + */ + function SubAgent(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SubAgent project. + * @member {string} project + * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @instance + */ + SubAgent.prototype.project = ""; + + /** + * SubAgent environment. + * @member {string} environment + * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @instance + */ + SubAgent.prototype.environment = ""; + + /** + * Creates a new SubAgent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @static + * @param {google.cloud.dialogflow.v2beta1.ISubAgent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SubAgent} SubAgent instance + */ + SubAgent.create = function create(properties) { + return new SubAgent(properties); + }; + + /** + * Encodes the specified SubAgent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SubAgent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @static + * @param {google.cloud.dialogflow.v2beta1.ISubAgent} message SubAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubAgent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.environment != null && Object.hasOwnProperty.call(message, "environment")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.environment); + return writer; + }; + + /** + * Encodes the specified SubAgent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SubAgent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @static + * @param {google.cloud.dialogflow.v2beta1.ISubAgent} message SubAgent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SubAgent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SubAgent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SubAgent} SubAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubAgent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SubAgent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.project = reader.string(); + break; + case 2: + message.environment = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SubAgent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SubAgent} SubAgent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SubAgent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SubAgent message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SubAgent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.environment != null && message.hasOwnProperty("environment")) + if (!$util.isString(message.environment)) + return "environment: string expected"; + return null; + }; + + /** + * Creates a SubAgent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SubAgent} SubAgent + */ + SubAgent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SubAgent) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SubAgent(); + if (object.project != null) + message.project = String(object.project); + if (object.environment != null) + message.environment = String(object.environment); + return message; + }; + + /** + * Creates a plain object from a SubAgent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @static + * @param {google.cloud.dialogflow.v2beta1.SubAgent} message SubAgent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SubAgent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.environment = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.environment != null && message.hasOwnProperty("environment")) + object.environment = message.environment; + return object; + }; + + /** + * Converts this SubAgent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SubAgent + * @instance + * @returns {Object.} JSON object + */ + SubAgent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SubAgent; + })(); + + v2beta1.SearchAgentsRequest = (function() { + + /** + * Properties of a SearchAgentsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISearchAgentsRequest + * @property {string|null} [parent] SearchAgentsRequest parent + * @property {number|null} [pageSize] SearchAgentsRequest pageSize + * @property {string|null} [pageToken] SearchAgentsRequest pageToken + */ + + /** + * Constructs a new SearchAgentsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SearchAgentsRequest. + * @implements ISearchAgentsRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsRequest=} [properties] Properties to set + */ + function SearchAgentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAgentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @instance + */ + SearchAgentsRequest.prototype.parent = ""; + + /** + * SearchAgentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @instance + */ + SearchAgentsRequest.prototype.pageSize = 0; + + /** + * SearchAgentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @instance + */ + SearchAgentsRequest.prototype.pageToken = ""; + + /** + * Creates a new SearchAgentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsRequest} SearchAgentsRequest instance + */ + SearchAgentsRequest.create = function create(properties) { + return new SearchAgentsRequest(properties); + }; + + /** + * Encodes the specified SearchAgentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsRequest} message SearchAgentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAgentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified SearchAgentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsRequest} message SearchAgentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAgentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAgentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsRequest} SearchAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAgentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SearchAgentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAgentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsRequest} SearchAgentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAgentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAgentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAgentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a SearchAgentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsRequest} SearchAgentsRequest + */ + SearchAgentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchAgentsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SearchAgentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a SearchAgentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchAgentsRequest} message SearchAgentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAgentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this SearchAgentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsRequest + * @instance + * @returns {Object.} JSON object + */ + SearchAgentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchAgentsRequest; + })(); + + v2beta1.SearchAgentsResponse = (function() { + + /** + * Properties of a SearchAgentsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISearchAgentsResponse + * @property {Array.|null} [agents] SearchAgentsResponse agents + * @property {string|null} [nextPageToken] SearchAgentsResponse nextPageToken + */ + + /** + * Constructs a new SearchAgentsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SearchAgentsResponse. + * @implements ISearchAgentsResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsResponse=} [properties] Properties to set + */ + function SearchAgentsResponse(properties) { + this.agents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SearchAgentsResponse agents. + * @member {Array.} agents + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @instance + */ + SearchAgentsResponse.prototype.agents = $util.emptyArray; + + /** + * SearchAgentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @instance + */ + SearchAgentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new SearchAgentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsResponse} SearchAgentsResponse instance + */ + SearchAgentsResponse.create = function create(properties) { + return new SearchAgentsResponse(properties); + }; + + /** + * Encodes the specified SearchAgentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsResponse} message SearchAgentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAgentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agents != null && message.agents.length) + for (var i = 0; i < message.agents.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Agent.encode(message.agents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified SearchAgentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SearchAgentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ISearchAgentsResponse} message SearchAgentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SearchAgentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SearchAgentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsResponse} SearchAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAgentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SearchAgentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.agents && message.agents.length)) + message.agents = []; + message.agents.push($root.google.cloud.dialogflow.v2beta1.Agent.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SearchAgentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsResponse} SearchAgentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SearchAgentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SearchAgentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SearchAgentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agents != null && message.hasOwnProperty("agents")) { + if (!Array.isArray(message.agents)) + return "agents: array expected"; + for (var i = 0; i < message.agents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Agent.verify(message.agents[i]); + if (error) + return "agents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a SearchAgentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SearchAgentsResponse} SearchAgentsResponse + */ + SearchAgentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SearchAgentsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SearchAgentsResponse(); + if (object.agents) { + if (!Array.isArray(object.agents)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchAgentsResponse.agents: array expected"); + message.agents = []; + for (var i = 0; i < object.agents.length; ++i) { + if (typeof object.agents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SearchAgentsResponse.agents: object expected"); + message.agents[i] = $root.google.cloud.dialogflow.v2beta1.Agent.fromObject(object.agents[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a SearchAgentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.SearchAgentsResponse} message SearchAgentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SearchAgentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.agents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.agents && message.agents.length) { + object.agents = []; + for (var j = 0; j < message.agents.length; ++j) + object.agents[j] = $root.google.cloud.dialogflow.v2beta1.Agent.toObject(message.agents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this SearchAgentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SearchAgentsResponse + * @instance + * @returns {Object.} JSON object + */ + SearchAgentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SearchAgentsResponse; + })(); + + v2beta1.TrainAgentRequest = (function() { + + /** + * Properties of a TrainAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ITrainAgentRequest + * @property {string|null} [parent] TrainAgentRequest parent + */ + + /** + * Constructs a new TrainAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a TrainAgentRequest. + * @implements ITrainAgentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ITrainAgentRequest=} [properties] Properties to set + */ + function TrainAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainAgentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @instance + */ + TrainAgentRequest.prototype.parent = ""; + + /** + * Creates a new TrainAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ITrainAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.TrainAgentRequest} TrainAgentRequest instance + */ + TrainAgentRequest.create = function create(properties) { + return new TrainAgentRequest(properties); + }; + + /** + * Encodes the specified TrainAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TrainAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ITrainAgentRequest} message TrainAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified TrainAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TrainAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ITrainAgentRequest} message TrainAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrainAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.TrainAgentRequest} TrainAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainAgentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.TrainAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrainAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.TrainAgentRequest} TrainAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a TrainAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.TrainAgentRequest} TrainAgentRequest + */ + TrainAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.TrainAgentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.TrainAgentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a TrainAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.TrainAgentRequest} message TrainAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this TrainAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.TrainAgentRequest + * @instance + * @returns {Object.} JSON object + */ + TrainAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TrainAgentRequest; + })(); + + v2beta1.ExportAgentRequest = (function() { + + /** + * Properties of an ExportAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IExportAgentRequest + * @property {string|null} [parent] ExportAgentRequest parent + * @property {string|null} [agentUri] ExportAgentRequest agentUri + */ + + /** + * Constructs a new ExportAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an ExportAgentRequest. + * @implements IExportAgentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IExportAgentRequest=} [properties] Properties to set + */ + function ExportAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportAgentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.parent = ""; + + /** + * ExportAgentRequest agentUri. + * @member {string} agentUri + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @instance + */ + ExportAgentRequest.prototype.agentUri = ""; + + /** + * Creates a new ExportAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IExportAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ExportAgentRequest} ExportAgentRequest instance + */ + ExportAgentRequest.create = function create(properties) { + return new ExportAgentRequest(properties); + }; + + /** + * Encodes the specified ExportAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IExportAgentRequest} message ExportAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentUri); + return writer; + }; + + /** + * Encodes the specified ExportAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IExportAgentRequest} message ExportAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ExportAgentRequest} ExportAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAgentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ExportAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.agentUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ExportAgentRequest} ExportAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) + if (!$util.isString(message.agentUri)) + return "agentUri: string expected"; + return null; + }; + + /** + * Creates an ExportAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ExportAgentRequest} ExportAgentRequest + */ + ExportAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ExportAgentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ExportAgentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.agentUri != null) + message.agentUri = String(object.agentUri); + return message; + }; + + /** + * Creates a plain object from an ExportAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ExportAgentRequest} message ExportAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.agentUri = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) + object.agentUri = message.agentUri; + return object; + }; + + /** + * Converts this ExportAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentRequest + * @instance + * @returns {Object.} JSON object + */ + ExportAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportAgentRequest; + })(); + + v2beta1.ExportAgentResponse = (function() { + + /** + * Properties of an ExportAgentResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IExportAgentResponse + * @property {string|null} [agentUri] ExportAgentResponse agentUri + * @property {Uint8Array|null} [agentContent] ExportAgentResponse agentContent + */ + + /** + * Constructs a new ExportAgentResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an ExportAgentResponse. + * @implements IExportAgentResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IExportAgentResponse=} [properties] Properties to set + */ + function ExportAgentResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ExportAgentResponse agentUri. + * @member {string} agentUri + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @instance + */ + ExportAgentResponse.prototype.agentUri = ""; + + /** + * ExportAgentResponse agentContent. + * @member {Uint8Array} agentContent + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @instance + */ + ExportAgentResponse.prototype.agentContent = $util.newBuffer([]); + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ExportAgentResponse agent. + * @member {"agentUri"|"agentContent"|undefined} agent + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @instance + */ + Object.defineProperty(ExportAgentResponse.prototype, "agent", { + get: $util.oneOfGetter($oneOfFields = ["agentUri", "agentContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ExportAgentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IExportAgentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ExportAgentResponse} ExportAgentResponse instance + */ + ExportAgentResponse.create = function create(properties) { + return new ExportAgentResponse(properties); + }; + + /** + * Encodes the specified ExportAgentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IExportAgentResponse} message ExportAgentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAgentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agentUri); + if (message.agentContent != null && Object.hasOwnProperty.call(message, "agentContent")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.agentContent); + return writer; + }; + + /** + * Encodes the specified ExportAgentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ExportAgentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IExportAgentResponse} message ExportAgentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExportAgentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExportAgentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ExportAgentResponse} ExportAgentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAgentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ExportAgentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.agentUri = reader.string(); + break; + case 2: + message.agentContent = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExportAgentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ExportAgentResponse} ExportAgentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExportAgentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExportAgentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExportAgentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + properties.agent = 1; + if (!$util.isString(message.agentUri)) + return "agentUri: string expected"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + if (properties.agent === 1) + return "agent: multiple values"; + properties.agent = 1; + if (!(message.agentContent && typeof message.agentContent.length === "number" || $util.isString(message.agentContent))) + return "agentContent: buffer expected"; + } + return null; + }; + + /** + * Creates an ExportAgentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ExportAgentResponse} ExportAgentResponse + */ + ExportAgentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ExportAgentResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ExportAgentResponse(); + if (object.agentUri != null) + message.agentUri = String(object.agentUri); + if (object.agentContent != null) + if (typeof object.agentContent === "string") + $util.base64.decode(object.agentContent, message.agentContent = $util.newBuffer($util.base64.length(object.agentContent)), 0); + else if (object.agentContent.length) + message.agentContent = object.agentContent; + return message; + }; + + /** + * Creates a plain object from an ExportAgentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ExportAgentResponse} message ExportAgentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExportAgentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + object.agentUri = message.agentUri; + if (options.oneofs) + object.agent = "agentUri"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + object.agentContent = options.bytes === String ? $util.base64.encode(message.agentContent, 0, message.agentContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.agentContent) : message.agentContent; + if (options.oneofs) + object.agent = "agentContent"; + } + return object; + }; + + /** + * Converts this ExportAgentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ExportAgentResponse + * @instance + * @returns {Object.} JSON object + */ + ExportAgentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExportAgentResponse; + })(); + + v2beta1.ImportAgentRequest = (function() { + + /** + * Properties of an ImportAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IImportAgentRequest + * @property {string|null} [parent] ImportAgentRequest parent + * @property {string|null} [agentUri] ImportAgentRequest agentUri + * @property {Uint8Array|null} [agentContent] ImportAgentRequest agentContent + */ + + /** + * Constructs a new ImportAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an ImportAgentRequest. + * @implements IImportAgentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IImportAgentRequest=} [properties] Properties to set + */ + function ImportAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ImportAgentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @instance + */ + ImportAgentRequest.prototype.parent = ""; + + /** + * ImportAgentRequest agentUri. + * @member {string} agentUri + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @instance + */ + ImportAgentRequest.prototype.agentUri = ""; + + /** + * ImportAgentRequest agentContent. + * @member {Uint8Array} agentContent + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @instance + */ + ImportAgentRequest.prototype.agentContent = $util.newBuffer([]); + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ImportAgentRequest agent. + * @member {"agentUri"|"agentContent"|undefined} agent + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @instance + */ + Object.defineProperty(ImportAgentRequest.prototype, "agent", { + get: $util.oneOfGetter($oneOfFields = ["agentUri", "agentContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ImportAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IImportAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ImportAgentRequest} ImportAgentRequest instance + */ + ImportAgentRequest.create = function create(properties) { + return new ImportAgentRequest(properties); + }; + + /** + * Encodes the specified ImportAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IImportAgentRequest} message ImportAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentUri); + if (message.agentContent != null && Object.hasOwnProperty.call(message, "agentContent")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.agentContent); + return writer; + }; + + /** + * Encodes the specified ImportAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IImportAgentRequest} message ImportAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ImportAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ImportAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ImportAgentRequest} ImportAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAgentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ImportAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.agentUri = reader.string(); + break; + case 3: + message.agentContent = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ImportAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ImportAgentRequest} ImportAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + properties.agent = 1; + if (!$util.isString(message.agentUri)) + return "agentUri: string expected"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + if (properties.agent === 1) + return "agent: multiple values"; + properties.agent = 1; + if (!(message.agentContent && typeof message.agentContent.length === "number" || $util.isString(message.agentContent))) + return "agentContent: buffer expected"; + } + return null; + }; + + /** + * Creates an ImportAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ImportAgentRequest} ImportAgentRequest + */ + ImportAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ImportAgentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ImportAgentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.agentUri != null) + message.agentUri = String(object.agentUri); + if (object.agentContent != null) + if (typeof object.agentContent === "string") + $util.base64.decode(object.agentContent, message.agentContent = $util.newBuffer($util.base64.length(object.agentContent)), 0); + else if (object.agentContent.length) + message.agentContent = object.agentContent; + return message; + }; + + /** + * Creates a plain object from an ImportAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ImportAgentRequest} message ImportAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ImportAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + object.agentUri = message.agentUri; + if (options.oneofs) + object.agent = "agentUri"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + object.agentContent = options.bytes === String ? $util.base64.encode(message.agentContent, 0, message.agentContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.agentContent) : message.agentContent; + if (options.oneofs) + object.agent = "agentContent"; + } + return object; + }; + + /** + * Converts this ImportAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ImportAgentRequest + * @instance + * @returns {Object.} JSON object + */ + ImportAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ImportAgentRequest; + })(); + + v2beta1.RestoreAgentRequest = (function() { + + /** + * Properties of a RestoreAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IRestoreAgentRequest + * @property {string|null} [parent] RestoreAgentRequest parent + * @property {string|null} [agentUri] RestoreAgentRequest agentUri + * @property {Uint8Array|null} [agentContent] RestoreAgentRequest agentContent + */ + + /** + * Constructs a new RestoreAgentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a RestoreAgentRequest. + * @implements IRestoreAgentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IRestoreAgentRequest=} [properties] Properties to set + */ + function RestoreAgentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreAgentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.parent = ""; + + /** + * RestoreAgentRequest agentUri. + * @member {string} agentUri + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.agentUri = ""; + + /** + * RestoreAgentRequest agentContent. + * @member {Uint8Array} agentContent + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @instance + */ + RestoreAgentRequest.prototype.agentContent = $util.newBuffer([]); + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreAgentRequest agent. + * @member {"agentUri"|"agentContent"|undefined} agent + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @instance + */ + Object.defineProperty(RestoreAgentRequest.prototype, "agent", { + get: $util.oneOfGetter($oneOfFields = ["agentUri", "agentContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreAgentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IRestoreAgentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.RestoreAgentRequest} RestoreAgentRequest instance + */ + RestoreAgentRequest.create = function create(properties) { + return new RestoreAgentRequest(properties); + }; + + /** + * Encodes the specified RestoreAgentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.RestoreAgentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IRestoreAgentRequest} message RestoreAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAgentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.agentUri != null && Object.hasOwnProperty.call(message, "agentUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.agentUri); + if (message.agentContent != null && Object.hasOwnProperty.call(message, "agentContent")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.agentContent); + return writer; + }; + + /** + * Encodes the specified RestoreAgentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.RestoreAgentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IRestoreAgentRequest} message RestoreAgentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreAgentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreAgentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.RestoreAgentRequest} RestoreAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAgentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.RestoreAgentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.agentUri = reader.string(); + break; + case 3: + message.agentContent = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreAgentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.RestoreAgentRequest} RestoreAgentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreAgentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreAgentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreAgentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + properties.agent = 1; + if (!$util.isString(message.agentUri)) + return "agentUri: string expected"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + if (properties.agent === 1) + return "agent: multiple values"; + properties.agent = 1; + if (!(message.agentContent && typeof message.agentContent.length === "number" || $util.isString(message.agentContent))) + return "agentContent: buffer expected"; + } + return null; + }; + + /** + * Creates a RestoreAgentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.RestoreAgentRequest} RestoreAgentRequest + */ + RestoreAgentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.RestoreAgentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.RestoreAgentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.agentUri != null) + message.agentUri = String(object.agentUri); + if (object.agentContent != null) + if (typeof object.agentContent === "string") + $util.base64.decode(object.agentContent, message.agentContent = $util.newBuffer($util.base64.length(object.agentContent)), 0); + else if (object.agentContent.length) + message.agentContent = object.agentContent; + return message; + }; + + /** + * Creates a plain object from a RestoreAgentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.RestoreAgentRequest} message RestoreAgentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreAgentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.agentUri != null && message.hasOwnProperty("agentUri")) { + object.agentUri = message.agentUri; + if (options.oneofs) + object.agent = "agentUri"; + } + if (message.agentContent != null && message.hasOwnProperty("agentContent")) { + object.agentContent = options.bytes === String ? $util.base64.encode(message.agentContent, 0, message.agentContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.agentContent) : message.agentContent; + if (options.oneofs) + object.agent = "agentContent"; + } + return object; + }; + + /** + * Converts this RestoreAgentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.RestoreAgentRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreAgentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RestoreAgentRequest; + })(); + + v2beta1.GetValidationResultRequest = (function() { + + /** + * Properties of a GetValidationResultRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IGetValidationResultRequest + * @property {string|null} [parent] GetValidationResultRequest parent + * @property {string|null} [languageCode] GetValidationResultRequest languageCode + */ + + /** + * Constructs a new GetValidationResultRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a GetValidationResultRequest. + * @implements IGetValidationResultRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IGetValidationResultRequest=} [properties] Properties to set + */ + function GetValidationResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetValidationResultRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @instance + */ + GetValidationResultRequest.prototype.parent = ""; + + /** + * GetValidationResultRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @instance + */ + GetValidationResultRequest.prototype.languageCode = ""; + + /** + * Creates a new GetValidationResultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetValidationResultRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GetValidationResultRequest} GetValidationResultRequest instance + */ + GetValidationResultRequest.create = function create(properties) { + return new GetValidationResultRequest(properties); + }; + + /** + * Encodes the specified GetValidationResultRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetValidationResultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetValidationResultRequest} message GetValidationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetValidationResultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified GetValidationResultRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetValidationResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetValidationResultRequest} message GetValidationResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetValidationResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetValidationResultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.GetValidationResultRequest} GetValidationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetValidationResultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetValidationResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 3: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetValidationResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.GetValidationResultRequest} GetValidationResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetValidationResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetValidationResultRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetValidationResultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a GetValidationResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.GetValidationResultRequest} GetValidationResultRequest + */ + GetValidationResultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetValidationResultRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.GetValidationResultRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a GetValidationResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.GetValidationResultRequest} message GetValidationResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetValidationResultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this GetValidationResultRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.GetValidationResultRequest + * @instance + * @returns {Object.} JSON object + */ + GetValidationResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetValidationResultRequest; + })(); + + v2beta1.Environments = (function() { + + /** + * Constructs a new Environments service. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an Environments + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Environments(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Environments.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Environments; + + /** + * Creates new Environments service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Environments + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Environments} RPC service. Useful where requests and/or responses are streamed. + */ + Environments.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Environments#listEnvironments}. + * @memberof google.cloud.dialogflow.v2beta1.Environments + * @typedef ListEnvironmentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse} [response] ListEnvironmentsResponse + */ + + /** + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.dialogflow.v2beta1.Environments + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Environments.ListEnvironmentsCallback} callback Node-style callback called with the error, if any, and ListEnvironmentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Environments.prototype.listEnvironments = function listEnvironments(request, callback) { + return this.rpcCall(listEnvironments, $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest, $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse, request, callback); + }, "name", { value: "ListEnvironments" }); + + /** + * Calls ListEnvironments. + * @function listEnvironments + * @memberof google.cloud.dialogflow.v2beta1.Environments + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest} request ListEnvironmentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Environments; + })(); + + v2beta1.Environment = (function() { + + /** + * Properties of an Environment. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IEnvironment + * @property {string|null} [name] Environment name + * @property {string|null} [description] Environment description + * @property {string|null} [agentVersion] Environment agentVersion + * @property {google.cloud.dialogflow.v2beta1.Environment.State|null} [state] Environment state + * @property {google.protobuf.ITimestamp|null} [updateTime] Environment updateTime + */ + + /** + * Constructs a new Environment. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an Environment. + * @implements IEnvironment + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IEnvironment=} [properties] Properties to set + */ + function Environment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Environment name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @instance + */ + Environment.prototype.name = ""; + + /** + * Environment description. + * @member {string} description + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @instance + */ + Environment.prototype.description = ""; + + /** + * Environment agentVersion. + * @member {string} agentVersion + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @instance + */ + Environment.prototype.agentVersion = ""; + + /** + * Environment state. + * @member {google.cloud.dialogflow.v2beta1.Environment.State} state + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @instance + */ + Environment.prototype.state = 0; + + /** + * Environment updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @instance + */ + Environment.prototype.updateTime = null; + + /** + * Creates a new Environment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @static + * @param {google.cloud.dialogflow.v2beta1.IEnvironment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Environment} Environment instance + */ + Environment.create = function create(properties) { + return new Environment(properties); + }; + + /** + * Encodes the specified Environment message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Environment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @static + * @param {google.cloud.dialogflow.v2beta1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.agentVersion != null && Object.hasOwnProperty.call(message, "agentVersion")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.agentVersion); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Environment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Environment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @static + * @param {google.cloud.dialogflow.v2beta1.IEnvironment} message Environment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Environment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Environment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Environment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.agentVersion = reader.string(); + break; + case 4: + message.state = reader.int32(); + break; + case 5: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Environment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Environment} Environment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Environment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Environment message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Environment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.agentVersion != null && message.hasOwnProperty("agentVersion")) + if (!$util.isString(message.agentVersion)) + return "agentVersion: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + return null; + }; + + /** + * Creates an Environment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Environment} Environment + */ + Environment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Environment) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Environment(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.agentVersion != null) + message.agentVersion = String(object.agentVersion); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "STOPPED": + case 1: + message.state = 1; + break; + case "LOADING": + case 2: + message.state = 2; + break; + case "RUNNING": + case 3: + message.state = 3; + break; + } + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Environment.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + return message; + }; + + /** + * Creates a plain object from an Environment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @static + * @param {google.cloud.dialogflow.v2beta1.Environment} message Environment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Environment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.agentVersion = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.updateTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.agentVersion != null && message.hasOwnProperty("agentVersion")) + object.agentVersion = message.agentVersion; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Environment.State[message.state] : message.state; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + return object; + }; + + /** + * Converts this Environment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Environment + * @instance + * @returns {Object.} JSON object + */ + Environment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * State enum. + * @name google.cloud.dialogflow.v2beta1.Environment.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} STOPPED=1 STOPPED value + * @property {number} LOADING=2 LOADING value + * @property {number} RUNNING=3 RUNNING value + */ + Environment.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "STOPPED"] = 1; + values[valuesById[2] = "LOADING"] = 2; + values[valuesById[3] = "RUNNING"] = 3; + return values; + })(); + + return Environment; + })(); + + v2beta1.ListEnvironmentsRequest = (function() { + + /** + * Properties of a ListEnvironmentsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListEnvironmentsRequest + * @property {string|null} [parent] ListEnvironmentsRequest parent + * @property {number|null} [pageSize] ListEnvironmentsRequest pageSize + * @property {string|null} [pageToken] ListEnvironmentsRequest pageToken + */ + + /** + * Constructs a new ListEnvironmentsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListEnvironmentsRequest. + * @implements IListEnvironmentsRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest=} [properties] Properties to set + */ + function ListEnvironmentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEnvironmentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.parent = ""; + + /** + * ListEnvironmentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.pageSize = 0; + + /** + * ListEnvironmentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * @instance + */ + ListEnvironmentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListEnvironmentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest} ListEnvironmentsRequest instance + */ + ListEnvironmentsRequest.create = function create(properties) { + return new ListEnvironmentsRequest(properties); + }; + + /** + * Encodes the specified ListEnvironmentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListEnvironmentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsRequest} message ListEnvironmentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest} ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEnvironmentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest} ListEnvironmentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEnvironmentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEnvironmentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListEnvironmentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest} ListEnvironmentsRequest + */ + ListEnvironmentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListEnvironmentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest} message ListEnvironmentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEnvironmentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListEnvironmentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListEnvironmentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListEnvironmentsRequest; + })(); + + v2beta1.ListEnvironmentsResponse = (function() { + + /** + * Properties of a ListEnvironmentsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListEnvironmentsResponse + * @property {Array.|null} [environments] ListEnvironmentsResponse environments + * @property {string|null} [nextPageToken] ListEnvironmentsResponse nextPageToken + */ + + /** + * Constructs a new ListEnvironmentsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListEnvironmentsResponse. + * @implements IListEnvironmentsResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse=} [properties] Properties to set + */ + function ListEnvironmentsResponse(properties) { + this.environments = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListEnvironmentsResponse environments. + * @member {Array.} environments + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * @instance + */ + ListEnvironmentsResponse.prototype.environments = $util.emptyArray; + + /** + * ListEnvironmentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * @instance + */ + ListEnvironmentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListEnvironmentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse} ListEnvironmentsResponse instance + */ + ListEnvironmentsResponse.create = function create(properties) { + return new ListEnvironmentsResponse(properties); + }; + + /** + * Encodes the specified ListEnvironmentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.environments != null && message.environments.length) + for (var i = 0; i < message.environments.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Environment.encode(message.environments[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListEnvironmentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListEnvironmentsResponse} message ListEnvironmentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEnvironmentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse} ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.environments && message.environments.length)) + message.environments = []; + message.environments.push($root.google.cloud.dialogflow.v2beta1.Environment.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListEnvironmentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse} ListEnvironmentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEnvironmentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListEnvironmentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEnvironmentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.environments != null && message.hasOwnProperty("environments")) { + if (!Array.isArray(message.environments)) + return "environments: array expected"; + for (var i = 0; i < message.environments.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Environment.verify(message.environments[i]); + if (error) + return "environments." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListEnvironmentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse} ListEnvironmentsResponse + */ + ListEnvironmentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse(); + if (object.environments) { + if (!Array.isArray(object.environments)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse.environments: array expected"); + message.environments = []; + for (var i = 0; i < object.environments.length; ++i) { + if (typeof object.environments[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse.environments: object expected"); + message.environments[i] = $root.google.cloud.dialogflow.v2beta1.Environment.fromObject(object.environments[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListEnvironmentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse} message ListEnvironmentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEnvironmentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.environments = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.environments && message.environments.length) { + object.environments = []; + for (var j = 0; j < message.environments.length; ++j) + object.environments[j] = $root.google.cloud.dialogflow.v2beta1.Environment.toObject(message.environments[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListEnvironmentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListEnvironmentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListEnvironmentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListEnvironmentsResponse; + })(); + + v2beta1.SpeechContext = (function() { + + /** + * Properties of a SpeechContext. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISpeechContext + * @property {Array.|null} [phrases] SpeechContext phrases + * @property {number|null} [boost] SpeechContext boost + */ + + /** + * Constructs a new SpeechContext. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SpeechContext. + * @implements ISpeechContext + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISpeechContext=} [properties] Properties to set + */ + function SpeechContext(properties) { + this.phrases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechContext phrases. + * @member {Array.} phrases + * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @instance + */ + SpeechContext.prototype.phrases = $util.emptyArray; + + /** + * SpeechContext boost. + * @member {number} boost + * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @instance + */ + SpeechContext.prototype.boost = 0; + + /** + * Creates a new SpeechContext instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @static + * @param {google.cloud.dialogflow.v2beta1.ISpeechContext=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SpeechContext} SpeechContext instance + */ + SpeechContext.create = function create(properties) { + return new SpeechContext(properties); + }; + + /** + * Encodes the specified SpeechContext message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechContext.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @static + * @param {google.cloud.dialogflow.v2beta1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phrases != null && message.phrases.length) + for (var i = 0; i < message.phrases.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phrases[i]); + if (message.boost != null && Object.hasOwnProperty.call(message, "boost")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.boost); + return writer; + }; + + /** + * Encodes the specified SpeechContext message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechContext.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @static + * @param {google.cloud.dialogflow.v2beta1.ISpeechContext} message SpeechContext message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechContext.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SpeechContext(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.phrases && message.phrases.length)) + message.phrases = []; + message.phrases.push(reader.string()); + break; + case 2: + message.boost = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechContext message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SpeechContext} SpeechContext + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechContext.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechContext message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechContext.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phrases != null && message.hasOwnProperty("phrases")) { + if (!Array.isArray(message.phrases)) + return "phrases: array expected"; + for (var i = 0; i < message.phrases.length; ++i) + if (!$util.isString(message.phrases[i])) + return "phrases: string[] expected"; + } + if (message.boost != null && message.hasOwnProperty("boost")) + if (typeof message.boost !== "number") + return "boost: number expected"; + return null; + }; + + /** + * Creates a SpeechContext message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SpeechContext} SpeechContext + */ + SpeechContext.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SpeechContext) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SpeechContext(); + if (object.phrases) { + if (!Array.isArray(object.phrases)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SpeechContext.phrases: array expected"); + message.phrases = []; + for (var i = 0; i < object.phrases.length; ++i) + message.phrases[i] = String(object.phrases[i]); + } + if (object.boost != null) + message.boost = Number(object.boost); + return message; + }; + + /** + * Creates a plain object from a SpeechContext message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @static + * @param {google.cloud.dialogflow.v2beta1.SpeechContext} message SpeechContext + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechContext.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.phrases = []; + if (options.defaults) + object.boost = 0; + if (message.phrases && message.phrases.length) { + object.phrases = []; + for (var j = 0; j < message.phrases.length; ++j) + object.phrases[j] = message.phrases[j]; + } + if (message.boost != null && message.hasOwnProperty("boost")) + object.boost = options.json && !isFinite(message.boost) ? String(message.boost) : message.boost; + return object; + }; + + /** + * Converts this SpeechContext to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SpeechContext + * @instance + * @returns {Object.} JSON object + */ + SpeechContext.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SpeechContext; + })(); + + /** + * AudioEncoding enum. + * @name google.cloud.dialogflow.v2beta1.AudioEncoding + * @enum {number} + * @property {number} AUDIO_ENCODING_UNSPECIFIED=0 AUDIO_ENCODING_UNSPECIFIED value + * @property {number} AUDIO_ENCODING_LINEAR_16=1 AUDIO_ENCODING_LINEAR_16 value + * @property {number} AUDIO_ENCODING_FLAC=2 AUDIO_ENCODING_FLAC value + * @property {number} AUDIO_ENCODING_MULAW=3 AUDIO_ENCODING_MULAW value + * @property {number} AUDIO_ENCODING_AMR=4 AUDIO_ENCODING_AMR value + * @property {number} AUDIO_ENCODING_AMR_WB=5 AUDIO_ENCODING_AMR_WB value + * @property {number} AUDIO_ENCODING_OGG_OPUS=6 AUDIO_ENCODING_OGG_OPUS value + * @property {number} AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE=7 AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE value + */ + v2beta1.AudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUDIO_ENCODING_LINEAR_16"] = 1; + values[valuesById[2] = "AUDIO_ENCODING_FLAC"] = 2; + values[valuesById[3] = "AUDIO_ENCODING_MULAW"] = 3; + values[valuesById[4] = "AUDIO_ENCODING_AMR"] = 4; + values[valuesById[5] = "AUDIO_ENCODING_AMR_WB"] = 5; + values[valuesById[6] = "AUDIO_ENCODING_OGG_OPUS"] = 6; + values[valuesById[7] = "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE"] = 7; + return values; + })(); + + v2beta1.SpeechWordInfo = (function() { + + /** + * Properties of a SpeechWordInfo. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISpeechWordInfo + * @property {string|null} [word] SpeechWordInfo word + * @property {google.protobuf.IDuration|null} [startOffset] SpeechWordInfo startOffset + * @property {google.protobuf.IDuration|null} [endOffset] SpeechWordInfo endOffset + * @property {number|null} [confidence] SpeechWordInfo confidence + */ + + /** + * Constructs a new SpeechWordInfo. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SpeechWordInfo. + * @implements ISpeechWordInfo + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISpeechWordInfo=} [properties] Properties to set + */ + function SpeechWordInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechWordInfo word. + * @member {string} word + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.word = ""; + + /** + * SpeechWordInfo startOffset. + * @member {google.protobuf.IDuration|null|undefined} startOffset + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.startOffset = null; + + /** + * SpeechWordInfo endOffset. + * @member {google.protobuf.IDuration|null|undefined} endOffset + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.endOffset = null; + + /** + * SpeechWordInfo confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @instance + */ + SpeechWordInfo.prototype.confidence = 0; + + /** + * Creates a new SpeechWordInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @static + * @param {google.cloud.dialogflow.v2beta1.ISpeechWordInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SpeechWordInfo} SpeechWordInfo instance + */ + SpeechWordInfo.create = function create(properties) { + return new SpeechWordInfo(properties); + }; + + /** + * Encodes the specified SpeechWordInfo message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechWordInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @static + * @param {google.cloud.dialogflow.v2beta1.ISpeechWordInfo} message SpeechWordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechWordInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startOffset != null && Object.hasOwnProperty.call(message, "startOffset")) + $root.google.protobuf.Duration.encode(message.startOffset, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endOffset != null && Object.hasOwnProperty.call(message, "endOffset")) + $root.google.protobuf.Duration.encode(message.endOffset, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.word != null && Object.hasOwnProperty.call(message, "word")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.word); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + return writer; + }; + + /** + * Encodes the specified SpeechWordInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechWordInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @static + * @param {google.cloud.dialogflow.v2beta1.ISpeechWordInfo} message SpeechWordInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechWordInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechWordInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SpeechWordInfo} SpeechWordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechWordInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.word = reader.string(); + break; + case 1: + message.startOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 2: + message.endOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 4: + message.confidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechWordInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SpeechWordInfo} SpeechWordInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechWordInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechWordInfo message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechWordInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.word != null && message.hasOwnProperty("word")) + if (!$util.isString(message.word)) + return "word: string expected"; + if (message.startOffset != null && message.hasOwnProperty("startOffset")) { + var error = $root.google.protobuf.Duration.verify(message.startOffset); + if (error) + return "startOffset." + error; + } + if (message.endOffset != null && message.hasOwnProperty("endOffset")) { + var error = $root.google.protobuf.Duration.verify(message.endOffset); + if (error) + return "endOffset." + error; + } + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + return null; + }; + + /** + * Creates a SpeechWordInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SpeechWordInfo} SpeechWordInfo + */ + SpeechWordInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo(); + if (object.word != null) + message.word = String(object.word); + if (object.startOffset != null) { + if (typeof object.startOffset !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SpeechWordInfo.startOffset: object expected"); + message.startOffset = $root.google.protobuf.Duration.fromObject(object.startOffset); + } + if (object.endOffset != null) { + if (typeof object.endOffset !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SpeechWordInfo.endOffset: object expected"); + message.endOffset = $root.google.protobuf.Duration.fromObject(object.endOffset); + } + if (object.confidence != null) + message.confidence = Number(object.confidence); + return message; + }; + + /** + * Creates a plain object from a SpeechWordInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @static + * @param {google.cloud.dialogflow.v2beta1.SpeechWordInfo} message SpeechWordInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechWordInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startOffset = null; + object.endOffset = null; + object.word = ""; + object.confidence = 0; + } + if (message.startOffset != null && message.hasOwnProperty("startOffset")) + object.startOffset = $root.google.protobuf.Duration.toObject(message.startOffset, options); + if (message.endOffset != null && message.hasOwnProperty("endOffset")) + object.endOffset = $root.google.protobuf.Duration.toObject(message.endOffset, options); + if (message.word != null && message.hasOwnProperty("word")) + object.word = message.word; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + return object; + }; + + /** + * Converts this SpeechWordInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SpeechWordInfo + * @instance + * @returns {Object.} JSON object + */ + SpeechWordInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SpeechWordInfo; + })(); + + /** + * SpeechModelVariant enum. + * @name google.cloud.dialogflow.v2beta1.SpeechModelVariant + * @enum {number} + * @property {number} SPEECH_MODEL_VARIANT_UNSPECIFIED=0 SPEECH_MODEL_VARIANT_UNSPECIFIED value + * @property {number} USE_BEST_AVAILABLE=1 USE_BEST_AVAILABLE value + * @property {number} USE_STANDARD=2 USE_STANDARD value + * @property {number} USE_ENHANCED=3 USE_ENHANCED value + */ + v2beta1.SpeechModelVariant = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SPEECH_MODEL_VARIANT_UNSPECIFIED"] = 0; + values[valuesById[1] = "USE_BEST_AVAILABLE"] = 1; + values[valuesById[2] = "USE_STANDARD"] = 2; + values[valuesById[3] = "USE_ENHANCED"] = 3; + return values; + })(); + + v2beta1.InputAudioConfig = (function() { + + /** + * Properties of an InputAudioConfig. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IInputAudioConfig + * @property {google.cloud.dialogflow.v2beta1.AudioEncoding|null} [audioEncoding] InputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] InputAudioConfig sampleRateHertz + * @property {string|null} [languageCode] InputAudioConfig languageCode + * @property {boolean|null} [enableWordInfo] InputAudioConfig enableWordInfo + * @property {Array.|null} [phraseHints] InputAudioConfig phraseHints + * @property {Array.|null} [speechContexts] InputAudioConfig speechContexts + * @property {string|null} [model] InputAudioConfig model + * @property {google.cloud.dialogflow.v2beta1.SpeechModelVariant|null} [modelVariant] InputAudioConfig modelVariant + * @property {boolean|null} [singleUtterance] InputAudioConfig singleUtterance + * @property {boolean|null} [disableNoSpeechRecognizedEvent] InputAudioConfig disableNoSpeechRecognizedEvent + */ + + /** + * Constructs a new InputAudioConfig. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an InputAudioConfig. + * @implements IInputAudioConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IInputAudioConfig=} [properties] Properties to set + */ + function InputAudioConfig(properties) { + this.phraseHints = []; + this.speechContexts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputAudioConfig audioEncoding. + * @member {google.cloud.dialogflow.v2beta1.AudioEncoding} audioEncoding + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.audioEncoding = 0; + + /** + * InputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.sampleRateHertz = 0; + + /** + * InputAudioConfig languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.languageCode = ""; + + /** + * InputAudioConfig enableWordInfo. + * @member {boolean} enableWordInfo + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.enableWordInfo = false; + + /** + * InputAudioConfig phraseHints. + * @member {Array.} phraseHints + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.phraseHints = $util.emptyArray; + + /** + * InputAudioConfig speechContexts. + * @member {Array.} speechContexts + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.speechContexts = $util.emptyArray; + + /** + * InputAudioConfig model. + * @member {string} model + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.model = ""; + + /** + * InputAudioConfig modelVariant. + * @member {google.cloud.dialogflow.v2beta1.SpeechModelVariant} modelVariant + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.modelVariant = 0; + + /** + * InputAudioConfig singleUtterance. + * @member {boolean} singleUtterance + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.singleUtterance = false; + + /** + * InputAudioConfig disableNoSpeechRecognizedEvent. + * @member {boolean} disableNoSpeechRecognizedEvent + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @instance + */ + InputAudioConfig.prototype.disableNoSpeechRecognizedEvent = false; + + /** + * Creates a new InputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.IInputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.InputAudioConfig} InputAudioConfig instance + */ + InputAudioConfig.create = function create(properties) { + return new InputAudioConfig(properties); + }; + + /** + * Encodes the specified InputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.phraseHints != null && message.phraseHints.length) + for (var i = 0; i < message.phraseHints.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.phraseHints[i]); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.model); + if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.singleUtterance); + if (message.modelVariant != null && Object.hasOwnProperty.call(message, "modelVariant")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.modelVariant); + if (message.speechContexts != null && message.speechContexts.length) + for (var i = 0; i < message.speechContexts.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SpeechContext.encode(message.speechContexts[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.enableWordInfo != null && Object.hasOwnProperty.call(message, "enableWordInfo")) + writer.uint32(/* id 13, wireType 0 =*/104).bool(message.enableWordInfo); + if (message.disableNoSpeechRecognizedEvent != null && Object.hasOwnProperty.call(message, "disableNoSpeechRecognizedEvent")) + writer.uint32(/* id 14, wireType 0 =*/112).bool(message.disableNoSpeechRecognizedEvent); + return writer; + }; + + /** + * Encodes the specified InputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.IInputAudioConfig} message InputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.InputAudioConfig} InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudioConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.InputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.audioEncoding = reader.int32(); + break; + case 2: + message.sampleRateHertz = reader.int32(); + break; + case 3: + message.languageCode = reader.string(); + break; + case 13: + message.enableWordInfo = reader.bool(); + break; + case 4: + if (!(message.phraseHints && message.phraseHints.length)) + message.phraseHints = []; + message.phraseHints.push(reader.string()); + break; + case 11: + if (!(message.speechContexts && message.speechContexts.length)) + message.speechContexts = []; + message.speechContexts.push($root.google.cloud.dialogflow.v2beta1.SpeechContext.decode(reader, reader.uint32())); + break; + case 7: + message.model = reader.string(); + break; + case 10: + message.modelVariant = reader.int32(); + break; + case 8: + message.singleUtterance = reader.bool(); + break; + case 14: + message.disableNoSpeechRecognizedEvent = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.InputAudioConfig} InputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputAudioConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputAudioConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.enableWordInfo != null && message.hasOwnProperty("enableWordInfo")) + if (typeof message.enableWordInfo !== "boolean") + return "enableWordInfo: boolean expected"; + if (message.phraseHints != null && message.hasOwnProperty("phraseHints")) { + if (!Array.isArray(message.phraseHints)) + return "phraseHints: array expected"; + for (var i = 0; i < message.phraseHints.length; ++i) + if (!$util.isString(message.phraseHints[i])) + return "phraseHints: string[] expected"; + } + if (message.speechContexts != null && message.hasOwnProperty("speechContexts")) { + if (!Array.isArray(message.speechContexts)) + return "speechContexts: array expected"; + for (var i = 0; i < message.speechContexts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SpeechContext.verify(message.speechContexts[i]); + if (error) + return "speechContexts." + error; + } + } + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + if (message.modelVariant != null && message.hasOwnProperty("modelVariant")) + switch (message.modelVariant) { + default: + return "modelVariant: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (typeof message.singleUtterance !== "boolean") + return "singleUtterance: boolean expected"; + if (message.disableNoSpeechRecognizedEvent != null && message.hasOwnProperty("disableNoSpeechRecognizedEvent")) + if (typeof message.disableNoSpeechRecognizedEvent !== "boolean") + return "disableNoSpeechRecognizedEvent: boolean expected"; + return null; + }; + + /** + * Creates an InputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.InputAudioConfig} InputAudioConfig + */ + InputAudioConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.InputAudioConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.InputAudioConfig(); + switch (object.audioEncoding) { + case "AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "AUDIO_ENCODING_LINEAR_16": + case 1: + message.audioEncoding = 1; + break; + case "AUDIO_ENCODING_FLAC": + case 2: + message.audioEncoding = 2; + break; + case "AUDIO_ENCODING_MULAW": + case 3: + message.audioEncoding = 3; + break; + case "AUDIO_ENCODING_AMR": + case 4: + message.audioEncoding = 4; + break; + case "AUDIO_ENCODING_AMR_WB": + case 5: + message.audioEncoding = 5; + break; + case "AUDIO_ENCODING_OGG_OPUS": + case 6: + message.audioEncoding = 6; + break; + case "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": + case 7: + message.audioEncoding = 7; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.enableWordInfo != null) + message.enableWordInfo = Boolean(object.enableWordInfo); + if (object.phraseHints) { + if (!Array.isArray(object.phraseHints)) + throw TypeError(".google.cloud.dialogflow.v2beta1.InputAudioConfig.phraseHints: array expected"); + message.phraseHints = []; + for (var i = 0; i < object.phraseHints.length; ++i) + message.phraseHints[i] = String(object.phraseHints[i]); + } + if (object.speechContexts) { + if (!Array.isArray(object.speechContexts)) + throw TypeError(".google.cloud.dialogflow.v2beta1.InputAudioConfig.speechContexts: array expected"); + message.speechContexts = []; + for (var i = 0; i < object.speechContexts.length; ++i) { + if (typeof object.speechContexts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.InputAudioConfig.speechContexts: object expected"); + message.speechContexts[i] = $root.google.cloud.dialogflow.v2beta1.SpeechContext.fromObject(object.speechContexts[i]); + } + } + if (object.model != null) + message.model = String(object.model); + switch (object.modelVariant) { + case "SPEECH_MODEL_VARIANT_UNSPECIFIED": + case 0: + message.modelVariant = 0; + break; + case "USE_BEST_AVAILABLE": + case 1: + message.modelVariant = 1; + break; + case "USE_STANDARD": + case 2: + message.modelVariant = 2; + break; + case "USE_ENHANCED": + case 3: + message.modelVariant = 3; + break; + } + if (object.singleUtterance != null) + message.singleUtterance = Boolean(object.singleUtterance); + if (object.disableNoSpeechRecognizedEvent != null) + message.disableNoSpeechRecognizedEvent = Boolean(object.disableNoSpeechRecognizedEvent); + return message; + }; + + /** + * Creates a plain object from an InputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.InputAudioConfig} message InputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.phraseHints = []; + object.speechContexts = []; + } + if (options.defaults) { + object.audioEncoding = options.enums === String ? "AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.languageCode = ""; + object.model = ""; + object.singleUtterance = false; + object.modelVariant = options.enums === String ? "SPEECH_MODEL_VARIANT_UNSPECIFIED" : 0; + object.enableWordInfo = false; + object.disableNoSpeechRecognizedEvent = false; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.AudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.phraseHints && message.phraseHints.length) { + object.phraseHints = []; + for (var j = 0; j < message.phraseHints.length; ++j) + object.phraseHints[j] = message.phraseHints[j]; + } + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + object.singleUtterance = message.singleUtterance; + if (message.modelVariant != null && message.hasOwnProperty("modelVariant")) + object.modelVariant = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.SpeechModelVariant[message.modelVariant] : message.modelVariant; + if (message.speechContexts && message.speechContexts.length) { + object.speechContexts = []; + for (var j = 0; j < message.speechContexts.length; ++j) + object.speechContexts[j] = $root.google.cloud.dialogflow.v2beta1.SpeechContext.toObject(message.speechContexts[j], options); + } + if (message.enableWordInfo != null && message.hasOwnProperty("enableWordInfo")) + object.enableWordInfo = message.enableWordInfo; + if (message.disableNoSpeechRecognizedEvent != null && message.hasOwnProperty("disableNoSpeechRecognizedEvent")) + object.disableNoSpeechRecognizedEvent = message.disableNoSpeechRecognizedEvent; + return object; + }; + + /** + * Converts this InputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.InputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + InputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InputAudioConfig; + })(); + + v2beta1.VoiceSelectionParams = (function() { + + /** + * Properties of a VoiceSelectionParams. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IVoiceSelectionParams + * @property {string|null} [name] VoiceSelectionParams name + * @property {google.cloud.dialogflow.v2beta1.SsmlVoiceGender|null} [ssmlGender] VoiceSelectionParams ssmlGender + */ + + /** + * Constructs a new VoiceSelectionParams. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a VoiceSelectionParams. + * @implements IVoiceSelectionParams + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IVoiceSelectionParams=} [properties] Properties to set + */ + function VoiceSelectionParams(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * VoiceSelectionParams name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @instance + */ + VoiceSelectionParams.prototype.name = ""; + + /** + * VoiceSelectionParams ssmlGender. + * @member {google.cloud.dialogflow.v2beta1.SsmlVoiceGender} ssmlGender + * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @instance + */ + VoiceSelectionParams.prototype.ssmlGender = 0; + + /** + * Creates a new VoiceSelectionParams instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.v2beta1.IVoiceSelectionParams=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.VoiceSelectionParams} VoiceSelectionParams instance + */ + VoiceSelectionParams.create = function create(properties) { + return new VoiceSelectionParams(properties); + }; + + /** + * Encodes the specified VoiceSelectionParams message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.VoiceSelectionParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.v2beta1.IVoiceSelectionParams} message VoiceSelectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceSelectionParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ssmlGender != null && Object.hasOwnProperty.call(message, "ssmlGender")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.ssmlGender); + return writer; + }; + + /** + * Encodes the specified VoiceSelectionParams message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.VoiceSelectionParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.v2beta1.IVoiceSelectionParams} message VoiceSelectionParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + VoiceSelectionParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.VoiceSelectionParams} VoiceSelectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceSelectionParams.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.ssmlGender = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a VoiceSelectionParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.VoiceSelectionParams} VoiceSelectionParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + VoiceSelectionParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a VoiceSelectionParams message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + VoiceSelectionParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ssmlGender != null && message.hasOwnProperty("ssmlGender")) + switch (message.ssmlGender) { + default: + return "ssmlGender: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a VoiceSelectionParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.VoiceSelectionParams} VoiceSelectionParams + */ + VoiceSelectionParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams(); + if (object.name != null) + message.name = String(object.name); + switch (object.ssmlGender) { + case "SSML_VOICE_GENDER_UNSPECIFIED": + case 0: + message.ssmlGender = 0; + break; + case "SSML_VOICE_GENDER_MALE": + case 1: + message.ssmlGender = 1; + break; + case "SSML_VOICE_GENDER_FEMALE": + case 2: + message.ssmlGender = 2; + break; + case "SSML_VOICE_GENDER_NEUTRAL": + case 3: + message.ssmlGender = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a VoiceSelectionParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @static + * @param {google.cloud.dialogflow.v2beta1.VoiceSelectionParams} message VoiceSelectionParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + VoiceSelectionParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ssmlGender = options.enums === String ? "SSML_VOICE_GENDER_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ssmlGender != null && message.hasOwnProperty("ssmlGender")) + object.ssmlGender = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.SsmlVoiceGender[message.ssmlGender] : message.ssmlGender; + return object; + }; + + /** + * Converts this VoiceSelectionParams to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.VoiceSelectionParams + * @instance + * @returns {Object.} JSON object + */ + VoiceSelectionParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return VoiceSelectionParams; + })(); + + v2beta1.SynthesizeSpeechConfig = (function() { + + /** + * Properties of a SynthesizeSpeechConfig. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISynthesizeSpeechConfig + * @property {number|null} [speakingRate] SynthesizeSpeechConfig speakingRate + * @property {number|null} [pitch] SynthesizeSpeechConfig pitch + * @property {number|null} [volumeGainDb] SynthesizeSpeechConfig volumeGainDb + * @property {Array.|null} [effectsProfileId] SynthesizeSpeechConfig effectsProfileId + * @property {google.cloud.dialogflow.v2beta1.IVoiceSelectionParams|null} [voice] SynthesizeSpeechConfig voice + */ + + /** + * Constructs a new SynthesizeSpeechConfig. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SynthesizeSpeechConfig. + * @implements ISynthesizeSpeechConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig=} [properties] Properties to set + */ + function SynthesizeSpeechConfig(properties) { + this.effectsProfileId = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SynthesizeSpeechConfig speakingRate. + * @member {number} speakingRate + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.speakingRate = 0; + + /** + * SynthesizeSpeechConfig pitch. + * @member {number} pitch + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.pitch = 0; + + /** + * SynthesizeSpeechConfig volumeGainDb. + * @member {number} volumeGainDb + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.volumeGainDb = 0; + + /** + * SynthesizeSpeechConfig effectsProfileId. + * @member {Array.} effectsProfileId + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.effectsProfileId = $util.emptyArray; + + /** + * SynthesizeSpeechConfig voice. + * @member {google.cloud.dialogflow.v2beta1.IVoiceSelectionParams|null|undefined} voice + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @instance + */ + SynthesizeSpeechConfig.prototype.voice = null; + + /** + * Creates a new SynthesizeSpeechConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig} SynthesizeSpeechConfig instance + */ + SynthesizeSpeechConfig.create = function create(properties) { + return new SynthesizeSpeechConfig(properties); + }; + + /** + * Encodes the specified SynthesizeSpeechConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speakingRate != null && Object.hasOwnProperty.call(message, "speakingRate")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.speakingRate); + if (message.pitch != null && Object.hasOwnProperty.call(message, "pitch")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.pitch); + if (message.volumeGainDb != null && Object.hasOwnProperty.call(message, "volumeGainDb")) + writer.uint32(/* id 3, wireType 1 =*/25).double(message.volumeGainDb); + if (message.voice != null && Object.hasOwnProperty.call(message, "voice")) + $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams.encode(message.voice, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.effectsProfileId != null && message.effectsProfileId.length) + for (var i = 0; i < message.effectsProfileId.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.effectsProfileId[i]); + return writer; + }; + + /** + * Encodes the specified SynthesizeSpeechConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig} message SynthesizeSpeechConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SynthesizeSpeechConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.speakingRate = reader.double(); + break; + case 2: + message.pitch = reader.double(); + break; + case 3: + message.volumeGainDb = reader.double(); + break; + case 5: + if (!(message.effectsProfileId && message.effectsProfileId.length)) + message.effectsProfileId = []; + message.effectsProfileId.push(reader.string()); + break; + case 4: + message.voice = $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SynthesizeSpeechConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig} SynthesizeSpeechConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SynthesizeSpeechConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SynthesizeSpeechConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SynthesizeSpeechConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + if (typeof message.speakingRate !== "number") + return "speakingRate: number expected"; + if (message.pitch != null && message.hasOwnProperty("pitch")) + if (typeof message.pitch !== "number") + return "pitch: number expected"; + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + if (typeof message.volumeGainDb !== "number") + return "volumeGainDb: number expected"; + if (message.effectsProfileId != null && message.hasOwnProperty("effectsProfileId")) { + if (!Array.isArray(message.effectsProfileId)) + return "effectsProfileId: array expected"; + for (var i = 0; i < message.effectsProfileId.length; ++i) + if (!$util.isString(message.effectsProfileId[i])) + return "effectsProfileId: string[] expected"; + } + if (message.voice != null && message.hasOwnProperty("voice")) { + var error = $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams.verify(message.voice); + if (error) + return "voice." + error; + } + return null; + }; + + /** + * Creates a SynthesizeSpeechConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig} SynthesizeSpeechConfig + */ + SynthesizeSpeechConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig(); + if (object.speakingRate != null) + message.speakingRate = Number(object.speakingRate); + if (object.pitch != null) + message.pitch = Number(object.pitch); + if (object.volumeGainDb != null) + message.volumeGainDb = Number(object.volumeGainDb); + if (object.effectsProfileId) { + if (!Array.isArray(object.effectsProfileId)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.effectsProfileId: array expected"); + message.effectsProfileId = []; + for (var i = 0; i < object.effectsProfileId.length; ++i) + message.effectsProfileId[i] = String(object.effectsProfileId[i]); + } + if (object.voice != null) { + if (typeof object.voice !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.voice: object expected"); + message.voice = $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams.fromObject(object.voice); + } + return message; + }; + + /** + * Creates a plain object from a SynthesizeSpeechConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig} message SynthesizeSpeechConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SynthesizeSpeechConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.effectsProfileId = []; + if (options.defaults) { + object.speakingRate = 0; + object.pitch = 0; + object.volumeGainDb = 0; + object.voice = null; + } + if (message.speakingRate != null && message.hasOwnProperty("speakingRate")) + object.speakingRate = options.json && !isFinite(message.speakingRate) ? String(message.speakingRate) : message.speakingRate; + if (message.pitch != null && message.hasOwnProperty("pitch")) + object.pitch = options.json && !isFinite(message.pitch) ? String(message.pitch) : message.pitch; + if (message.volumeGainDb != null && message.hasOwnProperty("volumeGainDb")) + object.volumeGainDb = options.json && !isFinite(message.volumeGainDb) ? String(message.volumeGainDb) : message.volumeGainDb; + if (message.voice != null && message.hasOwnProperty("voice")) + object.voice = $root.google.cloud.dialogflow.v2beta1.VoiceSelectionParams.toObject(message.voice, options); + if (message.effectsProfileId && message.effectsProfileId.length) { + object.effectsProfileId = []; + for (var j = 0; j < message.effectsProfileId.length; ++j) + object.effectsProfileId[j] = message.effectsProfileId[j]; + } + return object; + }; + + /** + * Converts this SynthesizeSpeechConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig + * @instance + * @returns {Object.} JSON object + */ + SynthesizeSpeechConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SynthesizeSpeechConfig; + })(); + + /** + * SsmlVoiceGender enum. + * @name google.cloud.dialogflow.v2beta1.SsmlVoiceGender + * @enum {number} + * @property {number} SSML_VOICE_GENDER_UNSPECIFIED=0 SSML_VOICE_GENDER_UNSPECIFIED value + * @property {number} SSML_VOICE_GENDER_MALE=1 SSML_VOICE_GENDER_MALE value + * @property {number} SSML_VOICE_GENDER_FEMALE=2 SSML_VOICE_GENDER_FEMALE value + * @property {number} SSML_VOICE_GENDER_NEUTRAL=3 SSML_VOICE_GENDER_NEUTRAL value + */ + v2beta1.SsmlVoiceGender = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SSML_VOICE_GENDER_UNSPECIFIED"] = 0; + values[valuesById[1] = "SSML_VOICE_GENDER_MALE"] = 1; + values[valuesById[2] = "SSML_VOICE_GENDER_FEMALE"] = 2; + values[valuesById[3] = "SSML_VOICE_GENDER_NEUTRAL"] = 3; + return values; + })(); + + v2beta1.OutputAudioConfig = (function() { + + /** + * Properties of an OutputAudioConfig. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IOutputAudioConfig + * @property {google.cloud.dialogflow.v2beta1.OutputAudioEncoding|null} [audioEncoding] OutputAudioConfig audioEncoding + * @property {number|null} [sampleRateHertz] OutputAudioConfig sampleRateHertz + * @property {google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig|null} [synthesizeSpeechConfig] OutputAudioConfig synthesizeSpeechConfig + */ + + /** + * Constructs a new OutputAudioConfig. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an OutputAudioConfig. + * @implements IOutputAudioConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IOutputAudioConfig=} [properties] Properties to set + */ + function OutputAudioConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputAudioConfig audioEncoding. + * @member {google.cloud.dialogflow.v2beta1.OutputAudioEncoding} audioEncoding + * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.audioEncoding = 0; + + /** + * OutputAudioConfig sampleRateHertz. + * @member {number} sampleRateHertz + * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.sampleRateHertz = 0; + + /** + * OutputAudioConfig synthesizeSpeechConfig. + * @member {google.cloud.dialogflow.v2beta1.ISynthesizeSpeechConfig|null|undefined} synthesizeSpeechConfig + * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @instance + */ + OutputAudioConfig.prototype.synthesizeSpeechConfig = null; + + /** + * Creates a new OutputAudioConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.IOutputAudioConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.OutputAudioConfig} OutputAudioConfig instance + */ + OutputAudioConfig.create = function create(properties) { + return new OutputAudioConfig(properties); + }; + + /** + * Encodes the specified OutputAudioConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioEncoding != null && Object.hasOwnProperty.call(message, "audioEncoding")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.audioEncoding); + if (message.sampleRateHertz != null && Object.hasOwnProperty.call(message, "sampleRateHertz")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.sampleRateHertz); + if (message.synthesizeSpeechConfig != null && Object.hasOwnProperty.call(message, "synthesizeSpeechConfig")) + $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.encode(message.synthesizeSpeechConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OutputAudioConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.IOutputAudioConfig} message OutputAudioConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudioConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.audioEncoding = reader.int32(); + break; + case 2: + message.sampleRateHertz = reader.int32(); + break; + case 3: + message.synthesizeSpeechConfig = $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputAudioConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.OutputAudioConfig} OutputAudioConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudioConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputAudioConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputAudioConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + switch (message.audioEncoding) { + default: + return "audioEncoding: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + if (!$util.isInteger(message.sampleRateHertz)) + return "sampleRateHertz: integer expected"; + if (message.synthesizeSpeechConfig != null && message.hasOwnProperty("synthesizeSpeechConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.verify(message.synthesizeSpeechConfig); + if (error) + return "synthesizeSpeechConfig." + error; + } + return null; + }; + + /** + * Creates an OutputAudioConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.OutputAudioConfig} OutputAudioConfig + */ + OutputAudioConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig(); + switch (object.audioEncoding) { + case "OUTPUT_AUDIO_ENCODING_UNSPECIFIED": + case 0: + message.audioEncoding = 0; + break; + case "OUTPUT_AUDIO_ENCODING_LINEAR_16": + case 1: + message.audioEncoding = 1; + break; + case "OUTPUT_AUDIO_ENCODING_MP3": + case 2: + message.audioEncoding = 2; + break; + case "OUTPUT_AUDIO_ENCODING_OGG_OPUS": + case 3: + message.audioEncoding = 3; + break; + } + if (object.sampleRateHertz != null) + message.sampleRateHertz = object.sampleRateHertz | 0; + if (object.synthesizeSpeechConfig != null) { + if (typeof object.synthesizeSpeechConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.OutputAudioConfig.synthesizeSpeechConfig: object expected"); + message.synthesizeSpeechConfig = $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.fromObject(object.synthesizeSpeechConfig); + } + return message; + }; + + /** + * Creates a plain object from an OutputAudioConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.OutputAudioConfig} message OutputAudioConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputAudioConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.audioEncoding = options.enums === String ? "OUTPUT_AUDIO_ENCODING_UNSPECIFIED" : 0; + object.sampleRateHertz = 0; + object.synthesizeSpeechConfig = null; + } + if (message.audioEncoding != null && message.hasOwnProperty("audioEncoding")) + object.audioEncoding = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.OutputAudioEncoding[message.audioEncoding] : message.audioEncoding; + if (message.sampleRateHertz != null && message.hasOwnProperty("sampleRateHertz")) + object.sampleRateHertz = message.sampleRateHertz; + if (message.synthesizeSpeechConfig != null && message.hasOwnProperty("synthesizeSpeechConfig")) + object.synthesizeSpeechConfig = $root.google.cloud.dialogflow.v2beta1.SynthesizeSpeechConfig.toObject(message.synthesizeSpeechConfig, options); + return object; + }; + + /** + * Converts this OutputAudioConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.OutputAudioConfig + * @instance + * @returns {Object.} JSON object + */ + OutputAudioConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputAudioConfig; + })(); + + v2beta1.TelephonyDtmfEvents = (function() { + + /** + * Properties of a TelephonyDtmfEvents. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ITelephonyDtmfEvents + * @property {Array.|null} [dtmfEvents] TelephonyDtmfEvents dtmfEvents + */ + + /** + * Constructs a new TelephonyDtmfEvents. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a TelephonyDtmfEvents. + * @implements ITelephonyDtmfEvents + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents=} [properties] Properties to set + */ + function TelephonyDtmfEvents(properties) { + this.dtmfEvents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TelephonyDtmfEvents dtmfEvents. + * @member {Array.} dtmfEvents + * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @instance + */ + TelephonyDtmfEvents.prototype.dtmfEvents = $util.emptyArray; + + /** + * Creates a new TelephonyDtmfEvents instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @static + * @param {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents} TelephonyDtmfEvents instance + */ + TelephonyDtmfEvents.create = function create(properties) { + return new TelephonyDtmfEvents(properties); + }; + + /** + * Encodes the specified TelephonyDtmfEvents message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @static + * @param {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents} message TelephonyDtmfEvents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonyDtmfEvents.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dtmfEvents != null && message.dtmfEvents.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.dtmfEvents.length; ++i) + writer.int32(message.dtmfEvents[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified TelephonyDtmfEvents message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @static + * @param {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents} message TelephonyDtmfEvents message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonyDtmfEvents.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TelephonyDtmfEvents message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents} TelephonyDtmfEvents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonyDtmfEvents.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.dtmfEvents && message.dtmfEvents.length)) + message.dtmfEvents = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.dtmfEvents.push(reader.int32()); + } else + message.dtmfEvents.push(reader.int32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TelephonyDtmfEvents message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents} TelephonyDtmfEvents + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonyDtmfEvents.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TelephonyDtmfEvents message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TelephonyDtmfEvents.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dtmfEvents != null && message.hasOwnProperty("dtmfEvents")) { + if (!Array.isArray(message.dtmfEvents)) + return "dtmfEvents: array expected"; + for (var i = 0; i < message.dtmfEvents.length; ++i) + switch (message.dtmfEvents[i]) { + default: + return "dtmfEvents: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + break; + } + } + return null; + }; + + /** + * Creates a TelephonyDtmfEvents message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents} TelephonyDtmfEvents + */ + TelephonyDtmfEvents.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents(); + if (object.dtmfEvents) { + if (!Array.isArray(object.dtmfEvents)) + throw TypeError(".google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.dtmfEvents: array expected"); + message.dtmfEvents = []; + for (var i = 0; i < object.dtmfEvents.length; ++i) + switch (object.dtmfEvents[i]) { + default: + case "TELEPHONY_DTMF_UNSPECIFIED": + case 0: + message.dtmfEvents[i] = 0; + break; + case "DTMF_ONE": + case 1: + message.dtmfEvents[i] = 1; + break; + case "DTMF_TWO": + case 2: + message.dtmfEvents[i] = 2; + break; + case "DTMF_THREE": + case 3: + message.dtmfEvents[i] = 3; + break; + case "DTMF_FOUR": + case 4: + message.dtmfEvents[i] = 4; + break; + case "DTMF_FIVE": + case 5: + message.dtmfEvents[i] = 5; + break; + case "DTMF_SIX": + case 6: + message.dtmfEvents[i] = 6; + break; + case "DTMF_SEVEN": + case 7: + message.dtmfEvents[i] = 7; + break; + case "DTMF_EIGHT": + case 8: + message.dtmfEvents[i] = 8; + break; + case "DTMF_NINE": + case 9: + message.dtmfEvents[i] = 9; + break; + case "DTMF_ZERO": + case 10: + message.dtmfEvents[i] = 10; + break; + case "DTMF_A": + case 11: + message.dtmfEvents[i] = 11; + break; + case "DTMF_B": + case 12: + message.dtmfEvents[i] = 12; + break; + case "DTMF_C": + case 13: + message.dtmfEvents[i] = 13; + break; + case "DTMF_D": + case 14: + message.dtmfEvents[i] = 14; + break; + case "DTMF_STAR": + case 15: + message.dtmfEvents[i] = 15; + break; + case "DTMF_POUND": + case 16: + message.dtmfEvents[i] = 16; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a TelephonyDtmfEvents message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @static + * @param {google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents} message TelephonyDtmfEvents + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TelephonyDtmfEvents.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dtmfEvents = []; + if (message.dtmfEvents && message.dtmfEvents.length) { + object.dtmfEvents = []; + for (var j = 0; j < message.dtmfEvents.length; ++j) + object.dtmfEvents[j] = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.TelephonyDtmf[message.dtmfEvents[j]] : message.dtmfEvents[j]; + } + return object; + }; + + /** + * Converts this TelephonyDtmfEvents to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents + * @instance + * @returns {Object.} JSON object + */ + TelephonyDtmfEvents.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TelephonyDtmfEvents; + })(); + + /** + * OutputAudioEncoding enum. + * @name google.cloud.dialogflow.v2beta1.OutputAudioEncoding + * @enum {number} + * @property {number} OUTPUT_AUDIO_ENCODING_UNSPECIFIED=0 OUTPUT_AUDIO_ENCODING_UNSPECIFIED value + * @property {number} OUTPUT_AUDIO_ENCODING_LINEAR_16=1 OUTPUT_AUDIO_ENCODING_LINEAR_16 value + * @property {number} OUTPUT_AUDIO_ENCODING_MP3=2 OUTPUT_AUDIO_ENCODING_MP3 value + * @property {number} OUTPUT_AUDIO_ENCODING_OGG_OPUS=3 OUTPUT_AUDIO_ENCODING_OGG_OPUS value + */ + v2beta1.OutputAudioEncoding = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OUTPUT_AUDIO_ENCODING_UNSPECIFIED"] = 0; + values[valuesById[1] = "OUTPUT_AUDIO_ENCODING_LINEAR_16"] = 1; + values[valuesById[2] = "OUTPUT_AUDIO_ENCODING_MP3"] = 2; + values[valuesById[3] = "OUTPUT_AUDIO_ENCODING_OGG_OPUS"] = 3; + return values; + })(); + + v2beta1.SpeechToTextConfig = (function() { + + /** + * Properties of a SpeechToTextConfig. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISpeechToTextConfig + * @property {google.cloud.dialogflow.v2beta1.SpeechModelVariant|null} [speechModelVariant] SpeechToTextConfig speechModelVariant + */ + + /** + * Constructs a new SpeechToTextConfig. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SpeechToTextConfig. + * @implements ISpeechToTextConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISpeechToTextConfig=} [properties] Properties to set + */ + function SpeechToTextConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SpeechToTextConfig speechModelVariant. + * @member {google.cloud.dialogflow.v2beta1.SpeechModelVariant} speechModelVariant + * @memberof google.cloud.dialogflow.v2beta1.SpeechToTextConfig + * @instance + */ + SpeechToTextConfig.prototype.speechModelVariant = 0; + + /** + * Creates a new SpeechToTextConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SpeechToTextConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.ISpeechToTextConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SpeechToTextConfig} SpeechToTextConfig instance + */ + SpeechToTextConfig.create = function create(properties) { + return new SpeechToTextConfig(properties); + }; + + /** + * Encodes the specified SpeechToTextConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechToTextConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SpeechToTextConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.ISpeechToTextConfig} message SpeechToTextConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechToTextConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.speechModelVariant != null && Object.hasOwnProperty.call(message, "speechModelVariant")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.speechModelVariant); + return writer; + }; + + /** + * Encodes the specified SpeechToTextConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SpeechToTextConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SpeechToTextConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.ISpeechToTextConfig} message SpeechToTextConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SpeechToTextConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SpeechToTextConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SpeechToTextConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SpeechToTextConfig} SpeechToTextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechToTextConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SpeechToTextConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.speechModelVariant = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SpeechToTextConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SpeechToTextConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SpeechToTextConfig} SpeechToTextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SpeechToTextConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SpeechToTextConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SpeechToTextConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SpeechToTextConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.speechModelVariant != null && message.hasOwnProperty("speechModelVariant")) + switch (message.speechModelVariant) { + default: + return "speechModelVariant: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a SpeechToTextConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SpeechToTextConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SpeechToTextConfig} SpeechToTextConfig + */ + SpeechToTextConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SpeechToTextConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SpeechToTextConfig(); + switch (object.speechModelVariant) { + case "SPEECH_MODEL_VARIANT_UNSPECIFIED": + case 0: + message.speechModelVariant = 0; + break; + case "USE_BEST_AVAILABLE": + case 1: + message.speechModelVariant = 1; + break; + case "USE_STANDARD": + case 2: + message.speechModelVariant = 2; + break; + case "USE_ENHANCED": + case 3: + message.speechModelVariant = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a SpeechToTextConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SpeechToTextConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.SpeechToTextConfig} message SpeechToTextConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SpeechToTextConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.speechModelVariant = options.enums === String ? "SPEECH_MODEL_VARIANT_UNSPECIFIED" : 0; + if (message.speechModelVariant != null && message.hasOwnProperty("speechModelVariant")) + object.speechModelVariant = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.SpeechModelVariant[message.speechModelVariant] : message.speechModelVariant; + return object; + }; + + /** + * Converts this SpeechToTextConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SpeechToTextConfig + * @instance + * @returns {Object.} JSON object + */ + SpeechToTextConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SpeechToTextConfig; + })(); + + /** + * TelephonyDtmf enum. + * @name google.cloud.dialogflow.v2beta1.TelephonyDtmf + * @enum {number} + * @property {number} TELEPHONY_DTMF_UNSPECIFIED=0 TELEPHONY_DTMF_UNSPECIFIED value + * @property {number} DTMF_ONE=1 DTMF_ONE value + * @property {number} DTMF_TWO=2 DTMF_TWO value + * @property {number} DTMF_THREE=3 DTMF_THREE value + * @property {number} DTMF_FOUR=4 DTMF_FOUR value + * @property {number} DTMF_FIVE=5 DTMF_FIVE value + * @property {number} DTMF_SIX=6 DTMF_SIX value + * @property {number} DTMF_SEVEN=7 DTMF_SEVEN value + * @property {number} DTMF_EIGHT=8 DTMF_EIGHT value + * @property {number} DTMF_NINE=9 DTMF_NINE value + * @property {number} DTMF_ZERO=10 DTMF_ZERO value + * @property {number} DTMF_A=11 DTMF_A value + * @property {number} DTMF_B=12 DTMF_B value + * @property {number} DTMF_C=13 DTMF_C value + * @property {number} DTMF_D=14 DTMF_D value + * @property {number} DTMF_STAR=15 DTMF_STAR value + * @property {number} DTMF_POUND=16 DTMF_POUND value + */ + v2beta1.TelephonyDtmf = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TELEPHONY_DTMF_UNSPECIFIED"] = 0; + values[valuesById[1] = "DTMF_ONE"] = 1; + values[valuesById[2] = "DTMF_TWO"] = 2; + values[valuesById[3] = "DTMF_THREE"] = 3; + values[valuesById[4] = "DTMF_FOUR"] = 4; + values[valuesById[5] = "DTMF_FIVE"] = 5; + values[valuesById[6] = "DTMF_SIX"] = 6; + values[valuesById[7] = "DTMF_SEVEN"] = 7; + values[valuesById[8] = "DTMF_EIGHT"] = 8; + values[valuesById[9] = "DTMF_NINE"] = 9; + values[valuesById[10] = "DTMF_ZERO"] = 10; + values[valuesById[11] = "DTMF_A"] = 11; + values[valuesById[12] = "DTMF_B"] = 12; + values[valuesById[13] = "DTMF_C"] = 13; + values[valuesById[14] = "DTMF_D"] = 14; + values[valuesById[15] = "DTMF_STAR"] = 15; + values[valuesById[16] = "DTMF_POUND"] = 16; + return values; + })(); + + v2beta1.ValidationError = (function() { + + /** + * Properties of a ValidationError. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IValidationError + * @property {google.cloud.dialogflow.v2beta1.ValidationError.Severity|null} [severity] ValidationError severity + * @property {Array.|null} [entries] ValidationError entries + * @property {string|null} [errorMessage] ValidationError errorMessage + */ + + /** + * Constructs a new ValidationError. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ValidationError. + * @implements IValidationError + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IValidationError=} [properties] Properties to set + */ + function ValidationError(properties) { + this.entries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidationError severity. + * @member {google.cloud.dialogflow.v2beta1.ValidationError.Severity} severity + * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @instance + */ + ValidationError.prototype.severity = 0; + + /** + * ValidationError entries. + * @member {Array.} entries + * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @instance + */ + ValidationError.prototype.entries = $util.emptyArray; + + /** + * ValidationError errorMessage. + * @member {string} errorMessage + * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @instance + */ + ValidationError.prototype.errorMessage = ""; + + /** + * Creates a new ValidationError instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @static + * @param {google.cloud.dialogflow.v2beta1.IValidationError=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ValidationError} ValidationError instance + */ + ValidationError.create = function create(properties) { + return new ValidationError(properties); + }; + + /** + * Encodes the specified ValidationError message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationError.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @static + * @param {google.cloud.dialogflow.v2beta1.IValidationError} message ValidationError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidationError.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.severity != null && Object.hasOwnProperty.call(message, "severity")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.severity); + if (message.entries != null && message.entries.length) + for (var i = 0; i < message.entries.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.entries[i]); + if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.errorMessage); + return writer; + }; + + /** + * Encodes the specified ValidationError message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationError.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @static + * @param {google.cloud.dialogflow.v2beta1.IValidationError} message ValidationError message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidationError.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidationError message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ValidationError} ValidationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidationError.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ValidationError(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.severity = reader.int32(); + break; + case 3: + if (!(message.entries && message.entries.length)) + message.entries = []; + message.entries.push(reader.string()); + break; + case 4: + message.errorMessage = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidationError message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ValidationError} ValidationError + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidationError.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidationError message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidationError.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.severity != null && message.hasOwnProperty("severity")) + switch (message.severity) { + default: + return "severity: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.entries != null && message.hasOwnProperty("entries")) { + if (!Array.isArray(message.entries)) + return "entries: array expected"; + for (var i = 0; i < message.entries.length; ++i) + if (!$util.isString(message.entries[i])) + return "entries: string[] expected"; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + if (!$util.isString(message.errorMessage)) + return "errorMessage: string expected"; + return null; + }; + + /** + * Creates a ValidationError message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ValidationError} ValidationError + */ + ValidationError.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ValidationError) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ValidationError(); + switch (object.severity) { + case "SEVERITY_UNSPECIFIED": + case 0: + message.severity = 0; + break; + case "INFO": + case 1: + message.severity = 1; + break; + case "WARNING": + case 2: + message.severity = 2; + break; + case "ERROR": + case 3: + message.severity = 3; + break; + case "CRITICAL": + case 4: + message.severity = 4; + break; + } + if (object.entries) { + if (!Array.isArray(object.entries)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ValidationError.entries: array expected"); + message.entries = []; + for (var i = 0; i < object.entries.length; ++i) + message.entries[i] = String(object.entries[i]); + } + if (object.errorMessage != null) + message.errorMessage = String(object.errorMessage); + return message; + }; + + /** + * Creates a plain object from a ValidationError message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @static + * @param {google.cloud.dialogflow.v2beta1.ValidationError} message ValidationError + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidationError.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entries = []; + if (options.defaults) { + object.severity = options.enums === String ? "SEVERITY_UNSPECIFIED" : 0; + object.errorMessage = ""; + } + if (message.severity != null && message.hasOwnProperty("severity")) + object.severity = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.ValidationError.Severity[message.severity] : message.severity; + if (message.entries && message.entries.length) { + object.entries = []; + for (var j = 0; j < message.entries.length; ++j) + object.entries[j] = message.entries[j]; + } + if (message.errorMessage != null && message.hasOwnProperty("errorMessage")) + object.errorMessage = message.errorMessage; + return object; + }; + + /** + * Converts this ValidationError to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ValidationError + * @instance + * @returns {Object.} JSON object + */ + ValidationError.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Severity enum. + * @name google.cloud.dialogflow.v2beta1.ValidationError.Severity + * @enum {number} + * @property {number} SEVERITY_UNSPECIFIED=0 SEVERITY_UNSPECIFIED value + * @property {number} INFO=1 INFO value + * @property {number} WARNING=2 WARNING value + * @property {number} ERROR=3 ERROR value + * @property {number} CRITICAL=4 CRITICAL value + */ + ValidationError.Severity = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "SEVERITY_UNSPECIFIED"] = 0; + values[valuesById[1] = "INFO"] = 1; + values[valuesById[2] = "WARNING"] = 2; + values[valuesById[3] = "ERROR"] = 3; + values[valuesById[4] = "CRITICAL"] = 4; + return values; + })(); + + return ValidationError; + })(); + + v2beta1.ValidationResult = (function() { + + /** + * Properties of a ValidationResult. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IValidationResult + * @property {Array.|null} [validationErrors] ValidationResult validationErrors + */ + + /** + * Constructs a new ValidationResult. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ValidationResult. + * @implements IValidationResult + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IValidationResult=} [properties] Properties to set + */ + function ValidationResult(properties) { + this.validationErrors = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ValidationResult validationErrors. + * @member {Array.} validationErrors + * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @instance + */ + ValidationResult.prototype.validationErrors = $util.emptyArray; + + /** + * Creates a new ValidationResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @static + * @param {google.cloud.dialogflow.v2beta1.IValidationResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ValidationResult} ValidationResult instance + */ + ValidationResult.create = function create(properties) { + return new ValidationResult(properties); + }; + + /** + * Encodes the specified ValidationResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @static + * @param {google.cloud.dialogflow.v2beta1.IValidationResult} message ValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidationResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.validationErrors != null && message.validationErrors.length) + for (var i = 0; i < message.validationErrors.length; ++i) + $root.google.cloud.dialogflow.v2beta1.ValidationError.encode(message.validationErrors[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ValidationResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ValidationResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @static + * @param {google.cloud.dialogflow.v2beta1.IValidationResult} message ValidationResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ValidationResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ValidationResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ValidationResult} ValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidationResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ValidationResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.validationErrors && message.validationErrors.length)) + message.validationErrors = []; + message.validationErrors.push($root.google.cloud.dialogflow.v2beta1.ValidationError.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ValidationResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ValidationResult} ValidationResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ValidationResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ValidationResult message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ValidationResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.validationErrors != null && message.hasOwnProperty("validationErrors")) { + if (!Array.isArray(message.validationErrors)) + return "validationErrors: array expected"; + for (var i = 0; i < message.validationErrors.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.ValidationError.verify(message.validationErrors[i]); + if (error) + return "validationErrors." + error; + } + } + return null; + }; + + /** + * Creates a ValidationResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ValidationResult} ValidationResult + */ + ValidationResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ValidationResult) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ValidationResult(); + if (object.validationErrors) { + if (!Array.isArray(object.validationErrors)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ValidationResult.validationErrors: array expected"); + message.validationErrors = []; + for (var i = 0; i < object.validationErrors.length; ++i) { + if (typeof object.validationErrors[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ValidationResult.validationErrors: object expected"); + message.validationErrors[i] = $root.google.cloud.dialogflow.v2beta1.ValidationError.fromObject(object.validationErrors[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ValidationResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @static + * @param {google.cloud.dialogflow.v2beta1.ValidationResult} message ValidationResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ValidationResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.validationErrors = []; + if (message.validationErrors && message.validationErrors.length) { + object.validationErrors = []; + for (var j = 0; j < message.validationErrors.length; ++j) + object.validationErrors[j] = $root.google.cloud.dialogflow.v2beta1.ValidationError.toObject(message.validationErrors[j], options); + } + return object; + }; + + /** + * Converts this ValidationResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ValidationResult + * @instance + * @returns {Object.} JSON object + */ + ValidationResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ValidationResult; + })(); + + v2beta1.AnswerRecords = (function() { + + /** + * Constructs a new AnswerRecords service. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an AnswerRecords + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function AnswerRecords(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (AnswerRecords.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = AnswerRecords; + + /** + * Creates new AnswerRecords service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecords + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {AnswerRecords} RPC service. Useful where requests and/or responses are streamed. + */ + AnswerRecords.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.AnswerRecords#getAnswerRecord}. + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecords + * @typedef GetAnswerRecordCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.AnswerRecord} [response] AnswerRecord + */ + + /** + * Calls GetAnswerRecord. + * @function getAnswerRecord + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecords + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest} request GetAnswerRecordRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.AnswerRecords.GetAnswerRecordCallback} callback Node-style callback called with the error, if any, and AnswerRecord + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnswerRecords.prototype.getAnswerRecord = function getAnswerRecord(request, callback) { + return this.rpcCall(getAnswerRecord, $root.google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest, $root.google.cloud.dialogflow.v2beta1.AnswerRecord, request, callback); + }, "name", { value: "GetAnswerRecord" }); + + /** + * Calls GetAnswerRecord. + * @function getAnswerRecord + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecords + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest} request GetAnswerRecordRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.AnswerRecords#listAnswerRecords}. + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecords + * @typedef ListAnswerRecordsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse} [response] ListAnswerRecordsResponse + */ + + /** + * Calls ListAnswerRecords. + * @function listAnswerRecords + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecords + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest} request ListAnswerRecordsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.AnswerRecords.ListAnswerRecordsCallback} callback Node-style callback called with the error, if any, and ListAnswerRecordsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnswerRecords.prototype.listAnswerRecords = function listAnswerRecords(request, callback) { + return this.rpcCall(listAnswerRecords, $root.google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest, $root.google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse, request, callback); + }, "name", { value: "ListAnswerRecords" }); + + /** + * Calls ListAnswerRecords. + * @function listAnswerRecords + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecords + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest} request ListAnswerRecordsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.AnswerRecords#updateAnswerRecord}. + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecords + * @typedef UpdateAnswerRecordCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.AnswerRecord} [response] AnswerRecord + */ + + /** + * Calls UpdateAnswerRecord. + * @function updateAnswerRecord + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecords + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest} request UpdateAnswerRecordRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.AnswerRecords.UpdateAnswerRecordCallback} callback Node-style callback called with the error, if any, and AnswerRecord + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(AnswerRecords.prototype.updateAnswerRecord = function updateAnswerRecord(request, callback) { + return this.rpcCall(updateAnswerRecord, $root.google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest, $root.google.cloud.dialogflow.v2beta1.AnswerRecord, request, callback); + }, "name", { value: "UpdateAnswerRecord" }); + + /** + * Calls UpdateAnswerRecord. + * @function updateAnswerRecord + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecords + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest} request UpdateAnswerRecordRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return AnswerRecords; + })(); + + v2beta1.AnswerRecord = (function() { + + /** + * Properties of an AnswerRecord. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IAnswerRecord + * @property {string|null} [name] AnswerRecord name + * @property {google.cloud.dialogflow.v2beta1.IAnswerFeedback|null} [answerFeedback] AnswerRecord answerFeedback + * @property {google.cloud.dialogflow.v2beta1.IAgentAssistantRecord|null} [agentAssistantRecord] AnswerRecord agentAssistantRecord + */ + + /** + * Constructs a new AnswerRecord. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an AnswerRecord. + * @implements IAnswerRecord + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IAnswerRecord=} [properties] Properties to set + */ + function AnswerRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnswerRecord name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @instance + */ + AnswerRecord.prototype.name = ""; + + /** + * AnswerRecord answerFeedback. + * @member {google.cloud.dialogflow.v2beta1.IAnswerFeedback|null|undefined} answerFeedback + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @instance + */ + AnswerRecord.prototype.answerFeedback = null; + + /** + * AnswerRecord agentAssistantRecord. + * @member {google.cloud.dialogflow.v2beta1.IAgentAssistantRecord|null|undefined} agentAssistantRecord + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @instance + */ + AnswerRecord.prototype.agentAssistantRecord = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnswerRecord record. + * @member {"agentAssistantRecord"|undefined} record + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @instance + */ + Object.defineProperty(AnswerRecord.prototype, "record", { + get: $util.oneOfGetter($oneOfFields = ["agentAssistantRecord"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnswerRecord instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnswerRecord=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.AnswerRecord} AnswerRecord instance + */ + AnswerRecord.create = function create(properties) { + return new AnswerRecord(properties); + }; + + /** + * Encodes the specified AnswerRecord message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnswerRecord.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnswerRecord} message AnswerRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.answerFeedback != null && Object.hasOwnProperty.call(message, "answerFeedback")) + $root.google.cloud.dialogflow.v2beta1.AnswerFeedback.encode(message.answerFeedback, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.agentAssistantRecord != null && Object.hasOwnProperty.call(message, "agentAssistantRecord")) + $root.google.cloud.dialogflow.v2beta1.AgentAssistantRecord.encode(message.agentAssistantRecord, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnswerRecord message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnswerRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnswerRecord} message AnswerRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnswerRecord message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.AnswerRecord} AnswerRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerRecord.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.AnswerRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.answerFeedback = $root.google.cloud.dialogflow.v2beta1.AnswerFeedback.decode(reader, reader.uint32()); + break; + case 4: + message.agentAssistantRecord = $root.google.cloud.dialogflow.v2beta1.AgentAssistantRecord.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnswerRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.AnswerRecord} AnswerRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnswerRecord message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnswerRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.answerFeedback != null && message.hasOwnProperty("answerFeedback")) { + var error = $root.google.cloud.dialogflow.v2beta1.AnswerFeedback.verify(message.answerFeedback); + if (error) + return "answerFeedback." + error; + } + if (message.agentAssistantRecord != null && message.hasOwnProperty("agentAssistantRecord")) { + properties.record = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.AgentAssistantRecord.verify(message.agentAssistantRecord); + if (error) + return "agentAssistantRecord." + error; + } + } + return null; + }; + + /** + * Creates an AnswerRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.AnswerRecord} AnswerRecord + */ + AnswerRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.AnswerRecord) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.AnswerRecord(); + if (object.name != null) + message.name = String(object.name); + if (object.answerFeedback != null) { + if (typeof object.answerFeedback !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnswerRecord.answerFeedback: object expected"); + message.answerFeedback = $root.google.cloud.dialogflow.v2beta1.AnswerFeedback.fromObject(object.answerFeedback); + } + if (object.agentAssistantRecord != null) { + if (typeof object.agentAssistantRecord !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnswerRecord.agentAssistantRecord: object expected"); + message.agentAssistantRecord = $root.google.cloud.dialogflow.v2beta1.AgentAssistantRecord.fromObject(object.agentAssistantRecord); + } + return message; + }; + + /** + * Creates a plain object from an AnswerRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @static + * @param {google.cloud.dialogflow.v2beta1.AnswerRecord} message AnswerRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnswerRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.answerFeedback = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.answerFeedback != null && message.hasOwnProperty("answerFeedback")) + object.answerFeedback = $root.google.cloud.dialogflow.v2beta1.AnswerFeedback.toObject(message.answerFeedback, options); + if (message.agentAssistantRecord != null && message.hasOwnProperty("agentAssistantRecord")) { + object.agentAssistantRecord = $root.google.cloud.dialogflow.v2beta1.AgentAssistantRecord.toObject(message.agentAssistantRecord, options); + if (options.oneofs) + object.record = "agentAssistantRecord"; + } + return object; + }; + + /** + * Converts this AnswerRecord to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.AnswerRecord + * @instance + * @returns {Object.} JSON object + */ + AnswerRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnswerRecord; + })(); + + v2beta1.AgentAssistantRecord = (function() { + + /** + * Properties of an AgentAssistantRecord. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IAgentAssistantRecord + * @property {google.cloud.dialogflow.v2beta1.IArticleAnswer|null} [articleSuggestionAnswer] AgentAssistantRecord articleSuggestionAnswer + * @property {google.cloud.dialogflow.v2beta1.IFaqAnswer|null} [faqAnswer] AgentAssistantRecord faqAnswer + */ + + /** + * Constructs a new AgentAssistantRecord. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an AgentAssistantRecord. + * @implements IAgentAssistantRecord + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IAgentAssistantRecord=} [properties] Properties to set + */ + function AgentAssistantRecord(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentAssistantRecord articleSuggestionAnswer. + * @member {google.cloud.dialogflow.v2beta1.IArticleAnswer|null|undefined} articleSuggestionAnswer + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantRecord + * @instance + */ + AgentAssistantRecord.prototype.articleSuggestionAnswer = null; + + /** + * AgentAssistantRecord faqAnswer. + * @member {google.cloud.dialogflow.v2beta1.IFaqAnswer|null|undefined} faqAnswer + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantRecord + * @instance + */ + AgentAssistantRecord.prototype.faqAnswer = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AgentAssistantRecord answer. + * @member {"articleSuggestionAnswer"|"faqAnswer"|undefined} answer + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantRecord + * @instance + */ + Object.defineProperty(AgentAssistantRecord.prototype, "answer", { + get: $util.oneOfGetter($oneOfFields = ["articleSuggestionAnswer", "faqAnswer"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AgentAssistantRecord instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantRecord + * @static + * @param {google.cloud.dialogflow.v2beta1.IAgentAssistantRecord=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.AgentAssistantRecord} AgentAssistantRecord instance + */ + AgentAssistantRecord.create = function create(properties) { + return new AgentAssistantRecord(properties); + }; + + /** + * Encodes the specified AgentAssistantRecord message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AgentAssistantRecord.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantRecord + * @static + * @param {google.cloud.dialogflow.v2beta1.IAgentAssistantRecord} message AgentAssistantRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentAssistantRecord.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.articleSuggestionAnswer != null && Object.hasOwnProperty.call(message, "articleSuggestionAnswer")) + $root.google.cloud.dialogflow.v2beta1.ArticleAnswer.encode(message.articleSuggestionAnswer, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.faqAnswer != null && Object.hasOwnProperty.call(message, "faqAnswer")) + $root.google.cloud.dialogflow.v2beta1.FaqAnswer.encode(message.faqAnswer, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AgentAssistantRecord message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AgentAssistantRecord.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantRecord + * @static + * @param {google.cloud.dialogflow.v2beta1.IAgentAssistantRecord} message AgentAssistantRecord message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentAssistantRecord.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentAssistantRecord message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.AgentAssistantRecord} AgentAssistantRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentAssistantRecord.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.AgentAssistantRecord(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + message.articleSuggestionAnswer = $root.google.cloud.dialogflow.v2beta1.ArticleAnswer.decode(reader, reader.uint32()); + break; + case 6: + message.faqAnswer = $root.google.cloud.dialogflow.v2beta1.FaqAnswer.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AgentAssistantRecord message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantRecord + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.AgentAssistantRecord} AgentAssistantRecord + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentAssistantRecord.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentAssistantRecord message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantRecord + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentAssistantRecord.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.articleSuggestionAnswer != null && message.hasOwnProperty("articleSuggestionAnswer")) { + properties.answer = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.ArticleAnswer.verify(message.articleSuggestionAnswer); + if (error) + return "articleSuggestionAnswer." + error; + } + } + if (message.faqAnswer != null && message.hasOwnProperty("faqAnswer")) { + if (properties.answer === 1) + return "answer: multiple values"; + properties.answer = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.FaqAnswer.verify(message.faqAnswer); + if (error) + return "faqAnswer." + error; + } + } + return null; + }; + + /** + * Creates an AgentAssistantRecord message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantRecord + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.AgentAssistantRecord} AgentAssistantRecord + */ + AgentAssistantRecord.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.AgentAssistantRecord) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.AgentAssistantRecord(); + if (object.articleSuggestionAnswer != null) { + if (typeof object.articleSuggestionAnswer !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AgentAssistantRecord.articleSuggestionAnswer: object expected"); + message.articleSuggestionAnswer = $root.google.cloud.dialogflow.v2beta1.ArticleAnswer.fromObject(object.articleSuggestionAnswer); + } + if (object.faqAnswer != null) { + if (typeof object.faqAnswer !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AgentAssistantRecord.faqAnswer: object expected"); + message.faqAnswer = $root.google.cloud.dialogflow.v2beta1.FaqAnswer.fromObject(object.faqAnswer); + } + return message; + }; + + /** + * Creates a plain object from an AgentAssistantRecord message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantRecord + * @static + * @param {google.cloud.dialogflow.v2beta1.AgentAssistantRecord} message AgentAssistantRecord + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentAssistantRecord.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.articleSuggestionAnswer != null && message.hasOwnProperty("articleSuggestionAnswer")) { + object.articleSuggestionAnswer = $root.google.cloud.dialogflow.v2beta1.ArticleAnswer.toObject(message.articleSuggestionAnswer, options); + if (options.oneofs) + object.answer = "articleSuggestionAnswer"; + } + if (message.faqAnswer != null && message.hasOwnProperty("faqAnswer")) { + object.faqAnswer = $root.google.cloud.dialogflow.v2beta1.FaqAnswer.toObject(message.faqAnswer, options); + if (options.oneofs) + object.answer = "faqAnswer"; + } + return object; + }; + + /** + * Converts this AgentAssistantRecord to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantRecord + * @instance + * @returns {Object.} JSON object + */ + AgentAssistantRecord.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AgentAssistantRecord; + })(); + + v2beta1.AnswerFeedback = (function() { + + /** + * Properties of an AnswerFeedback. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IAnswerFeedback + * @property {google.cloud.dialogflow.v2beta1.AnswerFeedback.CorrectnessLevel|null} [correctnessLevel] AnswerFeedback correctnessLevel + * @property {google.cloud.dialogflow.v2beta1.IAgentAssistantFeedback|null} [agentAssistantDetailFeedback] AnswerFeedback agentAssistantDetailFeedback + * @property {boolean|null} [clicked] AnswerFeedback clicked + * @property {google.protobuf.ITimestamp|null} [clickTime] AnswerFeedback clickTime + * @property {boolean|null} [displayed] AnswerFeedback displayed + * @property {google.protobuf.ITimestamp|null} [displayTime] AnswerFeedback displayTime + */ + + /** + * Constructs a new AnswerFeedback. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an AnswerFeedback. + * @implements IAnswerFeedback + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IAnswerFeedback=} [properties] Properties to set + */ + function AnswerFeedback(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnswerFeedback correctnessLevel. + * @member {google.cloud.dialogflow.v2beta1.AnswerFeedback.CorrectnessLevel} correctnessLevel + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.correctnessLevel = 0; + + /** + * AnswerFeedback agentAssistantDetailFeedback. + * @member {google.cloud.dialogflow.v2beta1.IAgentAssistantFeedback|null|undefined} agentAssistantDetailFeedback + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.agentAssistantDetailFeedback = null; + + /** + * AnswerFeedback clicked. + * @member {boolean} clicked + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.clicked = false; + + /** + * AnswerFeedback clickTime. + * @member {google.protobuf.ITimestamp|null|undefined} clickTime + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.clickTime = null; + + /** + * AnswerFeedback displayed. + * @member {boolean} displayed + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.displayed = false; + + /** + * AnswerFeedback displayTime. + * @member {google.protobuf.ITimestamp|null|undefined} displayTime + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @instance + */ + AnswerFeedback.prototype.displayTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnswerFeedback detailFeedback. + * @member {"agentAssistantDetailFeedback"|undefined} detailFeedback + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @instance + */ + Object.defineProperty(AnswerFeedback.prototype, "detailFeedback", { + get: $util.oneOfGetter($oneOfFields = ["agentAssistantDetailFeedback"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnswerFeedback instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnswerFeedback=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.AnswerFeedback} AnswerFeedback instance + */ + AnswerFeedback.create = function create(properties) { + return new AnswerFeedback(properties); + }; + + /** + * Encodes the specified AnswerFeedback message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnswerFeedback.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnswerFeedback} message AnswerFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerFeedback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.correctnessLevel != null && Object.hasOwnProperty.call(message, "correctnessLevel")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.correctnessLevel); + if (message.agentAssistantDetailFeedback != null && Object.hasOwnProperty.call(message, "agentAssistantDetailFeedback")) + $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.encode(message.agentAssistantDetailFeedback, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.clicked != null && Object.hasOwnProperty.call(message, "clicked")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.clicked); + if (message.displayed != null && Object.hasOwnProperty.call(message, "displayed")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.displayed); + if (message.clickTime != null && Object.hasOwnProperty.call(message, "clickTime")) + $root.google.protobuf.Timestamp.encode(message.clickTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.displayTime != null && Object.hasOwnProperty.call(message, "displayTime")) + $root.google.protobuf.Timestamp.encode(message.displayTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnswerFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnswerFeedback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnswerFeedback} message AnswerFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnswerFeedback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnswerFeedback message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.AnswerFeedback} AnswerFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerFeedback.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.AnswerFeedback(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.correctnessLevel = reader.int32(); + break; + case 2: + message.agentAssistantDetailFeedback = $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.decode(reader, reader.uint32()); + break; + case 3: + message.clicked = reader.bool(); + break; + case 5: + message.clickTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 4: + message.displayed = reader.bool(); + break; + case 6: + message.displayTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnswerFeedback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.AnswerFeedback} AnswerFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnswerFeedback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnswerFeedback message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnswerFeedback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.correctnessLevel != null && message.hasOwnProperty("correctnessLevel")) + switch (message.correctnessLevel) { + default: + return "correctnessLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.agentAssistantDetailFeedback != null && message.hasOwnProperty("agentAssistantDetailFeedback")) { + properties.detailFeedback = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.verify(message.agentAssistantDetailFeedback); + if (error) + return "agentAssistantDetailFeedback." + error; + } + } + if (message.clicked != null && message.hasOwnProperty("clicked")) + if (typeof message.clicked !== "boolean") + return "clicked: boolean expected"; + if (message.clickTime != null && message.hasOwnProperty("clickTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.clickTime); + if (error) + return "clickTime." + error; + } + if (message.displayed != null && message.hasOwnProperty("displayed")) + if (typeof message.displayed !== "boolean") + return "displayed: boolean expected"; + if (message.displayTime != null && message.hasOwnProperty("displayTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.displayTime); + if (error) + return "displayTime." + error; + } + return null; + }; + + /** + * Creates an AnswerFeedback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.AnswerFeedback} AnswerFeedback + */ + AnswerFeedback.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.AnswerFeedback) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.AnswerFeedback(); + switch (object.correctnessLevel) { + case "CORRECTNESS_LEVEL_UNSPECIFIED": + case 0: + message.correctnessLevel = 0; + break; + case "NOT_CORRECT": + case 1: + message.correctnessLevel = 1; + break; + case "PARTIALLY_CORRECT": + case 2: + message.correctnessLevel = 2; + break; + case "FULLY_CORRECT": + case 3: + message.correctnessLevel = 3; + break; + } + if (object.agentAssistantDetailFeedback != null) { + if (typeof object.agentAssistantDetailFeedback !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnswerFeedback.agentAssistantDetailFeedback: object expected"); + message.agentAssistantDetailFeedback = $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.fromObject(object.agentAssistantDetailFeedback); + } + if (object.clicked != null) + message.clicked = Boolean(object.clicked); + if (object.clickTime != null) { + if (typeof object.clickTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnswerFeedback.clickTime: object expected"); + message.clickTime = $root.google.protobuf.Timestamp.fromObject(object.clickTime); + } + if (object.displayed != null) + message.displayed = Boolean(object.displayed); + if (object.displayTime != null) { + if (typeof object.displayTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnswerFeedback.displayTime: object expected"); + message.displayTime = $root.google.protobuf.Timestamp.fromObject(object.displayTime); + } + return message; + }; + + /** + * Creates a plain object from an AnswerFeedback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @static + * @param {google.cloud.dialogflow.v2beta1.AnswerFeedback} message AnswerFeedback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnswerFeedback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.correctnessLevel = options.enums === String ? "CORRECTNESS_LEVEL_UNSPECIFIED" : 0; + object.clicked = false; + object.displayed = false; + object.clickTime = null; + object.displayTime = null; + } + if (message.correctnessLevel != null && message.hasOwnProperty("correctnessLevel")) + object.correctnessLevel = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.AnswerFeedback.CorrectnessLevel[message.correctnessLevel] : message.correctnessLevel; + if (message.agentAssistantDetailFeedback != null && message.hasOwnProperty("agentAssistantDetailFeedback")) { + object.agentAssistantDetailFeedback = $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.toObject(message.agentAssistantDetailFeedback, options); + if (options.oneofs) + object.detailFeedback = "agentAssistantDetailFeedback"; + } + if (message.clicked != null && message.hasOwnProperty("clicked")) + object.clicked = message.clicked; + if (message.displayed != null && message.hasOwnProperty("displayed")) + object.displayed = message.displayed; + if (message.clickTime != null && message.hasOwnProperty("clickTime")) + object.clickTime = $root.google.protobuf.Timestamp.toObject(message.clickTime, options); + if (message.displayTime != null && message.hasOwnProperty("displayTime")) + object.displayTime = $root.google.protobuf.Timestamp.toObject(message.displayTime, options); + return object; + }; + + /** + * Converts this AnswerFeedback to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.AnswerFeedback + * @instance + * @returns {Object.} JSON object + */ + AnswerFeedback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CorrectnessLevel enum. + * @name google.cloud.dialogflow.v2beta1.AnswerFeedback.CorrectnessLevel + * @enum {number} + * @property {number} CORRECTNESS_LEVEL_UNSPECIFIED=0 CORRECTNESS_LEVEL_UNSPECIFIED value + * @property {number} NOT_CORRECT=1 NOT_CORRECT value + * @property {number} PARTIALLY_CORRECT=2 PARTIALLY_CORRECT value + * @property {number} FULLY_CORRECT=3 FULLY_CORRECT value + */ + AnswerFeedback.CorrectnessLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CORRECTNESS_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "NOT_CORRECT"] = 1; + values[valuesById[2] = "PARTIALLY_CORRECT"] = 2; + values[valuesById[3] = "FULLY_CORRECT"] = 3; + return values; + })(); + + return AnswerFeedback; + })(); + + v2beta1.AgentAssistantFeedback = (function() { + + /** + * Properties of an AgentAssistantFeedback. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IAgentAssistantFeedback + * @property {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.AnswerRelevance|null} [answerRelevance] AgentAssistantFeedback answerRelevance + * @property {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentCorrectness|null} [documentCorrectness] AgentAssistantFeedback documentCorrectness + * @property {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentEfficiency|null} [documentEfficiency] AgentAssistantFeedback documentEfficiency + * @property {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.ISummarizationFeedback|null} [summarizationFeedback] AgentAssistantFeedback summarizationFeedback + */ + + /** + * Constructs a new AgentAssistantFeedback. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an AgentAssistantFeedback. + * @implements IAgentAssistantFeedback + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IAgentAssistantFeedback=} [properties] Properties to set + */ + function AgentAssistantFeedback(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AgentAssistantFeedback answerRelevance. + * @member {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.AnswerRelevance} answerRelevance + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @instance + */ + AgentAssistantFeedback.prototype.answerRelevance = 0; + + /** + * AgentAssistantFeedback documentCorrectness. + * @member {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentCorrectness} documentCorrectness + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @instance + */ + AgentAssistantFeedback.prototype.documentCorrectness = 0; + + /** + * AgentAssistantFeedback documentEfficiency. + * @member {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentEfficiency} documentEfficiency + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @instance + */ + AgentAssistantFeedback.prototype.documentEfficiency = 0; + + /** + * AgentAssistantFeedback summarizationFeedback. + * @member {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.ISummarizationFeedback|null|undefined} summarizationFeedback + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @instance + */ + AgentAssistantFeedback.prototype.summarizationFeedback = null; + + /** + * Creates a new AgentAssistantFeedback instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @static + * @param {google.cloud.dialogflow.v2beta1.IAgentAssistantFeedback=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback} AgentAssistantFeedback instance + */ + AgentAssistantFeedback.create = function create(properties) { + return new AgentAssistantFeedback(properties); + }; + + /** + * Encodes the specified AgentAssistantFeedback message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @static + * @param {google.cloud.dialogflow.v2beta1.IAgentAssistantFeedback} message AgentAssistantFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentAssistantFeedback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.answerRelevance != null && Object.hasOwnProperty.call(message, "answerRelevance")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.answerRelevance); + if (message.documentCorrectness != null && Object.hasOwnProperty.call(message, "documentCorrectness")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.documentCorrectness); + if (message.documentEfficiency != null && Object.hasOwnProperty.call(message, "documentEfficiency")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.documentEfficiency); + if (message.summarizationFeedback != null && Object.hasOwnProperty.call(message, "summarizationFeedback")) + $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback.encode(message.summarizationFeedback, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AgentAssistantFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @static + * @param {google.cloud.dialogflow.v2beta1.IAgentAssistantFeedback} message AgentAssistantFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AgentAssistantFeedback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AgentAssistantFeedback message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback} AgentAssistantFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentAssistantFeedback.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.answerRelevance = reader.int32(); + break; + case 2: + message.documentCorrectness = reader.int32(); + break; + case 3: + message.documentEfficiency = reader.int32(); + break; + case 4: + message.summarizationFeedback = $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AgentAssistantFeedback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback} AgentAssistantFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AgentAssistantFeedback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AgentAssistantFeedback message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AgentAssistantFeedback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.answerRelevance != null && message.hasOwnProperty("answerRelevance")) + switch (message.answerRelevance) { + default: + return "answerRelevance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.documentCorrectness != null && message.hasOwnProperty("documentCorrectness")) + switch (message.documentCorrectness) { + default: + return "documentCorrectness: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.documentEfficiency != null && message.hasOwnProperty("documentEfficiency")) + switch (message.documentEfficiency) { + default: + return "documentEfficiency: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.summarizationFeedback != null && message.hasOwnProperty("summarizationFeedback")) { + var error = $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback.verify(message.summarizationFeedback); + if (error) + return "summarizationFeedback." + error; + } + return null; + }; + + /** + * Creates an AgentAssistantFeedback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback} AgentAssistantFeedback + */ + AgentAssistantFeedback.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback(); + switch (object.answerRelevance) { + case "ANSWER_RELEVANCE_UNSPECIFIED": + case 0: + message.answerRelevance = 0; + break; + case "IRRELEVANT": + case 1: + message.answerRelevance = 1; + break; + case "RELEVANT": + case 2: + message.answerRelevance = 2; + break; + } + switch (object.documentCorrectness) { + case "DOCUMENT_CORRECTNESS_UNSPECIFIED": + case 0: + message.documentCorrectness = 0; + break; + case "INCORRECT": + case 1: + message.documentCorrectness = 1; + break; + case "CORRECT": + case 2: + message.documentCorrectness = 2; + break; + } + switch (object.documentEfficiency) { + case "DOCUMENT_EFFICIENCY_UNSPECIFIED": + case 0: + message.documentEfficiency = 0; + break; + case "INEFFICIENT": + case 1: + message.documentEfficiency = 1; + break; + case "EFFICIENT": + case 2: + message.documentEfficiency = 2; + break; + } + if (object.summarizationFeedback != null) { + if (typeof object.summarizationFeedback !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.summarizationFeedback: object expected"); + message.summarizationFeedback = $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback.fromObject(object.summarizationFeedback); + } + return message; + }; + + /** + * Creates a plain object from an AgentAssistantFeedback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @static + * @param {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback} message AgentAssistantFeedback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AgentAssistantFeedback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.answerRelevance = options.enums === String ? "ANSWER_RELEVANCE_UNSPECIFIED" : 0; + object.documentCorrectness = options.enums === String ? "DOCUMENT_CORRECTNESS_UNSPECIFIED" : 0; + object.documentEfficiency = options.enums === String ? "DOCUMENT_EFFICIENCY_UNSPECIFIED" : 0; + object.summarizationFeedback = null; + } + if (message.answerRelevance != null && message.hasOwnProperty("answerRelevance")) + object.answerRelevance = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.AnswerRelevance[message.answerRelevance] : message.answerRelevance; + if (message.documentCorrectness != null && message.hasOwnProperty("documentCorrectness")) + object.documentCorrectness = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentCorrectness[message.documentCorrectness] : message.documentCorrectness; + if (message.documentEfficiency != null && message.hasOwnProperty("documentEfficiency")) + object.documentEfficiency = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentEfficiency[message.documentEfficiency] : message.documentEfficiency; + if (message.summarizationFeedback != null && message.hasOwnProperty("summarizationFeedback")) + object.summarizationFeedback = $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback.toObject(message.summarizationFeedback, options); + return object; + }; + + /** + * Converts this AgentAssistantFeedback to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @instance + * @returns {Object.} JSON object + */ + AgentAssistantFeedback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + AgentAssistantFeedback.SummarizationFeedback = (function() { + + /** + * Properties of a SummarizationFeedback. + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @interface ISummarizationFeedback + * @property {google.protobuf.ITimestamp|null} [startTimestamp] SummarizationFeedback startTimestamp + * @property {google.protobuf.ITimestamp|null} [submitTimestamp] SummarizationFeedback submitTimestamp + * @property {string|null} [summaryText] SummarizationFeedback summaryText + */ + + /** + * Constructs a new SummarizationFeedback. + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback + * @classdesc Represents a SummarizationFeedback. + * @implements ISummarizationFeedback + * @constructor + * @param {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.ISummarizationFeedback=} [properties] Properties to set + */ + function SummarizationFeedback(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SummarizationFeedback startTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} startTimestamp + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback + * @instance + */ + SummarizationFeedback.prototype.startTimestamp = null; + + /** + * SummarizationFeedback submitTimestamp. + * @member {google.protobuf.ITimestamp|null|undefined} submitTimestamp + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback + * @instance + */ + SummarizationFeedback.prototype.submitTimestamp = null; + + /** + * SummarizationFeedback summaryText. + * @member {string} summaryText + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback + * @instance + */ + SummarizationFeedback.prototype.summaryText = ""; + + /** + * Creates a new SummarizationFeedback instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback + * @static + * @param {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.ISummarizationFeedback=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback} SummarizationFeedback instance + */ + SummarizationFeedback.create = function create(properties) { + return new SummarizationFeedback(properties); + }; + + /** + * Encodes the specified SummarizationFeedback message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback + * @static + * @param {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.ISummarizationFeedback} message SummarizationFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummarizationFeedback.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startTimestamp != null && Object.hasOwnProperty.call(message, "startTimestamp")) + $root.google.protobuf.Timestamp.encode(message.startTimestamp, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.submitTimestamp != null && Object.hasOwnProperty.call(message, "submitTimestamp")) + $root.google.protobuf.Timestamp.encode(message.submitTimestamp, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.summaryText != null && Object.hasOwnProperty.call(message, "summaryText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.summaryText); + return writer; + }; + + /** + * Encodes the specified SummarizationFeedback message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback + * @static + * @param {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.ISummarizationFeedback} message SummarizationFeedback message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SummarizationFeedback.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SummarizationFeedback message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback} SummarizationFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummarizationFeedback.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.startTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.submitTimestamp = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.summaryText = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SummarizationFeedback message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback} SummarizationFeedback + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SummarizationFeedback.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SummarizationFeedback message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SummarizationFeedback.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startTimestamp != null && message.hasOwnProperty("startTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTimestamp); + if (error) + return "startTimestamp." + error; + } + if (message.submitTimestamp != null && message.hasOwnProperty("submitTimestamp")) { + var error = $root.google.protobuf.Timestamp.verify(message.submitTimestamp); + if (error) + return "submitTimestamp." + error; + } + if (message.summaryText != null && message.hasOwnProperty("summaryText")) + if (!$util.isString(message.summaryText)) + return "summaryText: string expected"; + return null; + }; + + /** + * Creates a SummarizationFeedback message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback} SummarizationFeedback + */ + SummarizationFeedback.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback(); + if (object.startTimestamp != null) { + if (typeof object.startTimestamp !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback.startTimestamp: object expected"); + message.startTimestamp = $root.google.protobuf.Timestamp.fromObject(object.startTimestamp); + } + if (object.submitTimestamp != null) { + if (typeof object.submitTimestamp !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback.submitTimestamp: object expected"); + message.submitTimestamp = $root.google.protobuf.Timestamp.fromObject(object.submitTimestamp); + } + if (object.summaryText != null) + message.summaryText = String(object.summaryText); + return message; + }; + + /** + * Creates a plain object from a SummarizationFeedback message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback + * @static + * @param {google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback} message SummarizationFeedback + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SummarizationFeedback.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startTimestamp = null; + object.submitTimestamp = null; + object.summaryText = ""; + } + if (message.startTimestamp != null && message.hasOwnProperty("startTimestamp")) + object.startTimestamp = $root.google.protobuf.Timestamp.toObject(message.startTimestamp, options); + if (message.submitTimestamp != null && message.hasOwnProperty("submitTimestamp")) + object.submitTimestamp = $root.google.protobuf.Timestamp.toObject(message.submitTimestamp, options); + if (message.summaryText != null && message.hasOwnProperty("summaryText")) + object.summaryText = message.summaryText; + return object; + }; + + /** + * Converts this SummarizationFeedback to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.SummarizationFeedback + * @instance + * @returns {Object.} JSON object + */ + SummarizationFeedback.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SummarizationFeedback; + })(); + + /** + * AnswerRelevance enum. + * @name google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.AnswerRelevance + * @enum {number} + * @property {number} ANSWER_RELEVANCE_UNSPECIFIED=0 ANSWER_RELEVANCE_UNSPECIFIED value + * @property {number} IRRELEVANT=1 IRRELEVANT value + * @property {number} RELEVANT=2 RELEVANT value + */ + AgentAssistantFeedback.AnswerRelevance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ANSWER_RELEVANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IRRELEVANT"] = 1; + values[valuesById[2] = "RELEVANT"] = 2; + return values; + })(); + + /** + * DocumentCorrectness enum. + * @name google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentCorrectness + * @enum {number} + * @property {number} DOCUMENT_CORRECTNESS_UNSPECIFIED=0 DOCUMENT_CORRECTNESS_UNSPECIFIED value + * @property {number} INCORRECT=1 INCORRECT value + * @property {number} CORRECT=2 CORRECT value + */ + AgentAssistantFeedback.DocumentCorrectness = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_CORRECTNESS_UNSPECIFIED"] = 0; + values[valuesById[1] = "INCORRECT"] = 1; + values[valuesById[2] = "CORRECT"] = 2; + return values; + })(); + + /** + * DocumentEfficiency enum. + * @name google.cloud.dialogflow.v2beta1.AgentAssistantFeedback.DocumentEfficiency + * @enum {number} + * @property {number} DOCUMENT_EFFICIENCY_UNSPECIFIED=0 DOCUMENT_EFFICIENCY_UNSPECIFIED value + * @property {number} INEFFICIENT=1 INEFFICIENT value + * @property {number} EFFICIENT=2 EFFICIENT value + */ + AgentAssistantFeedback.DocumentEfficiency = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DOCUMENT_EFFICIENCY_UNSPECIFIED"] = 0; + values[valuesById[1] = "INEFFICIENT"] = 1; + values[valuesById[2] = "EFFICIENT"] = 2; + return values; + })(); + + return AgentAssistantFeedback; + })(); + + v2beta1.GetAnswerRecordRequest = (function() { + + /** + * Properties of a GetAnswerRecordRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IGetAnswerRecordRequest + * @property {string|null} [name] GetAnswerRecordRequest name + */ + + /** + * Constructs a new GetAnswerRecordRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a GetAnswerRecordRequest. + * @implements IGetAnswerRecordRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest=} [properties] Properties to set + */ + function GetAnswerRecordRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetAnswerRecordRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest + * @instance + */ + GetAnswerRecordRequest.prototype.name = ""; + + /** + * Creates a new GetAnswerRecordRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest} GetAnswerRecordRequest instance + */ + GetAnswerRecordRequest.create = function create(properties) { + return new GetAnswerRecordRequest(properties); + }; + + /** + * Encodes the specified GetAnswerRecordRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest} message GetAnswerRecordRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnswerRecordRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetAnswerRecordRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest} message GetAnswerRecordRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetAnswerRecordRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetAnswerRecordRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest} GetAnswerRecordRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnswerRecordRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetAnswerRecordRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest} GetAnswerRecordRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetAnswerRecordRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetAnswerRecordRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetAnswerRecordRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetAnswerRecordRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest} GetAnswerRecordRequest + */ + GetAnswerRecordRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetAnswerRecordRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest} message GetAnswerRecordRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetAnswerRecordRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetAnswerRecordRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest + * @instance + * @returns {Object.} JSON object + */ + GetAnswerRecordRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetAnswerRecordRequest; + })(); + + v2beta1.ListAnswerRecordsRequest = (function() { + + /** + * Properties of a ListAnswerRecordsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListAnswerRecordsRequest + * @property {string|null} [parent] ListAnswerRecordsRequest parent + * @property {number|null} [pageSize] ListAnswerRecordsRequest pageSize + * @property {string|null} [pageToken] ListAnswerRecordsRequest pageToken + */ + + /** + * Constructs a new ListAnswerRecordsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListAnswerRecordsRequest. + * @implements IListAnswerRecordsRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest=} [properties] Properties to set + */ + function ListAnswerRecordsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnswerRecordsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest + * @instance + */ + ListAnswerRecordsRequest.prototype.parent = ""; + + /** + * ListAnswerRecordsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest + * @instance + */ + ListAnswerRecordsRequest.prototype.pageSize = 0; + + /** + * ListAnswerRecordsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest + * @instance + */ + ListAnswerRecordsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListAnswerRecordsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest} ListAnswerRecordsRequest instance + */ + ListAnswerRecordsRequest.create = function create(properties) { + return new ListAnswerRecordsRequest(properties); + }; + + /** + * Encodes the specified ListAnswerRecordsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest} message ListAnswerRecordsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnswerRecordsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListAnswerRecordsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest} message ListAnswerRecordsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnswerRecordsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnswerRecordsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest} ListAnswerRecordsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnswerRecordsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnswerRecordsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest} ListAnswerRecordsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnswerRecordsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnswerRecordsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnswerRecordsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListAnswerRecordsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest} ListAnswerRecordsRequest + */ + ListAnswerRecordsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListAnswerRecordsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest} message ListAnswerRecordsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnswerRecordsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListAnswerRecordsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest + * @instance + * @returns {Object.} JSON object + */ + ListAnswerRecordsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAnswerRecordsRequest; + })(); + + v2beta1.ListAnswerRecordsResponse = (function() { + + /** + * Properties of a ListAnswerRecordsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListAnswerRecordsResponse + * @property {Array.|null} [answerRecords] ListAnswerRecordsResponse answerRecords + * @property {string|null} [nextPageToken] ListAnswerRecordsResponse nextPageToken + */ + + /** + * Constructs a new ListAnswerRecordsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListAnswerRecordsResponse. + * @implements IListAnswerRecordsResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse=} [properties] Properties to set + */ + function ListAnswerRecordsResponse(properties) { + this.answerRecords = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListAnswerRecordsResponse answerRecords. + * @member {Array.} answerRecords + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse + * @instance + */ + ListAnswerRecordsResponse.prototype.answerRecords = $util.emptyArray; + + /** + * ListAnswerRecordsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse + * @instance + */ + ListAnswerRecordsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListAnswerRecordsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse} ListAnswerRecordsResponse instance + */ + ListAnswerRecordsResponse.create = function create(properties) { + return new ListAnswerRecordsResponse(properties); + }; + + /** + * Encodes the specified ListAnswerRecordsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse} message ListAnswerRecordsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnswerRecordsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.answerRecords != null && message.answerRecords.length) + for (var i = 0; i < message.answerRecords.length; ++i) + $root.google.cloud.dialogflow.v2beta1.AnswerRecord.encode(message.answerRecords[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListAnswerRecordsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse} message ListAnswerRecordsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListAnswerRecordsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListAnswerRecordsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse} ListAnswerRecordsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnswerRecordsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.answerRecords && message.answerRecords.length)) + message.answerRecords = []; + message.answerRecords.push($root.google.cloud.dialogflow.v2beta1.AnswerRecord.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListAnswerRecordsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse} ListAnswerRecordsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListAnswerRecordsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListAnswerRecordsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListAnswerRecordsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.answerRecords != null && message.hasOwnProperty("answerRecords")) { + if (!Array.isArray(message.answerRecords)) + return "answerRecords: array expected"; + for (var i = 0; i < message.answerRecords.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.AnswerRecord.verify(message.answerRecords[i]); + if (error) + return "answerRecords." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListAnswerRecordsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse} ListAnswerRecordsResponse + */ + ListAnswerRecordsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse(); + if (object.answerRecords) { + if (!Array.isArray(object.answerRecords)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.answerRecords: array expected"); + message.answerRecords = []; + for (var i = 0; i < object.answerRecords.length; ++i) { + if (typeof object.answerRecords[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.answerRecords: object expected"); + message.answerRecords[i] = $root.google.cloud.dialogflow.v2beta1.AnswerRecord.fromObject(object.answerRecords[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListAnswerRecordsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse} message ListAnswerRecordsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListAnswerRecordsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.answerRecords = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.answerRecords && message.answerRecords.length) { + object.answerRecords = []; + for (var j = 0; j < message.answerRecords.length; ++j) + object.answerRecords[j] = $root.google.cloud.dialogflow.v2beta1.AnswerRecord.toObject(message.answerRecords[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListAnswerRecordsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse + * @instance + * @returns {Object.} JSON object + */ + ListAnswerRecordsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListAnswerRecordsResponse; + })(); + + v2beta1.UpdateAnswerRecordRequest = (function() { + + /** + * Properties of an UpdateAnswerRecordRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IUpdateAnswerRecordRequest + * @property {google.cloud.dialogflow.v2beta1.IAnswerRecord|null} [answerRecord] UpdateAnswerRecordRequest answerRecord + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateAnswerRecordRequest updateMask + */ + + /** + * Constructs a new UpdateAnswerRecordRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an UpdateAnswerRecordRequest. + * @implements IUpdateAnswerRecordRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest=} [properties] Properties to set + */ + function UpdateAnswerRecordRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateAnswerRecordRequest answerRecord. + * @member {google.cloud.dialogflow.v2beta1.IAnswerRecord|null|undefined} answerRecord + * @memberof google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest + * @instance + */ + UpdateAnswerRecordRequest.prototype.answerRecord = null; + + /** + * UpdateAnswerRecordRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest + * @instance + */ + UpdateAnswerRecordRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateAnswerRecordRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest} UpdateAnswerRecordRequest instance + */ + UpdateAnswerRecordRequest.create = function create(properties) { + return new UpdateAnswerRecordRequest(properties); + }; + + /** + * Encodes the specified UpdateAnswerRecordRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest} message UpdateAnswerRecordRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAnswerRecordRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.answerRecord != null && Object.hasOwnProperty.call(message, "answerRecord")) + $root.google.cloud.dialogflow.v2beta1.AnswerRecord.encode(message.answerRecord, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateAnswerRecordRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest} message UpdateAnswerRecordRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateAnswerRecordRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateAnswerRecordRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest} UpdateAnswerRecordRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAnswerRecordRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.answerRecord = $root.google.cloud.dialogflow.v2beta1.AnswerRecord.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateAnswerRecordRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest} UpdateAnswerRecordRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateAnswerRecordRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateAnswerRecordRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateAnswerRecordRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) { + var error = $root.google.cloud.dialogflow.v2beta1.AnswerRecord.verify(message.answerRecord); + if (error) + return "answerRecord." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateAnswerRecordRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest} UpdateAnswerRecordRequest + */ + UpdateAnswerRecordRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest(); + if (object.answerRecord != null) { + if (typeof object.answerRecord !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest.answerRecord: object expected"); + message.answerRecord = $root.google.cloud.dialogflow.v2beta1.AnswerRecord.fromObject(object.answerRecord); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateAnswerRecordRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest} message UpdateAnswerRecordRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateAnswerRecordRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.answerRecord = null; + object.updateMask = null; + } + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + object.answerRecord = $root.google.cloud.dialogflow.v2beta1.AnswerRecord.toObject(message.answerRecord, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateAnswerRecordRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateAnswerRecordRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateAnswerRecordRequest; + })(); + + v2beta1.Participants = (function() { + + /** + * Constructs a new Participants service. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a Participants + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Participants(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Participants.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Participants; + + /** + * Creates new Participants service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Participants} RPC service. Useful where requests and/or responses are streamed. + */ + Participants.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#createParticipant}. + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @typedef CreateParticipantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Participant} [response] Participant + */ + + /** + * Calls CreateParticipant. + * @function createParticipant + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateParticipantRequest} request CreateParticipantRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Participants.CreateParticipantCallback} callback Node-style callback called with the error, if any, and Participant + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Participants.prototype.createParticipant = function createParticipant(request, callback) { + return this.rpcCall(createParticipant, $root.google.cloud.dialogflow.v2beta1.CreateParticipantRequest, $root.google.cloud.dialogflow.v2beta1.Participant, request, callback); + }, "name", { value: "CreateParticipant" }); + + /** + * Calls CreateParticipant. + * @function createParticipant + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateParticipantRequest} request CreateParticipantRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#getParticipant}. + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @typedef GetParticipantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Participant} [response] Participant + */ + + /** + * Calls GetParticipant. + * @function getParticipant + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetParticipantRequest} request GetParticipantRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Participants.GetParticipantCallback} callback Node-style callback called with the error, if any, and Participant + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Participants.prototype.getParticipant = function getParticipant(request, callback) { + return this.rpcCall(getParticipant, $root.google.cloud.dialogflow.v2beta1.GetParticipantRequest, $root.google.cloud.dialogflow.v2beta1.Participant, request, callback); + }, "name", { value: "GetParticipant" }); + + /** + * Calls GetParticipant. + * @function getParticipant + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetParticipantRequest} request GetParticipantRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#listParticipants}. + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @typedef ListParticipantsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListParticipantsResponse} [response] ListParticipantsResponse + */ + + /** + * Calls ListParticipants. + * @function listParticipants + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListParticipantsRequest} request ListParticipantsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Participants.ListParticipantsCallback} callback Node-style callback called with the error, if any, and ListParticipantsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Participants.prototype.listParticipants = function listParticipants(request, callback) { + return this.rpcCall(listParticipants, $root.google.cloud.dialogflow.v2beta1.ListParticipantsRequest, $root.google.cloud.dialogflow.v2beta1.ListParticipantsResponse, request, callback); + }, "name", { value: "ListParticipants" }); + + /** + * Calls ListParticipants. + * @function listParticipants + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListParticipantsRequest} request ListParticipantsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#updateParticipant}. + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @typedef UpdateParticipantCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Participant} [response] Participant + */ + + /** + * Calls UpdateParticipant. + * @function updateParticipant + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest} request UpdateParticipantRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Participants.UpdateParticipantCallback} callback Node-style callback called with the error, if any, and Participant + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Participants.prototype.updateParticipant = function updateParticipant(request, callback) { + return this.rpcCall(updateParticipant, $root.google.cloud.dialogflow.v2beta1.UpdateParticipantRequest, $root.google.cloud.dialogflow.v2beta1.Participant, request, callback); + }, "name", { value: "UpdateParticipant" }); + + /** + * Calls UpdateParticipant. + * @function updateParticipant + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest} request UpdateParticipantRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#analyzeContent}. + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @typedef AnalyzeContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.AnalyzeContentResponse} [response] AnalyzeContentResponse + */ + + /** + * Calls AnalyzeContent. + * @function analyzeContent + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest} request AnalyzeContentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Participants.AnalyzeContentCallback} callback Node-style callback called with the error, if any, and AnalyzeContentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Participants.prototype.analyzeContent = function analyzeContent(request, callback) { + return this.rpcCall(analyzeContent, $root.google.cloud.dialogflow.v2beta1.AnalyzeContentRequest, $root.google.cloud.dialogflow.v2beta1.AnalyzeContentResponse, request, callback); + }, "name", { value: "AnalyzeContent" }); + + /** + * Calls AnalyzeContent. + * @function analyzeContent + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest} request AnalyzeContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#streamingAnalyzeContent}. + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @typedef StreamingAnalyzeContentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse} [response] StreamingAnalyzeContentResponse + */ + + /** + * Calls StreamingAnalyzeContent. + * @function streamingAnalyzeContent + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentRequest} request StreamingAnalyzeContentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Participants.StreamingAnalyzeContentCallback} callback Node-style callback called with the error, if any, and StreamingAnalyzeContentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Participants.prototype.streamingAnalyzeContent = function streamingAnalyzeContent(request, callback) { + return this.rpcCall(streamingAnalyzeContent, $root.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest, $root.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse, request, callback); + }, "name", { value: "StreamingAnalyzeContent" }); + + /** + * Calls StreamingAnalyzeContent. + * @function streamingAnalyzeContent + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentRequest} request StreamingAnalyzeContentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#suggestArticles}. + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @typedef SuggestArticlesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.SuggestArticlesResponse} [response] SuggestArticlesResponse + */ + + /** + * Calls SuggestArticles. + * @function suggestArticles + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest} request SuggestArticlesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Participants.SuggestArticlesCallback} callback Node-style callback called with the error, if any, and SuggestArticlesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Participants.prototype.suggestArticles = function suggestArticles(request, callback) { + return this.rpcCall(suggestArticles, $root.google.cloud.dialogflow.v2beta1.SuggestArticlesRequest, $root.google.cloud.dialogflow.v2beta1.SuggestArticlesResponse, request, callback); + }, "name", { value: "SuggestArticles" }); + + /** + * Calls SuggestArticles. + * @function suggestArticles + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest} request SuggestArticlesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#suggestFaqAnswers}. + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @typedef SuggestFaqAnswersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse} [response] SuggestFaqAnswersResponse + */ + + /** + * Calls SuggestFaqAnswers. + * @function suggestFaqAnswers + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest} request SuggestFaqAnswersRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswersCallback} callback Node-style callback called with the error, if any, and SuggestFaqAnswersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Participants.prototype.suggestFaqAnswers = function suggestFaqAnswers(request, callback) { + return this.rpcCall(suggestFaqAnswers, $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest, $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse, request, callback); + }, "name", { value: "SuggestFaqAnswers" }); + + /** + * Calls SuggestFaqAnswers. + * @function suggestFaqAnswers + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest} request SuggestFaqAnswersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#suggestSmartReplies}. + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @typedef SuggestSmartRepliesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse} [response] SuggestSmartRepliesResponse + */ + + /** + * Calls SuggestSmartReplies. + * @function suggestSmartReplies + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest} request SuggestSmartRepliesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Participants.SuggestSmartRepliesCallback} callback Node-style callback called with the error, if any, and SuggestSmartRepliesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Participants.prototype.suggestSmartReplies = function suggestSmartReplies(request, callback) { + return this.rpcCall(suggestSmartReplies, $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest, $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse, request, callback); + }, "name", { value: "SuggestSmartReplies" }); + + /** + * Calls SuggestSmartReplies. + * @function suggestSmartReplies + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest} request SuggestSmartRepliesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#listSuggestions}. + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @typedef ListSuggestionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListSuggestionsResponse} [response] ListSuggestionsResponse + */ + + /** + * Calls ListSuggestions. + * @function listSuggestions + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListSuggestionsRequest} request ListSuggestionsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Participants.ListSuggestionsCallback} callback Node-style callback called with the error, if any, and ListSuggestionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Participants.prototype.listSuggestions = function listSuggestions(request, callback) { + return this.rpcCall(listSuggestions, $root.google.cloud.dialogflow.v2beta1.ListSuggestionsRequest, $root.google.cloud.dialogflow.v2beta1.ListSuggestionsResponse, request, callback); + }, "name", { value: "ListSuggestions" }); + + /** + * Calls ListSuggestions. + * @function listSuggestions + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListSuggestionsRequest} request ListSuggestionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Participants#compileSuggestion}. + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @typedef CompileSuggestionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.CompileSuggestionResponse} [response] CompileSuggestionResponse + */ + + /** + * Calls CompileSuggestion. + * @function compileSuggestion + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest} request CompileSuggestionRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Participants.CompileSuggestionCallback} callback Node-style callback called with the error, if any, and CompileSuggestionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Participants.prototype.compileSuggestion = function compileSuggestion(request, callback) { + return this.rpcCall(compileSuggestion, $root.google.cloud.dialogflow.v2beta1.CompileSuggestionRequest, $root.google.cloud.dialogflow.v2beta1.CompileSuggestionResponse, request, callback); + }, "name", { value: "CompileSuggestion" }); + + /** + * Calls CompileSuggestion. + * @function compileSuggestion + * @memberof google.cloud.dialogflow.v2beta1.Participants + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest} request CompileSuggestionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Participants; + })(); + + v2beta1.Participant = (function() { + + /** + * Properties of a Participant. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IParticipant + * @property {string|null} [name] Participant name + * @property {google.cloud.dialogflow.v2beta1.Participant.Role|null} [role] Participant role + * @property {string|null} [obfuscatedExternalUserId] Participant obfuscatedExternalUserId + */ + + /** + * Constructs a new Participant. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a Participant. + * @implements IParticipant + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IParticipant=} [properties] Properties to set + */ + function Participant(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Participant name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.Participant + * @instance + */ + Participant.prototype.name = ""; + + /** + * Participant role. + * @member {google.cloud.dialogflow.v2beta1.Participant.Role} role + * @memberof google.cloud.dialogflow.v2beta1.Participant + * @instance + */ + Participant.prototype.role = 0; + + /** + * Participant obfuscatedExternalUserId. + * @member {string} obfuscatedExternalUserId + * @memberof google.cloud.dialogflow.v2beta1.Participant + * @instance + */ + Participant.prototype.obfuscatedExternalUserId = ""; + + /** + * Creates a new Participant instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Participant + * @static + * @param {google.cloud.dialogflow.v2beta1.IParticipant=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Participant} Participant instance + */ + Participant.create = function create(properties) { + return new Participant(properties); + }; + + /** + * Encodes the specified Participant message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Participant.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Participant + * @static + * @param {google.cloud.dialogflow.v2beta1.IParticipant} message Participant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Participant.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.role != null && Object.hasOwnProperty.call(message, "role")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.role); + if (message.obfuscatedExternalUserId != null && Object.hasOwnProperty.call(message, "obfuscatedExternalUserId")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.obfuscatedExternalUserId); + return writer; + }; + + /** + * Encodes the specified Participant message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Participant.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Participant + * @static + * @param {google.cloud.dialogflow.v2beta1.IParticipant} message Participant message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Participant.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Participant message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Participant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Participant} Participant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Participant.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Participant(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.role = reader.int32(); + break; + case 7: + message.obfuscatedExternalUserId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Participant message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Participant + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Participant} Participant + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Participant.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Participant message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Participant + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Participant.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.role != null && message.hasOwnProperty("role")) + switch (message.role) { + default: + return "role: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.obfuscatedExternalUserId != null && message.hasOwnProperty("obfuscatedExternalUserId")) + if (!$util.isString(message.obfuscatedExternalUserId)) + return "obfuscatedExternalUserId: string expected"; + return null; + }; + + /** + * Creates a Participant message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Participant + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Participant} Participant + */ + Participant.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Participant) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Participant(); + if (object.name != null) + message.name = String(object.name); + switch (object.role) { + case "ROLE_UNSPECIFIED": + case 0: + message.role = 0; + break; + case "HUMAN_AGENT": + case 1: + message.role = 1; + break; + case "AUTOMATED_AGENT": + case 2: + message.role = 2; + break; + case "END_USER": + case 3: + message.role = 3; + break; + } + if (object.obfuscatedExternalUserId != null) + message.obfuscatedExternalUserId = String(object.obfuscatedExternalUserId); + return message; + }; + + /** + * Creates a plain object from a Participant message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Participant + * @static + * @param {google.cloud.dialogflow.v2beta1.Participant} message Participant + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Participant.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.role = options.enums === String ? "ROLE_UNSPECIFIED" : 0; + object.obfuscatedExternalUserId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.role != null && message.hasOwnProperty("role")) + object.role = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Participant.Role[message.role] : message.role; + if (message.obfuscatedExternalUserId != null && message.hasOwnProperty("obfuscatedExternalUserId")) + object.obfuscatedExternalUserId = message.obfuscatedExternalUserId; + return object; + }; + + /** + * Converts this Participant to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Participant + * @instance + * @returns {Object.} JSON object + */ + Participant.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Role enum. + * @name google.cloud.dialogflow.v2beta1.Participant.Role + * @enum {number} + * @property {number} ROLE_UNSPECIFIED=0 ROLE_UNSPECIFIED value + * @property {number} HUMAN_AGENT=1 HUMAN_AGENT value + * @property {number} AUTOMATED_AGENT=2 AUTOMATED_AGENT value + * @property {number} END_USER=3 END_USER value + */ + Participant.Role = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ROLE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HUMAN_AGENT"] = 1; + values[valuesById[2] = "AUTOMATED_AGENT"] = 2; + values[valuesById[3] = "END_USER"] = 3; + return values; + })(); + + return Participant; + })(); + + v2beta1.Message = (function() { + + /** + * Properties of a Message. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IMessage + * @property {string|null} [name] Message name + * @property {string|null} [content] Message content + * @property {string|null} [languageCode] Message languageCode + * @property {string|null} [participant] Message participant + * @property {google.cloud.dialogflow.v2beta1.Participant.Role|null} [participantRole] Message participantRole + * @property {google.protobuf.ITimestamp|null} [createTime] Message createTime + * @property {google.protobuf.ITimestamp|null} [sendTime] Message sendTime + * @property {google.cloud.dialogflow.v2beta1.IMessageAnnotation|null} [messageAnnotation] Message messageAnnotation + * @property {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult|null} [sentimentAnalysis] Message sentimentAnalysis + */ + + /** + * Constructs a new Message. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IMessage=} [properties] Properties to set + */ + function Message(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Message name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.Message + * @instance + */ + Message.prototype.name = ""; + + /** + * Message content. + * @member {string} content + * @memberof google.cloud.dialogflow.v2beta1.Message + * @instance + */ + Message.prototype.content = ""; + + /** + * Message languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.Message + * @instance + */ + Message.prototype.languageCode = ""; + + /** + * Message participant. + * @member {string} participant + * @memberof google.cloud.dialogflow.v2beta1.Message + * @instance + */ + Message.prototype.participant = ""; + + /** + * Message participantRole. + * @member {google.cloud.dialogflow.v2beta1.Participant.Role} participantRole + * @memberof google.cloud.dialogflow.v2beta1.Message + * @instance + */ + Message.prototype.participantRole = 0; + + /** + * Message createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.v2beta1.Message + * @instance + */ + Message.prototype.createTime = null; + + /** + * Message sendTime. + * @member {google.protobuf.ITimestamp|null|undefined} sendTime + * @memberof google.cloud.dialogflow.v2beta1.Message + * @instance + */ + Message.prototype.sendTime = null; + + /** + * Message messageAnnotation. + * @member {google.cloud.dialogflow.v2beta1.IMessageAnnotation|null|undefined} messageAnnotation + * @memberof google.cloud.dialogflow.v2beta1.Message + * @instance + */ + Message.prototype.messageAnnotation = null; + + /** + * Message sentimentAnalysis. + * @member {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult|null|undefined} sentimentAnalysis + * @memberof google.cloud.dialogflow.v2beta1.Message + * @instance + */ + Message.prototype.sentimentAnalysis = null; + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Message + * @static + * @param {google.cloud.dialogflow.v2beta1.IMessage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Message.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Message + * @static + * @param {google.cloud.dialogflow.v2beta1.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.content); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.participant); + if (message.participantRole != null && Object.hasOwnProperty.call(message, "participantRole")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.participantRole); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.messageAnnotation != null && Object.hasOwnProperty.call(message, "messageAnnotation")) + $root.google.cloud.dialogflow.v2beta1.MessageAnnotation.encode(message.messageAnnotation, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.sentimentAnalysis != null && Object.hasOwnProperty.call(message, "sentimentAnalysis")) + $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.encode(message.sentimentAnalysis, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sendTime != null && Object.hasOwnProperty.call(message, "sendTime")) + $root.google.protobuf.Timestamp.encode(message.sendTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Message + * @static + * @param {google.cloud.dialogflow.v2beta1.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.content = reader.string(); + break; + case 3: + message.languageCode = reader.string(); + break; + case 4: + message.participant = reader.string(); + break; + case 5: + message.participantRole = reader.int32(); + break; + case 6: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 9: + message.sendTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.messageAnnotation = $root.google.cloud.dialogflow.v2beta1.MessageAnnotation.decode(reader, reader.uint32()); + break; + case 8: + message.sentimentAnalysis = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.content != null && message.hasOwnProperty("content")) + if (!$util.isString(message.content)) + return "content: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + if (message.participantRole != null && message.hasOwnProperty("participantRole")) + switch (message.participantRole) { + default: + return "participantRole: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.sendTime != null && message.hasOwnProperty("sendTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.sendTime); + if (error) + return "sendTime." + error; + } + if (message.messageAnnotation != null && message.hasOwnProperty("messageAnnotation")) { + var error = $root.google.cloud.dialogflow.v2beta1.MessageAnnotation.verify(message.messageAnnotation); + if (error) + return "messageAnnotation." + error; + } + if (message.sentimentAnalysis != null && message.hasOwnProperty("sentimentAnalysis")) { + var error = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.verify(message.sentimentAnalysis); + if (error) + return "sentimentAnalysis." + error; + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Message + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Message) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Message(); + if (object.name != null) + message.name = String(object.name); + if (object.content != null) + message.content = String(object.content); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.participant != null) + message.participant = String(object.participant); + switch (object.participantRole) { + case "ROLE_UNSPECIFIED": + case 0: + message.participantRole = 0; + break; + case "HUMAN_AGENT": + case 1: + message.participantRole = 1; + break; + case "AUTOMATED_AGENT": + case 2: + message.participantRole = 2; + break; + case "END_USER": + case 3: + message.participantRole = 3; + break; + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Message.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.sendTime != null) { + if (typeof object.sendTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Message.sendTime: object expected"); + message.sendTime = $root.google.protobuf.Timestamp.fromObject(object.sendTime); + } + if (object.messageAnnotation != null) { + if (typeof object.messageAnnotation !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Message.messageAnnotation: object expected"); + message.messageAnnotation = $root.google.cloud.dialogflow.v2beta1.MessageAnnotation.fromObject(object.messageAnnotation); + } + if (object.sentimentAnalysis != null) { + if (typeof object.sentimentAnalysis !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Message.sentimentAnalysis: object expected"); + message.sentimentAnalysis = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.fromObject(object.sentimentAnalysis); + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Message + * @static + * @param {google.cloud.dialogflow.v2beta1.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.content = ""; + object.languageCode = ""; + object.participant = ""; + object.participantRole = options.enums === String ? "ROLE_UNSPECIFIED" : 0; + object.createTime = null; + object.messageAnnotation = null; + object.sentimentAnalysis = null; + object.sendTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.content != null && message.hasOwnProperty("content")) + object.content = message.content; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + if (message.participantRole != null && message.hasOwnProperty("participantRole")) + object.participantRole = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Participant.Role[message.participantRole] : message.participantRole; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.messageAnnotation != null && message.hasOwnProperty("messageAnnotation")) + object.messageAnnotation = $root.google.cloud.dialogflow.v2beta1.MessageAnnotation.toObject(message.messageAnnotation, options); + if (message.sentimentAnalysis != null && message.hasOwnProperty("sentimentAnalysis")) + object.sentimentAnalysis = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.toObject(message.sentimentAnalysis, options); + if (message.sendTime != null && message.hasOwnProperty("sendTime")) + object.sendTime = $root.google.protobuf.Timestamp.toObject(message.sendTime, options); + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Message; + })(); + + v2beta1.CreateParticipantRequest = (function() { + + /** + * Properties of a CreateParticipantRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ICreateParticipantRequest + * @property {string|null} [parent] CreateParticipantRequest parent + * @property {google.cloud.dialogflow.v2beta1.IParticipant|null} [participant] CreateParticipantRequest participant + */ + + /** + * Constructs a new CreateParticipantRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a CreateParticipantRequest. + * @implements ICreateParticipantRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ICreateParticipantRequest=} [properties] Properties to set + */ + function CreateParticipantRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateParticipantRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.CreateParticipantRequest + * @instance + */ + CreateParticipantRequest.prototype.parent = ""; + + /** + * CreateParticipantRequest participant. + * @member {google.cloud.dialogflow.v2beta1.IParticipant|null|undefined} participant + * @memberof google.cloud.dialogflow.v2beta1.CreateParticipantRequest + * @instance + */ + CreateParticipantRequest.prototype.participant = null; + + /** + * Creates a new CreateParticipantRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CreateParticipantRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateParticipantRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CreateParticipantRequest} CreateParticipantRequest instance + */ + CreateParticipantRequest.create = function create(properties) { + return new CreateParticipantRequest(properties); + }; + + /** + * Encodes the specified CreateParticipantRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateParticipantRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CreateParticipantRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateParticipantRequest} message CreateParticipantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateParticipantRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + $root.google.cloud.dialogflow.v2beta1.Participant.encode(message.participant, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateParticipantRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateParticipantRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateParticipantRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateParticipantRequest} message CreateParticipantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateParticipantRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateParticipantRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CreateParticipantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CreateParticipantRequest} CreateParticipantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateParticipantRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateParticipantRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.participant = $root.google.cloud.dialogflow.v2beta1.Participant.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateParticipantRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateParticipantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CreateParticipantRequest} CreateParticipantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateParticipantRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateParticipantRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CreateParticipantRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateParticipantRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.participant != null && message.hasOwnProperty("participant")) { + var error = $root.google.cloud.dialogflow.v2beta1.Participant.verify(message.participant); + if (error) + return "participant." + error; + } + return null; + }; + + /** + * Creates a CreateParticipantRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CreateParticipantRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CreateParticipantRequest} CreateParticipantRequest + */ + CreateParticipantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateParticipantRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CreateParticipantRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.participant != null) { + if (typeof object.participant !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CreateParticipantRequest.participant: object expected"); + message.participant = $root.google.cloud.dialogflow.v2beta1.Participant.fromObject(object.participant); + } + return message; + }; + + /** + * Creates a plain object from a CreateParticipantRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CreateParticipantRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.CreateParticipantRequest} message CreateParticipantRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateParticipantRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.participant = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = $root.google.cloud.dialogflow.v2beta1.Participant.toObject(message.participant, options); + return object; + }; + + /** + * Converts this CreateParticipantRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CreateParticipantRequest + * @instance + * @returns {Object.} JSON object + */ + CreateParticipantRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateParticipantRequest; + })(); + + v2beta1.GetParticipantRequest = (function() { + + /** + * Properties of a GetParticipantRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IGetParticipantRequest + * @property {string|null} [name] GetParticipantRequest name + */ + + /** + * Constructs a new GetParticipantRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a GetParticipantRequest. + * @implements IGetParticipantRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IGetParticipantRequest=} [properties] Properties to set + */ + function GetParticipantRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetParticipantRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.GetParticipantRequest + * @instance + */ + GetParticipantRequest.prototype.name = ""; + + /** + * Creates a new GetParticipantRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.GetParticipantRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetParticipantRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GetParticipantRequest} GetParticipantRequest instance + */ + GetParticipantRequest.create = function create(properties) { + return new GetParticipantRequest(properties); + }; + + /** + * Encodes the specified GetParticipantRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetParticipantRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.GetParticipantRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetParticipantRequest} message GetParticipantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetParticipantRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetParticipantRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetParticipantRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetParticipantRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetParticipantRequest} message GetParticipantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetParticipantRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetParticipantRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.GetParticipantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.GetParticipantRequest} GetParticipantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetParticipantRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetParticipantRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetParticipantRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetParticipantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.GetParticipantRequest} GetParticipantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetParticipantRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetParticipantRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.GetParticipantRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetParticipantRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetParticipantRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.GetParticipantRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.GetParticipantRequest} GetParticipantRequest + */ + GetParticipantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetParticipantRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.GetParticipantRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetParticipantRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.GetParticipantRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.GetParticipantRequest} message GetParticipantRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetParticipantRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetParticipantRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.GetParticipantRequest + * @instance + * @returns {Object.} JSON object + */ + GetParticipantRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetParticipantRequest; + })(); + + v2beta1.ListParticipantsRequest = (function() { + + /** + * Properties of a ListParticipantsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListParticipantsRequest + * @property {string|null} [parent] ListParticipantsRequest parent + * @property {number|null} [pageSize] ListParticipantsRequest pageSize + * @property {string|null} [pageToken] ListParticipantsRequest pageToken + */ + + /** + * Constructs a new ListParticipantsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListParticipantsRequest. + * @implements IListParticipantsRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListParticipantsRequest=} [properties] Properties to set + */ + function ListParticipantsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListParticipantsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsRequest + * @instance + */ + ListParticipantsRequest.prototype.parent = ""; + + /** + * ListParticipantsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsRequest + * @instance + */ + ListParticipantsRequest.prototype.pageSize = 0; + + /** + * ListParticipantsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsRequest + * @instance + */ + ListParticipantsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListParticipantsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListParticipantsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListParticipantsRequest} ListParticipantsRequest instance + */ + ListParticipantsRequest.create = function create(properties) { + return new ListParticipantsRequest(properties); + }; + + /** + * Encodes the specified ListParticipantsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListParticipantsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListParticipantsRequest} message ListParticipantsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListParticipantsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListParticipantsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListParticipantsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListParticipantsRequest} message ListParticipantsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListParticipantsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListParticipantsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListParticipantsRequest} ListParticipantsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListParticipantsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListParticipantsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListParticipantsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListParticipantsRequest} ListParticipantsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListParticipantsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListParticipantsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListParticipantsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListParticipantsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListParticipantsRequest} ListParticipantsRequest + */ + ListParticipantsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListParticipantsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListParticipantsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListParticipantsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ListParticipantsRequest} message ListParticipantsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListParticipantsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListParticipantsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsRequest + * @instance + * @returns {Object.} JSON object + */ + ListParticipantsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListParticipantsRequest; + })(); + + v2beta1.ListParticipantsResponse = (function() { + + /** + * Properties of a ListParticipantsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListParticipantsResponse + * @property {Array.|null} [participants] ListParticipantsResponse participants + * @property {string|null} [nextPageToken] ListParticipantsResponse nextPageToken + */ + + /** + * Constructs a new ListParticipantsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListParticipantsResponse. + * @implements IListParticipantsResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListParticipantsResponse=} [properties] Properties to set + */ + function ListParticipantsResponse(properties) { + this.participants = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListParticipantsResponse participants. + * @member {Array.} participants + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsResponse + * @instance + */ + ListParticipantsResponse.prototype.participants = $util.emptyArray; + + /** + * ListParticipantsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsResponse + * @instance + */ + ListParticipantsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListParticipantsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListParticipantsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListParticipantsResponse} ListParticipantsResponse instance + */ + ListParticipantsResponse.create = function create(properties) { + return new ListParticipantsResponse(properties); + }; + + /** + * Encodes the specified ListParticipantsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListParticipantsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListParticipantsResponse} message ListParticipantsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListParticipantsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.participants != null && message.participants.length) + for (var i = 0; i < message.participants.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Participant.encode(message.participants[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListParticipantsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListParticipantsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListParticipantsResponse} message ListParticipantsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListParticipantsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListParticipantsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListParticipantsResponse} ListParticipantsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListParticipantsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListParticipantsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.participants && message.participants.length)) + message.participants = []; + message.participants.push($root.google.cloud.dialogflow.v2beta1.Participant.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListParticipantsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListParticipantsResponse} ListParticipantsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListParticipantsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListParticipantsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListParticipantsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.participants != null && message.hasOwnProperty("participants")) { + if (!Array.isArray(message.participants)) + return "participants: array expected"; + for (var i = 0; i < message.participants.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Participant.verify(message.participants[i]); + if (error) + return "participants." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListParticipantsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListParticipantsResponse} ListParticipantsResponse + */ + ListParticipantsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListParticipantsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListParticipantsResponse(); + if (object.participants) { + if (!Array.isArray(object.participants)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListParticipantsResponse.participants: array expected"); + message.participants = []; + for (var i = 0; i < object.participants.length; ++i) { + if (typeof object.participants[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListParticipantsResponse.participants: object expected"); + message.participants[i] = $root.google.cloud.dialogflow.v2beta1.Participant.fromObject(object.participants[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListParticipantsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ListParticipantsResponse} message ListParticipantsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListParticipantsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.participants = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.participants && message.participants.length) { + object.participants = []; + for (var j = 0; j < message.participants.length; ++j) + object.participants[j] = $root.google.cloud.dialogflow.v2beta1.Participant.toObject(message.participants[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListParticipantsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListParticipantsResponse + * @instance + * @returns {Object.} JSON object + */ + ListParticipantsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListParticipantsResponse; + })(); + + v2beta1.UpdateParticipantRequest = (function() { + + /** + * Properties of an UpdateParticipantRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IUpdateParticipantRequest + * @property {google.cloud.dialogflow.v2beta1.IParticipant|null} [participant] UpdateParticipantRequest participant + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateParticipantRequest updateMask + */ + + /** + * Constructs a new UpdateParticipantRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an UpdateParticipantRequest. + * @implements IUpdateParticipantRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest=} [properties] Properties to set + */ + function UpdateParticipantRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateParticipantRequest participant. + * @member {google.cloud.dialogflow.v2beta1.IParticipant|null|undefined} participant + * @memberof google.cloud.dialogflow.v2beta1.UpdateParticipantRequest + * @instance + */ + UpdateParticipantRequest.prototype.participant = null; + + /** + * UpdateParticipantRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.UpdateParticipantRequest + * @instance + */ + UpdateParticipantRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateParticipantRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.UpdateParticipantRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.UpdateParticipantRequest} UpdateParticipantRequest instance + */ + UpdateParticipantRequest.create = function create(properties) { + return new UpdateParticipantRequest(properties); + }; + + /** + * Encodes the specified UpdateParticipantRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateParticipantRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.UpdateParticipantRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest} message UpdateParticipantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateParticipantRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + $root.google.cloud.dialogflow.v2beta1.Participant.encode(message.participant, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateParticipantRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateParticipantRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.UpdateParticipantRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest} message UpdateParticipantRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateParticipantRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateParticipantRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.UpdateParticipantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.UpdateParticipantRequest} UpdateParticipantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateParticipantRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateParticipantRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.participant = $root.google.cloud.dialogflow.v2beta1.Participant.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateParticipantRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.UpdateParticipantRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.UpdateParticipantRequest} UpdateParticipantRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateParticipantRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateParticipantRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.UpdateParticipantRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateParticipantRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.participant != null && message.hasOwnProperty("participant")) { + var error = $root.google.cloud.dialogflow.v2beta1.Participant.verify(message.participant); + if (error) + return "participant." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateParticipantRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.UpdateParticipantRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.UpdateParticipantRequest} UpdateParticipantRequest + */ + UpdateParticipantRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateParticipantRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.UpdateParticipantRequest(); + if (object.participant != null) { + if (typeof object.participant !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateParticipantRequest.participant: object expected"); + message.participant = $root.google.cloud.dialogflow.v2beta1.Participant.fromObject(object.participant); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateParticipantRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateParticipantRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.UpdateParticipantRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.UpdateParticipantRequest} message UpdateParticipantRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateParticipantRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.participant = null; + object.updateMask = null; + } + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = $root.google.cloud.dialogflow.v2beta1.Participant.toObject(message.participant, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateParticipantRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.UpdateParticipantRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateParticipantRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateParticipantRequest; + })(); + + v2beta1.InputText = (function() { + + /** + * Properties of an InputText. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IInputText + * @property {string|null} [text] InputText text + * @property {string|null} [languageCode] InputText languageCode + */ + + /** + * Constructs a new InputText. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an InputText. + * @implements IInputText + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IInputText=} [properties] Properties to set + */ + function InputText(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputText text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2beta1.InputText + * @instance + */ + InputText.prototype.text = ""; + + /** + * InputText languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.InputText + * @instance + */ + InputText.prototype.languageCode = ""; + + /** + * Creates a new InputText instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.InputText + * @static + * @param {google.cloud.dialogflow.v2beta1.IInputText=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.InputText} InputText instance + */ + InputText.create = function create(properties) { + return new InputText(properties); + }; + + /** + * Encodes the specified InputText message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputText.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.InputText + * @static + * @param {google.cloud.dialogflow.v2beta1.IInputText} message InputText message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputText.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified InputText message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputText.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.InputText + * @static + * @param {google.cloud.dialogflow.v2beta1.IInputText} message InputText message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputText.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputText message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.InputText + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.InputText} InputText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputText.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.InputText(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputText message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.InputText + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.InputText} InputText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputText.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputText message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.InputText + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputText.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an InputText message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.InputText + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.InputText} InputText + */ + InputText.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.InputText) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.InputText(); + if (object.text != null) + message.text = String(object.text); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an InputText message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.InputText + * @static + * @param {google.cloud.dialogflow.v2beta1.InputText} message InputText + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputText.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.languageCode = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this InputText to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.InputText + * @instance + * @returns {Object.} JSON object + */ + InputText.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InputText; + })(); + + v2beta1.InputAudio = (function() { + + /** + * Properties of an InputAudio. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IInputAudio + * @property {google.cloud.dialogflow.v2beta1.IInputAudioConfig|null} [config] InputAudio config + * @property {Uint8Array|null} [audio] InputAudio audio + */ + + /** + * Constructs a new InputAudio. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an InputAudio. + * @implements IInputAudio + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IInputAudio=} [properties] Properties to set + */ + function InputAudio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputAudio config. + * @member {google.cloud.dialogflow.v2beta1.IInputAudioConfig|null|undefined} config + * @memberof google.cloud.dialogflow.v2beta1.InputAudio + * @instance + */ + InputAudio.prototype.config = null; + + /** + * InputAudio audio. + * @member {Uint8Array} audio + * @memberof google.cloud.dialogflow.v2beta1.InputAudio + * @instance + */ + InputAudio.prototype.audio = $util.newBuffer([]); + + /** + * Creates a new InputAudio instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.InputAudio + * @static + * @param {google.cloud.dialogflow.v2beta1.IInputAudio=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.InputAudio} InputAudio instance + */ + InputAudio.create = function create(properties) { + return new InputAudio(properties); + }; + + /** + * Encodes the specified InputAudio message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputAudio.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.InputAudio + * @static + * @param {google.cloud.dialogflow.v2beta1.IInputAudio} message InputAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); + return writer; + }; + + /** + * Encodes the specified InputAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputAudio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.InputAudio + * @static + * @param {google.cloud.dialogflow.v2beta1.IInputAudio} message InputAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputAudio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputAudio message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.InputAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.InputAudio} InputAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudio.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.InputAudio(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.config = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.decode(reader, reader.uint32()); + break; + case 2: + message.audio = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputAudio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.InputAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.InputAudio} InputAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputAudio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputAudio message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.InputAudio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputAudio.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + return null; + }; + + /** + * Creates an InputAudio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.InputAudio + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.InputAudio} InputAudio + */ + InputAudio.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.InputAudio) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.InputAudio(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.InputAudio.config: object expected"); + message.config = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.fromObject(object.config); + } + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length) + message.audio = object.audio; + return message; + }; + + /** + * Creates a plain object from an InputAudio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.InputAudio + * @static + * @param {google.cloud.dialogflow.v2beta1.InputAudio} message InputAudio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputAudio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + if (options.bytes === String) + object.audio = ""; + else { + object.audio = []; + if (options.bytes !== Array) + object.audio = $util.newBuffer(object.audio); + } + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + return object; + }; + + /** + * Converts this InputAudio to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.InputAudio + * @instance + * @returns {Object.} JSON object + */ + InputAudio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InputAudio; + })(); + + v2beta1.AudioInput = (function() { + + /** + * Properties of an AudioInput. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IAudioInput + * @property {google.cloud.dialogflow.v2beta1.IInputAudioConfig|null} [config] AudioInput config + * @property {Uint8Array|null} [audio] AudioInput audio + */ + + /** + * Constructs a new AudioInput. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an AudioInput. + * @implements IAudioInput + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IAudioInput=} [properties] Properties to set + */ + function AudioInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AudioInput config. + * @member {google.cloud.dialogflow.v2beta1.IInputAudioConfig|null|undefined} config + * @memberof google.cloud.dialogflow.v2beta1.AudioInput + * @instance + */ + AudioInput.prototype.config = null; + + /** + * AudioInput audio. + * @member {Uint8Array} audio + * @memberof google.cloud.dialogflow.v2beta1.AudioInput + * @instance + */ + AudioInput.prototype.audio = $util.newBuffer([]); + + /** + * Creates a new AudioInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.AudioInput + * @static + * @param {google.cloud.dialogflow.v2beta1.IAudioInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.AudioInput} AudioInput instance + */ + AudioInput.create = function create(properties) { + return new AudioInput(properties); + }; + + /** + * Encodes the specified AudioInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AudioInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.AudioInput + * @static + * @param {google.cloud.dialogflow.v2beta1.IAudioInput} message AudioInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); + return writer; + }; + + /** + * Encodes the specified AudioInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AudioInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AudioInput + * @static + * @param {google.cloud.dialogflow.v2beta1.IAudioInput} message AudioInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AudioInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AudioInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.AudioInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.AudioInput} AudioInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioInput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.AudioInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.config = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.decode(reader, reader.uint32()); + break; + case 2: + message.audio = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AudioInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AudioInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.AudioInput} AudioInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AudioInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AudioInput message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.AudioInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AudioInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + return null; + }; + + /** + * Creates an AudioInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.AudioInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.AudioInput} AudioInput + */ + AudioInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.AudioInput) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.AudioInput(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AudioInput.config: object expected"); + message.config = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.fromObject(object.config); + } + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length) + message.audio = object.audio; + return message; + }; + + /** + * Creates a plain object from an AudioInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.AudioInput + * @static + * @param {google.cloud.dialogflow.v2beta1.AudioInput} message AudioInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AudioInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + if (options.bytes === String) + object.audio = ""; + else { + object.audio = []; + if (options.bytes !== Array) + object.audio = $util.newBuffer(object.audio); + } + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + return object; + }; + + /** + * Converts this AudioInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.AudioInput + * @instance + * @returns {Object.} JSON object + */ + AudioInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AudioInput; + })(); + + v2beta1.OutputAudio = (function() { + + /** + * Properties of an OutputAudio. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IOutputAudio + * @property {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null} [config] OutputAudio config + * @property {Uint8Array|null} [audio] OutputAudio audio + */ + + /** + * Constructs a new OutputAudio. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an OutputAudio. + * @implements IOutputAudio + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IOutputAudio=} [properties] Properties to set + */ + function OutputAudio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OutputAudio config. + * @member {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null|undefined} config + * @memberof google.cloud.dialogflow.v2beta1.OutputAudio + * @instance + */ + OutputAudio.prototype.config = null; + + /** + * OutputAudio audio. + * @member {Uint8Array} audio + * @memberof google.cloud.dialogflow.v2beta1.OutputAudio + * @instance + */ + OutputAudio.prototype.audio = $util.newBuffer([]); + + /** + * Creates a new OutputAudio instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.OutputAudio + * @static + * @param {google.cloud.dialogflow.v2beta1.IOutputAudio=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.OutputAudio} OutputAudio instance + */ + OutputAudio.create = function create(properties) { + return new OutputAudio(properties); + }; + + /** + * Encodes the specified OutputAudio message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.OutputAudio.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.OutputAudio + * @static + * @param {google.cloud.dialogflow.v2beta1.IOutputAudio} message OutputAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.config != null && Object.hasOwnProperty.call(message, "config")) + $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.encode(message.config, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.audio); + return writer; + }; + + /** + * Encodes the specified OutputAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.OutputAudio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.OutputAudio + * @static + * @param {google.cloud.dialogflow.v2beta1.IOutputAudio} message OutputAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OutputAudio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OutputAudio message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.OutputAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.OutputAudio} OutputAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudio.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.OutputAudio(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.config = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.decode(reader, reader.uint32()); + break; + case 2: + message.audio = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OutputAudio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.OutputAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.OutputAudio} OutputAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OutputAudio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OutputAudio message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.OutputAudio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OutputAudio.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.config != null && message.hasOwnProperty("config")) { + var error = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify(message.config); + if (error) + return "config." + error; + } + if (message.audio != null && message.hasOwnProperty("audio")) + if (!(message.audio && typeof message.audio.length === "number" || $util.isString(message.audio))) + return "audio: buffer expected"; + return null; + }; + + /** + * Creates an OutputAudio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.OutputAudio + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.OutputAudio} OutputAudio + */ + OutputAudio.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.OutputAudio) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.OutputAudio(); + if (object.config != null) { + if (typeof object.config !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.OutputAudio.config: object expected"); + message.config = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.fromObject(object.config); + } + if (object.audio != null) + if (typeof object.audio === "string") + $util.base64.decode(object.audio, message.audio = $util.newBuffer($util.base64.length(object.audio)), 0); + else if (object.audio.length) + message.audio = object.audio; + return message; + }; + + /** + * Creates a plain object from an OutputAudio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.OutputAudio + * @static + * @param {google.cloud.dialogflow.v2beta1.OutputAudio} message OutputAudio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OutputAudio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.config = null; + if (options.bytes === String) + object.audio = ""; + else { + object.audio = []; + if (options.bytes !== Array) + object.audio = $util.newBuffer(object.audio); + } + } + if (message.config != null && message.hasOwnProperty("config")) + object.config = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.toObject(message.config, options); + if (message.audio != null && message.hasOwnProperty("audio")) + object.audio = options.bytes === String ? $util.base64.encode(message.audio, 0, message.audio.length) : options.bytes === Array ? Array.prototype.slice.call(message.audio) : message.audio; + return object; + }; + + /** + * Converts this OutputAudio to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.OutputAudio + * @instance + * @returns {Object.} JSON object + */ + OutputAudio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OutputAudio; + })(); + + v2beta1.AutomatedAgentReply = (function() { + + /** + * Properties of an AutomatedAgentReply. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IAutomatedAgentReply + * @property {google.cloud.dialogflow.v2beta1.IDetectIntentResponse|null} [detectIntentResponse] AutomatedAgentReply detectIntentResponse + * @property {Array.|null} [responseMessages] AutomatedAgentReply responseMessages + * @property {string|null} [intent] AutomatedAgentReply intent + * @property {string|null} [event] AutomatedAgentReply event + * @property {google.protobuf.IStruct|null} [cxSessionParameters] AutomatedAgentReply cxSessionParameters + */ + + /** + * Constructs a new AutomatedAgentReply. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an AutomatedAgentReply. + * @implements IAutomatedAgentReply + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IAutomatedAgentReply=} [properties] Properties to set + */ + function AutomatedAgentReply(properties) { + this.responseMessages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AutomatedAgentReply detectIntentResponse. + * @member {google.cloud.dialogflow.v2beta1.IDetectIntentResponse|null|undefined} detectIntentResponse + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @instance + */ + AutomatedAgentReply.prototype.detectIntentResponse = null; + + /** + * AutomatedAgentReply responseMessages. + * @member {Array.} responseMessages + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @instance + */ + AutomatedAgentReply.prototype.responseMessages = $util.emptyArray; + + /** + * AutomatedAgentReply intent. + * @member {string} intent + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @instance + */ + AutomatedAgentReply.prototype.intent = ""; + + /** + * AutomatedAgentReply event. + * @member {string} event + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @instance + */ + AutomatedAgentReply.prototype.event = ""; + + /** + * AutomatedAgentReply cxSessionParameters. + * @member {google.protobuf.IStruct|null|undefined} cxSessionParameters + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @instance + */ + AutomatedAgentReply.prototype.cxSessionParameters = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AutomatedAgentReply response. + * @member {"detectIntentResponse"|undefined} response + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @instance + */ + Object.defineProperty(AutomatedAgentReply.prototype, "response", { + get: $util.oneOfGetter($oneOfFields = ["detectIntentResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * AutomatedAgentReply match. + * @member {"intent"|"event"|undefined} match + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @instance + */ + Object.defineProperty(AutomatedAgentReply.prototype, "match", { + get: $util.oneOfGetter($oneOfFields = ["intent", "event"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AutomatedAgentReply instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @static + * @param {google.cloud.dialogflow.v2beta1.IAutomatedAgentReply=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.AutomatedAgentReply} AutomatedAgentReply instance + */ + AutomatedAgentReply.create = function create(properties) { + return new AutomatedAgentReply(properties); + }; + + /** + * Encodes the specified AutomatedAgentReply message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AutomatedAgentReply.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @static + * @param {google.cloud.dialogflow.v2beta1.IAutomatedAgentReply} message AutomatedAgentReply message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedAgentReply.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.detectIntentResponse != null && Object.hasOwnProperty.call(message, "detectIntentResponse")) + $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse.encode(message.detectIntentResponse, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.responseMessages != null && message.responseMessages.length) + for (var i = 0; i < message.responseMessages.length; ++i) + $root.google.cloud.dialogflow.v2beta1.ResponseMessage.encode(message.responseMessages[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.intent); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.event); + if (message.cxSessionParameters != null && Object.hasOwnProperty.call(message, "cxSessionParameters")) + $root.google.protobuf.Struct.encode(message.cxSessionParameters, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AutomatedAgentReply message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AutomatedAgentReply.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @static + * @param {google.cloud.dialogflow.v2beta1.IAutomatedAgentReply} message AutomatedAgentReply message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AutomatedAgentReply.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AutomatedAgentReply message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.AutomatedAgentReply} AutomatedAgentReply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedAgentReply.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.detectIntentResponse = $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.responseMessages && message.responseMessages.length)) + message.responseMessages = []; + message.responseMessages.push($root.google.cloud.dialogflow.v2beta1.ResponseMessage.decode(reader, reader.uint32())); + break; + case 4: + message.intent = reader.string(); + break; + case 5: + message.event = reader.string(); + break; + case 6: + message.cxSessionParameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AutomatedAgentReply message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.AutomatedAgentReply} AutomatedAgentReply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AutomatedAgentReply.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AutomatedAgentReply message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AutomatedAgentReply.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.detectIntentResponse != null && message.hasOwnProperty("detectIntentResponse")) { + properties.response = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse.verify(message.detectIntentResponse); + if (error) + return "detectIntentResponse." + error; + } + } + if (message.responseMessages != null && message.hasOwnProperty("responseMessages")) { + if (!Array.isArray(message.responseMessages)) + return "responseMessages: array expected"; + for (var i = 0; i < message.responseMessages.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.verify(message.responseMessages[i]); + if (error) + return "responseMessages." + error; + } + } + if (message.intent != null && message.hasOwnProperty("intent")) { + properties.match = 1; + if (!$util.isString(message.intent)) + return "intent: string expected"; + } + if (message.event != null && message.hasOwnProperty("event")) { + if (properties.match === 1) + return "match: multiple values"; + properties.match = 1; + if (!$util.isString(message.event)) + return "event: string expected"; + } + if (message.cxSessionParameters != null && message.hasOwnProperty("cxSessionParameters")) { + var error = $root.google.protobuf.Struct.verify(message.cxSessionParameters); + if (error) + return "cxSessionParameters." + error; + } + return null; + }; + + /** + * Creates an AutomatedAgentReply message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.AutomatedAgentReply} AutomatedAgentReply + */ + AutomatedAgentReply.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply(); + if (object.detectIntentResponse != null) { + if (typeof object.detectIntentResponse !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AutomatedAgentReply.detectIntentResponse: object expected"); + message.detectIntentResponse = $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse.fromObject(object.detectIntentResponse); + } + if (object.responseMessages) { + if (!Array.isArray(object.responseMessages)) + throw TypeError(".google.cloud.dialogflow.v2beta1.AutomatedAgentReply.responseMessages: array expected"); + message.responseMessages = []; + for (var i = 0; i < object.responseMessages.length; ++i) { + if (typeof object.responseMessages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AutomatedAgentReply.responseMessages: object expected"); + message.responseMessages[i] = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.fromObject(object.responseMessages[i]); + } + } + if (object.intent != null) + message.intent = String(object.intent); + if (object.event != null) + message.event = String(object.event); + if (object.cxSessionParameters != null) { + if (typeof object.cxSessionParameters !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AutomatedAgentReply.cxSessionParameters: object expected"); + message.cxSessionParameters = $root.google.protobuf.Struct.fromObject(object.cxSessionParameters); + } + return message; + }; + + /** + * Creates a plain object from an AutomatedAgentReply message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @static + * @param {google.cloud.dialogflow.v2beta1.AutomatedAgentReply} message AutomatedAgentReply + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AutomatedAgentReply.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.responseMessages = []; + if (options.defaults) + object.cxSessionParameters = null; + if (message.detectIntentResponse != null && message.hasOwnProperty("detectIntentResponse")) { + object.detectIntentResponse = $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse.toObject(message.detectIntentResponse, options); + if (options.oneofs) + object.response = "detectIntentResponse"; + } + if (message.responseMessages && message.responseMessages.length) { + object.responseMessages = []; + for (var j = 0; j < message.responseMessages.length; ++j) + object.responseMessages[j] = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.toObject(message.responseMessages[j], options); + } + if (message.intent != null && message.hasOwnProperty("intent")) { + object.intent = message.intent; + if (options.oneofs) + object.match = "intent"; + } + if (message.event != null && message.hasOwnProperty("event")) { + object.event = message.event; + if (options.oneofs) + object.match = "event"; + } + if (message.cxSessionParameters != null && message.hasOwnProperty("cxSessionParameters")) + object.cxSessionParameters = $root.google.protobuf.Struct.toObject(message.cxSessionParameters, options); + return object; + }; + + /** + * Converts this AutomatedAgentReply to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentReply + * @instance + * @returns {Object.} JSON object + */ + AutomatedAgentReply.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AutomatedAgentReply; + })(); + + v2beta1.SuggestionFeature = (function() { + + /** + * Properties of a SuggestionFeature. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISuggestionFeature + * @property {google.cloud.dialogflow.v2beta1.SuggestionFeature.Type|null} [type] SuggestionFeature type + */ + + /** + * Constructs a new SuggestionFeature. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SuggestionFeature. + * @implements ISuggestionFeature + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISuggestionFeature=} [properties] Properties to set + */ + function SuggestionFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestionFeature type. + * @member {google.cloud.dialogflow.v2beta1.SuggestionFeature.Type} type + * @memberof google.cloud.dialogflow.v2beta1.SuggestionFeature + * @instance + */ + SuggestionFeature.prototype.type = 0; + + /** + * Creates a new SuggestionFeature instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SuggestionFeature + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestionFeature=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SuggestionFeature} SuggestionFeature instance + */ + SuggestionFeature.create = function create(properties) { + return new SuggestionFeature(properties); + }; + + /** + * Encodes the specified SuggestionFeature message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestionFeature.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SuggestionFeature + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestionFeature} message SuggestionFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + return writer; + }; + + /** + * Encodes the specified SuggestionFeature message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestionFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestionFeature + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestionFeature} message SuggestionFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestionFeature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SuggestionFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SuggestionFeature} SuggestionFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionFeature.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SuggestionFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.type = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestionFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestionFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SuggestionFeature} SuggestionFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestionFeature message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SuggestionFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a SuggestionFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestionFeature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SuggestionFeature} SuggestionFeature + */ + SuggestionFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SuggestionFeature) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SuggestionFeature(); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ARTICLE_SUGGESTION": + case 1: + message.type = 1; + break; + case "FAQ": + case 2: + message.type = 2; + break; + case "SMART_REPLY": + case 3: + message.type = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a SuggestionFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestionFeature + * @static + * @param {google.cloud.dialogflow.v2beta1.SuggestionFeature} message SuggestionFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionFeature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.SuggestionFeature.Type[message.type] : message.type; + return object; + }; + + /** + * Converts this SuggestionFeature to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SuggestionFeature + * @instance + * @returns {Object.} JSON object + */ + SuggestionFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.dialogflow.v2beta1.SuggestionFeature.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ARTICLE_SUGGESTION=1 ARTICLE_SUGGESTION value + * @property {number} FAQ=2 FAQ value + * @property {number} SMART_REPLY=3 SMART_REPLY value + */ + SuggestionFeature.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ARTICLE_SUGGESTION"] = 1; + values[valuesById[2] = "FAQ"] = 2; + values[valuesById[3] = "SMART_REPLY"] = 3; + return values; + })(); + + return SuggestionFeature; + })(); + + v2beta1.AnalyzeContentRequest = (function() { + + /** + * Properties of an AnalyzeContentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IAnalyzeContentRequest + * @property {string|null} [participant] AnalyzeContentRequest participant + * @property {google.cloud.dialogflow.v2beta1.IInputText|null} [text] AnalyzeContentRequest text + * @property {google.cloud.dialogflow.v2beta1.IInputAudio|null} [audio] AnalyzeContentRequest audio + * @property {google.cloud.dialogflow.v2beta1.ITextInput|null} [textInput] AnalyzeContentRequest textInput + * @property {google.cloud.dialogflow.v2beta1.IAudioInput|null} [audioInput] AnalyzeContentRequest audioInput + * @property {google.cloud.dialogflow.v2beta1.IEventInput|null} [eventInput] AnalyzeContentRequest eventInput + * @property {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null} [replyAudioConfig] AnalyzeContentRequest replyAudioConfig + * @property {google.cloud.dialogflow.v2beta1.IQueryParameters|null} [queryParams] AnalyzeContentRequest queryParams + * @property {google.protobuf.ITimestamp|null} [messageSendTime] AnalyzeContentRequest messageSendTime + * @property {string|null} [requestId] AnalyzeContentRequest requestId + */ + + /** + * Constructs a new AnalyzeContentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an AnalyzeContentRequest. + * @implements IAnalyzeContentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest=} [properties] Properties to set + */ + function AnalyzeContentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeContentRequest participant. + * @member {string} participant + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.participant = ""; + + /** + * AnalyzeContentRequest text. + * @member {google.cloud.dialogflow.v2beta1.IInputText|null|undefined} text + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.text = null; + + /** + * AnalyzeContentRequest audio. + * @member {google.cloud.dialogflow.v2beta1.IInputAudio|null|undefined} audio + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.audio = null; + + /** + * AnalyzeContentRequest textInput. + * @member {google.cloud.dialogflow.v2beta1.ITextInput|null|undefined} textInput + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.textInput = null; + + /** + * AnalyzeContentRequest audioInput. + * @member {google.cloud.dialogflow.v2beta1.IAudioInput|null|undefined} audioInput + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.audioInput = null; + + /** + * AnalyzeContentRequest eventInput. + * @member {google.cloud.dialogflow.v2beta1.IEventInput|null|undefined} eventInput + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.eventInput = null; + + /** + * AnalyzeContentRequest replyAudioConfig. + * @member {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null|undefined} replyAudioConfig + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.replyAudioConfig = null; + + /** + * AnalyzeContentRequest queryParams. + * @member {google.cloud.dialogflow.v2beta1.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.queryParams = null; + + /** + * AnalyzeContentRequest messageSendTime. + * @member {google.protobuf.ITimestamp|null|undefined} messageSendTime + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.messageSendTime = null; + + /** + * AnalyzeContentRequest requestId. + * @member {string} requestId + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @instance + */ + AnalyzeContentRequest.prototype.requestId = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * AnalyzeContentRequest input. + * @member {"text"|"audio"|"textInput"|"audioInput"|"eventInput"|undefined} input + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @instance + */ + Object.defineProperty(AnalyzeContentRequest.prototype, "input", { + get: $util.oneOfGetter($oneOfFields = ["text", "audio", "textInput", "audioInput", "eventInput"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AnalyzeContentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.AnalyzeContentRequest} AnalyzeContentRequest instance + */ + AnalyzeContentRequest.create = function create(properties) { + return new AnalyzeContentRequest(properties); + }; + + /** + * Encodes the specified AnalyzeContentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest} message AnalyzeContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeContentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.participant); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.dialogflow.v2beta1.InputText.encode(message.text, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.audio != null && Object.hasOwnProperty.call(message, "audio")) + $root.google.cloud.dialogflow.v2beta1.InputAudio.encode(message.audio, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.replyAudioConfig != null && Object.hasOwnProperty.call(message, "replyAudioConfig")) + $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.encode(message.replyAudioConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.textInput != null && Object.hasOwnProperty.call(message, "textInput")) + $root.google.cloud.dialogflow.v2beta1.TextInput.encode(message.textInput, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.audioInput != null && Object.hasOwnProperty.call(message, "audioInput")) + $root.google.cloud.dialogflow.v2beta1.AudioInput.encode(message.audioInput, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.eventInput != null && Object.hasOwnProperty.call(message, "eventInput")) + $root.google.cloud.dialogflow.v2beta1.EventInput.encode(message.eventInput, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.v2beta1.QueryParameters.encode(message.queryParams, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.messageSendTime != null && Object.hasOwnProperty.call(message, "messageSendTime")) + $root.google.protobuf.Timestamp.encode(message.messageSendTime, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified AnalyzeContentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest} message AnalyzeContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.AnalyzeContentRequest} AnalyzeContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeContentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.AnalyzeContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.participant = reader.string(); + break; + case 3: + message.text = $root.google.cloud.dialogflow.v2beta1.InputText.decode(reader, reader.uint32()); + break; + case 4: + message.audio = $root.google.cloud.dialogflow.v2beta1.InputAudio.decode(reader, reader.uint32()); + break; + case 6: + message.textInput = $root.google.cloud.dialogflow.v2beta1.TextInput.decode(reader, reader.uint32()); + break; + case 7: + message.audioInput = $root.google.cloud.dialogflow.v2beta1.AudioInput.decode(reader, reader.uint32()); + break; + case 8: + message.eventInput = $root.google.cloud.dialogflow.v2beta1.EventInput.decode(reader, reader.uint32()); + break; + case 5: + message.replyAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.decode(reader, reader.uint32()); + break; + case 9: + message.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.decode(reader, reader.uint32()); + break; + case 10: + message.messageSendTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 11: + message.requestId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.AnalyzeContentRequest} AnalyzeContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeContentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeContentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + if (message.text != null && message.hasOwnProperty("text")) { + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.InputText.verify(message.text); + if (error) + return "text." + error; + } + } + if (message.audio != null && message.hasOwnProperty("audio")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.InputAudio.verify(message.audio); + if (error) + return "audio." + error; + } + } + if (message.textInput != null && message.hasOwnProperty("textInput")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.TextInput.verify(message.textInput); + if (error) + return "textInput." + error; + } + } + if (message.audioInput != null && message.hasOwnProperty("audioInput")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.AudioInput.verify(message.audioInput); + if (error) + return "audioInput." + error; + } + } + if (message.eventInput != null && message.hasOwnProperty("eventInput")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.EventInput.verify(message.eventInput); + if (error) + return "eventInput." + error; + } + } + if (message.replyAudioConfig != null && message.hasOwnProperty("replyAudioConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify(message.replyAudioConfig); + if (error) + return "replyAudioConfig." + error; + } + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.v2beta1.QueryParameters.verify(message.queryParams); + if (error) + return "queryParams." + error; + } + if (message.messageSendTime != null && message.hasOwnProperty("messageSendTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.messageSendTime); + if (error) + return "messageSendTime." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an AnalyzeContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.AnalyzeContentRequest} AnalyzeContentRequest + */ + AnalyzeContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.AnalyzeContentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.AnalyzeContentRequest(); + if (object.participant != null) + message.participant = String(object.participant); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.text: object expected"); + message.text = $root.google.cloud.dialogflow.v2beta1.InputText.fromObject(object.text); + } + if (object.audio != null) { + if (typeof object.audio !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.audio: object expected"); + message.audio = $root.google.cloud.dialogflow.v2beta1.InputAudio.fromObject(object.audio); + } + if (object.textInput != null) { + if (typeof object.textInput !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.textInput: object expected"); + message.textInput = $root.google.cloud.dialogflow.v2beta1.TextInput.fromObject(object.textInput); + } + if (object.audioInput != null) { + if (typeof object.audioInput !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.audioInput: object expected"); + message.audioInput = $root.google.cloud.dialogflow.v2beta1.AudioInput.fromObject(object.audioInput); + } + if (object.eventInput != null) { + if (typeof object.eventInput !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.eventInput: object expected"); + message.eventInput = $root.google.cloud.dialogflow.v2beta1.EventInput.fromObject(object.eventInput); + } + if (object.replyAudioConfig != null) { + if (typeof object.replyAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.replyAudioConfig: object expected"); + message.replyAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.fromObject(object.replyAudioConfig); + } + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.fromObject(object.queryParams); + } + if (object.messageSendTime != null) { + if (typeof object.messageSendTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentRequest.messageSendTime: object expected"); + message.messageSendTime = $root.google.protobuf.Timestamp.fromObject(object.messageSendTime); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an AnalyzeContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.AnalyzeContentRequest} message AnalyzeContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.participant = ""; + object.replyAudioConfig = null; + object.queryParams = null; + object.messageSendTime = null; + object.requestId = ""; + } + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = $root.google.cloud.dialogflow.v2beta1.InputText.toObject(message.text, options); + if (options.oneofs) + object.input = "text"; + } + if (message.audio != null && message.hasOwnProperty("audio")) { + object.audio = $root.google.cloud.dialogflow.v2beta1.InputAudio.toObject(message.audio, options); + if (options.oneofs) + object.input = "audio"; + } + if (message.replyAudioConfig != null && message.hasOwnProperty("replyAudioConfig")) + object.replyAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.toObject(message.replyAudioConfig, options); + if (message.textInput != null && message.hasOwnProperty("textInput")) { + object.textInput = $root.google.cloud.dialogflow.v2beta1.TextInput.toObject(message.textInput, options); + if (options.oneofs) + object.input = "textInput"; + } + if (message.audioInput != null && message.hasOwnProperty("audioInput")) { + object.audioInput = $root.google.cloud.dialogflow.v2beta1.AudioInput.toObject(message.audioInput, options); + if (options.oneofs) + object.input = "audioInput"; + } + if (message.eventInput != null && message.hasOwnProperty("eventInput")) { + object.eventInput = $root.google.cloud.dialogflow.v2beta1.EventInput.toObject(message.eventInput, options); + if (options.oneofs) + object.input = "eventInput"; + } + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.toObject(message.queryParams, options); + if (message.messageSendTime != null && message.hasOwnProperty("messageSendTime")) + object.messageSendTime = $root.google.protobuf.Timestamp.toObject(message.messageSendTime, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this AnalyzeContentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentRequest + * @instance + * @returns {Object.} JSON object + */ + AnalyzeContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnalyzeContentRequest; + })(); + + v2beta1.DtmfParameters = (function() { + + /** + * Properties of a DtmfParameters. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IDtmfParameters + * @property {boolean|null} [acceptsDtmfInput] DtmfParameters acceptsDtmfInput + */ + + /** + * Constructs a new DtmfParameters. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a DtmfParameters. + * @implements IDtmfParameters + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IDtmfParameters=} [properties] Properties to set + */ + function DtmfParameters(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DtmfParameters acceptsDtmfInput. + * @member {boolean} acceptsDtmfInput + * @memberof google.cloud.dialogflow.v2beta1.DtmfParameters + * @instance + */ + DtmfParameters.prototype.acceptsDtmfInput = false; + + /** + * Creates a new DtmfParameters instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.DtmfParameters + * @static + * @param {google.cloud.dialogflow.v2beta1.IDtmfParameters=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DtmfParameters} DtmfParameters instance + */ + DtmfParameters.create = function create(properties) { + return new DtmfParameters(properties); + }; + + /** + * Encodes the specified DtmfParameters message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DtmfParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.DtmfParameters + * @static + * @param {google.cloud.dialogflow.v2beta1.IDtmfParameters} message DtmfParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DtmfParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.acceptsDtmfInput != null && Object.hasOwnProperty.call(message, "acceptsDtmfInput")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.acceptsDtmfInput); + return writer; + }; + + /** + * Encodes the specified DtmfParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DtmfParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DtmfParameters + * @static + * @param {google.cloud.dialogflow.v2beta1.IDtmfParameters} message DtmfParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DtmfParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DtmfParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.DtmfParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.DtmfParameters} DtmfParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DtmfParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DtmfParameters(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.acceptsDtmfInput = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DtmfParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DtmfParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.DtmfParameters} DtmfParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DtmfParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DtmfParameters message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.DtmfParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DtmfParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.acceptsDtmfInput != null && message.hasOwnProperty("acceptsDtmfInput")) + if (typeof message.acceptsDtmfInput !== "boolean") + return "acceptsDtmfInput: boolean expected"; + return null; + }; + + /** + * Creates a DtmfParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.DtmfParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.DtmfParameters} DtmfParameters + */ + DtmfParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DtmfParameters) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.DtmfParameters(); + if (object.acceptsDtmfInput != null) + message.acceptsDtmfInput = Boolean(object.acceptsDtmfInput); + return message; + }; + + /** + * Creates a plain object from a DtmfParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.DtmfParameters + * @static + * @param {google.cloud.dialogflow.v2beta1.DtmfParameters} message DtmfParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DtmfParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.acceptsDtmfInput = false; + if (message.acceptsDtmfInput != null && message.hasOwnProperty("acceptsDtmfInput")) + object.acceptsDtmfInput = message.acceptsDtmfInput; + return object; + }; + + /** + * Converts this DtmfParameters to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.DtmfParameters + * @instance + * @returns {Object.} JSON object + */ + DtmfParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DtmfParameters; + })(); + + v2beta1.AnalyzeContentResponse = (function() { + + /** + * Properties of an AnalyzeContentResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IAnalyzeContentResponse + * @property {string|null} [replyText] AnalyzeContentResponse replyText + * @property {google.cloud.dialogflow.v2beta1.IOutputAudio|null} [replyAudio] AnalyzeContentResponse replyAudio + * @property {google.cloud.dialogflow.v2beta1.IAutomatedAgentReply|null} [automatedAgentReply] AnalyzeContentResponse automatedAgentReply + * @property {google.cloud.dialogflow.v2beta1.IMessage|null} [message] AnalyzeContentResponse message + * @property {Array.|null} [humanAgentSuggestionResults] AnalyzeContentResponse humanAgentSuggestionResults + * @property {Array.|null} [endUserSuggestionResults] AnalyzeContentResponse endUserSuggestionResults + * @property {google.cloud.dialogflow.v2beta1.IDtmfParameters|null} [dtmfParameters] AnalyzeContentResponse dtmfParameters + */ + + /** + * Constructs a new AnalyzeContentResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an AnalyzeContentResponse. + * @implements IAnalyzeContentResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse=} [properties] Properties to set + */ + function AnalyzeContentResponse(properties) { + this.humanAgentSuggestionResults = []; + this.endUserSuggestionResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnalyzeContentResponse replyText. + * @member {string} replyText + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @instance + */ + AnalyzeContentResponse.prototype.replyText = ""; + + /** + * AnalyzeContentResponse replyAudio. + * @member {google.cloud.dialogflow.v2beta1.IOutputAudio|null|undefined} replyAudio + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @instance + */ + AnalyzeContentResponse.prototype.replyAudio = null; + + /** + * AnalyzeContentResponse automatedAgentReply. + * @member {google.cloud.dialogflow.v2beta1.IAutomatedAgentReply|null|undefined} automatedAgentReply + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @instance + */ + AnalyzeContentResponse.prototype.automatedAgentReply = null; + + /** + * AnalyzeContentResponse message. + * @member {google.cloud.dialogflow.v2beta1.IMessage|null|undefined} message + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @instance + */ + AnalyzeContentResponse.prototype.message = null; + + /** + * AnalyzeContentResponse humanAgentSuggestionResults. + * @member {Array.} humanAgentSuggestionResults + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @instance + */ + AnalyzeContentResponse.prototype.humanAgentSuggestionResults = $util.emptyArray; + + /** + * AnalyzeContentResponse endUserSuggestionResults. + * @member {Array.} endUserSuggestionResults + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @instance + */ + AnalyzeContentResponse.prototype.endUserSuggestionResults = $util.emptyArray; + + /** + * AnalyzeContentResponse dtmfParameters. + * @member {google.cloud.dialogflow.v2beta1.IDtmfParameters|null|undefined} dtmfParameters + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @instance + */ + AnalyzeContentResponse.prototype.dtmfParameters = null; + + /** + * Creates a new AnalyzeContentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.AnalyzeContentResponse} AnalyzeContentResponse instance + */ + AnalyzeContentResponse.create = function create(properties) { + return new AnalyzeContentResponse(properties); + }; + + /** + * Encodes the specified AnalyzeContentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse} message AnalyzeContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeContentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.replyText != null && Object.hasOwnProperty.call(message, "replyText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.replyText); + if (message.replyAudio != null && Object.hasOwnProperty.call(message, "replyAudio")) + $root.google.cloud.dialogflow.v2beta1.OutputAudio.encode(message.replyAudio, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.automatedAgentReply != null && Object.hasOwnProperty.call(message, "automatedAgentReply")) + $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply.encode(message.automatedAgentReply, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.cloud.dialogflow.v2beta1.Message.encode(message.message, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.humanAgentSuggestionResults != null && message.humanAgentSuggestionResults.length) + for (var i = 0; i < message.humanAgentSuggestionResults.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SuggestionResult.encode(message.humanAgentSuggestionResults[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.endUserSuggestionResults != null && message.endUserSuggestionResults.length) + for (var i = 0; i < message.endUserSuggestionResults.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SuggestionResult.encode(message.endUserSuggestionResults[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.dtmfParameters != null && Object.hasOwnProperty.call(message, "dtmfParameters")) + $root.google.cloud.dialogflow.v2beta1.DtmfParameters.encode(message.dtmfParameters, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnalyzeContentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse} message AnalyzeContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnalyzeContentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnalyzeContentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.AnalyzeContentResponse} AnalyzeContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeContentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.AnalyzeContentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.replyText = reader.string(); + break; + case 2: + message.replyAudio = $root.google.cloud.dialogflow.v2beta1.OutputAudio.decode(reader, reader.uint32()); + break; + case 3: + message.automatedAgentReply = $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply.decode(reader, reader.uint32()); + break; + case 5: + message.message = $root.google.cloud.dialogflow.v2beta1.Message.decode(reader, reader.uint32()); + break; + case 6: + if (!(message.humanAgentSuggestionResults && message.humanAgentSuggestionResults.length)) + message.humanAgentSuggestionResults = []; + message.humanAgentSuggestionResults.push($root.google.cloud.dialogflow.v2beta1.SuggestionResult.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.endUserSuggestionResults && message.endUserSuggestionResults.length)) + message.endUserSuggestionResults = []; + message.endUserSuggestionResults.push($root.google.cloud.dialogflow.v2beta1.SuggestionResult.decode(reader, reader.uint32())); + break; + case 9: + message.dtmfParameters = $root.google.cloud.dialogflow.v2beta1.DtmfParameters.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnalyzeContentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.AnalyzeContentResponse} AnalyzeContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnalyzeContentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnalyzeContentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnalyzeContentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.replyText != null && message.hasOwnProperty("replyText")) + if (!$util.isString(message.replyText)) + return "replyText: string expected"; + if (message.replyAudio != null && message.hasOwnProperty("replyAudio")) { + var error = $root.google.cloud.dialogflow.v2beta1.OutputAudio.verify(message.replyAudio); + if (error) + return "replyAudio." + error; + } + if (message.automatedAgentReply != null && message.hasOwnProperty("automatedAgentReply")) { + var error = $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply.verify(message.automatedAgentReply); + if (error) + return "automatedAgentReply." + error; + } + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.cloud.dialogflow.v2beta1.Message.verify(message.message); + if (error) + return "message." + error; + } + if (message.humanAgentSuggestionResults != null && message.hasOwnProperty("humanAgentSuggestionResults")) { + if (!Array.isArray(message.humanAgentSuggestionResults)) + return "humanAgentSuggestionResults: array expected"; + for (var i = 0; i < message.humanAgentSuggestionResults.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.verify(message.humanAgentSuggestionResults[i]); + if (error) + return "humanAgentSuggestionResults." + error; + } + } + if (message.endUserSuggestionResults != null && message.hasOwnProperty("endUserSuggestionResults")) { + if (!Array.isArray(message.endUserSuggestionResults)) + return "endUserSuggestionResults: array expected"; + for (var i = 0; i < message.endUserSuggestionResults.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.verify(message.endUserSuggestionResults[i]); + if (error) + return "endUserSuggestionResults." + error; + } + } + if (message.dtmfParameters != null && message.hasOwnProperty("dtmfParameters")) { + var error = $root.google.cloud.dialogflow.v2beta1.DtmfParameters.verify(message.dtmfParameters); + if (error) + return "dtmfParameters." + error; + } + return null; + }; + + /** + * Creates an AnalyzeContentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.AnalyzeContentResponse} AnalyzeContentResponse + */ + AnalyzeContentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.AnalyzeContentResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.AnalyzeContentResponse(); + if (object.replyText != null) + message.replyText = String(object.replyText); + if (object.replyAudio != null) { + if (typeof object.replyAudio !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.replyAudio: object expected"); + message.replyAudio = $root.google.cloud.dialogflow.v2beta1.OutputAudio.fromObject(object.replyAudio); + } + if (object.automatedAgentReply != null) { + if (typeof object.automatedAgentReply !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.automatedAgentReply: object expected"); + message.automatedAgentReply = $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply.fromObject(object.automatedAgentReply); + } + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.message: object expected"); + message.message = $root.google.cloud.dialogflow.v2beta1.Message.fromObject(object.message); + } + if (object.humanAgentSuggestionResults) { + if (!Array.isArray(object.humanAgentSuggestionResults)) + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.humanAgentSuggestionResults: array expected"); + message.humanAgentSuggestionResults = []; + for (var i = 0; i < object.humanAgentSuggestionResults.length; ++i) { + if (typeof object.humanAgentSuggestionResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.humanAgentSuggestionResults: object expected"); + message.humanAgentSuggestionResults[i] = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.fromObject(object.humanAgentSuggestionResults[i]); + } + } + if (object.endUserSuggestionResults) { + if (!Array.isArray(object.endUserSuggestionResults)) + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.endUserSuggestionResults: array expected"); + message.endUserSuggestionResults = []; + for (var i = 0; i < object.endUserSuggestionResults.length; ++i) { + if (typeof object.endUserSuggestionResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.endUserSuggestionResults: object expected"); + message.endUserSuggestionResults[i] = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.fromObject(object.endUserSuggestionResults[i]); + } + } + if (object.dtmfParameters != null) { + if (typeof object.dtmfParameters !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnalyzeContentResponse.dtmfParameters: object expected"); + message.dtmfParameters = $root.google.cloud.dialogflow.v2beta1.DtmfParameters.fromObject(object.dtmfParameters); + } + return message; + }; + + /** + * Creates a plain object from an AnalyzeContentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.AnalyzeContentResponse} message AnalyzeContentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnalyzeContentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.humanAgentSuggestionResults = []; + object.endUserSuggestionResults = []; + } + if (options.defaults) { + object.replyText = ""; + object.replyAudio = null; + object.automatedAgentReply = null; + object.message = null; + object.dtmfParameters = null; + } + if (message.replyText != null && message.hasOwnProperty("replyText")) + object.replyText = message.replyText; + if (message.replyAudio != null && message.hasOwnProperty("replyAudio")) + object.replyAudio = $root.google.cloud.dialogflow.v2beta1.OutputAudio.toObject(message.replyAudio, options); + if (message.automatedAgentReply != null && message.hasOwnProperty("automatedAgentReply")) + object.automatedAgentReply = $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply.toObject(message.automatedAgentReply, options); + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.cloud.dialogflow.v2beta1.Message.toObject(message.message, options); + if (message.humanAgentSuggestionResults && message.humanAgentSuggestionResults.length) { + object.humanAgentSuggestionResults = []; + for (var j = 0; j < message.humanAgentSuggestionResults.length; ++j) + object.humanAgentSuggestionResults[j] = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.toObject(message.humanAgentSuggestionResults[j], options); + } + if (message.endUserSuggestionResults && message.endUserSuggestionResults.length) { + object.endUserSuggestionResults = []; + for (var j = 0; j < message.endUserSuggestionResults.length; ++j) + object.endUserSuggestionResults[j] = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.toObject(message.endUserSuggestionResults[j], options); + } + if (message.dtmfParameters != null && message.hasOwnProperty("dtmfParameters")) + object.dtmfParameters = $root.google.cloud.dialogflow.v2beta1.DtmfParameters.toObject(message.dtmfParameters, options); + return object; + }; + + /** + * Converts this AnalyzeContentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.AnalyzeContentResponse + * @instance + * @returns {Object.} JSON object + */ + AnalyzeContentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnalyzeContentResponse; + })(); + + v2beta1.InputTextConfig = (function() { + + /** + * Properties of an InputTextConfig. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IInputTextConfig + * @property {string|null} [languageCode] InputTextConfig languageCode + */ + + /** + * Constructs a new InputTextConfig. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an InputTextConfig. + * @implements IInputTextConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IInputTextConfig=} [properties] Properties to set + */ + function InputTextConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InputTextConfig languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.InputTextConfig + * @instance + */ + InputTextConfig.prototype.languageCode = ""; + + /** + * Creates a new InputTextConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.InputTextConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.IInputTextConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.InputTextConfig} InputTextConfig instance + */ + InputTextConfig.create = function create(properties) { + return new InputTextConfig(properties); + }; + + /** + * Encodes the specified InputTextConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputTextConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.InputTextConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.IInputTextConfig} message InputTextConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputTextConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified InputTextConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.InputTextConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.InputTextConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.IInputTextConfig} message InputTextConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InputTextConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InputTextConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.InputTextConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.InputTextConfig} InputTextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputTextConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.InputTextConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InputTextConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.InputTextConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.InputTextConfig} InputTextConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InputTextConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InputTextConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.InputTextConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InputTextConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an InputTextConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.InputTextConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.InputTextConfig} InputTextConfig + */ + InputTextConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.InputTextConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.InputTextConfig(); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an InputTextConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.InputTextConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.InputTextConfig} message InputTextConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InputTextConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.languageCode = ""; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this InputTextConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.InputTextConfig + * @instance + * @returns {Object.} JSON object + */ + InputTextConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return InputTextConfig; + })(); + + v2beta1.StreamingAnalyzeContentRequest = (function() { + + /** + * Properties of a StreamingAnalyzeContentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IStreamingAnalyzeContentRequest + * @property {string|null} [participant] StreamingAnalyzeContentRequest participant + * @property {google.cloud.dialogflow.v2beta1.IInputAudioConfig|null} [audioConfig] StreamingAnalyzeContentRequest audioConfig + * @property {google.cloud.dialogflow.v2beta1.IInputTextConfig|null} [textConfig] StreamingAnalyzeContentRequest textConfig + * @property {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null} [replyAudioConfig] StreamingAnalyzeContentRequest replyAudioConfig + * @property {Uint8Array|null} [inputAudio] StreamingAnalyzeContentRequest inputAudio + * @property {string|null} [inputText] StreamingAnalyzeContentRequest inputText + * @property {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents|null} [inputDtmf] StreamingAnalyzeContentRequest inputDtmf + * @property {google.cloud.dialogflow.v2beta1.IQueryParameters|null} [queryParams] StreamingAnalyzeContentRequest queryParams + * @property {boolean|null} [enableExtendedStreaming] StreamingAnalyzeContentRequest enableExtendedStreaming + */ + + /** + * Constructs a new StreamingAnalyzeContentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a StreamingAnalyzeContentRequest. + * @implements IStreamingAnalyzeContentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentRequest=} [properties] Properties to set + */ + function StreamingAnalyzeContentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingAnalyzeContentRequest participant. + * @member {string} participant + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @instance + */ + StreamingAnalyzeContentRequest.prototype.participant = ""; + + /** + * StreamingAnalyzeContentRequest audioConfig. + * @member {google.cloud.dialogflow.v2beta1.IInputAudioConfig|null|undefined} audioConfig + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @instance + */ + StreamingAnalyzeContentRequest.prototype.audioConfig = null; + + /** + * StreamingAnalyzeContentRequest textConfig. + * @member {google.cloud.dialogflow.v2beta1.IInputTextConfig|null|undefined} textConfig + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @instance + */ + StreamingAnalyzeContentRequest.prototype.textConfig = null; + + /** + * StreamingAnalyzeContentRequest replyAudioConfig. + * @member {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null|undefined} replyAudioConfig + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @instance + */ + StreamingAnalyzeContentRequest.prototype.replyAudioConfig = null; + + /** + * StreamingAnalyzeContentRequest inputAudio. + * @member {Uint8Array} inputAudio + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @instance + */ + StreamingAnalyzeContentRequest.prototype.inputAudio = $util.newBuffer([]); + + /** + * StreamingAnalyzeContentRequest inputText. + * @member {string} inputText + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @instance + */ + StreamingAnalyzeContentRequest.prototype.inputText = ""; + + /** + * StreamingAnalyzeContentRequest inputDtmf. + * @member {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents|null|undefined} inputDtmf + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @instance + */ + StreamingAnalyzeContentRequest.prototype.inputDtmf = null; + + /** + * StreamingAnalyzeContentRequest queryParams. + * @member {google.cloud.dialogflow.v2beta1.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @instance + */ + StreamingAnalyzeContentRequest.prototype.queryParams = null; + + /** + * StreamingAnalyzeContentRequest enableExtendedStreaming. + * @member {boolean} enableExtendedStreaming + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @instance + */ + StreamingAnalyzeContentRequest.prototype.enableExtendedStreaming = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * StreamingAnalyzeContentRequest config. + * @member {"audioConfig"|"textConfig"|undefined} config + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @instance + */ + Object.defineProperty(StreamingAnalyzeContentRequest.prototype, "config", { + get: $util.oneOfGetter($oneOfFields = ["audioConfig", "textConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * StreamingAnalyzeContentRequest input. + * @member {"inputAudio"|"inputText"|"inputDtmf"|undefined} input + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @instance + */ + Object.defineProperty(StreamingAnalyzeContentRequest.prototype, "input", { + get: $util.oneOfGetter($oneOfFields = ["inputAudio", "inputText", "inputDtmf"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new StreamingAnalyzeContentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest} StreamingAnalyzeContentRequest instance + */ + StreamingAnalyzeContentRequest.create = function create(properties) { + return new StreamingAnalyzeContentRequest(properties); + }; + + /** + * Encodes the specified StreamingAnalyzeContentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentRequest} message StreamingAnalyzeContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAnalyzeContentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.participant); + if (message.audioConfig != null && Object.hasOwnProperty.call(message, "audioConfig")) + $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.encode(message.audioConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.textConfig != null && Object.hasOwnProperty.call(message, "textConfig")) + $root.google.cloud.dialogflow.v2beta1.InputTextConfig.encode(message.textConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.replyAudioConfig != null && Object.hasOwnProperty.call(message, "replyAudioConfig")) + $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.encode(message.replyAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputAudio != null && Object.hasOwnProperty.call(message, "inputAudio")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.inputAudio); + if (message.inputText != null && Object.hasOwnProperty.call(message, "inputText")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.inputText); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.v2beta1.QueryParameters.encode(message.queryParams, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.inputDtmf != null && Object.hasOwnProperty.call(message, "inputDtmf")) + $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.encode(message.inputDtmf, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.enableExtendedStreaming != null && Object.hasOwnProperty.call(message, "enableExtendedStreaming")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableExtendedStreaming); + return writer; + }; + + /** + * Encodes the specified StreamingAnalyzeContentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentRequest} message StreamingAnalyzeContentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAnalyzeContentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingAnalyzeContentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest} StreamingAnalyzeContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAnalyzeContentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.participant = reader.string(); + break; + case 2: + message.audioConfig = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.decode(reader, reader.uint32()); + break; + case 3: + message.textConfig = $root.google.cloud.dialogflow.v2beta1.InputTextConfig.decode(reader, reader.uint32()); + break; + case 4: + message.replyAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.decode(reader, reader.uint32()); + break; + case 5: + message.inputAudio = reader.bytes(); + break; + case 6: + message.inputText = reader.string(); + break; + case 9: + message.inputDtmf = $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.decode(reader, reader.uint32()); + break; + case 7: + message.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.decode(reader, reader.uint32()); + break; + case 11: + message.enableExtendedStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingAnalyzeContentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest} StreamingAnalyzeContentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAnalyzeContentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingAnalyzeContentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingAnalyzeContentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { + properties.config = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.verify(message.audioConfig); + if (error) + return "audioConfig." + error; + } + } + if (message.textConfig != null && message.hasOwnProperty("textConfig")) { + if (properties.config === 1) + return "config: multiple values"; + properties.config = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.InputTextConfig.verify(message.textConfig); + if (error) + return "textConfig." + error; + } + } + if (message.replyAudioConfig != null && message.hasOwnProperty("replyAudioConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify(message.replyAudioConfig); + if (error) + return "replyAudioConfig." + error; + } + if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) { + properties.input = 1; + if (!(message.inputAudio && typeof message.inputAudio.length === "number" || $util.isString(message.inputAudio))) + return "inputAudio: buffer expected"; + } + if (message.inputText != null && message.hasOwnProperty("inputText")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + if (!$util.isString(message.inputText)) + return "inputText: string expected"; + } + if (message.inputDtmf != null && message.hasOwnProperty("inputDtmf")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.verify(message.inputDtmf); + if (error) + return "inputDtmf." + error; + } + } + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.v2beta1.QueryParameters.verify(message.queryParams); + if (error) + return "queryParams." + error; + } + if (message.enableExtendedStreaming != null && message.hasOwnProperty("enableExtendedStreaming")) + if (typeof message.enableExtendedStreaming !== "boolean") + return "enableExtendedStreaming: boolean expected"; + return null; + }; + + /** + * Creates a StreamingAnalyzeContentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest} StreamingAnalyzeContentRequest + */ + StreamingAnalyzeContentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest(); + if (object.participant != null) + message.participant = String(object.participant); + if (object.audioConfig != null) { + if (typeof object.audioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.audioConfig: object expected"); + message.audioConfig = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.fromObject(object.audioConfig); + } + if (object.textConfig != null) { + if (typeof object.textConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.textConfig: object expected"); + message.textConfig = $root.google.cloud.dialogflow.v2beta1.InputTextConfig.fromObject(object.textConfig); + } + if (object.replyAudioConfig != null) { + if (typeof object.replyAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.replyAudioConfig: object expected"); + message.replyAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.fromObject(object.replyAudioConfig); + } + if (object.inputAudio != null) + if (typeof object.inputAudio === "string") + $util.base64.decode(object.inputAudio, message.inputAudio = $util.newBuffer($util.base64.length(object.inputAudio)), 0); + else if (object.inputAudio.length) + message.inputAudio = object.inputAudio; + if (object.inputText != null) + message.inputText = String(object.inputText); + if (object.inputDtmf != null) { + if (typeof object.inputDtmf !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.inputDtmf: object expected"); + message.inputDtmf = $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.fromObject(object.inputDtmf); + } + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.fromObject(object.queryParams); + } + if (object.enableExtendedStreaming != null) + message.enableExtendedStreaming = Boolean(object.enableExtendedStreaming); + return message; + }; + + /** + * Creates a plain object from a StreamingAnalyzeContentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest} message StreamingAnalyzeContentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingAnalyzeContentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.participant = ""; + object.replyAudioConfig = null; + object.queryParams = null; + object.enableExtendedStreaming = false; + } + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { + object.audioConfig = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.toObject(message.audioConfig, options); + if (options.oneofs) + object.config = "audioConfig"; + } + if (message.textConfig != null && message.hasOwnProperty("textConfig")) { + object.textConfig = $root.google.cloud.dialogflow.v2beta1.InputTextConfig.toObject(message.textConfig, options); + if (options.oneofs) + object.config = "textConfig"; + } + if (message.replyAudioConfig != null && message.hasOwnProperty("replyAudioConfig")) + object.replyAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.toObject(message.replyAudioConfig, options); + if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) { + object.inputAudio = options.bytes === String ? $util.base64.encode(message.inputAudio, 0, message.inputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputAudio) : message.inputAudio; + if (options.oneofs) + object.input = "inputAudio"; + } + if (message.inputText != null && message.hasOwnProperty("inputText")) { + object.inputText = message.inputText; + if (options.oneofs) + object.input = "inputText"; + } + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.toObject(message.queryParams, options); + if (message.inputDtmf != null && message.hasOwnProperty("inputDtmf")) { + object.inputDtmf = $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.toObject(message.inputDtmf, options); + if (options.oneofs) + object.input = "inputDtmf"; + } + if (message.enableExtendedStreaming != null && message.hasOwnProperty("enableExtendedStreaming")) + object.enableExtendedStreaming = message.enableExtendedStreaming; + return object; + }; + + /** + * Converts this StreamingAnalyzeContentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingAnalyzeContentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StreamingAnalyzeContentRequest; + })(); + + v2beta1.StreamingAnalyzeContentResponse = (function() { + + /** + * Properties of a StreamingAnalyzeContentResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IStreamingAnalyzeContentResponse + * @property {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null} [recognitionResult] StreamingAnalyzeContentResponse recognitionResult + * @property {string|null} [replyText] StreamingAnalyzeContentResponse replyText + * @property {google.cloud.dialogflow.v2beta1.IOutputAudio|null} [replyAudio] StreamingAnalyzeContentResponse replyAudio + * @property {google.cloud.dialogflow.v2beta1.IAutomatedAgentReply|null} [automatedAgentReply] StreamingAnalyzeContentResponse automatedAgentReply + * @property {google.cloud.dialogflow.v2beta1.IMessage|null} [message] StreamingAnalyzeContentResponse message + * @property {Array.|null} [humanAgentSuggestionResults] StreamingAnalyzeContentResponse humanAgentSuggestionResults + * @property {Array.|null} [endUserSuggestionResults] StreamingAnalyzeContentResponse endUserSuggestionResults + * @property {google.cloud.dialogflow.v2beta1.IDtmfParameters|null} [dtmfParameters] StreamingAnalyzeContentResponse dtmfParameters + */ + + /** + * Constructs a new StreamingAnalyzeContentResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a StreamingAnalyzeContentResponse. + * @implements IStreamingAnalyzeContentResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentResponse=} [properties] Properties to set + */ + function StreamingAnalyzeContentResponse(properties) { + this.humanAgentSuggestionResults = []; + this.endUserSuggestionResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingAnalyzeContentResponse recognitionResult. + * @member {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null|undefined} recognitionResult + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @instance + */ + StreamingAnalyzeContentResponse.prototype.recognitionResult = null; + + /** + * StreamingAnalyzeContentResponse replyText. + * @member {string} replyText + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @instance + */ + StreamingAnalyzeContentResponse.prototype.replyText = ""; + + /** + * StreamingAnalyzeContentResponse replyAudio. + * @member {google.cloud.dialogflow.v2beta1.IOutputAudio|null|undefined} replyAudio + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @instance + */ + StreamingAnalyzeContentResponse.prototype.replyAudio = null; + + /** + * StreamingAnalyzeContentResponse automatedAgentReply. + * @member {google.cloud.dialogflow.v2beta1.IAutomatedAgentReply|null|undefined} automatedAgentReply + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @instance + */ + StreamingAnalyzeContentResponse.prototype.automatedAgentReply = null; + + /** + * StreamingAnalyzeContentResponse message. + * @member {google.cloud.dialogflow.v2beta1.IMessage|null|undefined} message + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @instance + */ + StreamingAnalyzeContentResponse.prototype.message = null; + + /** + * StreamingAnalyzeContentResponse humanAgentSuggestionResults. + * @member {Array.} humanAgentSuggestionResults + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @instance + */ + StreamingAnalyzeContentResponse.prototype.humanAgentSuggestionResults = $util.emptyArray; + + /** + * StreamingAnalyzeContentResponse endUserSuggestionResults. + * @member {Array.} endUserSuggestionResults + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @instance + */ + StreamingAnalyzeContentResponse.prototype.endUserSuggestionResults = $util.emptyArray; + + /** + * StreamingAnalyzeContentResponse dtmfParameters. + * @member {google.cloud.dialogflow.v2beta1.IDtmfParameters|null|undefined} dtmfParameters + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @instance + */ + StreamingAnalyzeContentResponse.prototype.dtmfParameters = null; + + /** + * Creates a new StreamingAnalyzeContentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse} StreamingAnalyzeContentResponse instance + */ + StreamingAnalyzeContentResponse.create = function create(properties) { + return new StreamingAnalyzeContentResponse(properties); + }; + + /** + * Encodes the specified StreamingAnalyzeContentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentResponse} message StreamingAnalyzeContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAnalyzeContentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) + $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.replyText != null && Object.hasOwnProperty.call(message, "replyText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.replyText); + if (message.replyAudio != null && Object.hasOwnProperty.call(message, "replyAudio")) + $root.google.cloud.dialogflow.v2beta1.OutputAudio.encode(message.replyAudio, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.automatedAgentReply != null && Object.hasOwnProperty.call(message, "automatedAgentReply")) + $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply.encode(message.automatedAgentReply, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.cloud.dialogflow.v2beta1.Message.encode(message.message, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.humanAgentSuggestionResults != null && message.humanAgentSuggestionResults.length) + for (var i = 0; i < message.humanAgentSuggestionResults.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SuggestionResult.encode(message.humanAgentSuggestionResults[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.endUserSuggestionResults != null && message.endUserSuggestionResults.length) + for (var i = 0; i < message.endUserSuggestionResults.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SuggestionResult.encode(message.endUserSuggestionResults[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dtmfParameters != null && Object.hasOwnProperty.call(message, "dtmfParameters")) + $root.google.cloud.dialogflow.v2beta1.DtmfParameters.encode(message.dtmfParameters, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingAnalyzeContentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingAnalyzeContentResponse} message StreamingAnalyzeContentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingAnalyzeContentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingAnalyzeContentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse} StreamingAnalyzeContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAnalyzeContentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.recognitionResult = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.decode(reader, reader.uint32()); + break; + case 2: + message.replyText = reader.string(); + break; + case 3: + message.replyAudio = $root.google.cloud.dialogflow.v2beta1.OutputAudio.decode(reader, reader.uint32()); + break; + case 4: + message.automatedAgentReply = $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply.decode(reader, reader.uint32()); + break; + case 6: + message.message = $root.google.cloud.dialogflow.v2beta1.Message.decode(reader, reader.uint32()); + break; + case 7: + if (!(message.humanAgentSuggestionResults && message.humanAgentSuggestionResults.length)) + message.humanAgentSuggestionResults = []; + message.humanAgentSuggestionResults.push($root.google.cloud.dialogflow.v2beta1.SuggestionResult.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.endUserSuggestionResults && message.endUserSuggestionResults.length)) + message.endUserSuggestionResults = []; + message.endUserSuggestionResults.push($root.google.cloud.dialogflow.v2beta1.SuggestionResult.decode(reader, reader.uint32())); + break; + case 10: + message.dtmfParameters = $root.google.cloud.dialogflow.v2beta1.DtmfParameters.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingAnalyzeContentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse} StreamingAnalyzeContentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingAnalyzeContentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingAnalyzeContentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingAnalyzeContentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + var error = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.verify(message.recognitionResult); + if (error) + return "recognitionResult." + error; + } + if (message.replyText != null && message.hasOwnProperty("replyText")) + if (!$util.isString(message.replyText)) + return "replyText: string expected"; + if (message.replyAudio != null && message.hasOwnProperty("replyAudio")) { + var error = $root.google.cloud.dialogflow.v2beta1.OutputAudio.verify(message.replyAudio); + if (error) + return "replyAudio." + error; + } + if (message.automatedAgentReply != null && message.hasOwnProperty("automatedAgentReply")) { + var error = $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply.verify(message.automatedAgentReply); + if (error) + return "automatedAgentReply." + error; + } + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.cloud.dialogflow.v2beta1.Message.verify(message.message); + if (error) + return "message." + error; + } + if (message.humanAgentSuggestionResults != null && message.hasOwnProperty("humanAgentSuggestionResults")) { + if (!Array.isArray(message.humanAgentSuggestionResults)) + return "humanAgentSuggestionResults: array expected"; + for (var i = 0; i < message.humanAgentSuggestionResults.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.verify(message.humanAgentSuggestionResults[i]); + if (error) + return "humanAgentSuggestionResults." + error; + } + } + if (message.endUserSuggestionResults != null && message.hasOwnProperty("endUserSuggestionResults")) { + if (!Array.isArray(message.endUserSuggestionResults)) + return "endUserSuggestionResults: array expected"; + for (var i = 0; i < message.endUserSuggestionResults.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.verify(message.endUserSuggestionResults[i]); + if (error) + return "endUserSuggestionResults." + error; + } + } + if (message.dtmfParameters != null && message.hasOwnProperty("dtmfParameters")) { + var error = $root.google.cloud.dialogflow.v2beta1.DtmfParameters.verify(message.dtmfParameters); + if (error) + return "dtmfParameters." + error; + } + return null; + }; + + /** + * Creates a StreamingAnalyzeContentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse} StreamingAnalyzeContentResponse + */ + StreamingAnalyzeContentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse(); + if (object.recognitionResult != null) { + if (typeof object.recognitionResult !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.recognitionResult: object expected"); + message.recognitionResult = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.fromObject(object.recognitionResult); + } + if (object.replyText != null) + message.replyText = String(object.replyText); + if (object.replyAudio != null) { + if (typeof object.replyAudio !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.replyAudio: object expected"); + message.replyAudio = $root.google.cloud.dialogflow.v2beta1.OutputAudio.fromObject(object.replyAudio); + } + if (object.automatedAgentReply != null) { + if (typeof object.automatedAgentReply !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.automatedAgentReply: object expected"); + message.automatedAgentReply = $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply.fromObject(object.automatedAgentReply); + } + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.message: object expected"); + message.message = $root.google.cloud.dialogflow.v2beta1.Message.fromObject(object.message); + } + if (object.humanAgentSuggestionResults) { + if (!Array.isArray(object.humanAgentSuggestionResults)) + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.humanAgentSuggestionResults: array expected"); + message.humanAgentSuggestionResults = []; + for (var i = 0; i < object.humanAgentSuggestionResults.length; ++i) { + if (typeof object.humanAgentSuggestionResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.humanAgentSuggestionResults: object expected"); + message.humanAgentSuggestionResults[i] = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.fromObject(object.humanAgentSuggestionResults[i]); + } + } + if (object.endUserSuggestionResults) { + if (!Array.isArray(object.endUserSuggestionResults)) + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.endUserSuggestionResults: array expected"); + message.endUserSuggestionResults = []; + for (var i = 0; i < object.endUserSuggestionResults.length; ++i) { + if (typeof object.endUserSuggestionResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.endUserSuggestionResults: object expected"); + message.endUserSuggestionResults[i] = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.fromObject(object.endUserSuggestionResults[i]); + } + } + if (object.dtmfParameters != null) { + if (typeof object.dtmfParameters !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse.dtmfParameters: object expected"); + message.dtmfParameters = $root.google.cloud.dialogflow.v2beta1.DtmfParameters.fromObject(object.dtmfParameters); + } + return message; + }; + + /** + * Creates a plain object from a StreamingAnalyzeContentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse} message StreamingAnalyzeContentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingAnalyzeContentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.humanAgentSuggestionResults = []; + object.endUserSuggestionResults = []; + } + if (options.defaults) { + object.recognitionResult = null; + object.replyText = ""; + object.replyAudio = null; + object.automatedAgentReply = null; + object.message = null; + object.dtmfParameters = null; + } + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) + object.recognitionResult = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.toObject(message.recognitionResult, options); + if (message.replyText != null && message.hasOwnProperty("replyText")) + object.replyText = message.replyText; + if (message.replyAudio != null && message.hasOwnProperty("replyAudio")) + object.replyAudio = $root.google.cloud.dialogflow.v2beta1.OutputAudio.toObject(message.replyAudio, options); + if (message.automatedAgentReply != null && message.hasOwnProperty("automatedAgentReply")) + object.automatedAgentReply = $root.google.cloud.dialogflow.v2beta1.AutomatedAgentReply.toObject(message.automatedAgentReply, options); + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.cloud.dialogflow.v2beta1.Message.toObject(message.message, options); + if (message.humanAgentSuggestionResults && message.humanAgentSuggestionResults.length) { + object.humanAgentSuggestionResults = []; + for (var j = 0; j < message.humanAgentSuggestionResults.length; ++j) + object.humanAgentSuggestionResults[j] = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.toObject(message.humanAgentSuggestionResults[j], options); + } + if (message.endUserSuggestionResults && message.endUserSuggestionResults.length) { + object.endUserSuggestionResults = []; + for (var j = 0; j < message.endUserSuggestionResults.length; ++j) + object.endUserSuggestionResults[j] = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.toObject(message.endUserSuggestionResults[j], options); + } + if (message.dtmfParameters != null && message.hasOwnProperty("dtmfParameters")) + object.dtmfParameters = $root.google.cloud.dialogflow.v2beta1.DtmfParameters.toObject(message.dtmfParameters, options); + return object; + }; + + /** + * Converts this StreamingAnalyzeContentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingAnalyzeContentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StreamingAnalyzeContentResponse; + })(); + + v2beta1.AnnotatedMessagePart = (function() { + + /** + * Properties of an AnnotatedMessagePart. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IAnnotatedMessagePart + * @property {string|null} [text] AnnotatedMessagePart text + * @property {string|null} [entityType] AnnotatedMessagePart entityType + * @property {google.protobuf.IValue|null} [formattedValue] AnnotatedMessagePart formattedValue + */ + + /** + * Constructs a new AnnotatedMessagePart. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an AnnotatedMessagePart. + * @implements IAnnotatedMessagePart + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IAnnotatedMessagePart=} [properties] Properties to set + */ + function AnnotatedMessagePart(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AnnotatedMessagePart text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2beta1.AnnotatedMessagePart + * @instance + */ + AnnotatedMessagePart.prototype.text = ""; + + /** + * AnnotatedMessagePart entityType. + * @member {string} entityType + * @memberof google.cloud.dialogflow.v2beta1.AnnotatedMessagePart + * @instance + */ + AnnotatedMessagePart.prototype.entityType = ""; + + /** + * AnnotatedMessagePart formattedValue. + * @member {google.protobuf.IValue|null|undefined} formattedValue + * @memberof google.cloud.dialogflow.v2beta1.AnnotatedMessagePart + * @instance + */ + AnnotatedMessagePart.prototype.formattedValue = null; + + /** + * Creates a new AnnotatedMessagePart instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.AnnotatedMessagePart + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnnotatedMessagePart=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.AnnotatedMessagePart} AnnotatedMessagePart instance + */ + AnnotatedMessagePart.create = function create(properties) { + return new AnnotatedMessagePart(properties); + }; + + /** + * Encodes the specified AnnotatedMessagePart message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnnotatedMessagePart.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.AnnotatedMessagePart + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnnotatedMessagePart} message AnnotatedMessagePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatedMessagePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityType); + if (message.formattedValue != null && Object.hasOwnProperty.call(message, "formattedValue")) + $root.google.protobuf.Value.encode(message.formattedValue, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AnnotatedMessagePart message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AnnotatedMessagePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AnnotatedMessagePart + * @static + * @param {google.cloud.dialogflow.v2beta1.IAnnotatedMessagePart} message AnnotatedMessagePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AnnotatedMessagePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AnnotatedMessagePart message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.AnnotatedMessagePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.AnnotatedMessagePart} AnnotatedMessagePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatedMessagePart.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.AnnotatedMessagePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.entityType = reader.string(); + break; + case 3: + message.formattedValue = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AnnotatedMessagePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.AnnotatedMessagePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.AnnotatedMessagePart} AnnotatedMessagePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AnnotatedMessagePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AnnotatedMessagePart message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.AnnotatedMessagePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AnnotatedMessagePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) + if (!$util.isString(message.entityType)) + return "entityType: string expected"; + if (message.formattedValue != null && message.hasOwnProperty("formattedValue")) { + var error = $root.google.protobuf.Value.verify(message.formattedValue); + if (error) + return "formattedValue." + error; + } + return null; + }; + + /** + * Creates an AnnotatedMessagePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.AnnotatedMessagePart + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.AnnotatedMessagePart} AnnotatedMessagePart + */ + AnnotatedMessagePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.AnnotatedMessagePart) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.AnnotatedMessagePart(); + if (object.text != null) + message.text = String(object.text); + if (object.entityType != null) + message.entityType = String(object.entityType); + if (object.formattedValue != null) { + if (typeof object.formattedValue !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.AnnotatedMessagePart.formattedValue: object expected"); + message.formattedValue = $root.google.protobuf.Value.fromObject(object.formattedValue); + } + return message; + }; + + /** + * Creates a plain object from an AnnotatedMessagePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.AnnotatedMessagePart + * @static + * @param {google.cloud.dialogflow.v2beta1.AnnotatedMessagePart} message AnnotatedMessagePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AnnotatedMessagePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.entityType = ""; + object.formattedValue = null; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = message.entityType; + if (message.formattedValue != null && message.hasOwnProperty("formattedValue")) + object.formattedValue = $root.google.protobuf.Value.toObject(message.formattedValue, options); + return object; + }; + + /** + * Converts this AnnotatedMessagePart to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.AnnotatedMessagePart + * @instance + * @returns {Object.} JSON object + */ + AnnotatedMessagePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AnnotatedMessagePart; + })(); + + v2beta1.MessageAnnotation = (function() { + + /** + * Properties of a MessageAnnotation. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IMessageAnnotation + * @property {Array.|null} [parts] MessageAnnotation parts + * @property {boolean|null} [containEntities] MessageAnnotation containEntities + */ + + /** + * Constructs a new MessageAnnotation. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a MessageAnnotation. + * @implements IMessageAnnotation + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IMessageAnnotation=} [properties] Properties to set + */ + function MessageAnnotation(properties) { + this.parts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MessageAnnotation parts. + * @member {Array.} parts + * @memberof google.cloud.dialogflow.v2beta1.MessageAnnotation + * @instance + */ + MessageAnnotation.prototype.parts = $util.emptyArray; + + /** + * MessageAnnotation containEntities. + * @member {boolean} containEntities + * @memberof google.cloud.dialogflow.v2beta1.MessageAnnotation + * @instance + */ + MessageAnnotation.prototype.containEntities = false; + + /** + * Creates a new MessageAnnotation instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.MessageAnnotation + * @static + * @param {google.cloud.dialogflow.v2beta1.IMessageAnnotation=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.MessageAnnotation} MessageAnnotation instance + */ + MessageAnnotation.create = function create(properties) { + return new MessageAnnotation(properties); + }; + + /** + * Encodes the specified MessageAnnotation message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.MessageAnnotation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.MessageAnnotation + * @static + * @param {google.cloud.dialogflow.v2beta1.IMessageAnnotation} message MessageAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageAnnotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parts != null && message.parts.length) + for (var i = 0; i < message.parts.length; ++i) + $root.google.cloud.dialogflow.v2beta1.AnnotatedMessagePart.encode(message.parts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.containEntities != null && Object.hasOwnProperty.call(message, "containEntities")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.containEntities); + return writer; + }; + + /** + * Encodes the specified MessageAnnotation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.MessageAnnotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.MessageAnnotation + * @static + * @param {google.cloud.dialogflow.v2beta1.IMessageAnnotation} message MessageAnnotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageAnnotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageAnnotation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.MessageAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.MessageAnnotation} MessageAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageAnnotation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.MessageAnnotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.parts && message.parts.length)) + message.parts = []; + message.parts.push($root.google.cloud.dialogflow.v2beta1.AnnotatedMessagePart.decode(reader, reader.uint32())); + break; + case 2: + message.containEntities = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageAnnotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.MessageAnnotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.MessageAnnotation} MessageAnnotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageAnnotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageAnnotation message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.MessageAnnotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageAnnotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parts != null && message.hasOwnProperty("parts")) { + if (!Array.isArray(message.parts)) + return "parts: array expected"; + for (var i = 0; i < message.parts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.AnnotatedMessagePart.verify(message.parts[i]); + if (error) + return "parts." + error; + } + } + if (message.containEntities != null && message.hasOwnProperty("containEntities")) + if (typeof message.containEntities !== "boolean") + return "containEntities: boolean expected"; + return null; + }; + + /** + * Creates a MessageAnnotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.MessageAnnotation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.MessageAnnotation} MessageAnnotation + */ + MessageAnnotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.MessageAnnotation) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.MessageAnnotation(); + if (object.parts) { + if (!Array.isArray(object.parts)) + throw TypeError(".google.cloud.dialogflow.v2beta1.MessageAnnotation.parts: array expected"); + message.parts = []; + for (var i = 0; i < object.parts.length; ++i) { + if (typeof object.parts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.MessageAnnotation.parts: object expected"); + message.parts[i] = $root.google.cloud.dialogflow.v2beta1.AnnotatedMessagePart.fromObject(object.parts[i]); + } + } + if (object.containEntities != null) + message.containEntities = Boolean(object.containEntities); + return message; + }; + + /** + * Creates a plain object from a MessageAnnotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.MessageAnnotation + * @static + * @param {google.cloud.dialogflow.v2beta1.MessageAnnotation} message MessageAnnotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageAnnotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parts = []; + if (options.defaults) + object.containEntities = false; + if (message.parts && message.parts.length) { + object.parts = []; + for (var j = 0; j < message.parts.length; ++j) + object.parts[j] = $root.google.cloud.dialogflow.v2beta1.AnnotatedMessagePart.toObject(message.parts[j], options); + } + if (message.containEntities != null && message.hasOwnProperty("containEntities")) + object.containEntities = message.containEntities; + return object; + }; + + /** + * Converts this MessageAnnotation to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.MessageAnnotation + * @instance + * @returns {Object.} JSON object + */ + MessageAnnotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MessageAnnotation; + })(); + + v2beta1.ArticleAnswer = (function() { + + /** + * Properties of an ArticleAnswer. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IArticleAnswer + * @property {string|null} [title] ArticleAnswer title + * @property {string|null} [uri] ArticleAnswer uri + * @property {Array.|null} [snippets] ArticleAnswer snippets + * @property {Object.|null} [metadata] ArticleAnswer metadata + * @property {string|null} [answerRecord] ArticleAnswer answerRecord + */ + + /** + * Constructs a new ArticleAnswer. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an ArticleAnswer. + * @implements IArticleAnswer + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IArticleAnswer=} [properties] Properties to set + */ + function ArticleAnswer(properties) { + this.snippets = []; + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ArticleAnswer title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @instance + */ + ArticleAnswer.prototype.title = ""; + + /** + * ArticleAnswer uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @instance + */ + ArticleAnswer.prototype.uri = ""; + + /** + * ArticleAnswer snippets. + * @member {Array.} snippets + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @instance + */ + ArticleAnswer.prototype.snippets = $util.emptyArray; + + /** + * ArticleAnswer metadata. + * @member {Object.} metadata + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @instance + */ + ArticleAnswer.prototype.metadata = $util.emptyObject; + + /** + * ArticleAnswer answerRecord. + * @member {string} answerRecord + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @instance + */ + ArticleAnswer.prototype.answerRecord = ""; + + /** + * Creates a new ArticleAnswer instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.IArticleAnswer=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ArticleAnswer} ArticleAnswer instance + */ + ArticleAnswer.create = function create(properties) { + return new ArticleAnswer(properties); + }; + + /** + * Encodes the specified ArticleAnswer message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ArticleAnswer.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.IArticleAnswer} message ArticleAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArticleAnswer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.snippets != null && message.snippets.length) + for (var i = 0; i < message.snippets.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snippets[i]); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.answerRecord != null && Object.hasOwnProperty.call(message, "answerRecord")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.answerRecord); + return writer; + }; + + /** + * Encodes the specified ArticleAnswer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ArticleAnswer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.IArticleAnswer} message ArticleAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ArticleAnswer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ArticleAnswer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ArticleAnswer} ArticleAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArticleAnswer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ArticleAnswer(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.uri = reader.string(); + break; + case 3: + if (!(message.snippets && message.snippets.length)) + message.snippets = []; + message.snippets.push(reader.string()); + break; + case 5: + if (message.metadata === $util.emptyObject) + message.metadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + case 6: + message.answerRecord = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ArticleAnswer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ArticleAnswer} ArticleAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ArticleAnswer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ArticleAnswer message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ArticleAnswer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.snippets != null && message.hasOwnProperty("snippets")) { + if (!Array.isArray(message.snippets)) + return "snippets: array expected"; + for (var i = 0; i < message.snippets.length; ++i) + if (!$util.isString(message.snippets[i])) + return "snippets: string[] expected"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + if (!$util.isString(message.answerRecord)) + return "answerRecord: string expected"; + return null; + }; + + /** + * Creates an ArticleAnswer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ArticleAnswer} ArticleAnswer + */ + ArticleAnswer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ArticleAnswer) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ArticleAnswer(); + if (object.title != null) + message.title = String(object.title); + if (object.uri != null) + message.uri = String(object.uri); + if (object.snippets) { + if (!Array.isArray(object.snippets)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ArticleAnswer.snippets: array expected"); + message.snippets = []; + for (var i = 0; i < object.snippets.length; ++i) + message.snippets[i] = String(object.snippets[i]); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ArticleAnswer.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.answerRecord != null) + message.answerRecord = String(object.answerRecord); + return message; + }; + + /** + * Creates a plain object from an ArticleAnswer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.ArticleAnswer} message ArticleAnswer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ArticleAnswer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snippets = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.title = ""; + object.uri = ""; + object.answerRecord = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.snippets && message.snippets.length) { + object.snippets = []; + for (var j = 0; j < message.snippets.length; ++j) + object.snippets[j] = message.snippets[j]; + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + object.answerRecord = message.answerRecord; + return object; + }; + + /** + * Converts this ArticleAnswer to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ArticleAnswer + * @instance + * @returns {Object.} JSON object + */ + ArticleAnswer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ArticleAnswer; + })(); + + v2beta1.FaqAnswer = (function() { + + /** + * Properties of a FaqAnswer. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IFaqAnswer + * @property {string|null} [answer] FaqAnswer answer + * @property {number|null} [confidence] FaqAnswer confidence + * @property {string|null} [question] FaqAnswer question + * @property {string|null} [source] FaqAnswer source + * @property {Object.|null} [metadata] FaqAnswer metadata + * @property {string|null} [answerRecord] FaqAnswer answerRecord + */ + + /** + * Constructs a new FaqAnswer. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a FaqAnswer. + * @implements IFaqAnswer + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IFaqAnswer=} [properties] Properties to set + */ + function FaqAnswer(properties) { + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaqAnswer answer. + * @member {string} answer + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @instance + */ + FaqAnswer.prototype.answer = ""; + + /** + * FaqAnswer confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @instance + */ + FaqAnswer.prototype.confidence = 0; + + /** + * FaqAnswer question. + * @member {string} question + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @instance + */ + FaqAnswer.prototype.question = ""; + + /** + * FaqAnswer source. + * @member {string} source + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @instance + */ + FaqAnswer.prototype.source = ""; + + /** + * FaqAnswer metadata. + * @member {Object.} metadata + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @instance + */ + FaqAnswer.prototype.metadata = $util.emptyObject; + + /** + * FaqAnswer answerRecord. + * @member {string} answerRecord + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @instance + */ + FaqAnswer.prototype.answerRecord = ""; + + /** + * Creates a new FaqAnswer instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.IFaqAnswer=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.FaqAnswer} FaqAnswer instance + */ + FaqAnswer.create = function create(properties) { + return new FaqAnswer(properties); + }; + + /** + * Encodes the specified FaqAnswer message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.FaqAnswer.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.IFaqAnswer} message FaqAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaqAnswer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.answer != null && Object.hasOwnProperty.call(message, "answer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.answer); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.question != null && Object.hasOwnProperty.call(message, "question")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.question); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.source); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.answerRecord != null && Object.hasOwnProperty.call(message, "answerRecord")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.answerRecord); + return writer; + }; + + /** + * Encodes the specified FaqAnswer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.FaqAnswer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.IFaqAnswer} message FaqAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaqAnswer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaqAnswer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.FaqAnswer} FaqAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaqAnswer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.FaqAnswer(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.answer = reader.string(); + break; + case 2: + message.confidence = reader.float(); + break; + case 3: + message.question = reader.string(); + break; + case 4: + message.source = reader.string(); + break; + case 5: + if (message.metadata === $util.emptyObject) + message.metadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + case 6: + message.answerRecord = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaqAnswer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.FaqAnswer} FaqAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaqAnswer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaqAnswer message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaqAnswer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.answer != null && message.hasOwnProperty("answer")) + if (!$util.isString(message.answer)) + return "answer: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.question != null && message.hasOwnProperty("question")) + if (!$util.isString(message.question)) + return "question: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + if (!$util.isString(message.answerRecord)) + return "answerRecord: string expected"; + return null; + }; + + /** + * Creates a FaqAnswer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.FaqAnswer} FaqAnswer + */ + FaqAnswer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.FaqAnswer) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.FaqAnswer(); + if (object.answer != null) + message.answer = String(object.answer); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.question != null) + message.question = String(object.question); + if (object.source != null) + message.source = String(object.source); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.FaqAnswer.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.answerRecord != null) + message.answerRecord = String(object.answerRecord); + return message; + }; + + /** + * Creates a plain object from a FaqAnswer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.FaqAnswer} message FaqAnswer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaqAnswer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.answer = ""; + object.confidence = 0; + object.question = ""; + object.source = ""; + object.answerRecord = ""; + } + if (message.answer != null && message.hasOwnProperty("answer")) + object.answer = message.answer; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.question != null && message.hasOwnProperty("question")) + object.question = message.question; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + object.answerRecord = message.answerRecord; + return object; + }; + + /** + * Converts this FaqAnswer to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.FaqAnswer + * @instance + * @returns {Object.} JSON object + */ + FaqAnswer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FaqAnswer; + })(); + + v2beta1.SmartReplyAnswer = (function() { + + /** + * Properties of a SmartReplyAnswer. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISmartReplyAnswer + * @property {string|null} [reply] SmartReplyAnswer reply + * @property {number|null} [confidence] SmartReplyAnswer confidence + * @property {string|null} [answerRecord] SmartReplyAnswer answerRecord + */ + + /** + * Constructs a new SmartReplyAnswer. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SmartReplyAnswer. + * @implements ISmartReplyAnswer + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISmartReplyAnswer=} [properties] Properties to set + */ + function SmartReplyAnswer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SmartReplyAnswer reply. + * @member {string} reply + * @memberof google.cloud.dialogflow.v2beta1.SmartReplyAnswer + * @instance + */ + SmartReplyAnswer.prototype.reply = ""; + + /** + * SmartReplyAnswer confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.v2beta1.SmartReplyAnswer + * @instance + */ + SmartReplyAnswer.prototype.confidence = 0; + + /** + * SmartReplyAnswer answerRecord. + * @member {string} answerRecord + * @memberof google.cloud.dialogflow.v2beta1.SmartReplyAnswer + * @instance + */ + SmartReplyAnswer.prototype.answerRecord = ""; + + /** + * Creates a new SmartReplyAnswer instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SmartReplyAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.ISmartReplyAnswer=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SmartReplyAnswer} SmartReplyAnswer instance + */ + SmartReplyAnswer.create = function create(properties) { + return new SmartReplyAnswer(properties); + }; + + /** + * Encodes the specified SmartReplyAnswer message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SmartReplyAnswer.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SmartReplyAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.ISmartReplyAnswer} message SmartReplyAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SmartReplyAnswer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reply != null && Object.hasOwnProperty.call(message, "reply")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.reply); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.answerRecord != null && Object.hasOwnProperty.call(message, "answerRecord")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.answerRecord); + return writer; + }; + + /** + * Encodes the specified SmartReplyAnswer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SmartReplyAnswer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SmartReplyAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.ISmartReplyAnswer} message SmartReplyAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SmartReplyAnswer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SmartReplyAnswer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SmartReplyAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SmartReplyAnswer} SmartReplyAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SmartReplyAnswer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SmartReplyAnswer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.reply = reader.string(); + break; + case 2: + message.confidence = reader.float(); + break; + case 3: + message.answerRecord = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SmartReplyAnswer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SmartReplyAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SmartReplyAnswer} SmartReplyAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SmartReplyAnswer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SmartReplyAnswer message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SmartReplyAnswer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SmartReplyAnswer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.reply != null && message.hasOwnProperty("reply")) + if (!$util.isString(message.reply)) + return "reply: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + if (!$util.isString(message.answerRecord)) + return "answerRecord: string expected"; + return null; + }; + + /** + * Creates a SmartReplyAnswer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SmartReplyAnswer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SmartReplyAnswer} SmartReplyAnswer + */ + SmartReplyAnswer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SmartReplyAnswer) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SmartReplyAnswer(); + if (object.reply != null) + message.reply = String(object.reply); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.answerRecord != null) + message.answerRecord = String(object.answerRecord); + return message; + }; + + /** + * Creates a plain object from a SmartReplyAnswer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SmartReplyAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.SmartReplyAnswer} message SmartReplyAnswer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SmartReplyAnswer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.reply = ""; + object.confidence = 0; + object.answerRecord = ""; + } + if (message.reply != null && message.hasOwnProperty("reply")) + object.reply = message.reply; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + object.answerRecord = message.answerRecord; + return object; + }; + + /** + * Converts this SmartReplyAnswer to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SmartReplyAnswer + * @instance + * @returns {Object.} JSON object + */ + SmartReplyAnswer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SmartReplyAnswer; + })(); + + v2beta1.SuggestionResult = (function() { + + /** + * Properties of a SuggestionResult. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISuggestionResult + * @property {google.rpc.IStatus|null} [error] SuggestionResult error + * @property {google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse|null} [suggestArticlesResponse] SuggestionResult suggestArticlesResponse + * @property {google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse|null} [suggestFaqAnswersResponse] SuggestionResult suggestFaqAnswersResponse + * @property {google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse|null} [suggestSmartRepliesResponse] SuggestionResult suggestSmartRepliesResponse + */ + + /** + * Constructs a new SuggestionResult. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SuggestionResult. + * @implements ISuggestionResult + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISuggestionResult=} [properties] Properties to set + */ + function SuggestionResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestionResult error. + * @member {google.rpc.IStatus|null|undefined} error + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @instance + */ + SuggestionResult.prototype.error = null; + + /** + * SuggestionResult suggestArticlesResponse. + * @member {google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse|null|undefined} suggestArticlesResponse + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @instance + */ + SuggestionResult.prototype.suggestArticlesResponse = null; + + /** + * SuggestionResult suggestFaqAnswersResponse. + * @member {google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse|null|undefined} suggestFaqAnswersResponse + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @instance + */ + SuggestionResult.prototype.suggestFaqAnswersResponse = null; + + /** + * SuggestionResult suggestSmartRepliesResponse. + * @member {google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse|null|undefined} suggestSmartRepliesResponse + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @instance + */ + SuggestionResult.prototype.suggestSmartRepliesResponse = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * SuggestionResult suggestionResponse. + * @member {"error"|"suggestArticlesResponse"|"suggestFaqAnswersResponse"|"suggestSmartRepliesResponse"|undefined} suggestionResponse + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @instance + */ + Object.defineProperty(SuggestionResult.prototype, "suggestionResponse", { + get: $util.oneOfGetter($oneOfFields = ["error", "suggestArticlesResponse", "suggestFaqAnswersResponse", "suggestSmartRepliesResponse"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SuggestionResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestionResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SuggestionResult} SuggestionResult instance + */ + SuggestionResult.create = function create(properties) { + return new SuggestionResult(properties); + }; + + /** + * Encodes the specified SuggestionResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestionResult} message SuggestionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.google.rpc.Status.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.suggestArticlesResponse != null && Object.hasOwnProperty.call(message, "suggestArticlesResponse")) + $root.google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.encode(message.suggestArticlesResponse, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.suggestFaqAnswersResponse != null && Object.hasOwnProperty.call(message, "suggestFaqAnswersResponse")) + $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.encode(message.suggestFaqAnswersResponse, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.suggestSmartRepliesResponse != null && Object.hasOwnProperty.call(message, "suggestSmartRepliesResponse")) + $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.encode(message.suggestSmartRepliesResponse, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SuggestionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestionResult} message SuggestionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SuggestionResult} SuggestionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SuggestionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 2: + message.suggestArticlesResponse = $root.google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.decode(reader, reader.uint32()); + break; + case 3: + message.suggestFaqAnswersResponse = $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.decode(reader, reader.uint32()); + break; + case 4: + message.suggestSmartRepliesResponse = $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SuggestionResult} SuggestionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestionResult message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.error != null && message.hasOwnProperty("error")) { + properties.suggestionResponse = 1; + { + var error = $root.google.rpc.Status.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.suggestArticlesResponse != null && message.hasOwnProperty("suggestArticlesResponse")) { + if (properties.suggestionResponse === 1) + return "suggestionResponse: multiple values"; + properties.suggestionResponse = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.verify(message.suggestArticlesResponse); + if (error) + return "suggestArticlesResponse." + error; + } + } + if (message.suggestFaqAnswersResponse != null && message.hasOwnProperty("suggestFaqAnswersResponse")) { + if (properties.suggestionResponse === 1) + return "suggestionResponse: multiple values"; + properties.suggestionResponse = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.verify(message.suggestFaqAnswersResponse); + if (error) + return "suggestFaqAnswersResponse." + error; + } + } + if (message.suggestSmartRepliesResponse != null && message.hasOwnProperty("suggestSmartRepliesResponse")) { + if (properties.suggestionResponse === 1) + return "suggestionResponse: multiple values"; + properties.suggestionResponse = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.verify(message.suggestSmartRepliesResponse); + if (error) + return "suggestSmartRepliesResponse." + error; + } + } + return null; + }; + + /** + * Creates a SuggestionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SuggestionResult} SuggestionResult + */ + SuggestionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SuggestionResult) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SuggestionResult(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SuggestionResult.error: object expected"); + message.error = $root.google.rpc.Status.fromObject(object.error); + } + if (object.suggestArticlesResponse != null) { + if (typeof object.suggestArticlesResponse !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SuggestionResult.suggestArticlesResponse: object expected"); + message.suggestArticlesResponse = $root.google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.fromObject(object.suggestArticlesResponse); + } + if (object.suggestFaqAnswersResponse != null) { + if (typeof object.suggestFaqAnswersResponse !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SuggestionResult.suggestFaqAnswersResponse: object expected"); + message.suggestFaqAnswersResponse = $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.fromObject(object.suggestFaqAnswersResponse); + } + if (object.suggestSmartRepliesResponse != null) { + if (typeof object.suggestSmartRepliesResponse !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SuggestionResult.suggestSmartRepliesResponse: object expected"); + message.suggestSmartRepliesResponse = $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.fromObject(object.suggestSmartRepliesResponse); + } + return message; + }; + + /** + * Creates a plain object from a SuggestionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @static + * @param {google.cloud.dialogflow.v2beta1.SuggestionResult} message SuggestionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.google.rpc.Status.toObject(message.error, options); + if (options.oneofs) + object.suggestionResponse = "error"; + } + if (message.suggestArticlesResponse != null && message.hasOwnProperty("suggestArticlesResponse")) { + object.suggestArticlesResponse = $root.google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.toObject(message.suggestArticlesResponse, options); + if (options.oneofs) + object.suggestionResponse = "suggestArticlesResponse"; + } + if (message.suggestFaqAnswersResponse != null && message.hasOwnProperty("suggestFaqAnswersResponse")) { + object.suggestFaqAnswersResponse = $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.toObject(message.suggestFaqAnswersResponse, options); + if (options.oneofs) + object.suggestionResponse = "suggestFaqAnswersResponse"; + } + if (message.suggestSmartRepliesResponse != null && message.hasOwnProperty("suggestSmartRepliesResponse")) { + object.suggestSmartRepliesResponse = $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.toObject(message.suggestSmartRepliesResponse, options); + if (options.oneofs) + object.suggestionResponse = "suggestSmartRepliesResponse"; + } + return object; + }; + + /** + * Converts this SuggestionResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SuggestionResult + * @instance + * @returns {Object.} JSON object + */ + SuggestionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SuggestionResult; + })(); + + v2beta1.SuggestArticlesRequest = (function() { + + /** + * Properties of a SuggestArticlesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISuggestArticlesRequest + * @property {string|null} [parent] SuggestArticlesRequest parent + * @property {string|null} [latestMessage] SuggestArticlesRequest latestMessage + * @property {number|null} [contextSize] SuggestArticlesRequest contextSize + */ + + /** + * Constructs a new SuggestArticlesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SuggestArticlesRequest. + * @implements ISuggestArticlesRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest=} [properties] Properties to set + */ + function SuggestArticlesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestArticlesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesRequest + * @instance + */ + SuggestArticlesRequest.prototype.parent = ""; + + /** + * SuggestArticlesRequest latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesRequest + * @instance + */ + SuggestArticlesRequest.prototype.latestMessage = ""; + + /** + * SuggestArticlesRequest contextSize. + * @member {number} contextSize + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesRequest + * @instance + */ + SuggestArticlesRequest.prototype.contextSize = 0; + + /** + * Creates a new SuggestArticlesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SuggestArticlesRequest} SuggestArticlesRequest instance + */ + SuggestArticlesRequest.create = function create(properties) { + return new SuggestArticlesRequest(properties); + }; + + /** + * Encodes the specified SuggestArticlesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest} message SuggestArticlesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestArticlesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestMessage); + if (message.contextSize != null && Object.hasOwnProperty.call(message, "contextSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contextSize); + return writer; + }; + + /** + * Encodes the specified SuggestArticlesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest} message SuggestArticlesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestArticlesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestArticlesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SuggestArticlesRequest} SuggestArticlesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestArticlesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SuggestArticlesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.latestMessage = reader.string(); + break; + case 3: + message.contextSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestArticlesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SuggestArticlesRequest} SuggestArticlesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestArticlesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestArticlesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestArticlesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + if (!$util.isInteger(message.contextSize)) + return "contextSize: integer expected"; + return null; + }; + + /** + * Creates a SuggestArticlesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SuggestArticlesRequest} SuggestArticlesRequest + */ + SuggestArticlesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SuggestArticlesRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SuggestArticlesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + if (object.contextSize != null) + message.contextSize = object.contextSize | 0; + return message; + }; + + /** + * Creates a plain object from a SuggestArticlesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.SuggestArticlesRequest} message SuggestArticlesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestArticlesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.latestMessage = ""; + object.contextSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + object.contextSize = message.contextSize; + return object; + }; + + /** + * Converts this SuggestArticlesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesRequest + * @instance + * @returns {Object.} JSON object + */ + SuggestArticlesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SuggestArticlesRequest; + })(); + + v2beta1.SuggestArticlesResponse = (function() { + + /** + * Properties of a SuggestArticlesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISuggestArticlesResponse + * @property {Array.|null} [articleAnswers] SuggestArticlesResponse articleAnswers + * @property {string|null} [latestMessage] SuggestArticlesResponse latestMessage + * @property {number|null} [contextSize] SuggestArticlesResponse contextSize + */ + + /** + * Constructs a new SuggestArticlesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SuggestArticlesResponse. + * @implements ISuggestArticlesResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse=} [properties] Properties to set + */ + function SuggestArticlesResponse(properties) { + this.articleAnswers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestArticlesResponse articleAnswers. + * @member {Array.} articleAnswers + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesResponse + * @instance + */ + SuggestArticlesResponse.prototype.articleAnswers = $util.emptyArray; + + /** + * SuggestArticlesResponse latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesResponse + * @instance + */ + SuggestArticlesResponse.prototype.latestMessage = ""; + + /** + * SuggestArticlesResponse contextSize. + * @member {number} contextSize + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesResponse + * @instance + */ + SuggestArticlesResponse.prototype.contextSize = 0; + + /** + * Creates a new SuggestArticlesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SuggestArticlesResponse} SuggestArticlesResponse instance + */ + SuggestArticlesResponse.create = function create(properties) { + return new SuggestArticlesResponse(properties); + }; + + /** + * Encodes the specified SuggestArticlesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse} message SuggestArticlesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestArticlesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.articleAnswers != null && message.articleAnswers.length) + for (var i = 0; i < message.articleAnswers.length; ++i) + $root.google.cloud.dialogflow.v2beta1.ArticleAnswer.encode(message.articleAnswers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestMessage); + if (message.contextSize != null && Object.hasOwnProperty.call(message, "contextSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contextSize); + return writer; + }; + + /** + * Encodes the specified SuggestArticlesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse} message SuggestArticlesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestArticlesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestArticlesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SuggestArticlesResponse} SuggestArticlesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestArticlesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SuggestArticlesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.articleAnswers && message.articleAnswers.length)) + message.articleAnswers = []; + message.articleAnswers.push($root.google.cloud.dialogflow.v2beta1.ArticleAnswer.decode(reader, reader.uint32())); + break; + case 2: + message.latestMessage = reader.string(); + break; + case 3: + message.contextSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestArticlesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SuggestArticlesResponse} SuggestArticlesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestArticlesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestArticlesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestArticlesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.articleAnswers != null && message.hasOwnProperty("articleAnswers")) { + if (!Array.isArray(message.articleAnswers)) + return "articleAnswers: array expected"; + for (var i = 0; i < message.articleAnswers.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.ArticleAnswer.verify(message.articleAnswers[i]); + if (error) + return "articleAnswers." + error; + } + } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + if (!$util.isInteger(message.contextSize)) + return "contextSize: integer expected"; + return null; + }; + + /** + * Creates a SuggestArticlesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SuggestArticlesResponse} SuggestArticlesResponse + */ + SuggestArticlesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SuggestArticlesResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SuggestArticlesResponse(); + if (object.articleAnswers) { + if (!Array.isArray(object.articleAnswers)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.articleAnswers: array expected"); + message.articleAnswers = []; + for (var i = 0; i < object.articleAnswers.length; ++i) { + if (typeof object.articleAnswers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SuggestArticlesResponse.articleAnswers: object expected"); + message.articleAnswers[i] = $root.google.cloud.dialogflow.v2beta1.ArticleAnswer.fromObject(object.articleAnswers[i]); + } + } + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + if (object.contextSize != null) + message.contextSize = object.contextSize | 0; + return message; + }; + + /** + * Creates a plain object from a SuggestArticlesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.SuggestArticlesResponse} message SuggestArticlesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestArticlesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.articleAnswers = []; + if (options.defaults) { + object.latestMessage = ""; + object.contextSize = 0; + } + if (message.articleAnswers && message.articleAnswers.length) { + object.articleAnswers = []; + for (var j = 0; j < message.articleAnswers.length; ++j) + object.articleAnswers[j] = $root.google.cloud.dialogflow.v2beta1.ArticleAnswer.toObject(message.articleAnswers[j], options); + } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + object.contextSize = message.contextSize; + return object; + }; + + /** + * Converts this SuggestArticlesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SuggestArticlesResponse + * @instance + * @returns {Object.} JSON object + */ + SuggestArticlesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SuggestArticlesResponse; + })(); + + v2beta1.SuggestFaqAnswersRequest = (function() { + + /** + * Properties of a SuggestFaqAnswersRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISuggestFaqAnswersRequest + * @property {string|null} [parent] SuggestFaqAnswersRequest parent + * @property {string|null} [latestMessage] SuggestFaqAnswersRequest latestMessage + * @property {number|null} [contextSize] SuggestFaqAnswersRequest contextSize + */ + + /** + * Constructs a new SuggestFaqAnswersRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SuggestFaqAnswersRequest. + * @implements ISuggestFaqAnswersRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest=} [properties] Properties to set + */ + function SuggestFaqAnswersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestFaqAnswersRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest + * @instance + */ + SuggestFaqAnswersRequest.prototype.parent = ""; + + /** + * SuggestFaqAnswersRequest latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest + * @instance + */ + SuggestFaqAnswersRequest.prototype.latestMessage = ""; + + /** + * SuggestFaqAnswersRequest contextSize. + * @member {number} contextSize + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest + * @instance + */ + SuggestFaqAnswersRequest.prototype.contextSize = 0; + + /** + * Creates a new SuggestFaqAnswersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest} SuggestFaqAnswersRequest instance + */ + SuggestFaqAnswersRequest.create = function create(properties) { + return new SuggestFaqAnswersRequest(properties); + }; + + /** + * Encodes the specified SuggestFaqAnswersRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest} message SuggestFaqAnswersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestFaqAnswersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestMessage); + if (message.contextSize != null && Object.hasOwnProperty.call(message, "contextSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contextSize); + return writer; + }; + + /** + * Encodes the specified SuggestFaqAnswersRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest} message SuggestFaqAnswersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestFaqAnswersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestFaqAnswersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest} SuggestFaqAnswersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestFaqAnswersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.latestMessage = reader.string(); + break; + case 3: + message.contextSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestFaqAnswersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest} SuggestFaqAnswersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestFaqAnswersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestFaqAnswersRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestFaqAnswersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + if (!$util.isInteger(message.contextSize)) + return "contextSize: integer expected"; + return null; + }; + + /** + * Creates a SuggestFaqAnswersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest} SuggestFaqAnswersRequest + */ + SuggestFaqAnswersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + if (object.contextSize != null) + message.contextSize = object.contextSize | 0; + return message; + }; + + /** + * Creates a plain object from a SuggestFaqAnswersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest} message SuggestFaqAnswersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestFaqAnswersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.latestMessage = ""; + object.contextSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + object.contextSize = message.contextSize; + return object; + }; + + /** + * Converts this SuggestFaqAnswersRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest + * @instance + * @returns {Object.} JSON object + */ + SuggestFaqAnswersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SuggestFaqAnswersRequest; + })(); + + v2beta1.SuggestFaqAnswersResponse = (function() { + + /** + * Properties of a SuggestFaqAnswersResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISuggestFaqAnswersResponse + * @property {Array.|null} [faqAnswers] SuggestFaqAnswersResponse faqAnswers + * @property {string|null} [latestMessage] SuggestFaqAnswersResponse latestMessage + * @property {number|null} [contextSize] SuggestFaqAnswersResponse contextSize + */ + + /** + * Constructs a new SuggestFaqAnswersResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SuggestFaqAnswersResponse. + * @implements ISuggestFaqAnswersResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse=} [properties] Properties to set + */ + function SuggestFaqAnswersResponse(properties) { + this.faqAnswers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestFaqAnswersResponse faqAnswers. + * @member {Array.} faqAnswers + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse + * @instance + */ + SuggestFaqAnswersResponse.prototype.faqAnswers = $util.emptyArray; + + /** + * SuggestFaqAnswersResponse latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse + * @instance + */ + SuggestFaqAnswersResponse.prototype.latestMessage = ""; + + /** + * SuggestFaqAnswersResponse contextSize. + * @member {number} contextSize + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse + * @instance + */ + SuggestFaqAnswersResponse.prototype.contextSize = 0; + + /** + * Creates a new SuggestFaqAnswersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse} SuggestFaqAnswersResponse instance + */ + SuggestFaqAnswersResponse.create = function create(properties) { + return new SuggestFaqAnswersResponse(properties); + }; + + /** + * Encodes the specified SuggestFaqAnswersResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse} message SuggestFaqAnswersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestFaqAnswersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.faqAnswers != null && message.faqAnswers.length) + for (var i = 0; i < message.faqAnswers.length; ++i) + $root.google.cloud.dialogflow.v2beta1.FaqAnswer.encode(message.faqAnswers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestMessage); + if (message.contextSize != null && Object.hasOwnProperty.call(message, "contextSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contextSize); + return writer; + }; + + /** + * Encodes the specified SuggestFaqAnswersResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse} message SuggestFaqAnswersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestFaqAnswersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestFaqAnswersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse} SuggestFaqAnswersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestFaqAnswersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.faqAnswers && message.faqAnswers.length)) + message.faqAnswers = []; + message.faqAnswers.push($root.google.cloud.dialogflow.v2beta1.FaqAnswer.decode(reader, reader.uint32())); + break; + case 2: + message.latestMessage = reader.string(); + break; + case 3: + message.contextSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestFaqAnswersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse} SuggestFaqAnswersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestFaqAnswersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestFaqAnswersResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestFaqAnswersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.faqAnswers != null && message.hasOwnProperty("faqAnswers")) { + if (!Array.isArray(message.faqAnswers)) + return "faqAnswers: array expected"; + for (var i = 0; i < message.faqAnswers.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.FaqAnswer.verify(message.faqAnswers[i]); + if (error) + return "faqAnswers." + error; + } + } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + if (!$util.isInteger(message.contextSize)) + return "contextSize: integer expected"; + return null; + }; + + /** + * Creates a SuggestFaqAnswersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse} SuggestFaqAnswersResponse + */ + SuggestFaqAnswersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse(); + if (object.faqAnswers) { + if (!Array.isArray(object.faqAnswers)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.faqAnswers: array expected"); + message.faqAnswers = []; + for (var i = 0; i < object.faqAnswers.length; ++i) { + if (typeof object.faqAnswers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse.faqAnswers: object expected"); + message.faqAnswers[i] = $root.google.cloud.dialogflow.v2beta1.FaqAnswer.fromObject(object.faqAnswers[i]); + } + } + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + if (object.contextSize != null) + message.contextSize = object.contextSize | 0; + return message; + }; + + /** + * Creates a plain object from a SuggestFaqAnswersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse} message SuggestFaqAnswersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestFaqAnswersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.faqAnswers = []; + if (options.defaults) { + object.latestMessage = ""; + object.contextSize = 0; + } + if (message.faqAnswers && message.faqAnswers.length) { + object.faqAnswers = []; + for (var j = 0; j < message.faqAnswers.length; ++j) + object.faqAnswers[j] = $root.google.cloud.dialogflow.v2beta1.FaqAnswer.toObject(message.faqAnswers[j], options); + } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + object.contextSize = message.contextSize; + return object; + }; + + /** + * Converts this SuggestFaqAnswersResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse + * @instance + * @returns {Object.} JSON object + */ + SuggestFaqAnswersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SuggestFaqAnswersResponse; + })(); + + v2beta1.SuggestSmartRepliesRequest = (function() { + + /** + * Properties of a SuggestSmartRepliesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISuggestSmartRepliesRequest + * @property {string|null} [parent] SuggestSmartRepliesRequest parent + * @property {google.cloud.dialogflow.v2beta1.ITextInput|null} [currentTextInput] SuggestSmartRepliesRequest currentTextInput + * @property {string|null} [latestMessage] SuggestSmartRepliesRequest latestMessage + * @property {number|null} [contextSize] SuggestSmartRepliesRequest contextSize + */ + + /** + * Constructs a new SuggestSmartRepliesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SuggestSmartRepliesRequest. + * @implements ISuggestSmartRepliesRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest=} [properties] Properties to set + */ + function SuggestSmartRepliesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestSmartRepliesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @instance + */ + SuggestSmartRepliesRequest.prototype.parent = ""; + + /** + * SuggestSmartRepliesRequest currentTextInput. + * @member {google.cloud.dialogflow.v2beta1.ITextInput|null|undefined} currentTextInput + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @instance + */ + SuggestSmartRepliesRequest.prototype.currentTextInput = null; + + /** + * SuggestSmartRepliesRequest latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @instance + */ + SuggestSmartRepliesRequest.prototype.latestMessage = ""; + + /** + * SuggestSmartRepliesRequest contextSize. + * @member {number} contextSize + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @instance + */ + SuggestSmartRepliesRequest.prototype.contextSize = 0; + + /** + * Creates a new SuggestSmartRepliesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest} SuggestSmartRepliesRequest instance + */ + SuggestSmartRepliesRequest.create = function create(properties) { + return new SuggestSmartRepliesRequest(properties); + }; + + /** + * Encodes the specified SuggestSmartRepliesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest} message SuggestSmartRepliesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestSmartRepliesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestMessage); + if (message.contextSize != null && Object.hasOwnProperty.call(message, "contextSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contextSize); + if (message.currentTextInput != null && Object.hasOwnProperty.call(message, "currentTextInput")) + $root.google.cloud.dialogflow.v2beta1.TextInput.encode(message.currentTextInput, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SuggestSmartRepliesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest} message SuggestSmartRepliesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestSmartRepliesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestSmartRepliesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest} SuggestSmartRepliesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestSmartRepliesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 4: + message.currentTextInput = $root.google.cloud.dialogflow.v2beta1.TextInput.decode(reader, reader.uint32()); + break; + case 2: + message.latestMessage = reader.string(); + break; + case 3: + message.contextSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestSmartRepliesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest} SuggestSmartRepliesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestSmartRepliesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestSmartRepliesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestSmartRepliesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.currentTextInput != null && message.hasOwnProperty("currentTextInput")) { + var error = $root.google.cloud.dialogflow.v2beta1.TextInput.verify(message.currentTextInput); + if (error) + return "currentTextInput." + error; + } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + if (!$util.isInteger(message.contextSize)) + return "contextSize: integer expected"; + return null; + }; + + /** + * Creates a SuggestSmartRepliesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest} SuggestSmartRepliesRequest + */ + SuggestSmartRepliesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.currentTextInput != null) { + if (typeof object.currentTextInput !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest.currentTextInput: object expected"); + message.currentTextInput = $root.google.cloud.dialogflow.v2beta1.TextInput.fromObject(object.currentTextInput); + } + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + if (object.contextSize != null) + message.contextSize = object.contextSize | 0; + return message; + }; + + /** + * Creates a plain object from a SuggestSmartRepliesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest} message SuggestSmartRepliesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestSmartRepliesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.latestMessage = ""; + object.contextSize = 0; + object.currentTextInput = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + object.contextSize = message.contextSize; + if (message.currentTextInput != null && message.hasOwnProperty("currentTextInput")) + object.currentTextInput = $root.google.cloud.dialogflow.v2beta1.TextInput.toObject(message.currentTextInput, options); + return object; + }; + + /** + * Converts this SuggestSmartRepliesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest + * @instance + * @returns {Object.} JSON object + */ + SuggestSmartRepliesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SuggestSmartRepliesRequest; + })(); + + v2beta1.SuggestSmartRepliesResponse = (function() { + + /** + * Properties of a SuggestSmartRepliesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISuggestSmartRepliesResponse + * @property {Array.|null} [smartReplyAnswers] SuggestSmartRepliesResponse smartReplyAnswers + * @property {string|null} [latestMessage] SuggestSmartRepliesResponse latestMessage + * @property {number|null} [contextSize] SuggestSmartRepliesResponse contextSize + */ + + /** + * Constructs a new SuggestSmartRepliesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SuggestSmartRepliesResponse. + * @implements ISuggestSmartRepliesResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse=} [properties] Properties to set + */ + function SuggestSmartRepliesResponse(properties) { + this.smartReplyAnswers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestSmartRepliesResponse smartReplyAnswers. + * @member {Array.} smartReplyAnswers + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse + * @instance + */ + SuggestSmartRepliesResponse.prototype.smartReplyAnswers = $util.emptyArray; + + /** + * SuggestSmartRepliesResponse latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse + * @instance + */ + SuggestSmartRepliesResponse.prototype.latestMessage = ""; + + /** + * SuggestSmartRepliesResponse contextSize. + * @member {number} contextSize + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse + * @instance + */ + SuggestSmartRepliesResponse.prototype.contextSize = 0; + + /** + * Creates a new SuggestSmartRepliesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse} SuggestSmartRepliesResponse instance + */ + SuggestSmartRepliesResponse.create = function create(properties) { + return new SuggestSmartRepliesResponse(properties); + }; + + /** + * Encodes the specified SuggestSmartRepliesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse} message SuggestSmartRepliesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestSmartRepliesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.smartReplyAnswers != null && message.smartReplyAnswers.length) + for (var i = 0; i < message.smartReplyAnswers.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SmartReplyAnswer.encode(message.smartReplyAnswers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestMessage); + if (message.contextSize != null && Object.hasOwnProperty.call(message, "contextSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contextSize); + return writer; + }; + + /** + * Encodes the specified SuggestSmartRepliesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse} message SuggestSmartRepliesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestSmartRepliesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestSmartRepliesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse} SuggestSmartRepliesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestSmartRepliesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.smartReplyAnswers && message.smartReplyAnswers.length)) + message.smartReplyAnswers = []; + message.smartReplyAnswers.push($root.google.cloud.dialogflow.v2beta1.SmartReplyAnswer.decode(reader, reader.uint32())); + break; + case 2: + message.latestMessage = reader.string(); + break; + case 3: + message.contextSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestSmartRepliesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse} SuggestSmartRepliesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestSmartRepliesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestSmartRepliesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestSmartRepliesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.smartReplyAnswers != null && message.hasOwnProperty("smartReplyAnswers")) { + if (!Array.isArray(message.smartReplyAnswers)) + return "smartReplyAnswers: array expected"; + for (var i = 0; i < message.smartReplyAnswers.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SmartReplyAnswer.verify(message.smartReplyAnswers[i]); + if (error) + return "smartReplyAnswers." + error; + } + } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + if (!$util.isInteger(message.contextSize)) + return "contextSize: integer expected"; + return null; + }; + + /** + * Creates a SuggestSmartRepliesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse} SuggestSmartRepliesResponse + */ + SuggestSmartRepliesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse(); + if (object.smartReplyAnswers) { + if (!Array.isArray(object.smartReplyAnswers)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.smartReplyAnswers: array expected"); + message.smartReplyAnswers = []; + for (var i = 0; i < object.smartReplyAnswers.length; ++i) { + if (typeof object.smartReplyAnswers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse.smartReplyAnswers: object expected"); + message.smartReplyAnswers[i] = $root.google.cloud.dialogflow.v2beta1.SmartReplyAnswer.fromObject(object.smartReplyAnswers[i]); + } + } + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + if (object.contextSize != null) + message.contextSize = object.contextSize | 0; + return message; + }; + + /** + * Creates a plain object from a SuggestSmartRepliesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse} message SuggestSmartRepliesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestSmartRepliesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.smartReplyAnswers = []; + if (options.defaults) { + object.latestMessage = ""; + object.contextSize = 0; + } + if (message.smartReplyAnswers && message.smartReplyAnswers.length) { + object.smartReplyAnswers = []; + for (var j = 0; j < message.smartReplyAnswers.length; ++j) + object.smartReplyAnswers[j] = $root.google.cloud.dialogflow.v2beta1.SmartReplyAnswer.toObject(message.smartReplyAnswers[j], options); + } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + object.contextSize = message.contextSize; + return object; + }; + + /** + * Converts this SuggestSmartRepliesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse + * @instance + * @returns {Object.} JSON object + */ + SuggestSmartRepliesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SuggestSmartRepliesResponse; + })(); + + v2beta1.Suggestion = (function() { + + /** + * Properties of a Suggestion. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISuggestion + * @property {string|null} [name] Suggestion name + * @property {Array.|null} [articles] Suggestion articles + * @property {Array.|null} [faqAnswers] Suggestion faqAnswers + * @property {google.protobuf.ITimestamp|null} [createTime] Suggestion createTime + * @property {string|null} [latestMessage] Suggestion latestMessage + */ + + /** + * Constructs a new Suggestion. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a Suggestion. + * @implements ISuggestion + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISuggestion=} [properties] Properties to set + */ + function Suggestion(properties) { + this.articles = []; + this.faqAnswers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Suggestion name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @instance + */ + Suggestion.prototype.name = ""; + + /** + * Suggestion articles. + * @member {Array.} articles + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @instance + */ + Suggestion.prototype.articles = $util.emptyArray; + + /** + * Suggestion faqAnswers. + * @member {Array.} faqAnswers + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @instance + */ + Suggestion.prototype.faqAnswers = $util.emptyArray; + + /** + * Suggestion createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @instance + */ + Suggestion.prototype.createTime = null; + + /** + * Suggestion latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @instance + */ + Suggestion.prototype.latestMessage = ""; + + /** + * Creates a new Suggestion instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestion=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Suggestion} Suggestion instance + */ + Suggestion.create = function create(properties) { + return new Suggestion(properties); + }; + + /** + * Encodes the specified Suggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Suggestion.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestion} message Suggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.articles != null && message.articles.length) + for (var i = 0; i < message.articles.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Suggestion.Article.encode(message.articles[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.faqAnswers != null && message.faqAnswers.length) + for (var i = 0; i < message.faqAnswers.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.encode(message.faqAnswers[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.latestMessage); + return writer; + }; + + /** + * Encodes the specified Suggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Suggestion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.ISuggestion} message Suggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Suggestion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Suggestion} Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Suggestion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.articles && message.articles.length)) + message.articles = []; + message.articles.push($root.google.cloud.dialogflow.v2beta1.Suggestion.Article.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.faqAnswers && message.faqAnswers.length)) + message.faqAnswers = []; + message.faqAnswers.push($root.google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.decode(reader, reader.uint32())); + break; + case 5: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 7: + message.latestMessage = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Suggestion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Suggestion} Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Suggestion message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Suggestion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.articles != null && message.hasOwnProperty("articles")) { + if (!Array.isArray(message.articles)) + return "articles: array expected"; + for (var i = 0; i < message.articles.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Suggestion.Article.verify(message.articles[i]); + if (error) + return "articles." + error; + } + } + if (message.faqAnswers != null && message.hasOwnProperty("faqAnswers")) { + if (!Array.isArray(message.faqAnswers)) + return "faqAnswers: array expected"; + for (var i = 0; i < message.faqAnswers.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.verify(message.faqAnswers[i]); + if (error) + return "faqAnswers." + error; + } + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + return null; + }; + + /** + * Creates a Suggestion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Suggestion} Suggestion + */ + Suggestion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Suggestion) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Suggestion(); + if (object.name != null) + message.name = String(object.name); + if (object.articles) { + if (!Array.isArray(object.articles)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Suggestion.articles: array expected"); + message.articles = []; + for (var i = 0; i < object.articles.length; ++i) { + if (typeof object.articles[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Suggestion.articles: object expected"); + message.articles[i] = $root.google.cloud.dialogflow.v2beta1.Suggestion.Article.fromObject(object.articles[i]); + } + } + if (object.faqAnswers) { + if (!Array.isArray(object.faqAnswers)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Suggestion.faqAnswers: array expected"); + message.faqAnswers = []; + for (var i = 0; i < object.faqAnswers.length; ++i) { + if (typeof object.faqAnswers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Suggestion.faqAnswers: object expected"); + message.faqAnswers[i] = $root.google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.fromObject(object.faqAnswers[i]); + } + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Suggestion.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + return message; + }; + + /** + * Creates a plain object from a Suggestion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Suggestion} message Suggestion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Suggestion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.articles = []; + object.faqAnswers = []; + } + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.latestMessage = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.articles && message.articles.length) { + object.articles = []; + for (var j = 0; j < message.articles.length; ++j) + object.articles[j] = $root.google.cloud.dialogflow.v2beta1.Suggestion.Article.toObject(message.articles[j], options); + } + if (message.faqAnswers && message.faqAnswers.length) { + object.faqAnswers = []; + for (var j = 0; j < message.faqAnswers.length; ++j) + object.faqAnswers[j] = $root.google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.toObject(message.faqAnswers[j], options); + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + return object; + }; + + /** + * Converts this Suggestion to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @instance + * @returns {Object.} JSON object + */ + Suggestion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Suggestion.Article = (function() { + + /** + * Properties of an Article. + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @interface IArticle + * @property {string|null} [title] Article title + * @property {string|null} [uri] Article uri + * @property {Array.|null} [snippets] Article snippets + * @property {Object.|null} [metadata] Article metadata + * @property {string|null} [answerRecord] Article answerRecord + */ + + /** + * Constructs a new Article. + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @classdesc Represents an Article. + * @implements IArticle + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Suggestion.IArticle=} [properties] Properties to set + */ + function Article(properties) { + this.snippets = []; + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Article title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @instance + */ + Article.prototype.title = ""; + + /** + * Article uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @instance + */ + Article.prototype.uri = ""; + + /** + * Article snippets. + * @member {Array.} snippets + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @instance + */ + Article.prototype.snippets = $util.emptyArray; + + /** + * Article metadata. + * @member {Object.} metadata + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @instance + */ + Article.prototype.metadata = $util.emptyObject; + + /** + * Article answerRecord. + * @member {string} answerRecord + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @instance + */ + Article.prototype.answerRecord = ""; + + /** + * Creates a new Article instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @static + * @param {google.cloud.dialogflow.v2beta1.Suggestion.IArticle=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Suggestion.Article} Article instance + */ + Article.create = function create(properties) { + return new Article(properties); + }; + + /** + * Encodes the specified Article message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Suggestion.Article.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @static + * @param {google.cloud.dialogflow.v2beta1.Suggestion.IArticle} message Article message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Article.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + if (message.snippets != null && message.snippets.length) + for (var i = 0; i < message.snippets.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.snippets[i]); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.answerRecord != null && Object.hasOwnProperty.call(message, "answerRecord")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.answerRecord); + return writer; + }; + + /** + * Encodes the specified Article message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Suggestion.Article.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @static + * @param {google.cloud.dialogflow.v2beta1.Suggestion.IArticle} message Article message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Article.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Article message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Suggestion.Article} Article + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Article.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Suggestion.Article(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.uri = reader.string(); + break; + case 3: + if (!(message.snippets && message.snippets.length)) + message.snippets = []; + message.snippets.push(reader.string()); + break; + case 5: + if (message.metadata === $util.emptyObject) + message.metadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + case 6: + message.answerRecord = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Article message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Suggestion.Article} Article + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Article.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Article message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Article.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + if (message.snippets != null && message.hasOwnProperty("snippets")) { + if (!Array.isArray(message.snippets)) + return "snippets: array expected"; + for (var i = 0; i < message.snippets.length; ++i) + if (!$util.isString(message.snippets[i])) + return "snippets: string[] expected"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + if (!$util.isString(message.answerRecord)) + return "answerRecord: string expected"; + return null; + }; + + /** + * Creates an Article message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Suggestion.Article} Article + */ + Article.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Suggestion.Article) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Suggestion.Article(); + if (object.title != null) + message.title = String(object.title); + if (object.uri != null) + message.uri = String(object.uri); + if (object.snippets) { + if (!Array.isArray(object.snippets)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Suggestion.Article.snippets: array expected"); + message.snippets = []; + for (var i = 0; i < object.snippets.length; ++i) + message.snippets[i] = String(object.snippets[i]); + } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Suggestion.Article.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.answerRecord != null) + message.answerRecord = String(object.answerRecord); + return message; + }; + + /** + * Creates a plain object from an Article message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @static + * @param {google.cloud.dialogflow.v2beta1.Suggestion.Article} message Article + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Article.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.snippets = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.title = ""; + object.uri = ""; + object.answerRecord = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + if (message.snippets && message.snippets.length) { + object.snippets = []; + for (var j = 0; j < message.snippets.length; ++j) + object.snippets[j] = message.snippets[j]; + } + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + object.answerRecord = message.answerRecord; + return object; + }; + + /** + * Converts this Article to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.Article + * @instance + * @returns {Object.} JSON object + */ + Article.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Article; + })(); + + Suggestion.FaqAnswer = (function() { + + /** + * Properties of a FaqAnswer. + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @interface IFaqAnswer + * @property {string|null} [answer] FaqAnswer answer + * @property {number|null} [confidence] FaqAnswer confidence + * @property {string|null} [question] FaqAnswer question + * @property {string|null} [source] FaqAnswer source + * @property {Object.|null} [metadata] FaqAnswer metadata + * @property {string|null} [answerRecord] FaqAnswer answerRecord + */ + + /** + * Constructs a new FaqAnswer. + * @memberof google.cloud.dialogflow.v2beta1.Suggestion + * @classdesc Represents a FaqAnswer. + * @implements IFaqAnswer + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Suggestion.IFaqAnswer=} [properties] Properties to set + */ + function FaqAnswer(properties) { + this.metadata = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FaqAnswer answer. + * @member {string} answer + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @instance + */ + FaqAnswer.prototype.answer = ""; + + /** + * FaqAnswer confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @instance + */ + FaqAnswer.prototype.confidence = 0; + + /** + * FaqAnswer question. + * @member {string} question + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @instance + */ + FaqAnswer.prototype.question = ""; + + /** + * FaqAnswer source. + * @member {string} source + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @instance + */ + FaqAnswer.prototype.source = ""; + + /** + * FaqAnswer metadata. + * @member {Object.} metadata + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @instance + */ + FaqAnswer.prototype.metadata = $util.emptyObject; + + /** + * FaqAnswer answerRecord. + * @member {string} answerRecord + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @instance + */ + FaqAnswer.prototype.answerRecord = ""; + + /** + * Creates a new FaqAnswer instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.Suggestion.IFaqAnswer=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer} FaqAnswer instance + */ + FaqAnswer.create = function create(properties) { + return new FaqAnswer(properties); + }; + + /** + * Encodes the specified FaqAnswer message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.Suggestion.IFaqAnswer} message FaqAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaqAnswer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.answer != null && Object.hasOwnProperty.call(message, "answer")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.answer); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.confidence); + if (message.question != null && Object.hasOwnProperty.call(message, "question")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.question); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.source); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.answerRecord != null && Object.hasOwnProperty.call(message, "answerRecord")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.answerRecord); + return writer; + }; + + /** + * Encodes the specified FaqAnswer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.Suggestion.IFaqAnswer} message FaqAnswer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FaqAnswer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FaqAnswer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer} FaqAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaqAnswer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.answer = reader.string(); + break; + case 2: + message.confidence = reader.float(); + break; + case 3: + message.question = reader.string(); + break; + case 4: + message.source = reader.string(); + break; + case 5: + if (message.metadata === $util.emptyObject) + message.metadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; + break; + case 6: + message.answerRecord = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FaqAnswer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer} FaqAnswer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FaqAnswer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FaqAnswer message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FaqAnswer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.answer != null && message.hasOwnProperty("answer")) + if (!$util.isString(message.answer)) + return "answer: string expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.question != null && message.hasOwnProperty("question")) + if (!$util.isString(message.question)) + return "question: string expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; + } + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + if (!$util.isString(message.answerRecord)) + return "answerRecord: string expected"; + return null; + }; + + /** + * Creates a FaqAnswer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer} FaqAnswer + */ + FaqAnswer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer(); + if (object.answer != null) + message.answer = String(object.answer); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.question != null) + message.question = String(object.question); + if (object.source != null) + message.source = String(object.source); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); + } + if (object.answerRecord != null) + message.answerRecord = String(object.answerRecord); + return message; + }; + + /** + * Creates a plain object from a FaqAnswer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @static + * @param {google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer} message FaqAnswer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FaqAnswer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.answer = ""; + object.confidence = 0; + object.question = ""; + object.source = ""; + object.answerRecord = ""; + } + if (message.answer != null && message.hasOwnProperty("answer")) + object.answer = message.answer; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.question != null && message.hasOwnProperty("question")) + object.question = message.question; + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; + } + if (message.answerRecord != null && message.hasOwnProperty("answerRecord")) + object.answerRecord = message.answerRecord; + return object; + }; + + /** + * Converts this FaqAnswer to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Suggestion.FaqAnswer + * @instance + * @returns {Object.} JSON object + */ + FaqAnswer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FaqAnswer; + })(); + + return Suggestion; + })(); + + v2beta1.ListSuggestionsRequest = (function() { + + /** + * Properties of a ListSuggestionsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListSuggestionsRequest + * @property {string|null} [parent] ListSuggestionsRequest parent + * @property {number|null} [pageSize] ListSuggestionsRequest pageSize + * @property {string|null} [pageToken] ListSuggestionsRequest pageToken + * @property {string|null} [filter] ListSuggestionsRequest filter + */ + + /** + * Constructs a new ListSuggestionsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListSuggestionsRequest. + * @implements IListSuggestionsRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListSuggestionsRequest=} [properties] Properties to set + */ + function ListSuggestionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSuggestionsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @instance + */ + ListSuggestionsRequest.prototype.parent = ""; + + /** + * ListSuggestionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @instance + */ + ListSuggestionsRequest.prototype.pageSize = 0; + + /** + * ListSuggestionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @instance + */ + ListSuggestionsRequest.prototype.pageToken = ""; + + /** + * ListSuggestionsRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @instance + */ + ListSuggestionsRequest.prototype.filter = ""; + + /** + * Creates a new ListSuggestionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListSuggestionsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListSuggestionsRequest} ListSuggestionsRequest instance + */ + ListSuggestionsRequest.create = function create(properties) { + return new ListSuggestionsRequest(properties); + }; + + /** + * Encodes the specified ListSuggestionsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSuggestionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListSuggestionsRequest} message ListSuggestionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSuggestionsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; + + /** + * Encodes the specified ListSuggestionsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSuggestionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListSuggestionsRequest} message ListSuggestionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSuggestionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSuggestionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListSuggestionsRequest} ListSuggestionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSuggestionsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListSuggestionsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSuggestionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListSuggestionsRequest} ListSuggestionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSuggestionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSuggestionsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSuggestionsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; + + /** + * Creates a ListSuggestionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListSuggestionsRequest} ListSuggestionsRequest + */ + ListSuggestionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListSuggestionsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListSuggestionsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; + + /** + * Creates a plain object from a ListSuggestionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ListSuggestionsRequest} message ListSuggestionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSuggestionsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; + + /** + * Converts this ListSuggestionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListSuggestionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSuggestionsRequest; + })(); + + v2beta1.ListSuggestionsResponse = (function() { + + /** + * Properties of a ListSuggestionsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListSuggestionsResponse + * @property {Array.|null} [suggestions] ListSuggestionsResponse suggestions + * @property {string|null} [nextPageToken] ListSuggestionsResponse nextPageToken + */ + + /** + * Constructs a new ListSuggestionsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListSuggestionsResponse. + * @implements IListSuggestionsResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListSuggestionsResponse=} [properties] Properties to set + */ + function ListSuggestionsResponse(properties) { + this.suggestions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSuggestionsResponse suggestions. + * @member {Array.} suggestions + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsResponse + * @instance + */ + ListSuggestionsResponse.prototype.suggestions = $util.emptyArray; + + /** + * ListSuggestionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsResponse + * @instance + */ + ListSuggestionsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListSuggestionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListSuggestionsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListSuggestionsResponse} ListSuggestionsResponse instance + */ + ListSuggestionsResponse.create = function create(properties) { + return new ListSuggestionsResponse(properties); + }; + + /** + * Encodes the specified ListSuggestionsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSuggestionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListSuggestionsResponse} message ListSuggestionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSuggestionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestions != null && message.suggestions.length) + for (var i = 0; i < message.suggestions.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Suggestion.encode(message.suggestions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListSuggestionsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSuggestionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListSuggestionsResponse} message ListSuggestionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSuggestionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSuggestionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListSuggestionsResponse} ListSuggestionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSuggestionsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListSuggestionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.suggestions && message.suggestions.length)) + message.suggestions = []; + message.suggestions.push($root.google.cloud.dialogflow.v2beta1.Suggestion.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSuggestionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListSuggestionsResponse} ListSuggestionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSuggestionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSuggestionsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSuggestionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + if (!Array.isArray(message.suggestions)) + return "suggestions: array expected"; + for (var i = 0; i < message.suggestions.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Suggestion.verify(message.suggestions[i]); + if (error) + return "suggestions." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListSuggestionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListSuggestionsResponse} ListSuggestionsResponse + */ + ListSuggestionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListSuggestionsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListSuggestionsResponse(); + if (object.suggestions) { + if (!Array.isArray(object.suggestions)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListSuggestionsResponse.suggestions: array expected"); + message.suggestions = []; + for (var i = 0; i < object.suggestions.length; ++i) { + if (typeof object.suggestions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListSuggestionsResponse.suggestions: object expected"); + message.suggestions[i] = $root.google.cloud.dialogflow.v2beta1.Suggestion.fromObject(object.suggestions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListSuggestionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ListSuggestionsResponse} message ListSuggestionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSuggestionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.suggestions = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.suggestions && message.suggestions.length) { + object.suggestions = []; + for (var j = 0; j < message.suggestions.length; ++j) + object.suggestions[j] = $root.google.cloud.dialogflow.v2beta1.Suggestion.toObject(message.suggestions[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListSuggestionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListSuggestionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListSuggestionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListSuggestionsResponse; + })(); + + v2beta1.CompileSuggestionRequest = (function() { + + /** + * Properties of a CompileSuggestionRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ICompileSuggestionRequest + * @property {string|null} [parent] CompileSuggestionRequest parent + * @property {string|null} [latestMessage] CompileSuggestionRequest latestMessage + * @property {number|null} [contextSize] CompileSuggestionRequest contextSize + */ + + /** + * Constructs a new CompileSuggestionRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a CompileSuggestionRequest. + * @implements ICompileSuggestionRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest=} [properties] Properties to set + */ + function CompileSuggestionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompileSuggestionRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionRequest + * @instance + */ + CompileSuggestionRequest.prototype.parent = ""; + + /** + * CompileSuggestionRequest latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionRequest + * @instance + */ + CompileSuggestionRequest.prototype.latestMessage = ""; + + /** + * CompileSuggestionRequest contextSize. + * @member {number} contextSize + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionRequest + * @instance + */ + CompileSuggestionRequest.prototype.contextSize = 0; + + /** + * Creates a new CompileSuggestionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CompileSuggestionRequest} CompileSuggestionRequest instance + */ + CompileSuggestionRequest.create = function create(properties) { + return new CompileSuggestionRequest(properties); + }; + + /** + * Encodes the specified CompileSuggestionRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CompileSuggestionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest} message CompileSuggestionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompileSuggestionRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestMessage); + if (message.contextSize != null && Object.hasOwnProperty.call(message, "contextSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contextSize); + return writer; + }; + + /** + * Encodes the specified CompileSuggestionRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CompileSuggestionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest} message CompileSuggestionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompileSuggestionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompileSuggestionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CompileSuggestionRequest} CompileSuggestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompileSuggestionRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CompileSuggestionRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.latestMessage = reader.string(); + break; + case 3: + message.contextSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompileSuggestionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CompileSuggestionRequest} CompileSuggestionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompileSuggestionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompileSuggestionRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompileSuggestionRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + if (!$util.isInteger(message.contextSize)) + return "contextSize: integer expected"; + return null; + }; + + /** + * Creates a CompileSuggestionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CompileSuggestionRequest} CompileSuggestionRequest + */ + CompileSuggestionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CompileSuggestionRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CompileSuggestionRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + if (object.contextSize != null) + message.contextSize = object.contextSize | 0; + return message; + }; + + /** + * Creates a plain object from a CompileSuggestionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.CompileSuggestionRequest} message CompileSuggestionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompileSuggestionRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.latestMessage = ""; + object.contextSize = 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + object.contextSize = message.contextSize; + return object; + }; + + /** + * Converts this CompileSuggestionRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionRequest + * @instance + * @returns {Object.} JSON object + */ + CompileSuggestionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompileSuggestionRequest; + })(); + + v2beta1.CompileSuggestionResponse = (function() { + + /** + * Properties of a CompileSuggestionResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ICompileSuggestionResponse + * @property {google.cloud.dialogflow.v2beta1.ISuggestion|null} [suggestion] CompileSuggestionResponse suggestion + * @property {string|null} [latestMessage] CompileSuggestionResponse latestMessage + * @property {number|null} [contextSize] CompileSuggestionResponse contextSize + */ + + /** + * Constructs a new CompileSuggestionResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a CompileSuggestionResponse. + * @implements ICompileSuggestionResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse=} [properties] Properties to set + */ + function CompileSuggestionResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CompileSuggestionResponse suggestion. + * @member {google.cloud.dialogflow.v2beta1.ISuggestion|null|undefined} suggestion + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionResponse + * @instance + */ + CompileSuggestionResponse.prototype.suggestion = null; + + /** + * CompileSuggestionResponse latestMessage. + * @member {string} latestMessage + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionResponse + * @instance + */ + CompileSuggestionResponse.prototype.latestMessage = ""; + + /** + * CompileSuggestionResponse contextSize. + * @member {number} contextSize + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionResponse + * @instance + */ + CompileSuggestionResponse.prototype.contextSize = 0; + + /** + * Creates a new CompileSuggestionResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CompileSuggestionResponse} CompileSuggestionResponse instance + */ + CompileSuggestionResponse.create = function create(properties) { + return new CompileSuggestionResponse(properties); + }; + + /** + * Encodes the specified CompileSuggestionResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CompileSuggestionResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse} message CompileSuggestionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompileSuggestionResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestion != null && Object.hasOwnProperty.call(message, "suggestion")) + $root.google.cloud.dialogflow.v2beta1.Suggestion.encode(message.suggestion, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.latestMessage != null && Object.hasOwnProperty.call(message, "latestMessage")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.latestMessage); + if (message.contextSize != null && Object.hasOwnProperty.call(message, "contextSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.contextSize); + return writer; + }; + + /** + * Encodes the specified CompileSuggestionResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CompileSuggestionResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse} message CompileSuggestionResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompileSuggestionResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CompileSuggestionResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CompileSuggestionResponse} CompileSuggestionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompileSuggestionResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CompileSuggestionResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.suggestion = $root.google.cloud.dialogflow.v2beta1.Suggestion.decode(reader, reader.uint32()); + break; + case 2: + message.latestMessage = reader.string(); + break; + case 3: + message.contextSize = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CompileSuggestionResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CompileSuggestionResponse} CompileSuggestionResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompileSuggestionResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CompileSuggestionResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompileSuggestionResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestion != null && message.hasOwnProperty("suggestion")) { + var error = $root.google.cloud.dialogflow.v2beta1.Suggestion.verify(message.suggestion); + if (error) + return "suggestion." + error; + } + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + if (!$util.isString(message.latestMessage)) + return "latestMessage: string expected"; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + if (!$util.isInteger(message.contextSize)) + return "contextSize: integer expected"; + return null; + }; + + /** + * Creates a CompileSuggestionResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CompileSuggestionResponse} CompileSuggestionResponse + */ + CompileSuggestionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CompileSuggestionResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CompileSuggestionResponse(); + if (object.suggestion != null) { + if (typeof object.suggestion !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CompileSuggestionResponse.suggestion: object expected"); + message.suggestion = $root.google.cloud.dialogflow.v2beta1.Suggestion.fromObject(object.suggestion); + } + if (object.latestMessage != null) + message.latestMessage = String(object.latestMessage); + if (object.contextSize != null) + message.contextSize = object.contextSize | 0; + return message; + }; + + /** + * Creates a plain object from a CompileSuggestionResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.CompileSuggestionResponse} message CompileSuggestionResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompileSuggestionResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.suggestion = null; + object.latestMessage = ""; + object.contextSize = 0; + } + if (message.suggestion != null && message.hasOwnProperty("suggestion")) + object.suggestion = $root.google.cloud.dialogflow.v2beta1.Suggestion.toObject(message.suggestion, options); + if (message.latestMessage != null && message.hasOwnProperty("latestMessage")) + object.latestMessage = message.latestMessage; + if (message.contextSize != null && message.hasOwnProperty("contextSize")) + object.contextSize = message.contextSize; + return object; + }; + + /** + * Converts this CompileSuggestionResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CompileSuggestionResponse + * @instance + * @returns {Object.} JSON object + */ + CompileSuggestionResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CompileSuggestionResponse; + })(); + + v2beta1.ResponseMessage = (function() { + + /** + * Properties of a ResponseMessage. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IResponseMessage + * @property {google.cloud.dialogflow.v2beta1.ResponseMessage.IText|null} [text] ResponseMessage text + * @property {google.protobuf.IStruct|null} [payload] ResponseMessage payload + * @property {google.cloud.dialogflow.v2beta1.ResponseMessage.ILiveAgentHandoff|null} [liveAgentHandoff] ResponseMessage liveAgentHandoff + * @property {google.cloud.dialogflow.v2beta1.ResponseMessage.IEndInteraction|null} [endInteraction] ResponseMessage endInteraction + */ + + /** + * Constructs a new ResponseMessage. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ResponseMessage. + * @implements IResponseMessage + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IResponseMessage=} [properties] Properties to set + */ + function ResponseMessage(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseMessage text. + * @member {google.cloud.dialogflow.v2beta1.ResponseMessage.IText|null|undefined} text + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.text = null; + + /** + * ResponseMessage payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.payload = null; + + /** + * ResponseMessage liveAgentHandoff. + * @member {google.cloud.dialogflow.v2beta1.ResponseMessage.ILiveAgentHandoff|null|undefined} liveAgentHandoff + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.liveAgentHandoff = null; + + /** + * ResponseMessage endInteraction. + * @member {google.cloud.dialogflow.v2beta1.ResponseMessage.IEndInteraction|null|undefined} endInteraction + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @instance + */ + ResponseMessage.prototype.endInteraction = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResponseMessage message. + * @member {"text"|"payload"|"liveAgentHandoff"|"endInteraction"|undefined} message + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @instance + */ + Object.defineProperty(ResponseMessage.prototype, "message", { + get: $util.oneOfGetter($oneOfFields = ["text", "payload", "liveAgentHandoff", "endInteraction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResponseMessage instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @static + * @param {google.cloud.dialogflow.v2beta1.IResponseMessage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage} ResponseMessage instance + */ + ResponseMessage.create = function create(properties) { + return new ResponseMessage(properties); + }; + + /** + * Encodes the specified ResponseMessage message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @static + * @param {google.cloud.dialogflow.v2beta1.IResponseMessage} message ResponseMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMessage.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.dialogflow.v2beta1.ResponseMessage.Text.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.liveAgentHandoff != null && Object.hasOwnProperty.call(message, "liveAgentHandoff")) + $root.google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff.encode(message.liveAgentHandoff, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endInteraction != null && Object.hasOwnProperty.call(message, "endInteraction")) + $root.google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction.encode(message.endInteraction, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ResponseMessage message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @static + * @param {google.cloud.dialogflow.v2beta1.IResponseMessage} message ResponseMessage message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMessage.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseMessage message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage} ResponseMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMessage.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ResponseMessage(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.Text.decode(reader, reader.uint32()); + break; + case 2: + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 3: + message.liveAgentHandoff = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff.decode(reader, reader.uint32()); + break; + case 4: + message.endInteraction = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseMessage message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage} ResponseMessage + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMessage.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseMessage message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseMessage.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.Text.verify(message.text); + if (error) + return "text." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + } + if (message.liveAgentHandoff != null && message.hasOwnProperty("liveAgentHandoff")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff.verify(message.liveAgentHandoff); + if (error) + return "liveAgentHandoff." + error; + } + } + if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction.verify(message.endInteraction); + if (error) + return "endInteraction." + error; + } + } + return null; + }; + + /** + * Creates a ResponseMessage message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage} ResponseMessage + */ + ResponseMessage.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ResponseMessage) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ResponseMessage(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ResponseMessage.text: object expected"); + message.text = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.Text.fromObject(object.text); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ResponseMessage.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.liveAgentHandoff != null) { + if (typeof object.liveAgentHandoff !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ResponseMessage.liveAgentHandoff: object expected"); + message.liveAgentHandoff = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff.fromObject(object.liveAgentHandoff); + } + if (object.endInteraction != null) { + if (typeof object.endInteraction !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ResponseMessage.endInteraction: object expected"); + message.endInteraction = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction.fromObject(object.endInteraction); + } + return message; + }; + + /** + * Creates a plain object from a ResponseMessage message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage} message ResponseMessage + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseMessage.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.Text.toObject(message.text, options); + if (options.oneofs) + object.message = "text"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (options.oneofs) + object.message = "payload"; + } + if (message.liveAgentHandoff != null && message.hasOwnProperty("liveAgentHandoff")) { + object.liveAgentHandoff = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff.toObject(message.liveAgentHandoff, options); + if (options.oneofs) + object.message = "liveAgentHandoff"; + } + if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) { + object.endInteraction = $root.google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction.toObject(message.endInteraction, options); + if (options.oneofs) + object.message = "endInteraction"; + } + return object; + }; + + /** + * Converts this ResponseMessage to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @instance + * @returns {Object.} JSON object + */ + ResponseMessage.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ResponseMessage.Text = (function() { + + /** + * Properties of a Text. + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @interface IText + * @property {Array.|null} [text] Text text + */ + + /** + * Constructs a new Text. + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @classdesc Represents a Text. + * @implements IText + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.IText=} [properties] Properties to set + */ + function Text(properties) { + this.text = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Text text. + * @member {Array.} text + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.Text + * @instance + */ + Text.prototype.text = $util.emptyArray; + + /** + * Creates a new Text instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.Text + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.IText=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage.Text} Text instance + */ + Text.create = function create(properties) { + return new Text(properties); + }; + + /** + * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.Text.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.Text + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.IText} message Text message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Text.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && message.text.length) + for (var i = 0; i < message.text.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text[i]); + return writer; + }; + + /** + * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.Text.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.Text + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.IText} message Text message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Text.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Text message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.Text + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage.Text} Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Text.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ResponseMessage.Text(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.text && message.text.length)) + message.text = []; + message.text.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Text message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.Text + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage.Text} Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Text.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Text message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.Text + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Text.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) { + if (!Array.isArray(message.text)) + return "text: array expected"; + for (var i = 0; i < message.text.length; ++i) + if (!$util.isString(message.text[i])) + return "text: string[] expected"; + } + return null; + }; + + /** + * Creates a Text message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.Text + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage.Text} Text + */ + Text.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ResponseMessage.Text) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ResponseMessage.Text(); + if (object.text) { + if (!Array.isArray(object.text)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ResponseMessage.Text.text: array expected"); + message.text = []; + for (var i = 0; i < object.text.length; ++i) + message.text[i] = String(object.text[i]); + } + return message; + }; + + /** + * Creates a plain object from a Text message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.Text + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.Text} message Text + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Text.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.text = []; + if (message.text && message.text.length) { + object.text = []; + for (var j = 0; j < message.text.length; ++j) + object.text[j] = message.text[j]; + } + return object; + }; + + /** + * Converts this Text to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.Text + * @instance + * @returns {Object.} JSON object + */ + Text.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Text; + })(); + + ResponseMessage.LiveAgentHandoff = (function() { + + /** + * Properties of a LiveAgentHandoff. + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @interface ILiveAgentHandoff + * @property {google.protobuf.IStruct|null} [metadata] LiveAgentHandoff metadata + */ + + /** + * Constructs a new LiveAgentHandoff. + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @classdesc Represents a LiveAgentHandoff. + * @implements ILiveAgentHandoff + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.ILiveAgentHandoff=} [properties] Properties to set + */ + function LiveAgentHandoff(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LiveAgentHandoff metadata. + * @member {google.protobuf.IStruct|null|undefined} metadata + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff + * @instance + */ + LiveAgentHandoff.prototype.metadata = null; + + /** + * Creates a new LiveAgentHandoff instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.ILiveAgentHandoff=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff} LiveAgentHandoff instance + */ + LiveAgentHandoff.create = function create(properties) { + return new LiveAgentHandoff(properties); + }; + + /** + * Encodes the specified LiveAgentHandoff message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.ILiveAgentHandoff} message LiveAgentHandoff message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LiveAgentHandoff.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.protobuf.Struct.encode(message.metadata, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified LiveAgentHandoff message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.ILiveAgentHandoff} message LiveAgentHandoff message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LiveAgentHandoff.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LiveAgentHandoff message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff} LiveAgentHandoff + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LiveAgentHandoff.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.metadata = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LiveAgentHandoff message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff} LiveAgentHandoff + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LiveAgentHandoff.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LiveAgentHandoff message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LiveAgentHandoff.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.google.protobuf.Struct.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a LiveAgentHandoff message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff} LiveAgentHandoff + */ + LiveAgentHandoff.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff(); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff.metadata: object expected"); + message.metadata = $root.google.protobuf.Struct.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a LiveAgentHandoff message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff} message LiveAgentHandoff + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LiveAgentHandoff.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.google.protobuf.Struct.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this LiveAgentHandoff to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.LiveAgentHandoff + * @instance + * @returns {Object.} JSON object + */ + LiveAgentHandoff.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LiveAgentHandoff; + })(); + + ResponseMessage.EndInteraction = (function() { + + /** + * Properties of an EndInteraction. + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @interface IEndInteraction + */ + + /** + * Constructs a new EndInteraction. + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage + * @classdesc Represents an EndInteraction. + * @implements IEndInteraction + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.IEndInteraction=} [properties] Properties to set + */ + function EndInteraction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new EndInteraction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.IEndInteraction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction} EndInteraction instance + */ + EndInteraction.create = function create(properties) { + return new EndInteraction(properties); + }; + + /** + * Encodes the specified EndInteraction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.IEndInteraction} message EndInteraction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndInteraction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified EndInteraction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.IEndInteraction} message EndInteraction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EndInteraction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EndInteraction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction} EndInteraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndInteraction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EndInteraction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction} EndInteraction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EndInteraction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EndInteraction message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EndInteraction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates an EndInteraction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction} EndInteraction + */ + EndInteraction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction) + return object; + return new $root.google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction(); + }; + + /** + * Creates a plain object from an EndInteraction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction + * @static + * @param {google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction} message EndInteraction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EndInteraction.toObject = function toObject() { + return {}; + }; + + /** + * Converts this EndInteraction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ResponseMessage.EndInteraction + * @instance + * @returns {Object.} JSON object + */ + EndInteraction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EndInteraction; + })(); + + return ResponseMessage; + })(); + + v2beta1.Sessions = (function() { + + /** + * Constructs a new Sessions service. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a Sessions + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Sessions(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Sessions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Sessions; + + /** + * Creates new Sessions service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Sessions + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Sessions} RPC service. Useful where requests and/or responses are streamed. + */ + Sessions.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Sessions#detectIntent}. + * @memberof google.cloud.dialogflow.v2beta1.Sessions + * @typedef DetectIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.DetectIntentResponse} [response] DetectIntentResponse + */ + + /** + * Calls DetectIntent. + * @function detectIntent + * @memberof google.cloud.dialogflow.v2beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDetectIntentRequest} request DetectIntentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Sessions.DetectIntentCallback} callback Node-style callback called with the error, if any, and DetectIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.detectIntent = function detectIntent(request, callback) { + return this.rpcCall(detectIntent, $root.google.cloud.dialogflow.v2beta1.DetectIntentRequest, $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse, request, callback); + }, "name", { value: "DetectIntent" }); + + /** + * Calls DetectIntent. + * @function detectIntent + * @memberof google.cloud.dialogflow.v2beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDetectIntentRequest} request DetectIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Sessions#streamingDetectIntent}. + * @memberof google.cloud.dialogflow.v2beta1.Sessions + * @typedef StreamingDetectIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse} [response] StreamingDetectIntentResponse + */ + + /** + * Calls StreamingDetectIntent. + * @function streamingDetectIntent + * @memberof google.cloud.dialogflow.v2beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest} request StreamingDetectIntentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Sessions.StreamingDetectIntentCallback} callback Node-style callback called with the error, if any, and StreamingDetectIntentResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Sessions.prototype.streamingDetectIntent = function streamingDetectIntent(request, callback) { + return this.rpcCall(streamingDetectIntent, $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest, $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse, request, callback); + }, "name", { value: "StreamingDetectIntent" }); + + /** + * Calls StreamingDetectIntent. + * @function streamingDetectIntent + * @memberof google.cloud.dialogflow.v2beta1.Sessions + * @instance + * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest} request StreamingDetectIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Sessions; + })(); + + v2beta1.DetectIntentRequest = (function() { + + /** + * Properties of a DetectIntentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IDetectIntentRequest + * @property {string|null} [session] DetectIntentRequest session + * @property {google.cloud.dialogflow.v2beta1.IQueryParameters|null} [queryParams] DetectIntentRequest queryParams + * @property {google.cloud.dialogflow.v2beta1.IQueryInput|null} [queryInput] DetectIntentRequest queryInput + * @property {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentRequest outputAudioConfig + * @property {google.protobuf.IFieldMask|null} [outputAudioConfigMask] DetectIntentRequest outputAudioConfigMask + * @property {Uint8Array|null} [inputAudio] DetectIntentRequest inputAudio + */ + + /** + * Constructs a new DetectIntentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a DetectIntentRequest. + * @implements IDetectIntentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IDetectIntentRequest=} [properties] Properties to set + */ + function DetectIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectIntentRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.session = ""; + + /** + * DetectIntentRequest queryParams. + * @member {google.cloud.dialogflow.v2beta1.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.queryParams = null; + + /** + * DetectIntentRequest queryInput. + * @member {google.cloud.dialogflow.v2beta1.IQueryInput|null|undefined} queryInput + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.queryInput = null; + + /** + * DetectIntentRequest outputAudioConfig. + * @member {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.outputAudioConfig = null; + + /** + * DetectIntentRequest outputAudioConfigMask. + * @member {google.protobuf.IFieldMask|null|undefined} outputAudioConfigMask + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.outputAudioConfigMask = null; + + /** + * DetectIntentRequest inputAudio. + * @member {Uint8Array} inputAudio + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @instance + */ + DetectIntentRequest.prototype.inputAudio = $util.newBuffer([]); + + /** + * Creates a new DetectIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDetectIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DetectIntentRequest} DetectIntentRequest instance + */ + DetectIntentRequest.create = function create(properties) { + return new DetectIntentRequest(properties); + }; + + /** + * Encodes the specified DetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDetectIntentRequest} message DetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.v2beta1.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) + $root.google.cloud.dialogflow.v2beta1.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.inputAudio != null && Object.hasOwnProperty.call(message, "inputAudio")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.inputAudio); + if (message.outputAudioConfigMask != null && Object.hasOwnProperty.call(message, "outputAudioConfigMask")) + $root.google.protobuf.FieldMask.encode(message.outputAudioConfigMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDetectIntentRequest} message DetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.DetectIntentRequest} DetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DetectIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.session = reader.string(); + break; + case 2: + message.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.decode(reader, reader.uint32()); + break; + case 3: + message.queryInput = $root.google.cloud.dialogflow.v2beta1.QueryInput.decode(reader, reader.uint32()); + break; + case 4: + message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.decode(reader, reader.uint32()); + break; + case 7: + message.outputAudioConfigMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 5: + message.inputAudio = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.DetectIntentRequest} DetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectIntentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.v2beta1.QueryParameters.verify(message.queryParams); + if (error) + return "queryParams." + error; + } + if (message.queryInput != null && message.hasOwnProperty("queryInput")) { + var error = $root.google.cloud.dialogflow.v2beta1.QueryInput.verify(message.queryInput); + if (error) + return "queryInput." + error; + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.outputAudioConfigMask); + if (error) + return "outputAudioConfigMask." + error; + } + if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) + if (!(message.inputAudio && typeof message.inputAudio.length === "number" || $util.isString(message.inputAudio))) + return "inputAudio: buffer expected"; + return null; + }; + + /** + * Creates a DetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.DetectIntentRequest} DetectIntentRequest + */ + DetectIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DetectIntentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.DetectIntentRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.fromObject(object.queryParams); + } + if (object.queryInput != null) { + if (typeof object.queryInput !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentRequest.queryInput: object expected"); + message.queryInput = $root.google.cloud.dialogflow.v2beta1.QueryInput.fromObject(object.queryInput); + } + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentRequest.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + if (object.outputAudioConfigMask != null) { + if (typeof object.outputAudioConfigMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentRequest.outputAudioConfigMask: object expected"); + message.outputAudioConfigMask = $root.google.protobuf.FieldMask.fromObject(object.outputAudioConfigMask); + } + if (object.inputAudio != null) + if (typeof object.inputAudio === "string") + $util.base64.decode(object.inputAudio, message.inputAudio = $util.newBuffer($util.base64.length(object.inputAudio)), 0); + else if (object.inputAudio.length) + message.inputAudio = object.inputAudio; + return message; + }; + + /** + * Creates a plain object from a DetectIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.DetectIntentRequest} message DetectIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.queryParams = null; + object.queryInput = null; + object.outputAudioConfig = null; + if (options.bytes === String) + object.inputAudio = ""; + else { + object.inputAudio = []; + if (options.bytes !== Array) + object.inputAudio = $util.newBuffer(object.inputAudio); + } + object.outputAudioConfigMask = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.toObject(message.queryParams, options); + if (message.queryInput != null && message.hasOwnProperty("queryInput")) + object.queryInput = $root.google.cloud.dialogflow.v2beta1.QueryInput.toObject(message.queryInput, options); + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) + object.inputAudio = options.bytes === String ? $util.base64.encode(message.inputAudio, 0, message.inputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputAudio) : message.inputAudio; + if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) + object.outputAudioConfigMask = $root.google.protobuf.FieldMask.toObject(message.outputAudioConfigMask, options); + return object; + }; + + /** + * Converts this DetectIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @instance + * @returns {Object.} JSON object + */ + DetectIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectIntentRequest; + })(); + + v2beta1.DetectIntentResponse = (function() { + + /** + * Properties of a DetectIntentResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IDetectIntentResponse + * @property {string|null} [responseId] DetectIntentResponse responseId + * @property {google.cloud.dialogflow.v2beta1.IQueryResult|null} [queryResult] DetectIntentResponse queryResult + * @property {Array.|null} [alternativeQueryResults] DetectIntentResponse alternativeQueryResults + * @property {google.rpc.IStatus|null} [webhookStatus] DetectIntentResponse webhookStatus + * @property {Uint8Array|null} [outputAudio] DetectIntentResponse outputAudio + * @property {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentResponse outputAudioConfig + */ + + /** + * Constructs a new DetectIntentResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a DetectIntentResponse. + * @implements IDetectIntentResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IDetectIntentResponse=} [properties] Properties to set + */ + function DetectIntentResponse(properties) { + this.alternativeQueryResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DetectIntentResponse responseId. + * @member {string} responseId + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.responseId = ""; + + /** + * DetectIntentResponse queryResult. + * @member {google.cloud.dialogflow.v2beta1.IQueryResult|null|undefined} queryResult + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.queryResult = null; + + /** + * DetectIntentResponse alternativeQueryResults. + * @member {Array.} alternativeQueryResults + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.alternativeQueryResults = $util.emptyArray; + + /** + * DetectIntentResponse webhookStatus. + * @member {google.rpc.IStatus|null|undefined} webhookStatus + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.webhookStatus = null; + + /** + * DetectIntentResponse outputAudio. + * @member {Uint8Array} outputAudio + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.outputAudio = $util.newBuffer([]); + + /** + * DetectIntentResponse outputAudioConfig. + * @member {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @instance + */ + DetectIntentResponse.prototype.outputAudioConfig = null; + + /** + * Creates a new DetectIntentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IDetectIntentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DetectIntentResponse} DetectIntentResponse instance + */ + DetectIntentResponse.create = function create(properties) { + return new DetectIntentResponse(properties); + }; + + /** + * Encodes the specified DetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IDetectIntentResponse} message DetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) + $root.google.cloud.dialogflow.v2beta1.QueryResult.encode(message.queryResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.webhookStatus != null && Object.hasOwnProperty.call(message, "webhookStatus")) + $root.google.rpc.Status.encode(message.webhookStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.outputAudio != null && Object.hasOwnProperty.call(message, "outputAudio")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.outputAudio); + if (message.alternativeQueryResults != null && message.alternativeQueryResults.length) + for (var i = 0; i < message.alternativeQueryResults.length; ++i) + $root.google.cloud.dialogflow.v2beta1.QueryResult.encode(message.alternativeQueryResults[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IDetectIntentResponse} message DetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DetectIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.DetectIntentResponse} DetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.responseId = reader.string(); + break; + case 2: + message.queryResult = $root.google.cloud.dialogflow.v2beta1.QueryResult.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.alternativeQueryResults && message.alternativeQueryResults.length)) + message.alternativeQueryResults = []; + message.alternativeQueryResults.push($root.google.cloud.dialogflow.v2beta1.QueryResult.decode(reader, reader.uint32())); + break; + case 3: + message.webhookStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 4: + message.outputAudio = reader.bytes(); + break; + case 6: + message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DetectIntentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.DetectIntentResponse} DetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DetectIntentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DetectIntentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DetectIntentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + var error = $root.google.cloud.dialogflow.v2beta1.QueryResult.verify(message.queryResult); + if (error) + return "queryResult." + error; + } + if (message.alternativeQueryResults != null && message.hasOwnProperty("alternativeQueryResults")) { + if (!Array.isArray(message.alternativeQueryResults)) + return "alternativeQueryResults: array expected"; + for (var i = 0; i < message.alternativeQueryResults.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.QueryResult.verify(message.alternativeQueryResults[i]); + if (error) + return "alternativeQueryResults." + error; + } + } + if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) { + var error = $root.google.rpc.Status.verify(message.webhookStatus); + if (error) + return "webhookStatus." + error; + } + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + if (!(message.outputAudio && typeof message.outputAudio.length === "number" || $util.isString(message.outputAudio))) + return "outputAudio: buffer expected"; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + return null; + }; + + /** + * Creates a DetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.DetectIntentResponse} DetectIntentResponse + */ + DetectIntentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse(); + if (object.responseId != null) + message.responseId = String(object.responseId); + if (object.queryResult != null) { + if (typeof object.queryResult !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentResponse.queryResult: object expected"); + message.queryResult = $root.google.cloud.dialogflow.v2beta1.QueryResult.fromObject(object.queryResult); + } + if (object.alternativeQueryResults) { + if (!Array.isArray(object.alternativeQueryResults)) + throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentResponse.alternativeQueryResults: array expected"); + message.alternativeQueryResults = []; + for (var i = 0; i < object.alternativeQueryResults.length; ++i) { + if (typeof object.alternativeQueryResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentResponse.alternativeQueryResults: object expected"); + message.alternativeQueryResults[i] = $root.google.cloud.dialogflow.v2beta1.QueryResult.fromObject(object.alternativeQueryResults[i]); + } + } + if (object.webhookStatus != null) { + if (typeof object.webhookStatus !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentResponse.webhookStatus: object expected"); + message.webhookStatus = $root.google.rpc.Status.fromObject(object.webhookStatus); + } + if (object.outputAudio != null) + if (typeof object.outputAudio === "string") + $util.base64.decode(object.outputAudio, message.outputAudio = $util.newBuffer($util.base64.length(object.outputAudio)), 0); + else if (object.outputAudio.length) + message.outputAudio = object.outputAudio; + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentResponse.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + return message; + }; + + /** + * Creates a plain object from a DetectIntentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.DetectIntentResponse} message DetectIntentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DetectIntentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternativeQueryResults = []; + if (options.defaults) { + object.responseId = ""; + object.queryResult = null; + object.webhookStatus = null; + if (options.bytes === String) + object.outputAudio = ""; + else { + object.outputAudio = []; + if (options.bytes !== Array) + object.outputAudio = $util.newBuffer(object.outputAudio); + } + object.outputAudioConfig = null; + } + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; + if (message.queryResult != null && message.hasOwnProperty("queryResult")) + object.queryResult = $root.google.cloud.dialogflow.v2beta1.QueryResult.toObject(message.queryResult, options); + if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) + object.webhookStatus = $root.google.rpc.Status.toObject(message.webhookStatus, options); + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; + if (message.alternativeQueryResults && message.alternativeQueryResults.length) { + object.alternativeQueryResults = []; + for (var j = 0; j < message.alternativeQueryResults.length; ++j) + object.alternativeQueryResults[j] = $root.google.cloud.dialogflow.v2beta1.QueryResult.toObject(message.alternativeQueryResults[j], options); + } + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); + return object; + }; + + /** + * Converts this DetectIntentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * @instance + * @returns {Object.} JSON object + */ + DetectIntentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DetectIntentResponse; + })(); + + v2beta1.QueryParameters = (function() { + + /** + * Properties of a QueryParameters. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IQueryParameters + * @property {string|null} [timeZone] QueryParameters timeZone + * @property {google.type.ILatLng|null} [geoLocation] QueryParameters geoLocation + * @property {Array.|null} [contexts] QueryParameters contexts + * @property {boolean|null} [resetContexts] QueryParameters resetContexts + * @property {Array.|null} [sessionEntityTypes] QueryParameters sessionEntityTypes + * @property {google.protobuf.IStruct|null} [payload] QueryParameters payload + * @property {Array.|null} [knowledgeBaseNames] QueryParameters knowledgeBaseNames + * @property {google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig|null} [sentimentAnalysisRequestConfig] QueryParameters sentimentAnalysisRequestConfig + * @property {Array.|null} [subAgents] QueryParameters subAgents + * @property {Object.|null} [webhookHeaders] QueryParameters webhookHeaders + */ + + /** + * Constructs a new QueryParameters. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a QueryParameters. + * @implements IQueryParameters + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IQueryParameters=} [properties] Properties to set + */ + function QueryParameters(properties) { + this.contexts = []; + this.sessionEntityTypes = []; + this.knowledgeBaseNames = []; + this.subAgents = []; + this.webhookHeaders = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryParameters timeZone. + * @member {string} timeZone + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.timeZone = ""; + + /** + * QueryParameters geoLocation. + * @member {google.type.ILatLng|null|undefined} geoLocation + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.geoLocation = null; + + /** + * QueryParameters contexts. + * @member {Array.} contexts + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.contexts = $util.emptyArray; + + /** + * QueryParameters resetContexts. + * @member {boolean} resetContexts + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.resetContexts = false; + + /** + * QueryParameters sessionEntityTypes. + * @member {Array.} sessionEntityTypes + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.sessionEntityTypes = $util.emptyArray; + + /** + * QueryParameters payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.payload = null; + + /** + * QueryParameters knowledgeBaseNames. + * @member {Array.} knowledgeBaseNames + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.knowledgeBaseNames = $util.emptyArray; + + /** + * QueryParameters sentimentAnalysisRequestConfig. + * @member {google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig|null|undefined} sentimentAnalysisRequestConfig + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.sentimentAnalysisRequestConfig = null; + + /** + * QueryParameters subAgents. + * @member {Array.} subAgents + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.subAgents = $util.emptyArray; + + /** + * QueryParameters webhookHeaders. + * @member {Object.} webhookHeaders + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @instance + */ + QueryParameters.prototype.webhookHeaders = $util.emptyObject; + + /** + * Creates a new QueryParameters instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @static + * @param {google.cloud.dialogflow.v2beta1.IQueryParameters=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.QueryParameters} QueryParameters instance + */ + QueryParameters.create = function create(properties) { + return new QueryParameters(properties); + }; + + /** + * Encodes the specified QueryParameters message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryParameters.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @static + * @param {google.cloud.dialogflow.v2beta1.IQueryParameters} message QueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameters.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeZone); + if (message.geoLocation != null && Object.hasOwnProperty.call(message, "geoLocation")) + $root.google.type.LatLng.encode(message.geoLocation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.contexts != null && message.contexts.length) + for (var i = 0; i < message.contexts.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Context.encode(message.contexts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.resetContexts != null && Object.hasOwnProperty.call(message, "resetContexts")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.resetContexts); + if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) + for (var i = 0; i < message.sessionEntityTypes.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SessionEntityType.encode(message.sessionEntityTypes[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.sentimentAnalysisRequestConfig != null && Object.hasOwnProperty.call(message, "sentimentAnalysisRequestConfig")) + $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.encode(message.sentimentAnalysisRequestConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.knowledgeBaseNames != null && message.knowledgeBaseNames.length) + for (var i = 0; i < message.knowledgeBaseNames.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.knowledgeBaseNames[i]); + if (message.subAgents != null && message.subAgents.length) + for (var i = 0; i < message.subAgents.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SubAgent.encode(message.subAgents[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.webhookHeaders != null && Object.hasOwnProperty.call(message, "webhookHeaders")) + for (var keys = Object.keys(message.webhookHeaders), i = 0; i < keys.length; ++i) + writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.webhookHeaders[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryParameters.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @static + * @param {google.cloud.dialogflow.v2beta1.IQueryParameters} message QueryParameters message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryParameters.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryParameters message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.QueryParameters} QueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameters.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.QueryParameters(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.timeZone = reader.string(); + break; + case 2: + message.geoLocation = $root.google.type.LatLng.decode(reader, reader.uint32()); + break; + case 3: + if (!(message.contexts && message.contexts.length)) + message.contexts = []; + message.contexts.push($root.google.cloud.dialogflow.v2beta1.Context.decode(reader, reader.uint32())); + break; + case 4: + message.resetContexts = reader.bool(); + break; + case 5: + if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) + message.sessionEntityTypes = []; + message.sessionEntityTypes.push($root.google.cloud.dialogflow.v2beta1.SessionEntityType.decode(reader, reader.uint32())); + break; + case 6: + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 12: + if (!(message.knowledgeBaseNames && message.knowledgeBaseNames.length)) + message.knowledgeBaseNames = []; + message.knowledgeBaseNames.push(reader.string()); + break; + case 10: + message.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.decode(reader, reader.uint32()); + break; + case 13: + if (!(message.subAgents && message.subAgents.length)) + message.subAgents = []; + message.subAgents.push($root.google.cloud.dialogflow.v2beta1.SubAgent.decode(reader, reader.uint32())); + break; + case 14: + if (message.webhookHeaders === $util.emptyObject) + message.webhookHeaders = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.webhookHeaders[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryParameters message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.QueryParameters} QueryParameters + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryParameters.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryParameters message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryParameters.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + if (message.geoLocation != null && message.hasOwnProperty("geoLocation")) { + var error = $root.google.type.LatLng.verify(message.geoLocation); + if (error) + return "geoLocation." + error; + } + if (message.contexts != null && message.hasOwnProperty("contexts")) { + if (!Array.isArray(message.contexts)) + return "contexts: array expected"; + for (var i = 0; i < message.contexts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Context.verify(message.contexts[i]); + if (error) + return "contexts." + error; + } + } + if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) + if (typeof message.resetContexts !== "boolean") + return "resetContexts: boolean expected"; + if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { + if (!Array.isArray(message.sessionEntityTypes)) + return "sessionEntityTypes: array expected"; + for (var i = 0; i < message.sessionEntityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.verify(message.sessionEntityTypes[i]); + if (error) + return "sessionEntityTypes." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + if (message.knowledgeBaseNames != null && message.hasOwnProperty("knowledgeBaseNames")) { + if (!Array.isArray(message.knowledgeBaseNames)) + return "knowledgeBaseNames: array expected"; + for (var i = 0; i < message.knowledgeBaseNames.length; ++i) + if (!$util.isString(message.knowledgeBaseNames[i])) + return "knowledgeBaseNames: string[] expected"; + } + if (message.sentimentAnalysisRequestConfig != null && message.hasOwnProperty("sentimentAnalysisRequestConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.verify(message.sentimentAnalysisRequestConfig); + if (error) + return "sentimentAnalysisRequestConfig." + error; + } + if (message.subAgents != null && message.hasOwnProperty("subAgents")) { + if (!Array.isArray(message.subAgents)) + return "subAgents: array expected"; + for (var i = 0; i < message.subAgents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SubAgent.verify(message.subAgents[i]); + if (error) + return "subAgents." + error; + } + } + if (message.webhookHeaders != null && message.hasOwnProperty("webhookHeaders")) { + if (!$util.isObject(message.webhookHeaders)) + return "webhookHeaders: object expected"; + var key = Object.keys(message.webhookHeaders); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.webhookHeaders[key[i]])) + return "webhookHeaders: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a QueryParameters message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.QueryParameters} QueryParameters + */ + QueryParameters.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.QueryParameters) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.QueryParameters(); + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + if (object.geoLocation != null) { + if (typeof object.geoLocation !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.geoLocation: object expected"); + message.geoLocation = $root.google.type.LatLng.fromObject(object.geoLocation); + } + if (object.contexts) { + if (!Array.isArray(object.contexts)) + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.contexts: array expected"); + message.contexts = []; + for (var i = 0; i < object.contexts.length; ++i) { + if (typeof object.contexts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.contexts: object expected"); + message.contexts[i] = $root.google.cloud.dialogflow.v2beta1.Context.fromObject(object.contexts[i]); + } + } + if (object.resetContexts != null) + message.resetContexts = Boolean(object.resetContexts); + if (object.sessionEntityTypes) { + if (!Array.isArray(object.sessionEntityTypes)) + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.sessionEntityTypes: array expected"); + message.sessionEntityTypes = []; + for (var i = 0; i < object.sessionEntityTypes.length; ++i) { + if (typeof object.sessionEntityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.sessionEntityTypes: object expected"); + message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.fromObject(object.sessionEntityTypes[i]); + } + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.knowledgeBaseNames) { + if (!Array.isArray(object.knowledgeBaseNames)) + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.knowledgeBaseNames: array expected"); + message.knowledgeBaseNames = []; + for (var i = 0; i < object.knowledgeBaseNames.length; ++i) + message.knowledgeBaseNames[i] = String(object.knowledgeBaseNames[i]); + } + if (object.sentimentAnalysisRequestConfig != null) { + if (typeof object.sentimentAnalysisRequestConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.sentimentAnalysisRequestConfig: object expected"); + message.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.fromObject(object.sentimentAnalysisRequestConfig); + } + if (object.subAgents) { + if (!Array.isArray(object.subAgents)) + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.subAgents: array expected"); + message.subAgents = []; + for (var i = 0; i < object.subAgents.length; ++i) { + if (typeof object.subAgents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.subAgents: object expected"); + message.subAgents[i] = $root.google.cloud.dialogflow.v2beta1.SubAgent.fromObject(object.subAgents[i]); + } + } + if (object.webhookHeaders) { + if (typeof object.webhookHeaders !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.webhookHeaders: object expected"); + message.webhookHeaders = {}; + for (var keys = Object.keys(object.webhookHeaders), i = 0; i < keys.length; ++i) + message.webhookHeaders[keys[i]] = String(object.webhookHeaders[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a QueryParameters message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @static + * @param {google.cloud.dialogflow.v2beta1.QueryParameters} message QueryParameters + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryParameters.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.contexts = []; + object.sessionEntityTypes = []; + object.knowledgeBaseNames = []; + object.subAgents = []; + } + if (options.objects || options.defaults) + object.webhookHeaders = {}; + if (options.defaults) { + object.timeZone = ""; + object.geoLocation = null; + object.resetContexts = false; + object.payload = null; + object.sentimentAnalysisRequestConfig = null; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + if (message.geoLocation != null && message.hasOwnProperty("geoLocation")) + object.geoLocation = $root.google.type.LatLng.toObject(message.geoLocation, options); + if (message.contexts && message.contexts.length) { + object.contexts = []; + for (var j = 0; j < message.contexts.length; ++j) + object.contexts[j] = $root.google.cloud.dialogflow.v2beta1.Context.toObject(message.contexts[j], options); + } + if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) + object.resetContexts = message.resetContexts; + if (message.sessionEntityTypes && message.sessionEntityTypes.length) { + object.sessionEntityTypes = []; + for (var j = 0; j < message.sessionEntityTypes.length; ++j) + object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.toObject(message.sessionEntityTypes[j], options); + } + if (message.payload != null && message.hasOwnProperty("payload")) + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (message.sentimentAnalysisRequestConfig != null && message.hasOwnProperty("sentimentAnalysisRequestConfig")) + object.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.toObject(message.sentimentAnalysisRequestConfig, options); + if (message.knowledgeBaseNames && message.knowledgeBaseNames.length) { + object.knowledgeBaseNames = []; + for (var j = 0; j < message.knowledgeBaseNames.length; ++j) + object.knowledgeBaseNames[j] = message.knowledgeBaseNames[j]; + } + if (message.subAgents && message.subAgents.length) { + object.subAgents = []; + for (var j = 0; j < message.subAgents.length; ++j) + object.subAgents[j] = $root.google.cloud.dialogflow.v2beta1.SubAgent.toObject(message.subAgents[j], options); + } + var keys2; + if (message.webhookHeaders && (keys2 = Object.keys(message.webhookHeaders)).length) { + object.webhookHeaders = {}; + for (var j = 0; j < keys2.length; ++j) + object.webhookHeaders[keys2[j]] = message.webhookHeaders[keys2[j]]; + } + return object; + }; + + /** + * Converts this QueryParameters to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @instance + * @returns {Object.} JSON object + */ + QueryParameters.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryParameters; + })(); + + v2beta1.QueryInput = (function() { + + /** + * Properties of a QueryInput. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IQueryInput + * @property {google.cloud.dialogflow.v2beta1.IInputAudioConfig|null} [audioConfig] QueryInput audioConfig + * @property {google.cloud.dialogflow.v2beta1.ITextInput|null} [text] QueryInput text + * @property {google.cloud.dialogflow.v2beta1.IEventInput|null} [event] QueryInput event + */ + + /** + * Constructs a new QueryInput. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a QueryInput. + * @implements IQueryInput + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IQueryInput=} [properties] Properties to set + */ + function QueryInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryInput audioConfig. + * @member {google.cloud.dialogflow.v2beta1.IInputAudioConfig|null|undefined} audioConfig + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @instance + */ + QueryInput.prototype.audioConfig = null; + + /** + * QueryInput text. + * @member {google.cloud.dialogflow.v2beta1.ITextInput|null|undefined} text + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @instance + */ + QueryInput.prototype.text = null; + + /** + * QueryInput event. + * @member {google.cloud.dialogflow.v2beta1.IEventInput|null|undefined} event + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @instance + */ + QueryInput.prototype.event = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * QueryInput input. + * @member {"audioConfig"|"text"|"event"|undefined} input + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @instance + */ + Object.defineProperty(QueryInput.prototype, "input", { + get: $util.oneOfGetter($oneOfFields = ["audioConfig", "text", "event"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new QueryInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @static + * @param {google.cloud.dialogflow.v2beta1.IQueryInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.QueryInput} QueryInput instance + */ + QueryInput.create = function create(properties) { + return new QueryInput(properties); + }; + + /** + * Encodes the specified QueryInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @static + * @param {google.cloud.dialogflow.v2beta1.IQueryInput} message QueryInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioConfig != null && Object.hasOwnProperty.call(message, "audioConfig")) + $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.encode(message.audioConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.dialogflow.v2beta1.TextInput.encode(message.text, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.event != null && Object.hasOwnProperty.call(message, "event")) + $root.google.cloud.dialogflow.v2beta1.EventInput.encode(message.event, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @static + * @param {google.cloud.dialogflow.v2beta1.IQueryInput} message QueryInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.QueryInput} QueryInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.QueryInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.audioConfig = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.decode(reader, reader.uint32()); + break; + case 2: + message.text = $root.google.cloud.dialogflow.v2beta1.TextInput.decode(reader, reader.uint32()); + break; + case 3: + message.event = $root.google.cloud.dialogflow.v2beta1.EventInput.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.QueryInput} QueryInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryInput message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.verify(message.audioConfig); + if (error) + return "audioConfig." + error; + } + } + if (message.text != null && message.hasOwnProperty("text")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.TextInput.verify(message.text); + if (error) + return "text." + error; + } + } + if (message.event != null && message.hasOwnProperty("event")) { + if (properties.input === 1) + return "input: multiple values"; + properties.input = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.EventInput.verify(message.event); + if (error) + return "event." + error; + } + } + return null; + }; + + /** + * Creates a QueryInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.QueryInput} QueryInput + */ + QueryInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.QueryInput) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.QueryInput(); + if (object.audioConfig != null) { + if (typeof object.audioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryInput.audioConfig: object expected"); + message.audioConfig = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.fromObject(object.audioConfig); + } + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryInput.text: object expected"); + message.text = $root.google.cloud.dialogflow.v2beta1.TextInput.fromObject(object.text); + } + if (object.event != null) { + if (typeof object.event !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryInput.event: object expected"); + message.event = $root.google.cloud.dialogflow.v2beta1.EventInput.fromObject(object.event); + } + return message; + }; + + /** + * Creates a plain object from a QueryInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @static + * @param {google.cloud.dialogflow.v2beta1.QueryInput} message QueryInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { + object.audioConfig = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.toObject(message.audioConfig, options); + if (options.oneofs) + object.input = "audioConfig"; + } + if (message.text != null && message.hasOwnProperty("text")) { + object.text = $root.google.cloud.dialogflow.v2beta1.TextInput.toObject(message.text, options); + if (options.oneofs) + object.input = "text"; + } + if (message.event != null && message.hasOwnProperty("event")) { + object.event = $root.google.cloud.dialogflow.v2beta1.EventInput.toObject(message.event, options); + if (options.oneofs) + object.input = "event"; + } + return object; + }; + + /** + * Converts this QueryInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @instance + * @returns {Object.} JSON object + */ + QueryInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryInput; + })(); + + v2beta1.QueryResult = (function() { + + /** + * Properties of a QueryResult. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IQueryResult + * @property {string|null} [queryText] QueryResult queryText + * @property {string|null} [languageCode] QueryResult languageCode + * @property {number|null} [speechRecognitionConfidence] QueryResult speechRecognitionConfidence + * @property {string|null} [action] QueryResult action + * @property {google.protobuf.IStruct|null} [parameters] QueryResult parameters + * @property {boolean|null} [allRequiredParamsPresent] QueryResult allRequiredParamsPresent + * @property {string|null} [fulfillmentText] QueryResult fulfillmentText + * @property {Array.|null} [fulfillmentMessages] QueryResult fulfillmentMessages + * @property {string|null} [webhookSource] QueryResult webhookSource + * @property {google.protobuf.IStruct|null} [webhookPayload] QueryResult webhookPayload + * @property {Array.|null} [outputContexts] QueryResult outputContexts + * @property {google.cloud.dialogflow.v2beta1.IIntent|null} [intent] QueryResult intent + * @property {number|null} [intentDetectionConfidence] QueryResult intentDetectionConfidence + * @property {google.protobuf.IStruct|null} [diagnosticInfo] QueryResult diagnosticInfo + * @property {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult|null} [sentimentAnalysisResult] QueryResult sentimentAnalysisResult + * @property {google.cloud.dialogflow.v2beta1.IKnowledgeAnswers|null} [knowledgeAnswers] QueryResult knowledgeAnswers + */ + + /** + * Constructs a new QueryResult. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a QueryResult. + * @implements IQueryResult + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IQueryResult=} [properties] Properties to set + */ + function QueryResult(properties) { + this.fulfillmentMessages = []; + this.outputContexts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QueryResult queryText. + * @member {string} queryText + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.queryText = ""; + + /** + * QueryResult languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.languageCode = ""; + + /** + * QueryResult speechRecognitionConfidence. + * @member {number} speechRecognitionConfidence + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.speechRecognitionConfidence = 0; + + /** + * QueryResult action. + * @member {string} action + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.action = ""; + + /** + * QueryResult parameters. + * @member {google.protobuf.IStruct|null|undefined} parameters + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.parameters = null; + + /** + * QueryResult allRequiredParamsPresent. + * @member {boolean} allRequiredParamsPresent + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.allRequiredParamsPresent = false; + + /** + * QueryResult fulfillmentText. + * @member {string} fulfillmentText + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.fulfillmentText = ""; + + /** + * QueryResult fulfillmentMessages. + * @member {Array.} fulfillmentMessages + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.fulfillmentMessages = $util.emptyArray; + + /** + * QueryResult webhookSource. + * @member {string} webhookSource + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.webhookSource = ""; + + /** + * QueryResult webhookPayload. + * @member {google.protobuf.IStruct|null|undefined} webhookPayload + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.webhookPayload = null; + + /** + * QueryResult outputContexts. + * @member {Array.} outputContexts + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.outputContexts = $util.emptyArray; + + /** + * QueryResult intent. + * @member {google.cloud.dialogflow.v2beta1.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.intent = null; + + /** + * QueryResult intentDetectionConfidence. + * @member {number} intentDetectionConfidence + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.intentDetectionConfidence = 0; + + /** + * QueryResult diagnosticInfo. + * @member {google.protobuf.IStruct|null|undefined} diagnosticInfo + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.diagnosticInfo = null; + + /** + * QueryResult sentimentAnalysisResult. + * @member {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult|null|undefined} sentimentAnalysisResult + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.sentimentAnalysisResult = null; + + /** + * QueryResult knowledgeAnswers. + * @member {google.cloud.dialogflow.v2beta1.IKnowledgeAnswers|null|undefined} knowledgeAnswers + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + */ + QueryResult.prototype.knowledgeAnswers = null; + + /** + * Creates a new QueryResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @static + * @param {google.cloud.dialogflow.v2beta1.IQueryResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.QueryResult} QueryResult instance + */ + QueryResult.create = function create(properties) { + return new QueryResult(properties); + }; + + /** + * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @static + * @param {google.cloud.dialogflow.v2beta1.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryText != null && Object.hasOwnProperty.call(message, "queryText")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryText); + if (message.speechRecognitionConfidence != null && Object.hasOwnProperty.call(message, "speechRecognitionConfidence")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.speechRecognitionConfidence); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.action); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.allRequiredParamsPresent != null && Object.hasOwnProperty.call(message, "allRequiredParamsPresent")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allRequiredParamsPresent); + if (message.fulfillmentText != null && Object.hasOwnProperty.call(message, "fulfillmentText")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.fulfillmentText); + if (message.fulfillmentMessages != null && message.fulfillmentMessages.length) + for (var i = 0; i < message.fulfillmentMessages.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.encode(message.fulfillmentMessages[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.webhookSource != null && Object.hasOwnProperty.call(message, "webhookSource")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.webhookSource); + if (message.webhookPayload != null && Object.hasOwnProperty.call(message, "webhookPayload")) + $root.google.protobuf.Struct.encode(message.webhookPayload, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.outputContexts != null && message.outputContexts.length) + for (var i = 0; i < message.outputContexts.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Context.encode(message.outputContexts[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intent, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.intentDetectionConfidence != null && Object.hasOwnProperty.call(message, "intentDetectionConfidence")) + writer.uint32(/* id 12, wireType 5 =*/101).float(message.intentDetectionConfidence); + if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) + $root.google.protobuf.Struct.encode(message.diagnosticInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.languageCode); + if (message.sentimentAnalysisResult != null && Object.hasOwnProperty.call(message, "sentimentAnalysisResult")) + $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.encode(message.sentimentAnalysisResult, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.knowledgeAnswers != null && Object.hasOwnProperty.call(message, "knowledgeAnswers")) + $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.encode(message.knowledgeAnswers, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @static + * @param {google.cloud.dialogflow.v2beta1.IQueryResult} message QueryResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QueryResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QueryResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.QueryResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.queryText = reader.string(); + break; + case 15: + message.languageCode = reader.string(); + break; + case 2: + message.speechRecognitionConfidence = reader.float(); + break; + case 3: + message.action = reader.string(); + break; + case 4: + message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 5: + message.allRequiredParamsPresent = reader.bool(); + break; + case 6: + message.fulfillmentText = reader.string(); + break; + case 7: + if (!(message.fulfillmentMessages && message.fulfillmentMessages.length)) + message.fulfillmentMessages = []; + message.fulfillmentMessages.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.decode(reader, reader.uint32())); + break; + case 8: + message.webhookSource = reader.string(); + break; + case 9: + message.webhookPayload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 10: + if (!(message.outputContexts && message.outputContexts.length)) + message.outputContexts = []; + message.outputContexts.push($root.google.cloud.dialogflow.v2beta1.Context.decode(reader, reader.uint32())); + break; + case 11: + message.intent = $root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32()); + break; + case 12: + message.intentDetectionConfidence = reader.float(); + break; + case 14: + message.diagnosticInfo = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 17: + message.sentimentAnalysisResult = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.decode(reader, reader.uint32()); + break; + case 18: + message.knowledgeAnswers = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.QueryResult} QueryResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QueryResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QueryResult message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QueryResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryText != null && message.hasOwnProperty("queryText")) + if (!$util.isString(message.queryText)) + return "queryText: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.speechRecognitionConfidence != null && message.hasOwnProperty("speechRecognitionConfidence")) + if (typeof message.speechRecognitionConfidence !== "number") + return "speechRecognitionConfidence: number expected"; + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Struct.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.allRequiredParamsPresent != null && message.hasOwnProperty("allRequiredParamsPresent")) + if (typeof message.allRequiredParamsPresent !== "boolean") + return "allRequiredParamsPresent: boolean expected"; + if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) + if (!$util.isString(message.fulfillmentText)) + return "fulfillmentText: string expected"; + if (message.fulfillmentMessages != null && message.hasOwnProperty("fulfillmentMessages")) { + if (!Array.isArray(message.fulfillmentMessages)) + return "fulfillmentMessages: array expected"; + for (var i = 0; i < message.fulfillmentMessages.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.verify(message.fulfillmentMessages[i]); + if (error) + return "fulfillmentMessages." + error; + } + } + if (message.webhookSource != null && message.hasOwnProperty("webhookSource")) + if (!$util.isString(message.webhookSource)) + return "webhookSource: string expected"; + if (message.webhookPayload != null && message.hasOwnProperty("webhookPayload")) { + var error = $root.google.protobuf.Struct.verify(message.webhookPayload); + if (error) + return "webhookPayload." + error; + } + if (message.outputContexts != null && message.hasOwnProperty("outputContexts")) { + if (!Array.isArray(message.outputContexts)) + return "outputContexts: array expected"; + for (var i = 0; i < message.outputContexts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Context.verify(message.outputContexts[i]); + if (error) + return "outputContexts." + error; + } + } + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intent); + if (error) + return "intent." + error; + } + if (message.intentDetectionConfidence != null && message.hasOwnProperty("intentDetectionConfidence")) + if (typeof message.intentDetectionConfidence !== "number") + return "intentDetectionConfidence: number expected"; + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { + var error = $root.google.protobuf.Struct.verify(message.diagnosticInfo); + if (error) + return "diagnosticInfo." + error; + } + if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) { + var error = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.verify(message.sentimentAnalysisResult); + if (error) + return "sentimentAnalysisResult." + error; + } + if (message.knowledgeAnswers != null && message.hasOwnProperty("knowledgeAnswers")) { + var error = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.verify(message.knowledgeAnswers); + if (error) + return "knowledgeAnswers." + error; + } + return null; + }; + + /** + * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.QueryResult} QueryResult + */ + QueryResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.QueryResult) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.QueryResult(); + if (object.queryText != null) + message.queryText = String(object.queryText); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.speechRecognitionConfidence != null) + message.speechRecognitionConfidence = Number(object.speechRecognitionConfidence); + if (object.action != null) + message.action = String(object.action); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.parameters: object expected"); + message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters); + } + if (object.allRequiredParamsPresent != null) + message.allRequiredParamsPresent = Boolean(object.allRequiredParamsPresent); + if (object.fulfillmentText != null) + message.fulfillmentText = String(object.fulfillmentText); + if (object.fulfillmentMessages) { + if (!Array.isArray(object.fulfillmentMessages)) + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.fulfillmentMessages: array expected"); + message.fulfillmentMessages = []; + for (var i = 0; i < object.fulfillmentMessages.length; ++i) { + if (typeof object.fulfillmentMessages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.fulfillmentMessages: object expected"); + message.fulfillmentMessages[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.fromObject(object.fulfillmentMessages[i]); + } + } + if (object.webhookSource != null) + message.webhookSource = String(object.webhookSource); + if (object.webhookPayload != null) { + if (typeof object.webhookPayload !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.webhookPayload: object expected"); + message.webhookPayload = $root.google.protobuf.Struct.fromObject(object.webhookPayload); + } + if (object.outputContexts) { + if (!Array.isArray(object.outputContexts)) + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.outputContexts: array expected"); + message.outputContexts = []; + for (var i = 0; i < object.outputContexts.length; ++i) { + if (typeof object.outputContexts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.outputContexts: object expected"); + message.outputContexts[i] = $root.google.cloud.dialogflow.v2beta1.Context.fromObject(object.outputContexts[i]); + } + } + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intent); + } + if (object.intentDetectionConfidence != null) + message.intentDetectionConfidence = Number(object.intentDetectionConfidence); + if (object.diagnosticInfo != null) { + if (typeof object.diagnosticInfo !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.diagnosticInfo: object expected"); + message.diagnosticInfo = $root.google.protobuf.Struct.fromObject(object.diagnosticInfo); + } + if (object.sentimentAnalysisResult != null) { + if (typeof object.sentimentAnalysisResult !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.sentimentAnalysisResult: object expected"); + message.sentimentAnalysisResult = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.fromObject(object.sentimentAnalysisResult); + } + if (object.knowledgeAnswers != null) { + if (typeof object.knowledgeAnswers !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.knowledgeAnswers: object expected"); + message.knowledgeAnswers = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.fromObject(object.knowledgeAnswers); + } + return message; + }; + + /** + * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @static + * @param {google.cloud.dialogflow.v2beta1.QueryResult} message QueryResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QueryResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.fulfillmentMessages = []; + object.outputContexts = []; + } + if (options.defaults) { + object.queryText = ""; + object.speechRecognitionConfidence = 0; + object.action = ""; + object.parameters = null; + object.allRequiredParamsPresent = false; + object.fulfillmentText = ""; + object.webhookSource = ""; + object.webhookPayload = null; + object.intent = null; + object.intentDetectionConfidence = 0; + object.diagnosticInfo = null; + object.languageCode = ""; + object.sentimentAnalysisResult = null; + object.knowledgeAnswers = null; + } + if (message.queryText != null && message.hasOwnProperty("queryText")) + object.queryText = message.queryText; + if (message.speechRecognitionConfidence != null && message.hasOwnProperty("speechRecognitionConfidence")) + object.speechRecognitionConfidence = options.json && !isFinite(message.speechRecognitionConfidence) ? String(message.speechRecognitionConfidence) : message.speechRecognitionConfidence; + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + if (message.allRequiredParamsPresent != null && message.hasOwnProperty("allRequiredParamsPresent")) + object.allRequiredParamsPresent = message.allRequiredParamsPresent; + if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) + object.fulfillmentText = message.fulfillmentText; + if (message.fulfillmentMessages && message.fulfillmentMessages.length) { + object.fulfillmentMessages = []; + for (var j = 0; j < message.fulfillmentMessages.length; ++j) + object.fulfillmentMessages[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.toObject(message.fulfillmentMessages[j], options); + } + if (message.webhookSource != null && message.hasOwnProperty("webhookSource")) + object.webhookSource = message.webhookSource; + if (message.webhookPayload != null && message.hasOwnProperty("webhookPayload")) + object.webhookPayload = $root.google.protobuf.Struct.toObject(message.webhookPayload, options); + if (message.outputContexts && message.outputContexts.length) { + object.outputContexts = []; + for (var j = 0; j < message.outputContexts.length; ++j) + object.outputContexts[j] = $root.google.cloud.dialogflow.v2beta1.Context.toObject(message.outputContexts[j], options); + } + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intent, options); + if (message.intentDetectionConfidence != null && message.hasOwnProperty("intentDetectionConfidence")) + object.intentDetectionConfidence = options.json && !isFinite(message.intentDetectionConfidence) ? String(message.intentDetectionConfidence) : message.intentDetectionConfidence; + if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) + object.diagnosticInfo = $root.google.protobuf.Struct.toObject(message.diagnosticInfo, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) + object.sentimentAnalysisResult = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.toObject(message.sentimentAnalysisResult, options); + if (message.knowledgeAnswers != null && message.hasOwnProperty("knowledgeAnswers")) + object.knowledgeAnswers = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.toObject(message.knowledgeAnswers, options); + return object; + }; + + /** + * Converts this QueryResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @instance + * @returns {Object.} JSON object + */ + QueryResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QueryResult; + })(); + + v2beta1.KnowledgeAnswers = (function() { + + /** + * Properties of a KnowledgeAnswers. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IKnowledgeAnswers + * @property {Array.|null} [answers] KnowledgeAnswers answers + */ + + /** + * Constructs a new KnowledgeAnswers. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a KnowledgeAnswers. + * @implements IKnowledgeAnswers + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IKnowledgeAnswers=} [properties] Properties to set + */ + function KnowledgeAnswers(properties) { + this.answers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KnowledgeAnswers answers. + * @member {Array.} answers + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @instance + */ + KnowledgeAnswers.prototype.answers = $util.emptyArray; + + /** + * Creates a new KnowledgeAnswers instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @static + * @param {google.cloud.dialogflow.v2beta1.IKnowledgeAnswers=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers} KnowledgeAnswers instance + */ + KnowledgeAnswers.create = function create(properties) { + return new KnowledgeAnswers(properties); + }; + + /** + * Encodes the specified KnowledgeAnswers message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @static + * @param {google.cloud.dialogflow.v2beta1.IKnowledgeAnswers} message KnowledgeAnswers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeAnswers.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.answers != null && message.answers.length) + for (var i = 0; i < message.answers.length; ++i) + $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.encode(message.answers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified KnowledgeAnswers message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @static + * @param {google.cloud.dialogflow.v2beta1.IKnowledgeAnswers} message KnowledgeAnswers message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeAnswers.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KnowledgeAnswers message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers} KnowledgeAnswers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeAnswers.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.answers && message.answers.length)) + message.answers = []; + message.answers.push($root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KnowledgeAnswers message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers} KnowledgeAnswers + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeAnswers.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KnowledgeAnswers message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KnowledgeAnswers.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.answers != null && message.hasOwnProperty("answers")) { + if (!Array.isArray(message.answers)) + return "answers: array expected"; + for (var i = 0; i < message.answers.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.verify(message.answers[i]); + if (error) + return "answers." + error; + } + } + return null; + }; + + /** + * Creates a KnowledgeAnswers message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers} KnowledgeAnswers + */ + KnowledgeAnswers.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers(); + if (object.answers) { + if (!Array.isArray(object.answers)) + throw TypeError(".google.cloud.dialogflow.v2beta1.KnowledgeAnswers.answers: array expected"); + message.answers = []; + for (var i = 0; i < object.answers.length; ++i) { + if (typeof object.answers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.KnowledgeAnswers.answers: object expected"); + message.answers[i] = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.fromObject(object.answers[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a KnowledgeAnswers message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @static + * @param {google.cloud.dialogflow.v2beta1.KnowledgeAnswers} message KnowledgeAnswers + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KnowledgeAnswers.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.answers = []; + if (message.answers && message.answers.length) { + object.answers = []; + for (var j = 0; j < message.answers.length; ++j) + object.answers[j] = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.toObject(message.answers[j], options); + } + return object; + }; + + /** + * Converts this KnowledgeAnswers to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @instance + * @returns {Object.} JSON object + */ + KnowledgeAnswers.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + KnowledgeAnswers.Answer = (function() { + + /** + * Properties of an Answer. + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @interface IAnswer + * @property {string|null} [source] Answer source + * @property {string|null} [faqQuestion] Answer faqQuestion + * @property {string|null} [answer] Answer answer + * @property {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel|null} [matchConfidenceLevel] Answer matchConfidenceLevel + * @property {number|null} [matchConfidence] Answer matchConfidence + */ + + /** + * Constructs a new Answer. + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @classdesc Represents an Answer. + * @implements IAnswer + * @constructor + * @param {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer=} [properties] Properties to set + */ + function Answer(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Answer source. + * @member {string} source + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @instance + */ + Answer.prototype.source = ""; + + /** + * Answer faqQuestion. + * @member {string} faqQuestion + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @instance + */ + Answer.prototype.faqQuestion = ""; + + /** + * Answer answer. + * @member {string} answer + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @instance + */ + Answer.prototype.answer = ""; + + /** + * Answer matchConfidenceLevel. + * @member {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel} matchConfidenceLevel + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @instance + */ + Answer.prototype.matchConfidenceLevel = 0; + + /** + * Answer matchConfidence. + * @member {number} matchConfidence + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @instance + */ + Answer.prototype.matchConfidence = 0; + + /** + * Creates a new Answer instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @static + * @param {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer} Answer instance + */ + Answer.create = function create(properties) { + return new Answer(properties); + }; + + /** + * Encodes the specified Answer message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @static + * @param {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer} message Answer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Answer.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.source); + if (message.faqQuestion != null && Object.hasOwnProperty.call(message, "faqQuestion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.faqQuestion); + if (message.answer != null && Object.hasOwnProperty.call(message, "answer")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.answer); + if (message.matchConfidenceLevel != null && Object.hasOwnProperty.call(message, "matchConfidenceLevel")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.matchConfidenceLevel); + if (message.matchConfidence != null && Object.hasOwnProperty.call(message, "matchConfidence")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.matchConfidence); + return writer; + }; + + /** + * Encodes the specified Answer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @static + * @param {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer} message Answer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Answer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Answer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer} Answer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Answer.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.source = reader.string(); + break; + case 2: + message.faqQuestion = reader.string(); + break; + case 3: + message.answer = reader.string(); + break; + case 4: + message.matchConfidenceLevel = reader.int32(); + break; + case 5: + message.matchConfidence = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Answer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer} Answer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Answer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Answer message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Answer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.source != null && message.hasOwnProperty("source")) + if (!$util.isString(message.source)) + return "source: string expected"; + if (message.faqQuestion != null && message.hasOwnProperty("faqQuestion")) + if (!$util.isString(message.faqQuestion)) + return "faqQuestion: string expected"; + if (message.answer != null && message.hasOwnProperty("answer")) + if (!$util.isString(message.answer)) + return "answer: string expected"; + if (message.matchConfidenceLevel != null && message.hasOwnProperty("matchConfidenceLevel")) + switch (message.matchConfidenceLevel) { + default: + return "matchConfidenceLevel: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.matchConfidence != null && message.hasOwnProperty("matchConfidence")) + if (typeof message.matchConfidence !== "number") + return "matchConfidence: number expected"; + return null; + }; + + /** + * Creates an Answer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer} Answer + */ + Answer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer(); + if (object.source != null) + message.source = String(object.source); + if (object.faqQuestion != null) + message.faqQuestion = String(object.faqQuestion); + if (object.answer != null) + message.answer = String(object.answer); + switch (object.matchConfidenceLevel) { + case "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED": + case 0: + message.matchConfidenceLevel = 0; + break; + case "LOW": + case 1: + message.matchConfidenceLevel = 1; + break; + case "MEDIUM": + case 2: + message.matchConfidenceLevel = 2; + break; + case "HIGH": + case 3: + message.matchConfidenceLevel = 3; + break; + } + if (object.matchConfidence != null) + message.matchConfidence = Number(object.matchConfidence); + return message; + }; + + /** + * Creates a plain object from an Answer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @static + * @param {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer} message Answer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Answer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.source = ""; + object.faqQuestion = ""; + object.answer = ""; + object.matchConfidenceLevel = options.enums === String ? "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED" : 0; + object.matchConfidence = 0; + } + if (message.source != null && message.hasOwnProperty("source")) + object.source = message.source; + if (message.faqQuestion != null && message.hasOwnProperty("faqQuestion")) + object.faqQuestion = message.faqQuestion; + if (message.answer != null && message.hasOwnProperty("answer")) + object.answer = message.answer; + if (message.matchConfidenceLevel != null && message.hasOwnProperty("matchConfidenceLevel")) + object.matchConfidenceLevel = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel[message.matchConfidenceLevel] : message.matchConfidenceLevel; + if (message.matchConfidence != null && message.hasOwnProperty("matchConfidence")) + object.matchConfidence = options.json && !isFinite(message.matchConfidence) ? String(message.matchConfidence) : message.matchConfidence; + return object; + }; + + /** + * Converts this Answer to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer + * @instance + * @returns {Object.} JSON object + */ + Answer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * MatchConfidenceLevel enum. + * @name google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel + * @enum {number} + * @property {number} MATCH_CONFIDENCE_LEVEL_UNSPECIFIED=0 MATCH_CONFIDENCE_LEVEL_UNSPECIFIED value + * @property {number} LOW=1 LOW value + * @property {number} MEDIUM=2 MEDIUM value + * @property {number} HIGH=3 HIGH value + */ + Answer.MatchConfidenceLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "LOW"] = 1; + values[valuesById[2] = "MEDIUM"] = 2; + values[valuesById[3] = "HIGH"] = 3; + return values; + })(); + + return Answer; + })(); + + return KnowledgeAnswers; + })(); + + v2beta1.StreamingDetectIntentRequest = (function() { + + /** + * Properties of a StreamingDetectIntentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IStreamingDetectIntentRequest + * @property {string|null} [session] StreamingDetectIntentRequest session + * @property {google.cloud.dialogflow.v2beta1.IQueryParameters|null} [queryParams] StreamingDetectIntentRequest queryParams + * @property {google.cloud.dialogflow.v2beta1.IQueryInput|null} [queryInput] StreamingDetectIntentRequest queryInput + * @property {boolean|null} [singleUtterance] StreamingDetectIntentRequest singleUtterance + * @property {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null} [outputAudioConfig] StreamingDetectIntentRequest outputAudioConfig + * @property {google.protobuf.IFieldMask|null} [outputAudioConfigMask] StreamingDetectIntentRequest outputAudioConfigMask + * @property {Uint8Array|null} [inputAudio] StreamingDetectIntentRequest inputAudio + */ + + /** + * Constructs a new StreamingDetectIntentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a StreamingDetectIntentRequest. + * @implements IStreamingDetectIntentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest=} [properties] Properties to set + */ + function StreamingDetectIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingDetectIntentRequest session. + * @member {string} session + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.session = ""; + + /** + * StreamingDetectIntentRequest queryParams. + * @member {google.cloud.dialogflow.v2beta1.IQueryParameters|null|undefined} queryParams + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.queryParams = null; + + /** + * StreamingDetectIntentRequest queryInput. + * @member {google.cloud.dialogflow.v2beta1.IQueryInput|null|undefined} queryInput + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.queryInput = null; + + /** + * StreamingDetectIntentRequest singleUtterance. + * @member {boolean} singleUtterance + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.singleUtterance = false; + + /** + * StreamingDetectIntentRequest outputAudioConfig. + * @member {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.outputAudioConfig = null; + + /** + * StreamingDetectIntentRequest outputAudioConfigMask. + * @member {google.protobuf.IFieldMask|null|undefined} outputAudioConfigMask + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.outputAudioConfigMask = null; + + /** + * StreamingDetectIntentRequest inputAudio. + * @member {Uint8Array} inputAudio + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @instance + */ + StreamingDetectIntentRequest.prototype.inputAudio = $util.newBuffer([]); + + /** + * Creates a new StreamingDetectIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest} StreamingDetectIntentRequest instance + */ + StreamingDetectIntentRequest.create = function create(properties) { + return new StreamingDetectIntentRequest(properties); + }; + + /** + * Encodes the specified StreamingDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest} message StreamingDetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.session != null && Object.hasOwnProperty.call(message, "session")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); + if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) + $root.google.cloud.dialogflow.v2beta1.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) + $root.google.cloud.dialogflow.v2beta1.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.singleUtterance); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.inputAudio != null && Object.hasOwnProperty.call(message, "inputAudio")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.inputAudio); + if (message.outputAudioConfigMask != null && Object.hasOwnProperty.call(message, "outputAudioConfigMask")) + $root.google.protobuf.FieldMask.encode(message.outputAudioConfigMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest} message StreamingDetectIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest} StreamingDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.session = reader.string(); + break; + case 2: + message.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.decode(reader, reader.uint32()); + break; + case 3: + message.queryInput = $root.google.cloud.dialogflow.v2beta1.QueryInput.decode(reader, reader.uint32()); + break; + case 4: + message.singleUtterance = reader.bool(); + break; + case 5: + message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.decode(reader, reader.uint32()); + break; + case 7: + message.outputAudioConfigMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 6: + message.inputAudio = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest} StreamingDetectIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingDetectIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingDetectIntentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.session != null && message.hasOwnProperty("session")) + if (!$util.isString(message.session)) + return "session: string expected"; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) { + var error = $root.google.cloud.dialogflow.v2beta1.QueryParameters.verify(message.queryParams); + if (error) + return "queryParams." + error; + } + if (message.queryInput != null && message.hasOwnProperty("queryInput")) { + var error = $root.google.cloud.dialogflow.v2beta1.QueryInput.verify(message.queryInput); + if (error) + return "queryInput." + error; + } + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + if (typeof message.singleUtterance !== "boolean") + return "singleUtterance: boolean expected"; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.outputAudioConfigMask); + if (error) + return "outputAudioConfigMask." + error; + } + if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) + if (!(message.inputAudio && typeof message.inputAudio.length === "number" || $util.isString(message.inputAudio))) + return "inputAudio: buffer expected"; + return null; + }; + + /** + * Creates a StreamingDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest} StreamingDetectIntentRequest + */ + StreamingDetectIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest(); + if (object.session != null) + message.session = String(object.session); + if (object.queryParams != null) { + if (typeof object.queryParams !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.queryParams: object expected"); + message.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.fromObject(object.queryParams); + } + if (object.queryInput != null) { + if (typeof object.queryInput !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.queryInput: object expected"); + message.queryInput = $root.google.cloud.dialogflow.v2beta1.QueryInput.fromObject(object.queryInput); + } + if (object.singleUtterance != null) + message.singleUtterance = Boolean(object.singleUtterance); + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + if (object.outputAudioConfigMask != null) { + if (typeof object.outputAudioConfigMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.outputAudioConfigMask: object expected"); + message.outputAudioConfigMask = $root.google.protobuf.FieldMask.fromObject(object.outputAudioConfigMask); + } + if (object.inputAudio != null) + if (typeof object.inputAudio === "string") + $util.base64.decode(object.inputAudio, message.inputAudio = $util.newBuffer($util.base64.length(object.inputAudio)), 0); + else if (object.inputAudio.length) + message.inputAudio = object.inputAudio; + return message; + }; + + /** + * Creates a plain object from a StreamingDetectIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest} message StreamingDetectIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingDetectIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.session = ""; + object.queryParams = null; + object.queryInput = null; + object.singleUtterance = false; + object.outputAudioConfig = null; + if (options.bytes === String) + object.inputAudio = ""; + else { + object.inputAudio = []; + if (options.bytes !== Array) + object.inputAudio = $util.newBuffer(object.inputAudio); + } + object.outputAudioConfigMask = null; + } + if (message.session != null && message.hasOwnProperty("session")) + object.session = message.session; + if (message.queryParams != null && message.hasOwnProperty("queryParams")) + object.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.toObject(message.queryParams, options); + if (message.queryInput != null && message.hasOwnProperty("queryInput")) + object.queryInput = $root.google.cloud.dialogflow.v2beta1.QueryInput.toObject(message.queryInput, options); + if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) + object.singleUtterance = message.singleUtterance; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) + object.inputAudio = options.bytes === String ? $util.base64.encode(message.inputAudio, 0, message.inputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputAudio) : message.inputAudio; + if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) + object.outputAudioConfigMask = $root.google.protobuf.FieldMask.toObject(message.outputAudioConfigMask, options); + return object; + }; + + /** + * Converts this StreamingDetectIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @instance + * @returns {Object.} JSON object + */ + StreamingDetectIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StreamingDetectIntentRequest; + })(); + + v2beta1.StreamingDetectIntentResponse = (function() { + + /** + * Properties of a StreamingDetectIntentResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IStreamingDetectIntentResponse + * @property {string|null} [responseId] StreamingDetectIntentResponse responseId + * @property {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null} [recognitionResult] StreamingDetectIntentResponse recognitionResult + * @property {google.cloud.dialogflow.v2beta1.IQueryResult|null} [queryResult] StreamingDetectIntentResponse queryResult + * @property {Array.|null} [alternativeQueryResults] StreamingDetectIntentResponse alternativeQueryResults + * @property {google.rpc.IStatus|null} [webhookStatus] StreamingDetectIntentResponse webhookStatus + * @property {Uint8Array|null} [outputAudio] StreamingDetectIntentResponse outputAudio + * @property {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null} [outputAudioConfig] StreamingDetectIntentResponse outputAudioConfig + */ + + /** + * Constructs a new StreamingDetectIntentResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a StreamingDetectIntentResponse. + * @implements IStreamingDetectIntentResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse=} [properties] Properties to set + */ + function StreamingDetectIntentResponse(properties) { + this.alternativeQueryResults = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingDetectIntentResponse responseId. + * @member {string} responseId + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.responseId = ""; + + /** + * StreamingDetectIntentResponse recognitionResult. + * @member {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null|undefined} recognitionResult + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.recognitionResult = null; + + /** + * StreamingDetectIntentResponse queryResult. + * @member {google.cloud.dialogflow.v2beta1.IQueryResult|null|undefined} queryResult + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.queryResult = null; + + /** + * StreamingDetectIntentResponse alternativeQueryResults. + * @member {Array.} alternativeQueryResults + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.alternativeQueryResults = $util.emptyArray; + + /** + * StreamingDetectIntentResponse webhookStatus. + * @member {google.rpc.IStatus|null|undefined} webhookStatus + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.webhookStatus = null; + + /** + * StreamingDetectIntentResponse outputAudio. + * @member {Uint8Array} outputAudio + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.outputAudio = $util.newBuffer([]); + + /** + * StreamingDetectIntentResponse outputAudioConfig. + * @member {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null|undefined} outputAudioConfig + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @instance + */ + StreamingDetectIntentResponse.prototype.outputAudioConfig = null; + + /** + * Creates a new StreamingDetectIntentResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse} StreamingDetectIntentResponse instance + */ + StreamingDetectIntentResponse.create = function create(properties) { + return new StreamingDetectIntentResponse(properties); + }; + + /** + * Encodes the specified StreamingDetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse} message StreamingDetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); + if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) + $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) + $root.google.cloud.dialogflow.v2beta1.QueryResult.encode(message.queryResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.webhookStatus != null && Object.hasOwnProperty.call(message, "webhookStatus")) + $root.google.rpc.Status.encode(message.webhookStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.outputAudio != null && Object.hasOwnProperty.call(message, "outputAudio")) + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.outputAudio); + if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) + $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.alternativeQueryResults != null && message.alternativeQueryResults.length) + for (var i = 0; i < message.alternativeQueryResults.length; ++i) + $root.google.cloud.dialogflow.v2beta1.QueryResult.encode(message.alternativeQueryResults[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingDetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse} message StreamingDetectIntentResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingDetectIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse} StreamingDetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.responseId = reader.string(); + break; + case 2: + message.recognitionResult = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.decode(reader, reader.uint32()); + break; + case 3: + message.queryResult = $root.google.cloud.dialogflow.v2beta1.QueryResult.decode(reader, reader.uint32()); + break; + case 7: + if (!(message.alternativeQueryResults && message.alternativeQueryResults.length)) + message.alternativeQueryResults = []; + message.alternativeQueryResults.push($root.google.cloud.dialogflow.v2beta1.QueryResult.decode(reader, reader.uint32())); + break; + case 4: + message.webhookStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + case 5: + message.outputAudio = reader.bytes(); + break; + case 6: + message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse} StreamingDetectIntentResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingDetectIntentResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingDetectIntentResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingDetectIntentResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.responseId != null && message.hasOwnProperty("responseId")) + if (!$util.isString(message.responseId)) + return "responseId: string expected"; + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { + var error = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.verify(message.recognitionResult); + if (error) + return "recognitionResult." + error; + } + if (message.queryResult != null && message.hasOwnProperty("queryResult")) { + var error = $root.google.cloud.dialogflow.v2beta1.QueryResult.verify(message.queryResult); + if (error) + return "queryResult." + error; + } + if (message.alternativeQueryResults != null && message.hasOwnProperty("alternativeQueryResults")) { + if (!Array.isArray(message.alternativeQueryResults)) + return "alternativeQueryResults: array expected"; + for (var i = 0; i < message.alternativeQueryResults.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.QueryResult.verify(message.alternativeQueryResults[i]); + if (error) + return "alternativeQueryResults." + error; + } + } + if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) { + var error = $root.google.rpc.Status.verify(message.webhookStatus); + if (error) + return "webhookStatus." + error; + } + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + if (!(message.outputAudio && typeof message.outputAudio.length === "number" || $util.isString(message.outputAudio))) + return "outputAudio: buffer expected"; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify(message.outputAudioConfig); + if (error) + return "outputAudioConfig." + error; + } + return null; + }; + + /** + * Creates a StreamingDetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse} StreamingDetectIntentResponse + */ + StreamingDetectIntentResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse(); + if (object.responseId != null) + message.responseId = String(object.responseId); + if (object.recognitionResult != null) { + if (typeof object.recognitionResult !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.recognitionResult: object expected"); + message.recognitionResult = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.fromObject(object.recognitionResult); + } + if (object.queryResult != null) { + if (typeof object.queryResult !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.queryResult: object expected"); + message.queryResult = $root.google.cloud.dialogflow.v2beta1.QueryResult.fromObject(object.queryResult); + } + if (object.alternativeQueryResults) { + if (!Array.isArray(object.alternativeQueryResults)) + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.alternativeQueryResults: array expected"); + message.alternativeQueryResults = []; + for (var i = 0; i < object.alternativeQueryResults.length; ++i) { + if (typeof object.alternativeQueryResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.alternativeQueryResults: object expected"); + message.alternativeQueryResults[i] = $root.google.cloud.dialogflow.v2beta1.QueryResult.fromObject(object.alternativeQueryResults[i]); + } + } + if (object.webhookStatus != null) { + if (typeof object.webhookStatus !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.webhookStatus: object expected"); + message.webhookStatus = $root.google.rpc.Status.fromObject(object.webhookStatus); + } + if (object.outputAudio != null) + if (typeof object.outputAudio === "string") + $util.base64.decode(object.outputAudio, message.outputAudio = $util.newBuffer($util.base64.length(object.outputAudio)), 0); + else if (object.outputAudio.length) + message.outputAudio = object.outputAudio; + if (object.outputAudioConfig != null) { + if (typeof object.outputAudioConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.outputAudioConfig: object expected"); + message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.fromObject(object.outputAudioConfig); + } + return message; + }; + + /** + * Creates a plain object from a StreamingDetectIntentResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse} message StreamingDetectIntentResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingDetectIntentResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.alternativeQueryResults = []; + if (options.defaults) { + object.responseId = ""; + object.recognitionResult = null; + object.queryResult = null; + object.webhookStatus = null; + if (options.bytes === String) + object.outputAudio = ""; + else { + object.outputAudio = []; + if (options.bytes !== Array) + object.outputAudio = $util.newBuffer(object.outputAudio); + } + object.outputAudioConfig = null; + } + if (message.responseId != null && message.hasOwnProperty("responseId")) + object.responseId = message.responseId; + if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) + object.recognitionResult = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.toObject(message.recognitionResult, options); + if (message.queryResult != null && message.hasOwnProperty("queryResult")) + object.queryResult = $root.google.cloud.dialogflow.v2beta1.QueryResult.toObject(message.queryResult, options); + if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) + object.webhookStatus = $root.google.rpc.Status.toObject(message.webhookStatus, options); + if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) + object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; + if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) + object.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); + if (message.alternativeQueryResults && message.alternativeQueryResults.length) { + object.alternativeQueryResults = []; + for (var j = 0; j < message.alternativeQueryResults.length; ++j) + object.alternativeQueryResults[j] = $root.google.cloud.dialogflow.v2beta1.QueryResult.toObject(message.alternativeQueryResults[j], options); + } + return object; + }; + + /** + * Converts this StreamingDetectIntentResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @instance + * @returns {Object.} JSON object + */ + StreamingDetectIntentResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StreamingDetectIntentResponse; + })(); + + v2beta1.StreamingRecognitionResult = (function() { + + /** + * Properties of a StreamingRecognitionResult. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IStreamingRecognitionResult + * @property {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType|null} [messageType] StreamingRecognitionResult messageType + * @property {string|null} [transcript] StreamingRecognitionResult transcript + * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal + * @property {number|null} [confidence] StreamingRecognitionResult confidence + * @property {number|null} [stability] StreamingRecognitionResult stability + * @property {Array.|null} [speechWordInfo] StreamingRecognitionResult speechWordInfo + * @property {google.protobuf.IDuration|null} [speechEndOffset] StreamingRecognitionResult speechEndOffset + * @property {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents|null} [dtmfDigits] StreamingRecognitionResult dtmfDigits + */ + + /** + * Constructs a new StreamingRecognitionResult. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a StreamingRecognitionResult. + * @implements IStreamingRecognitionResult + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult=} [properties] Properties to set + */ + function StreamingRecognitionResult(properties) { + this.speechWordInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StreamingRecognitionResult messageType. + * @member {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType} messageType + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.messageType = 0; + + /** + * StreamingRecognitionResult transcript. + * @member {string} transcript + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.transcript = ""; + + /** + * StreamingRecognitionResult isFinal. + * @member {boolean} isFinal + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.isFinal = false; + + /** + * StreamingRecognitionResult confidence. + * @member {number} confidence + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.confidence = 0; + + /** + * StreamingRecognitionResult stability. + * @member {number} stability + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.stability = 0; + + /** + * StreamingRecognitionResult speechWordInfo. + * @member {Array.} speechWordInfo + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.speechWordInfo = $util.emptyArray; + + /** + * StreamingRecognitionResult speechEndOffset. + * @member {google.protobuf.IDuration|null|undefined} speechEndOffset + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.speechEndOffset = null; + + /** + * StreamingRecognitionResult dtmfDigits. + * @member {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents|null|undefined} dtmfDigits + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @instance + */ + StreamingRecognitionResult.prototype.dtmfDigits = null; + + /** + * Creates a new StreamingRecognitionResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult} StreamingRecognitionResult instance + */ + StreamingRecognitionResult.create = function create(properties) { + return new StreamingRecognitionResult(properties); + }; + + /** + * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.messageType); + if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.transcript); + if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isFinal); + if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) + writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); + if (message.dtmfDigits != null && Object.hasOwnProperty.call(message, "dtmfDigits")) + $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.encode(message.dtmfDigits, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.stability != null && Object.hasOwnProperty.call(message, "stability")) + writer.uint32(/* id 6, wireType 5 =*/53).float(message.stability); + if (message.speechWordInfo != null && message.speechWordInfo.length) + for (var i = 0; i < message.speechWordInfo.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo.encode(message.speechWordInfo[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.speechEndOffset != null && Object.hasOwnProperty.call(message, "speechEndOffset")) + $root.google.protobuf.Duration.encode(message.speechEndOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageType = reader.int32(); + break; + case 2: + message.transcript = reader.string(); + break; + case 3: + message.isFinal = reader.bool(); + break; + case 4: + message.confidence = reader.float(); + break; + case 6: + message.stability = reader.float(); + break; + case 7: + if (!(message.speechWordInfo && message.speechWordInfo.length)) + message.speechWordInfo = []; + message.speechWordInfo.push($root.google.cloud.dialogflow.v2beta1.SpeechWordInfo.decode(reader, reader.uint32())); + break; + case 8: + message.speechEndOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + case 5: + message.dtmfDigits = $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult} StreamingRecognitionResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StreamingRecognitionResult message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StreamingRecognitionResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageType != null && message.hasOwnProperty("messageType")) + switch (message.messageType) { + default: + return "messageType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.transcript != null && message.hasOwnProperty("transcript")) + if (!$util.isString(message.transcript)) + return "transcript: string expected"; + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + if (typeof message.isFinal !== "boolean") + return "isFinal: boolean expected"; + if (message.confidence != null && message.hasOwnProperty("confidence")) + if (typeof message.confidence !== "number") + return "confidence: number expected"; + if (message.stability != null && message.hasOwnProperty("stability")) + if (typeof message.stability !== "number") + return "stability: number expected"; + if (message.speechWordInfo != null && message.hasOwnProperty("speechWordInfo")) { + if (!Array.isArray(message.speechWordInfo)) + return "speechWordInfo: array expected"; + for (var i = 0; i < message.speechWordInfo.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo.verify(message.speechWordInfo[i]); + if (error) + return "speechWordInfo." + error; + } + } + if (message.speechEndOffset != null && message.hasOwnProperty("speechEndOffset")) { + var error = $root.google.protobuf.Duration.verify(message.speechEndOffset); + if (error) + return "speechEndOffset." + error; + } + if (message.dtmfDigits != null && message.hasOwnProperty("dtmfDigits")) { + var error = $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.verify(message.dtmfDigits); + if (error) + return "dtmfDigits." + error; + } + return null; + }; + + /** + * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult} StreamingRecognitionResult + */ + StreamingRecognitionResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult(); + switch (object.messageType) { + case "MESSAGE_TYPE_UNSPECIFIED": + case 0: + message.messageType = 0; + break; + case "TRANSCRIPT": + case 1: + message.messageType = 1; + break; + case "END_OF_SINGLE_UTTERANCE": + case 2: + message.messageType = 2; + break; + } + if (object.transcript != null) + message.transcript = String(object.transcript); + if (object.isFinal != null) + message.isFinal = Boolean(object.isFinal); + if (object.confidence != null) + message.confidence = Number(object.confidence); + if (object.stability != null) + message.stability = Number(object.stability); + if (object.speechWordInfo) { + if (!Array.isArray(object.speechWordInfo)) + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.speechWordInfo: array expected"); + message.speechWordInfo = []; + for (var i = 0; i < object.speechWordInfo.length; ++i) { + if (typeof object.speechWordInfo[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.speechWordInfo: object expected"); + message.speechWordInfo[i] = $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo.fromObject(object.speechWordInfo[i]); + } + } + if (object.speechEndOffset != null) { + if (typeof object.speechEndOffset !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.speechEndOffset: object expected"); + message.speechEndOffset = $root.google.protobuf.Duration.fromObject(object.speechEndOffset); + } + if (object.dtmfDigits != null) { + if (typeof object.dtmfDigits !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.dtmfDigits: object expected"); + message.dtmfDigits = $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.fromObject(object.dtmfDigits); + } + return message; + }; + + /** + * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @static + * @param {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult} message StreamingRecognitionResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StreamingRecognitionResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.speechWordInfo = []; + if (options.defaults) { + object.messageType = options.enums === String ? "MESSAGE_TYPE_UNSPECIFIED" : 0; + object.transcript = ""; + object.isFinal = false; + object.confidence = 0; + object.dtmfDigits = null; + object.stability = 0; + object.speechEndOffset = null; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) + object.messageType = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType[message.messageType] : message.messageType; + if (message.transcript != null && message.hasOwnProperty("transcript")) + object.transcript = message.transcript; + if (message.isFinal != null && message.hasOwnProperty("isFinal")) + object.isFinal = message.isFinal; + if (message.confidence != null && message.hasOwnProperty("confidence")) + object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; + if (message.dtmfDigits != null && message.hasOwnProperty("dtmfDigits")) + object.dtmfDigits = $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.toObject(message.dtmfDigits, options); + if (message.stability != null && message.hasOwnProperty("stability")) + object.stability = options.json && !isFinite(message.stability) ? String(message.stability) : message.stability; + if (message.speechWordInfo && message.speechWordInfo.length) { + object.speechWordInfo = []; + for (var j = 0; j < message.speechWordInfo.length; ++j) + object.speechWordInfo[j] = $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo.toObject(message.speechWordInfo[j], options); + } + if (message.speechEndOffset != null && message.hasOwnProperty("speechEndOffset")) + object.speechEndOffset = $root.google.protobuf.Duration.toObject(message.speechEndOffset, options); + return object; + }; + + /** + * Converts this StreamingRecognitionResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @instance + * @returns {Object.} JSON object + */ + StreamingRecognitionResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * MessageType enum. + * @name google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType + * @enum {number} + * @property {number} MESSAGE_TYPE_UNSPECIFIED=0 MESSAGE_TYPE_UNSPECIFIED value + * @property {number} TRANSCRIPT=1 TRANSCRIPT value + * @property {number} END_OF_SINGLE_UTTERANCE=2 END_OF_SINGLE_UTTERANCE value + */ + StreamingRecognitionResult.MessageType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TRANSCRIPT"] = 1; + values[valuesById[2] = "END_OF_SINGLE_UTTERANCE"] = 2; + return values; + })(); + + return StreamingRecognitionResult; + })(); + + v2beta1.TextInput = (function() { + + /** + * Properties of a TextInput. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ITextInput + * @property {string|null} [text] TextInput text + * @property {string|null} [languageCode] TextInput languageCode + */ + + /** + * Constructs a new TextInput. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a TextInput. + * @implements ITextInput + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ITextInput=} [properties] Properties to set + */ + function TextInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TextInput text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @instance + */ + TextInput.prototype.text = ""; + + /** + * TextInput languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @instance + */ + TextInput.prototype.languageCode = ""; + + /** + * Creates a new TextInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @static + * @param {google.cloud.dialogflow.v2beta1.ITextInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.TextInput} TextInput instance + */ + TextInput.create = function create(properties) { + return new TextInput(properties); + }; + + /** + * Encodes the specified TextInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TextInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @static + * @param {google.cloud.dialogflow.v2beta1.ITextInput} message TextInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TextInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @static + * @param {google.cloud.dialogflow.v2beta1.ITextInput} message TextInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TextInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TextInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.TextInput} TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextInput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.TextInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TextInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.TextInput} TextInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TextInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TextInput message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TextInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates a TextInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.TextInput} TextInput + */ + TextInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.TextInput) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.TextInput(); + if (object.text != null) + message.text = String(object.text); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from a TextInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @static + * @param {google.cloud.dialogflow.v2beta1.TextInput} message TextInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TextInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.languageCode = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this TextInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @instance + * @returns {Object.} JSON object + */ + TextInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TextInput; + })(); + + v2beta1.EventInput = (function() { + + /** + * Properties of an EventInput. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IEventInput + * @property {string|null} [name] EventInput name + * @property {google.protobuf.IStruct|null} [parameters] EventInput parameters + * @property {string|null} [languageCode] EventInput languageCode + */ + + /** + * Constructs a new EventInput. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an EventInput. + * @implements IEventInput + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IEventInput=} [properties] Properties to set + */ + function EventInput(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EventInput name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @instance + */ + EventInput.prototype.name = ""; + + /** + * EventInput parameters. + * @member {google.protobuf.IStruct|null|undefined} parameters + * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @instance + */ + EventInput.prototype.parameters = null; + + /** + * EventInput languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @instance + */ + EventInput.prototype.languageCode = ""; + + /** + * Creates a new EventInput instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @static + * @param {google.cloud.dialogflow.v2beta1.IEventInput=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.EventInput} EventInput instance + */ + EventInput.create = function create(properties) { + return new EventInput(properties); + }; + + /** + * Encodes the specified EventInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EventInput.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @static + * @param {google.cloud.dialogflow.v2beta1.IEventInput} message EventInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventInput.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified EventInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EventInput.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @static + * @param {google.cloud.dialogflow.v2beta1.IEventInput} message EventInput message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EventInput.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EventInput message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.EventInput} EventInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventInput.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.EventInput(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 3: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EventInput message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.EventInput} EventInput + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EventInput.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EventInput message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EventInput.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Struct.verify(message.parameters); + if (error) + return "parameters." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; + + /** + * Creates an EventInput message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.EventInput} EventInput + */ + EventInput.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.EventInput) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.EventInput(); + if (object.name != null) + message.name = String(object.name); + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.EventInput.parameters: object expected"); + message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; + + /** + * Creates a plain object from an EventInput message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @static + * @param {google.cloud.dialogflow.v2beta1.EventInput} message EventInput + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EventInput.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.parameters = null; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; + + /** + * Converts this EventInput to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @instance + * @returns {Object.} JSON object + */ + EventInput.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EventInput; + })(); + + v2beta1.SentimentAnalysisRequestConfig = (function() { + + /** + * Properties of a SentimentAnalysisRequestConfig. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISentimentAnalysisRequestConfig + * @property {boolean|null} [analyzeQueryTextSentiment] SentimentAnalysisRequestConfig analyzeQueryTextSentiment + */ + + /** + * Constructs a new SentimentAnalysisRequestConfig. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SentimentAnalysisRequestConfig. + * @implements ISentimentAnalysisRequestConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig=} [properties] Properties to set + */ + function SentimentAnalysisRequestConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SentimentAnalysisRequestConfig analyzeQueryTextSentiment. + * @member {boolean} analyzeQueryTextSentiment + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @instance + */ + SentimentAnalysisRequestConfig.prototype.analyzeQueryTextSentiment = false; + + /** + * Creates a new SentimentAnalysisRequestConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig instance + */ + SentimentAnalysisRequestConfig.create = function create(properties) { + return new SentimentAnalysisRequestConfig(properties); + }; + + /** + * Encodes the specified SentimentAnalysisRequestConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig} message SentimentAnalysisRequestConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisRequestConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.analyzeQueryTextSentiment != null && Object.hasOwnProperty.call(message, "analyzeQueryTextSentiment")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.analyzeQueryTextSentiment); + return writer; + }; + + /** + * Encodes the specified SentimentAnalysisRequestConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig} message SentimentAnalysisRequestConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisRequestConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisRequestConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.analyzeQueryTextSentiment = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisRequestConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SentimentAnalysisRequestConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SentimentAnalysisRequestConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.analyzeQueryTextSentiment != null && message.hasOwnProperty("analyzeQueryTextSentiment")) + if (typeof message.analyzeQueryTextSentiment !== "boolean") + return "analyzeQueryTextSentiment: boolean expected"; + return null; + }; + + /** + * Creates a SentimentAnalysisRequestConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig + */ + SentimentAnalysisRequestConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig(); + if (object.analyzeQueryTextSentiment != null) + message.analyzeQueryTextSentiment = Boolean(object.analyzeQueryTextSentiment); + return message; + }; + + /** + * Creates a plain object from a SentimentAnalysisRequestConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig} message SentimentAnalysisRequestConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SentimentAnalysisRequestConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.analyzeQueryTextSentiment = false; + if (message.analyzeQueryTextSentiment != null && message.hasOwnProperty("analyzeQueryTextSentiment")) + object.analyzeQueryTextSentiment = message.analyzeQueryTextSentiment; + return object; + }; + + /** + * Converts this SentimentAnalysisRequestConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @instance + * @returns {Object.} JSON object + */ + SentimentAnalysisRequestConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SentimentAnalysisRequestConfig; + })(); + + v2beta1.SentimentAnalysisResult = (function() { + + /** + * Properties of a SentimentAnalysisResult. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISentimentAnalysisResult + * @property {google.cloud.dialogflow.v2beta1.ISentiment|null} [queryTextSentiment] SentimentAnalysisResult queryTextSentiment + */ + + /** + * Constructs a new SentimentAnalysisResult. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SentimentAnalysisResult. + * @implements ISentimentAnalysisResult + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult=} [properties] Properties to set + */ + function SentimentAnalysisResult(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SentimentAnalysisResult queryTextSentiment. + * @member {google.cloud.dialogflow.v2beta1.ISentiment|null|undefined} queryTextSentiment + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @instance + */ + SentimentAnalysisResult.prototype.queryTextSentiment = null; + + /** + * Creates a new SentimentAnalysisResult instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisResult} SentimentAnalysisResult instance + */ + SentimentAnalysisResult.create = function create(properties) { + return new SentimentAnalysisResult(properties); + }; + + /** + * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisResult.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.queryTextSentiment != null && Object.hasOwnProperty.call(message, "queryTextSentiment")) + $root.google.cloud.dialogflow.v2beta1.Sentiment.encode(message.queryTextSentiment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SentimentAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisResult} SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisResult.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.queryTextSentiment = $root.google.cloud.dialogflow.v2beta1.Sentiment.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisResult} SentimentAnalysisResult + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SentimentAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SentimentAnalysisResult message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SentimentAnalysisResult.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.queryTextSentiment != null && message.hasOwnProperty("queryTextSentiment")) { + var error = $root.google.cloud.dialogflow.v2beta1.Sentiment.verify(message.queryTextSentiment); + if (error) + return "queryTextSentiment." + error; + } + return null; + }; + + /** + * Creates a SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisResult} SentimentAnalysisResult + */ + SentimentAnalysisResult.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult(); + if (object.queryTextSentiment != null) { + if (typeof object.queryTextSentiment !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.queryTextSentiment: object expected"); + message.queryTextSentiment = $root.google.cloud.dialogflow.v2beta1.Sentiment.fromObject(object.queryTextSentiment); + } + return message; + }; + + /** + * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @static + * @param {google.cloud.dialogflow.v2beta1.SentimentAnalysisResult} message SentimentAnalysisResult + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SentimentAnalysisResult.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.queryTextSentiment = null; + if (message.queryTextSentiment != null && message.hasOwnProperty("queryTextSentiment")) + object.queryTextSentiment = $root.google.cloud.dialogflow.v2beta1.Sentiment.toObject(message.queryTextSentiment, options); + return object; + }; + + /** + * Converts this SentimentAnalysisResult to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @instance + * @returns {Object.} JSON object + */ + SentimentAnalysisResult.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SentimentAnalysisResult; + })(); + + v2beta1.Sentiment = (function() { + + /** + * Properties of a Sentiment. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISentiment + * @property {number|null} [score] Sentiment score + * @property {number|null} [magnitude] Sentiment magnitude + */ + + /** + * Constructs a new Sentiment. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a Sentiment. + * @implements ISentiment + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISentiment=} [properties] Properties to set + */ + function Sentiment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Sentiment score. + * @member {number} score + * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @instance + */ + Sentiment.prototype.score = 0; + + /** + * Sentiment magnitude. + * @member {number} magnitude + * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @instance + */ + Sentiment.prototype.magnitude = 0; + + /** + * Creates a new Sentiment instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @static + * @param {google.cloud.dialogflow.v2beta1.ISentiment=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Sentiment} Sentiment instance + */ + Sentiment.create = function create(properties) { + return new Sentiment(properties); + }; + + /** + * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Sentiment.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @static + * @param {google.cloud.dialogflow.v2beta1.ISentiment} message Sentiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sentiment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.score != null && Object.hasOwnProperty.call(message, "score")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); + if (message.magnitude != null && Object.hasOwnProperty.call(message, "magnitude")) + writer.uint32(/* id 2, wireType 5 =*/21).float(message.magnitude); + return writer; + }; + + /** + * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Sentiment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @static + * @param {google.cloud.dialogflow.v2beta1.ISentiment} message Sentiment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Sentiment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Sentiment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Sentiment} Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sentiment.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Sentiment(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.score = reader.float(); + break; + case 2: + message.magnitude = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Sentiment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Sentiment} Sentiment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Sentiment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Sentiment message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Sentiment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.score != null && message.hasOwnProperty("score")) + if (typeof message.score !== "number") + return "score: number expected"; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + if (typeof message.magnitude !== "number") + return "magnitude: number expected"; + return null; + }; + + /** + * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Sentiment} Sentiment + */ + Sentiment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Sentiment) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Sentiment(); + if (object.score != null) + message.score = Number(object.score); + if (object.magnitude != null) + message.magnitude = Number(object.magnitude); + return message; + }; + + /** + * Creates a plain object from a Sentiment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @static + * @param {google.cloud.dialogflow.v2beta1.Sentiment} message Sentiment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Sentiment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.score = 0; + object.magnitude = 0; + } + if (message.score != null && message.hasOwnProperty("score")) + object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; + if (message.magnitude != null && message.hasOwnProperty("magnitude")) + object.magnitude = options.json && !isFinite(message.magnitude) ? String(message.magnitude) : message.magnitude; + return object; + }; + + /** + * Converts this Sentiment to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @instance + * @returns {Object.} JSON object + */ + Sentiment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Sentiment; + })(); + + v2beta1.Contexts = (function() { + + /** + * Constructs a new Contexts service. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a Contexts + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Contexts(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Contexts.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Contexts; + + /** + * Creates new Contexts service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Contexts} RPC service. Useful where requests and/or responses are streamed. + */ + Contexts.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#listContexts}. + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @typedef ListContextsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListContextsResponse} [response] ListContextsResponse + */ + + /** + * Calls ListContexts. + * @function listContexts + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListContextsRequest} request ListContextsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Contexts.ListContextsCallback} callback Node-style callback called with the error, if any, and ListContextsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Contexts.prototype.listContexts = function listContexts(request, callback) { + return this.rpcCall(listContexts, $root.google.cloud.dialogflow.v2beta1.ListContextsRequest, $root.google.cloud.dialogflow.v2beta1.ListContextsResponse, request, callback); + }, "name", { value: "ListContexts" }); + + /** + * Calls ListContexts. + * @function listContexts + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListContextsRequest} request ListContextsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#getContext}. + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @typedef GetContextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Context} [response] Context + */ + + /** + * Calls GetContext. + * @function getContext + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetContextRequest} request GetContextRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Contexts.GetContextCallback} callback Node-style callback called with the error, if any, and Context + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Contexts.prototype.getContext = function getContext(request, callback) { + return this.rpcCall(getContext, $root.google.cloud.dialogflow.v2beta1.GetContextRequest, $root.google.cloud.dialogflow.v2beta1.Context, request, callback); + }, "name", { value: "GetContext" }); + + /** + * Calls GetContext. + * @function getContext + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetContextRequest} request GetContextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#createContext}. + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @typedef CreateContextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Context} [response] Context + */ + + /** + * Calls CreateContext. + * @function createContext + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateContextRequest} request CreateContextRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Contexts.CreateContextCallback} callback Node-style callback called with the error, if any, and Context + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Contexts.prototype.createContext = function createContext(request, callback) { + return this.rpcCall(createContext, $root.google.cloud.dialogflow.v2beta1.CreateContextRequest, $root.google.cloud.dialogflow.v2beta1.Context, request, callback); + }, "name", { value: "CreateContext" }); + + /** + * Calls CreateContext. + * @function createContext + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateContextRequest} request CreateContextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#updateContext}. + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @typedef UpdateContextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Context} [response] Context + */ + + /** + * Calls UpdateContext. + * @function updateContext + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateContextRequest} request UpdateContextRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Contexts.UpdateContextCallback} callback Node-style callback called with the error, if any, and Context + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Contexts.prototype.updateContext = function updateContext(request, callback) { + return this.rpcCall(updateContext, $root.google.cloud.dialogflow.v2beta1.UpdateContextRequest, $root.google.cloud.dialogflow.v2beta1.Context, request, callback); + }, "name", { value: "UpdateContext" }); + + /** + * Calls UpdateContext. + * @function updateContext + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateContextRequest} request UpdateContextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#deleteContext}. + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @typedef DeleteContextCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteContext. + * @function deleteContext + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteContextRequest} request DeleteContextRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Contexts.DeleteContextCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Contexts.prototype.deleteContext = function deleteContext(request, callback) { + return this.rpcCall(deleteContext, $root.google.cloud.dialogflow.v2beta1.DeleteContextRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteContext" }); + + /** + * Calls DeleteContext. + * @function deleteContext + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteContextRequest} request DeleteContextRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Contexts#deleteAllContexts}. + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @typedef DeleteAllContextsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteAllContexts. + * @function deleteAllContexts + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest} request DeleteAllContextsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Contexts.DeleteAllContextsCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Contexts.prototype.deleteAllContexts = function deleteAllContexts(request, callback) { + return this.rpcCall(deleteAllContexts, $root.google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteAllContexts" }); + + /** + * Calls DeleteAllContexts. + * @function deleteAllContexts + * @memberof google.cloud.dialogflow.v2beta1.Contexts + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest} request DeleteAllContextsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Contexts; + })(); + + v2beta1.Context = (function() { + + /** + * Properties of a Context. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IContext + * @property {string|null} [name] Context name + * @property {number|null} [lifespanCount] Context lifespanCount + * @property {google.protobuf.IStruct|null} [parameters] Context parameters + */ + + /** + * Constructs a new Context. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a Context. + * @implements IContext + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IContext=} [properties] Properties to set + */ + function Context(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Context name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.Context + * @instance + */ + Context.prototype.name = ""; + + /** + * Context lifespanCount. + * @member {number} lifespanCount + * @memberof google.cloud.dialogflow.v2beta1.Context + * @instance + */ + Context.prototype.lifespanCount = 0; + + /** + * Context parameters. + * @member {google.protobuf.IStruct|null|undefined} parameters + * @memberof google.cloud.dialogflow.v2beta1.Context + * @instance + */ + Context.prototype.parameters = null; + + /** + * Creates a new Context instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Context + * @static + * @param {google.cloud.dialogflow.v2beta1.IContext=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Context} Context instance + */ + Context.create = function create(properties) { + return new Context(properties); + }; + + /** + * Encodes the specified Context message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Context.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Context + * @static + * @param {google.cloud.dialogflow.v2beta1.IContext} message Context message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Context.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.lifespanCount != null && Object.hasOwnProperty.call(message, "lifespanCount")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.lifespanCount); + if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) + $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Context message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Context.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Context + * @static + * @param {google.cloud.dialogflow.v2beta1.IContext} message Context message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Context.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Context message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Context + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Context} Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Context.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Context(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.lifespanCount = reader.int32(); + break; + case 3: + message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Context message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Context + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Context} Context + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Context.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Context message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Context + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Context.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.lifespanCount != null && message.hasOwnProperty("lifespanCount")) + if (!$util.isInteger(message.lifespanCount)) + return "lifespanCount: integer expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + var error = $root.google.protobuf.Struct.verify(message.parameters); + if (error) + return "parameters." + error; + } + return null; + }; + + /** + * Creates a Context message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Context + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Context} Context + */ + Context.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Context) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Context(); + if (object.name != null) + message.name = String(object.name); + if (object.lifespanCount != null) + message.lifespanCount = object.lifespanCount | 0; + if (object.parameters != null) { + if (typeof object.parameters !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Context.parameters: object expected"); + message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters); + } + return message; + }; + + /** + * Creates a plain object from a Context message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Context + * @static + * @param {google.cloud.dialogflow.v2beta1.Context} message Context + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Context.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.lifespanCount = 0; + object.parameters = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.lifespanCount != null && message.hasOwnProperty("lifespanCount")) + object.lifespanCount = message.lifespanCount; + if (message.parameters != null && message.hasOwnProperty("parameters")) + object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); + return object; + }; + + /** + * Converts this Context to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Context + * @instance + * @returns {Object.} JSON object + */ + Context.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Context; + })(); + + v2beta1.ListContextsRequest = (function() { + + /** + * Properties of a ListContextsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListContextsRequest + * @property {string|null} [parent] ListContextsRequest parent + * @property {number|null} [pageSize] ListContextsRequest pageSize + * @property {string|null} [pageToken] ListContextsRequest pageToken + */ + + /** + * Constructs a new ListContextsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListContextsRequest. + * @implements IListContextsRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListContextsRequest=} [properties] Properties to set + */ + function ListContextsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListContextsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @instance + */ + ListContextsRequest.prototype.parent = ""; + + /** + * ListContextsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @instance + */ + ListContextsRequest.prototype.pageSize = 0; + + /** + * ListContextsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @instance + */ + ListContextsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListContextsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListContextsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListContextsRequest} ListContextsRequest instance + */ + ListContextsRequest.create = function create(properties) { + return new ListContextsRequest(properties); + }; + + /** + * Encodes the specified ListContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListContextsRequest} message ListContextsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContextsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListContextsRequest} message ListContextsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContextsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListContextsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListContextsRequest} ListContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContextsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListContextsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListContextsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListContextsRequest} ListContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContextsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListContextsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContextsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListContextsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListContextsRequest} ListContextsRequest + */ + ListContextsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListContextsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListContextsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListContextsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ListContextsRequest} message ListContextsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContextsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListContextsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListContextsRequest + * @instance + * @returns {Object.} JSON object + */ + ListContextsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListContextsRequest; + })(); + + v2beta1.ListContextsResponse = (function() { + + /** + * Properties of a ListContextsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListContextsResponse + * @property {Array.|null} [contexts] ListContextsResponse contexts + * @property {string|null} [nextPageToken] ListContextsResponse nextPageToken + */ + + /** + * Constructs a new ListContextsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListContextsResponse. + * @implements IListContextsResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListContextsResponse=} [properties] Properties to set + */ + function ListContextsResponse(properties) { + this.contexts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListContextsResponse contexts. + * @member {Array.} contexts + * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @instance + */ + ListContextsResponse.prototype.contexts = $util.emptyArray; + + /** + * ListContextsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @instance + */ + ListContextsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListContextsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListContextsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListContextsResponse} ListContextsResponse instance + */ + ListContextsResponse.create = function create(properties) { + return new ListContextsResponse(properties); + }; + + /** + * Encodes the specified ListContextsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListContextsResponse} message ListContextsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContextsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.contexts != null && message.contexts.length) + for (var i = 0; i < message.contexts.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Context.encode(message.contexts[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListContextsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListContextsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListContextsResponse} message ListContextsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListContextsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListContextsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListContextsResponse} ListContextsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContextsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListContextsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.contexts && message.contexts.length)) + message.contexts = []; + message.contexts.push($root.google.cloud.dialogflow.v2beta1.Context.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListContextsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListContextsResponse} ListContextsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListContextsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListContextsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListContextsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.contexts != null && message.hasOwnProperty("contexts")) { + if (!Array.isArray(message.contexts)) + return "contexts: array expected"; + for (var i = 0; i < message.contexts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Context.verify(message.contexts[i]); + if (error) + return "contexts." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListContextsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListContextsResponse} ListContextsResponse + */ + ListContextsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListContextsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListContextsResponse(); + if (object.contexts) { + if (!Array.isArray(object.contexts)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListContextsResponse.contexts: array expected"); + message.contexts = []; + for (var i = 0; i < object.contexts.length; ++i) { + if (typeof object.contexts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListContextsResponse.contexts: object expected"); + message.contexts[i] = $root.google.cloud.dialogflow.v2beta1.Context.fromObject(object.contexts[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListContextsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ListContextsResponse} message ListContextsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListContextsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.contexts = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.contexts && message.contexts.length) { + object.contexts = []; + for (var j = 0; j < message.contexts.length; ++j) + object.contexts[j] = $root.google.cloud.dialogflow.v2beta1.Context.toObject(message.contexts[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListContextsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListContextsResponse + * @instance + * @returns {Object.} JSON object + */ + ListContextsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListContextsResponse; + })(); + + v2beta1.GetContextRequest = (function() { + + /** + * Properties of a GetContextRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IGetContextRequest + * @property {string|null} [name] GetContextRequest name + */ + + /** + * Constructs a new GetContextRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a GetContextRequest. + * @implements IGetContextRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IGetContextRequest=} [properties] Properties to set + */ + function GetContextRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetContextRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @instance + */ + GetContextRequest.prototype.name = ""; + + /** + * Creates a new GetContextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetContextRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GetContextRequest} GetContextRequest instance + */ + GetContextRequest.create = function create(properties) { + return new GetContextRequest(properties); + }; + + /** + * Encodes the specified GetContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetContextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetContextRequest} message GetContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified GetContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetContextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetContextRequest} message GetContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetContextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.GetContextRequest} GetContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetContextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetContextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.GetContextRequest} GetContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetContextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetContextRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetContextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a GetContextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.GetContextRequest} GetContextRequest + */ + GetContextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetContextRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.GetContextRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetContextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.GetContextRequest} message GetContextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetContextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this GetContextRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.GetContextRequest + * @instance + * @returns {Object.} JSON object + */ + GetContextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetContextRequest; + })(); + + v2beta1.CreateContextRequest = (function() { + + /** + * Properties of a CreateContextRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ICreateContextRequest + * @property {string|null} [parent] CreateContextRequest parent + * @property {google.cloud.dialogflow.v2beta1.IContext|null} [context] CreateContextRequest context + */ + + /** + * Constructs a new CreateContextRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a CreateContextRequest. + * @implements ICreateContextRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ICreateContextRequest=} [properties] Properties to set + */ + function CreateContextRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateContextRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @instance + */ + CreateContextRequest.prototype.parent = ""; + + /** + * CreateContextRequest context. + * @member {google.cloud.dialogflow.v2beta1.IContext|null|undefined} context + * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @instance + */ + CreateContextRequest.prototype.context = null; + + /** + * Creates a new CreateContextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateContextRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CreateContextRequest} CreateContextRequest instance + */ + CreateContextRequest.create = function create(properties) { + return new CreateContextRequest(properties); + }; + + /** + * Encodes the specified CreateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateContextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateContextRequest} message CreateContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateContextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.google.cloud.dialogflow.v2beta1.Context.encode(message.context, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateContextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateContextRequest} message CreateContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateContextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CreateContextRequest} CreateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateContextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateContextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.context = $root.google.cloud.dialogflow.v2beta1.Context.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateContextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CreateContextRequest} CreateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateContextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateContextRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateContextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.google.cloud.dialogflow.v2beta1.Context.verify(message.context); + if (error) + return "context." + error; + } + return null; + }; + + /** + * Creates a CreateContextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CreateContextRequest} CreateContextRequest + */ + CreateContextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateContextRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CreateContextRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CreateContextRequest.context: object expected"); + message.context = $root.google.cloud.dialogflow.v2beta1.Context.fromObject(object.context); + } + return message; + }; + + /** + * Creates a plain object from a CreateContextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.CreateContextRequest} message CreateContextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateContextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.context = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.google.cloud.dialogflow.v2beta1.Context.toObject(message.context, options); + return object; + }; + + /** + * Converts this CreateContextRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CreateContextRequest + * @instance + * @returns {Object.} JSON object + */ + CreateContextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateContextRequest; + })(); + + v2beta1.UpdateContextRequest = (function() { + + /** + * Properties of an UpdateContextRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IUpdateContextRequest + * @property {google.cloud.dialogflow.v2beta1.IContext|null} [context] UpdateContextRequest context + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateContextRequest updateMask + */ + + /** + * Constructs a new UpdateContextRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an UpdateContextRequest. + * @implements IUpdateContextRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IUpdateContextRequest=} [properties] Properties to set + */ + function UpdateContextRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateContextRequest context. + * @member {google.cloud.dialogflow.v2beta1.IContext|null|undefined} context + * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @instance + */ + UpdateContextRequest.prototype.context = null; + + /** + * UpdateContextRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @instance + */ + UpdateContextRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateContextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateContextRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.UpdateContextRequest} UpdateContextRequest instance + */ + UpdateContextRequest.create = function create(properties) { + return new UpdateContextRequest(properties); + }; + + /** + * Encodes the specified UpdateContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateContextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateContextRequest} message UpdateContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateContextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.context != null && Object.hasOwnProperty.call(message, "context")) + $root.google.cloud.dialogflow.v2beta1.Context.encode(message.context, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified UpdateContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateContextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateContextRequest} message UpdateContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateContextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.UpdateContextRequest} UpdateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateContextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateContextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.context = $root.google.cloud.dialogflow.v2beta1.Context.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateContextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.UpdateContextRequest} UpdateContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateContextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateContextRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateContextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.context != null && message.hasOwnProperty("context")) { + var error = $root.google.cloud.dialogflow.v2beta1.Context.verify(message.context); + if (error) + return "context." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; + + /** + * Creates an UpdateContextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.UpdateContextRequest} UpdateContextRequest + */ + UpdateContextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateContextRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.UpdateContextRequest(); + if (object.context != null) { + if (typeof object.context !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateContextRequest.context: object expected"); + message.context = $root.google.cloud.dialogflow.v2beta1.Context.fromObject(object.context); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateContextRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; + + /** + * Creates a plain object from an UpdateContextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.UpdateContextRequest} message UpdateContextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateContextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.context = null; + object.updateMask = null; + } + if (message.context != null && message.hasOwnProperty("context")) + object.context = $root.google.cloud.dialogflow.v2beta1.Context.toObject(message.context, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this UpdateContextRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.UpdateContextRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateContextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateContextRequest; + })(); + + v2beta1.DeleteContextRequest = (function() { + + /** + * Properties of a DeleteContextRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IDeleteContextRequest + * @property {string|null} [name] DeleteContextRequest name + */ + + /** + * Constructs a new DeleteContextRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a DeleteContextRequest. + * @implements IDeleteContextRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IDeleteContextRequest=} [properties] Properties to set + */ + function DeleteContextRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteContextRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @instance + */ + DeleteContextRequest.prototype.name = ""; + + /** + * Creates a new DeleteContextRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteContextRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DeleteContextRequest} DeleteContextRequest instance + */ + DeleteContextRequest.create = function create(properties) { + return new DeleteContextRequest(properties); + }; + + /** + * Encodes the specified DeleteContextRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteContextRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteContextRequest} message DeleteContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteContextRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteContextRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteContextRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteContextRequest} message DeleteContextRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteContextRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteContextRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.DeleteContextRequest} DeleteContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteContextRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteContextRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteContextRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.DeleteContextRequest} DeleteContextRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteContextRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteContextRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteContextRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteContextRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.DeleteContextRequest} DeleteContextRequest + */ + DeleteContextRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteContextRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.DeleteContextRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteContextRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.DeleteContextRequest} message DeleteContextRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteContextRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteContextRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.DeleteContextRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteContextRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteContextRequest; + })(); + + v2beta1.DeleteAllContextsRequest = (function() { + + /** + * Properties of a DeleteAllContextsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IDeleteAllContextsRequest + * @property {string|null} [parent] DeleteAllContextsRequest parent + */ + + /** + * Constructs a new DeleteAllContextsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a DeleteAllContextsRequest. + * @implements IDeleteAllContextsRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest=} [properties] Properties to set + */ + function DeleteAllContextsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteAllContextsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @instance + */ + DeleteAllContextsRequest.prototype.parent = ""; + + /** + * Creates a new DeleteAllContextsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest} DeleteAllContextsRequest instance + */ + DeleteAllContextsRequest.create = function create(properties) { + return new DeleteAllContextsRequest(properties); + }; + + /** + * Encodes the specified DeleteAllContextsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest} message DeleteAllContextsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAllContextsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + return writer; + }; + + /** + * Encodes the specified DeleteAllContextsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteAllContextsRequest} message DeleteAllContextsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteAllContextsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteAllContextsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest} DeleteAllContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAllContextsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteAllContextsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest} DeleteAllContextsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteAllContextsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteAllContextsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteAllContextsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + return null; + }; + + /** + * Creates a DeleteAllContextsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest} DeleteAllContextsRequest + */ + DeleteAllContextsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + return message; + }; + + /** + * Creates a plain object from a DeleteAllContextsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest} message DeleteAllContextsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteAllContextsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + return object; + }; + + /** + * Converts this DeleteAllContextsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.DeleteAllContextsRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteAllContextsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteAllContextsRequest; + })(); + + v2beta1.GcsSources = (function() { + + /** + * Properties of a GcsSources. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IGcsSources + * @property {Array.|null} [uris] GcsSources uris + */ + + /** + * Constructs a new GcsSources. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a GcsSources. + * @implements IGcsSources + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IGcsSources=} [properties] Properties to set + */ + function GcsSources(properties) { + this.uris = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsSources uris. + * @member {Array.} uris + * @memberof google.cloud.dialogflow.v2beta1.GcsSources + * @instance + */ + GcsSources.prototype.uris = $util.emptyArray; + + /** + * Creates a new GcsSources instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.GcsSources + * @static + * @param {google.cloud.dialogflow.v2beta1.IGcsSources=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GcsSources} GcsSources instance + */ + GcsSources.create = function create(properties) { + return new GcsSources(properties); + }; + + /** + * Encodes the specified GcsSources message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GcsSources.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.GcsSources + * @static + * @param {google.cloud.dialogflow.v2beta1.IGcsSources} message GcsSources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSources.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uris != null && message.uris.length) + for (var i = 0; i < message.uris.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uris[i]); + return writer; + }; + + /** + * Encodes the specified GcsSources message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GcsSources.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GcsSources + * @static + * @param {google.cloud.dialogflow.v2beta1.IGcsSources} message GcsSources message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSources.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSources message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.GcsSources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.GcsSources} GcsSources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSources.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GcsSources(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.uris && message.uris.length)) + message.uris = []; + message.uris.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSources message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GcsSources + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.GcsSources} GcsSources + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSources.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSources message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.GcsSources + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSources.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uris != null && message.hasOwnProperty("uris")) { + if (!Array.isArray(message.uris)) + return "uris: array expected"; + for (var i = 0; i < message.uris.length; ++i) + if (!$util.isString(message.uris[i])) + return "uris: string[] expected"; + } + return null; + }; + + /** + * Creates a GcsSources message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.GcsSources + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.GcsSources} GcsSources + */ + GcsSources.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GcsSources) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.GcsSources(); + if (object.uris) { + if (!Array.isArray(object.uris)) + throw TypeError(".google.cloud.dialogflow.v2beta1.GcsSources.uris: array expected"); + message.uris = []; + for (var i = 0; i < object.uris.length; ++i) + message.uris[i] = String(object.uris[i]); + } + return message; + }; + + /** + * Creates a plain object from a GcsSources message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.GcsSources + * @static + * @param {google.cloud.dialogflow.v2beta1.GcsSources} message GcsSources + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSources.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uris = []; + if (message.uris && message.uris.length) { + object.uris = []; + for (var j = 0; j < message.uris.length; ++j) + object.uris[j] = message.uris[j]; + } + return object; + }; + + /** + * Converts this GcsSources to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.GcsSources + * @instance + * @returns {Object.} JSON object + */ + GcsSources.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsSources; + })(); + + v2beta1.GcsSource = (function() { + + /** + * Properties of a GcsSource. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IGcsSource + * @property {string|null} [uri] GcsSource uri + */ + + /** + * Constructs a new GcsSource. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a GcsSource. + * @implements IGcsSource + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IGcsSource=} [properties] Properties to set + */ + function GcsSource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcsSource uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @instance + */ + GcsSource.prototype.uri = ""; + + /** + * Creates a new GcsSource instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @static + * @param {google.cloud.dialogflow.v2beta1.IGcsSource=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GcsSource} GcsSource instance + */ + GcsSource.create = function create(properties) { + return new GcsSource(properties); + }; + + /** + * Encodes the specified GcsSource message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GcsSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @static + * @param {google.cloud.dialogflow.v2beta1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified GcsSource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GcsSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @static + * @param {google.cloud.dialogflow.v2beta1.IGcsSource} message GcsSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcsSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GcsSource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcsSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.GcsSource} GcsSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcsSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcsSource message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcsSource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a GcsSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.GcsSource} GcsSource + */ + GcsSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GcsSource) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.GcsSource(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a GcsSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @static + * @param {google.cloud.dialogflow.v2beta1.GcsSource} message GcsSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcsSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this GcsSource to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.GcsSource + * @instance + * @returns {Object.} JSON object + */ + GcsSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GcsSource; + })(); + + v2beta1.Intents = (function() { + + /** + * Constructs a new Intents service. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an Intents + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Intents(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Intents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Intents; + + /** + * Creates new Intents service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Intents} RPC service. Useful where requests and/or responses are streamed. + */ + Intents.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#listIntents}. + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @typedef ListIntentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListIntentsResponse} [response] ListIntentsResponse + */ + + /** + * Calls ListIntents. + * @function listIntents + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListIntentsRequest} request ListIntentsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Intents.ListIntentsCallback} callback Node-style callback called with the error, if any, and ListIntentsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.listIntents = function listIntents(request, callback) { + return this.rpcCall(listIntents, $root.google.cloud.dialogflow.v2beta1.ListIntentsRequest, $root.google.cloud.dialogflow.v2beta1.ListIntentsResponse, request, callback); + }, "name", { value: "ListIntents" }); + + /** + * Calls ListIntents. + * @function listIntents + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListIntentsRequest} request ListIntentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#getIntent}. + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @typedef GetIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Intent} [response] Intent + */ + + /** + * Calls GetIntent. + * @function getIntent + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetIntentRequest} request GetIntentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Intents.GetIntentCallback} callback Node-style callback called with the error, if any, and Intent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.getIntent = function getIntent(request, callback) { + return this.rpcCall(getIntent, $root.google.cloud.dialogflow.v2beta1.GetIntentRequest, $root.google.cloud.dialogflow.v2beta1.Intent, request, callback); + }, "name", { value: "GetIntent" }); + + /** + * Calls GetIntent. + * @function getIntent + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetIntentRequest} request GetIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#createIntent}. + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @typedef CreateIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Intent} [response] Intent + */ + + /** + * Calls CreateIntent. + * @function createIntent + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateIntentRequest} request CreateIntentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Intents.CreateIntentCallback} callback Node-style callback called with the error, if any, and Intent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.createIntent = function createIntent(request, callback) { + return this.rpcCall(createIntent, $root.google.cloud.dialogflow.v2beta1.CreateIntentRequest, $root.google.cloud.dialogflow.v2beta1.Intent, request, callback); + }, "name", { value: "CreateIntent" }); + + /** + * Calls CreateIntent. + * @function createIntent + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateIntentRequest} request CreateIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#updateIntent}. + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @typedef UpdateIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Intent} [response] Intent + */ + + /** + * Calls UpdateIntent. + * @function updateIntent + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateIntentRequest} request UpdateIntentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Intents.UpdateIntentCallback} callback Node-style callback called with the error, if any, and Intent + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.updateIntent = function updateIntent(request, callback) { + return this.rpcCall(updateIntent, $root.google.cloud.dialogflow.v2beta1.UpdateIntentRequest, $root.google.cloud.dialogflow.v2beta1.Intent, request, callback); + }, "name", { value: "UpdateIntent" }); + + /** + * Calls UpdateIntent. + * @function updateIntent + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateIntentRequest} request UpdateIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#deleteIntent}. + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @typedef DeleteIntentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteIntent. + * @function deleteIntent + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteIntentRequest} request DeleteIntentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Intents.DeleteIntentCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.deleteIntent = function deleteIntent(request, callback) { + return this.rpcCall(deleteIntent, $root.google.cloud.dialogflow.v2beta1.DeleteIntentRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteIntent" }); + + /** + * Calls DeleteIntent. + * @function deleteIntent + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteIntentRequest} request DeleteIntentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#batchUpdateIntents}. + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @typedef BatchUpdateIntentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchUpdateIntents. + * @function batchUpdateIntents + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest} request BatchUpdateIntentsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Intents.BatchUpdateIntentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.batchUpdateIntents = function batchUpdateIntents(request, callback) { + return this.rpcCall(batchUpdateIntents, $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchUpdateIntents" }); + + /** + * Calls BatchUpdateIntents. + * @function batchUpdateIntents + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest} request BatchUpdateIntentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Intents#batchDeleteIntents}. + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @typedef BatchDeleteIntentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls BatchDeleteIntents. + * @function batchDeleteIntents + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest} request BatchDeleteIntentsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Intents.BatchDeleteIntentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Intents.prototype.batchDeleteIntents = function batchDeleteIntents(request, callback) { + return this.rpcCall(batchDeleteIntents, $root.google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchDeleteIntents" }); + + /** + * Calls BatchDeleteIntents. + * @function batchDeleteIntents + * @memberof google.cloud.dialogflow.v2beta1.Intents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest} request BatchDeleteIntentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Intents; + })(); + + v2beta1.Intent = (function() { + + /** + * Properties of an Intent. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IIntent + * @property {string|null} [name] Intent name + * @property {string|null} [displayName] Intent displayName + * @property {google.cloud.dialogflow.v2beta1.Intent.WebhookState|null} [webhookState] Intent webhookState + * @property {number|null} [priority] Intent priority + * @property {boolean|null} [isFallback] Intent isFallback + * @property {boolean|null} [mlEnabled] Intent mlEnabled + * @property {boolean|null} [mlDisabled] Intent mlDisabled + * @property {boolean|null} [liveAgentHandoff] Intent liveAgentHandoff + * @property {boolean|null} [endInteraction] Intent endInteraction + * @property {Array.|null} [inputContextNames] Intent inputContextNames + * @property {Array.|null} [events] Intent events + * @property {Array.|null} [trainingPhrases] Intent trainingPhrases + * @property {string|null} [action] Intent action + * @property {Array.|null} [outputContexts] Intent outputContexts + * @property {boolean|null} [resetContexts] Intent resetContexts + * @property {Array.|null} [parameters] Intent parameters + * @property {Array.|null} [messages] Intent messages + * @property {Array.|null} [defaultResponsePlatforms] Intent defaultResponsePlatforms + * @property {string|null} [rootFollowupIntentName] Intent rootFollowupIntentName + * @property {string|null} [parentFollowupIntentName] Intent parentFollowupIntentName + * @property {Array.|null} [followupIntentInfo] Intent followupIntentInfo + */ + + /** + * Constructs a new Intent. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an Intent. + * @implements IIntent + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IIntent=} [properties] Properties to set + */ + function Intent(properties) { + this.inputContextNames = []; + this.events = []; + this.trainingPhrases = []; + this.outputContexts = []; + this.parameters = []; + this.messages = []; + this.defaultResponsePlatforms = []; + this.followupIntentInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Intent name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.name = ""; + + /** + * Intent displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.displayName = ""; + + /** + * Intent webhookState. + * @member {google.cloud.dialogflow.v2beta1.Intent.WebhookState} webhookState + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.webhookState = 0; + + /** + * Intent priority. + * @member {number} priority + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.priority = 0; + + /** + * Intent isFallback. + * @member {boolean} isFallback + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.isFallback = false; + + /** + * Intent mlEnabled. + * @member {boolean} mlEnabled + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.mlEnabled = false; + + /** + * Intent mlDisabled. + * @member {boolean} mlDisabled + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.mlDisabled = false; + + /** + * Intent liveAgentHandoff. + * @member {boolean} liveAgentHandoff + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.liveAgentHandoff = false; + + /** + * Intent endInteraction. + * @member {boolean} endInteraction + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.endInteraction = false; + + /** + * Intent inputContextNames. + * @member {Array.} inputContextNames + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.inputContextNames = $util.emptyArray; + + /** + * Intent events. + * @member {Array.} events + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.events = $util.emptyArray; + + /** + * Intent trainingPhrases. + * @member {Array.} trainingPhrases + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.trainingPhrases = $util.emptyArray; + + /** + * Intent action. + * @member {string} action + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.action = ""; + + /** + * Intent outputContexts. + * @member {Array.} outputContexts + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.outputContexts = $util.emptyArray; + + /** + * Intent resetContexts. + * @member {boolean} resetContexts + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.resetContexts = false; + + /** + * Intent parameters. + * @member {Array.} parameters + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.parameters = $util.emptyArray; + + /** + * Intent messages. + * @member {Array.} messages + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.messages = $util.emptyArray; + + /** + * Intent defaultResponsePlatforms. + * @member {Array.} defaultResponsePlatforms + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.defaultResponsePlatforms = $util.emptyArray; + + /** + * Intent rootFollowupIntentName. + * @member {string} rootFollowupIntentName + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.rootFollowupIntentName = ""; + + /** + * Intent parentFollowupIntentName. + * @member {string} parentFollowupIntentName + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.parentFollowupIntentName = ""; + + /** + * Intent followupIntentInfo. + * @member {Array.} followupIntentInfo + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + */ + Intent.prototype.followupIntentInfo = $util.emptyArray; + + /** + * Creates a new Intent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @static + * @param {google.cloud.dialogflow.v2beta1.IIntent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent} Intent instance + */ + Intent.create = function create(properties) { + return new Intent(properties); + }; + + /** + * Encodes the specified Intent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @static + * @param {google.cloud.dialogflow.v2beta1.IIntent} message Intent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.priority != null && Object.hasOwnProperty.call(message, "priority")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.priority); + if (message.isFallback != null && Object.hasOwnProperty.call(message, "isFallback")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.isFallback); + if (message.mlEnabled != null && Object.hasOwnProperty.call(message, "mlEnabled")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.mlEnabled); + if (message.webhookState != null && Object.hasOwnProperty.call(message, "webhookState")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.webhookState); + if (message.inputContextNames != null && message.inputContextNames.length) + for (var i = 0; i < message.inputContextNames.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.inputContextNames[i]); + if (message.events != null && message.events.length) + for (var i = 0; i < message.events.length; ++i) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.events[i]); + if (message.trainingPhrases != null && message.trainingPhrases.length) + for (var i = 0; i < message.trainingPhrases.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.encode(message.trainingPhrases[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.action); + if (message.outputContexts != null && message.outputContexts.length) + for (var i = 0; i < message.outputContexts.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Context.encode(message.outputContexts[i], writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.resetContexts != null && Object.hasOwnProperty.call(message, "resetContexts")) + writer.uint32(/* id 12, wireType 0 =*/96).bool(message.resetContexts); + if (message.parameters != null && message.parameters.length) + for (var i = 0; i < message.parameters.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Parameter.encode(message.parameters[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.encode(message.messages[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.defaultResponsePlatforms != null && message.defaultResponsePlatforms.length) { + writer.uint32(/* id 15, wireType 2 =*/122).fork(); + for (var i = 0; i < message.defaultResponsePlatforms.length; ++i) + writer.int32(message.defaultResponsePlatforms[i]); + writer.ldelim(); + } + if (message.rootFollowupIntentName != null && Object.hasOwnProperty.call(message, "rootFollowupIntentName")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.rootFollowupIntentName); + if (message.parentFollowupIntentName != null && Object.hasOwnProperty.call(message, "parentFollowupIntentName")) + writer.uint32(/* id 17, wireType 2 =*/138).string(message.parentFollowupIntentName); + if (message.followupIntentInfo != null && message.followupIntentInfo.length) + for (var i = 0; i < message.followupIntentInfo.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.encode(message.followupIntentInfo[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.mlDisabled != null && Object.hasOwnProperty.call(message, "mlDisabled")) + writer.uint32(/* id 19, wireType 0 =*/152).bool(message.mlDisabled); + if (message.liveAgentHandoff != null && Object.hasOwnProperty.call(message, "liveAgentHandoff")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.liveAgentHandoff); + if (message.endInteraction != null && Object.hasOwnProperty.call(message, "endInteraction")) + writer.uint32(/* id 21, wireType 0 =*/168).bool(message.endInteraction); + return writer; + }; + + /** + * Encodes the specified Intent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @static + * @param {google.cloud.dialogflow.v2beta1.IIntent} message Intent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Intent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Intent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent} Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 6: + message.webhookState = reader.int32(); + break; + case 3: + message.priority = reader.int32(); + break; + case 4: + message.isFallback = reader.bool(); + break; + case 5: + message.mlEnabled = reader.bool(); + break; + case 19: + message.mlDisabled = reader.bool(); + break; + case 20: + message.liveAgentHandoff = reader.bool(); + break; + case 21: + message.endInteraction = reader.bool(); + break; + case 7: + if (!(message.inputContextNames && message.inputContextNames.length)) + message.inputContextNames = []; + message.inputContextNames.push(reader.string()); + break; + case 8: + if (!(message.events && message.events.length)) + message.events = []; + message.events.push(reader.string()); + break; + case 9: + if (!(message.trainingPhrases && message.trainingPhrases.length)) + message.trainingPhrases = []; + message.trainingPhrases.push($root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.decode(reader, reader.uint32())); + break; + case 10: + message.action = reader.string(); + break; + case 11: + if (!(message.outputContexts && message.outputContexts.length)) + message.outputContexts = []; + message.outputContexts.push($root.google.cloud.dialogflow.v2beta1.Context.decode(reader, reader.uint32())); + break; + case 12: + message.resetContexts = reader.bool(); + break; + case 13: + if (!(message.parameters && message.parameters.length)) + message.parameters = []; + message.parameters.push($root.google.cloud.dialogflow.v2beta1.Intent.Parameter.decode(reader, reader.uint32())); + break; + case 14: + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.decode(reader, reader.uint32())); + break; + case 15: + if (!(message.defaultResponsePlatforms && message.defaultResponsePlatforms.length)) + message.defaultResponsePlatforms = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.defaultResponsePlatforms.push(reader.int32()); + } else + message.defaultResponsePlatforms.push(reader.int32()); + break; + case 16: + message.rootFollowupIntentName = reader.string(); + break; + case 17: + message.parentFollowupIntentName = reader.string(); + break; + case 18: + if (!(message.followupIntentInfo && message.followupIntentInfo.length)) + message.followupIntentInfo = []; + message.followupIntentInfo.push($root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Intent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent} Intent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Intent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Intent message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Intent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.webhookState != null && message.hasOwnProperty("webhookState")) + switch (message.webhookState) { + default: + return "webhookState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.priority != null && message.hasOwnProperty("priority")) + if (!$util.isInteger(message.priority)) + return "priority: integer expected"; + if (message.isFallback != null && message.hasOwnProperty("isFallback")) + if (typeof message.isFallback !== "boolean") + return "isFallback: boolean expected"; + if (message.mlEnabled != null && message.hasOwnProperty("mlEnabled")) + if (typeof message.mlEnabled !== "boolean") + return "mlEnabled: boolean expected"; + if (message.mlDisabled != null && message.hasOwnProperty("mlDisabled")) + if (typeof message.mlDisabled !== "boolean") + return "mlDisabled: boolean expected"; + if (message.liveAgentHandoff != null && message.hasOwnProperty("liveAgentHandoff")) + if (typeof message.liveAgentHandoff !== "boolean") + return "liveAgentHandoff: boolean expected"; + if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) + if (typeof message.endInteraction !== "boolean") + return "endInteraction: boolean expected"; + if (message.inputContextNames != null && message.hasOwnProperty("inputContextNames")) { + if (!Array.isArray(message.inputContextNames)) + return "inputContextNames: array expected"; + for (var i = 0; i < message.inputContextNames.length; ++i) + if (!$util.isString(message.inputContextNames[i])) + return "inputContextNames: string[] expected"; + } + if (message.events != null && message.hasOwnProperty("events")) { + if (!Array.isArray(message.events)) + return "events: array expected"; + for (var i = 0; i < message.events.length; ++i) + if (!$util.isString(message.events[i])) + return "events: string[] expected"; + } + if (message.trainingPhrases != null && message.hasOwnProperty("trainingPhrases")) { + if (!Array.isArray(message.trainingPhrases)) + return "trainingPhrases: array expected"; + for (var i = 0; i < message.trainingPhrases.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.verify(message.trainingPhrases[i]); + if (error) + return "trainingPhrases." + error; + } + } + if (message.action != null && message.hasOwnProperty("action")) + if (!$util.isString(message.action)) + return "action: string expected"; + if (message.outputContexts != null && message.hasOwnProperty("outputContexts")) { + if (!Array.isArray(message.outputContexts)) + return "outputContexts: array expected"; + for (var i = 0; i < message.outputContexts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Context.verify(message.outputContexts[i]); + if (error) + return "outputContexts." + error; + } + } + if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) + if (typeof message.resetContexts !== "boolean") + return "resetContexts: boolean expected"; + if (message.parameters != null && message.hasOwnProperty("parameters")) { + if (!Array.isArray(message.parameters)) + return "parameters: array expected"; + for (var i = 0; i < message.parameters.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Parameter.verify(message.parameters[i]); + if (error) + return "parameters." + error; + } + } + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + if (message.defaultResponsePlatforms != null && message.hasOwnProperty("defaultResponsePlatforms")) { + if (!Array.isArray(message.defaultResponsePlatforms)) + return "defaultResponsePlatforms: array expected"; + for (var i = 0; i < message.defaultResponsePlatforms.length; ++i) + switch (message.defaultResponsePlatforms[i]) { + default: + return "defaultResponsePlatforms: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 10: + case 11: + break; + } + } + if (message.rootFollowupIntentName != null && message.hasOwnProperty("rootFollowupIntentName")) + if (!$util.isString(message.rootFollowupIntentName)) + return "rootFollowupIntentName: string expected"; + if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) + if (!$util.isString(message.parentFollowupIntentName)) + return "parentFollowupIntentName: string expected"; + if (message.followupIntentInfo != null && message.hasOwnProperty("followupIntentInfo")) { + if (!Array.isArray(message.followupIntentInfo)) + return "followupIntentInfo: array expected"; + for (var i = 0; i < message.followupIntentInfo.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.verify(message.followupIntentInfo[i]); + if (error) + return "followupIntentInfo." + error; + } + } + return null; + }; + + /** + * Creates an Intent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent} Intent + */ + Intent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.webhookState) { + case "WEBHOOK_STATE_UNSPECIFIED": + case 0: + message.webhookState = 0; + break; + case "WEBHOOK_STATE_ENABLED": + case 1: + message.webhookState = 1; + break; + case "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING": + case 2: + message.webhookState = 2; + break; + } + if (object.priority != null) + message.priority = object.priority | 0; + if (object.isFallback != null) + message.isFallback = Boolean(object.isFallback); + if (object.mlEnabled != null) + message.mlEnabled = Boolean(object.mlEnabled); + if (object.mlDisabled != null) + message.mlDisabled = Boolean(object.mlDisabled); + if (object.liveAgentHandoff != null) + message.liveAgentHandoff = Boolean(object.liveAgentHandoff); + if (object.endInteraction != null) + message.endInteraction = Boolean(object.endInteraction); + if (object.inputContextNames) { + if (!Array.isArray(object.inputContextNames)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.inputContextNames: array expected"); + message.inputContextNames = []; + for (var i = 0; i < object.inputContextNames.length; ++i) + message.inputContextNames[i] = String(object.inputContextNames[i]); + } + if (object.events) { + if (!Array.isArray(object.events)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.events: array expected"); + message.events = []; + for (var i = 0; i < object.events.length; ++i) + message.events[i] = String(object.events[i]); + } + if (object.trainingPhrases) { + if (!Array.isArray(object.trainingPhrases)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.trainingPhrases: array expected"); + message.trainingPhrases = []; + for (var i = 0; i < object.trainingPhrases.length; ++i) { + if (typeof object.trainingPhrases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.trainingPhrases: object expected"); + message.trainingPhrases[i] = $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.fromObject(object.trainingPhrases[i]); + } + } + if (object.action != null) + message.action = String(object.action); + if (object.outputContexts) { + if (!Array.isArray(object.outputContexts)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.outputContexts: array expected"); + message.outputContexts = []; + for (var i = 0; i < object.outputContexts.length; ++i) { + if (typeof object.outputContexts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.outputContexts: object expected"); + message.outputContexts[i] = $root.google.cloud.dialogflow.v2beta1.Context.fromObject(object.outputContexts[i]); + } + } + if (object.resetContexts != null) + message.resetContexts = Boolean(object.resetContexts); + if (object.parameters) { + if (!Array.isArray(object.parameters)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.parameters: array expected"); + message.parameters = []; + for (var i = 0; i < object.parameters.length; ++i) { + if (typeof object.parameters[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.parameters: object expected"); + message.parameters[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Parameter.fromObject(object.parameters[i]); + } + } + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.messages: object expected"); + message.messages[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.fromObject(object.messages[i]); + } + } + if (object.defaultResponsePlatforms) { + if (!Array.isArray(object.defaultResponsePlatforms)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.defaultResponsePlatforms: array expected"); + message.defaultResponsePlatforms = []; + for (var i = 0; i < object.defaultResponsePlatforms.length; ++i) + switch (object.defaultResponsePlatforms[i]) { + default: + case "PLATFORM_UNSPECIFIED": + case 0: + message.defaultResponsePlatforms[i] = 0; + break; + case "FACEBOOK": + case 1: + message.defaultResponsePlatforms[i] = 1; + break; + case "SLACK": + case 2: + message.defaultResponsePlatforms[i] = 2; + break; + case "TELEGRAM": + case 3: + message.defaultResponsePlatforms[i] = 3; + break; + case "KIK": + case 4: + message.defaultResponsePlatforms[i] = 4; + break; + case "SKYPE": + case 5: + message.defaultResponsePlatforms[i] = 5; + break; + case "LINE": + case 6: + message.defaultResponsePlatforms[i] = 6; + break; + case "VIBER": + case 7: + message.defaultResponsePlatforms[i] = 7; + break; + case "ACTIONS_ON_GOOGLE": + case 8: + message.defaultResponsePlatforms[i] = 8; + break; + case "TELEPHONY": + case 10: + message.defaultResponsePlatforms[i] = 10; + break; + case "GOOGLE_HANGOUTS": + case 11: + message.defaultResponsePlatforms[i] = 11; + break; + } + } + if (object.rootFollowupIntentName != null) + message.rootFollowupIntentName = String(object.rootFollowupIntentName); + if (object.parentFollowupIntentName != null) + message.parentFollowupIntentName = String(object.parentFollowupIntentName); + if (object.followupIntentInfo) { + if (!Array.isArray(object.followupIntentInfo)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.followupIntentInfo: array expected"); + message.followupIntentInfo = []; + for (var i = 0; i < object.followupIntentInfo.length; ++i) { + if (typeof object.followupIntentInfo[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.followupIntentInfo: object expected"); + message.followupIntentInfo[i] = $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.fromObject(object.followupIntentInfo[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an Intent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent} message Intent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Intent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.inputContextNames = []; + object.events = []; + object.trainingPhrases = []; + object.outputContexts = []; + object.parameters = []; + object.messages = []; + object.defaultResponsePlatforms = []; + object.followupIntentInfo = []; + } + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.priority = 0; + object.isFallback = false; + object.mlEnabled = false; + object.webhookState = options.enums === String ? "WEBHOOK_STATE_UNSPECIFIED" : 0; + object.action = ""; + object.resetContexts = false; + object.rootFollowupIntentName = ""; + object.parentFollowupIntentName = ""; + object.mlDisabled = false; + object.liveAgentHandoff = false; + object.endInteraction = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.priority != null && message.hasOwnProperty("priority")) + object.priority = message.priority; + if (message.isFallback != null && message.hasOwnProperty("isFallback")) + object.isFallback = message.isFallback; + if (message.mlEnabled != null && message.hasOwnProperty("mlEnabled")) + object.mlEnabled = message.mlEnabled; + if (message.webhookState != null && message.hasOwnProperty("webhookState")) + object.webhookState = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.WebhookState[message.webhookState] : message.webhookState; + if (message.inputContextNames && message.inputContextNames.length) { + object.inputContextNames = []; + for (var j = 0; j < message.inputContextNames.length; ++j) + object.inputContextNames[j] = message.inputContextNames[j]; + } + if (message.events && message.events.length) { + object.events = []; + for (var j = 0; j < message.events.length; ++j) + object.events[j] = message.events[j]; + } + if (message.trainingPhrases && message.trainingPhrases.length) { + object.trainingPhrases = []; + for (var j = 0; j < message.trainingPhrases.length; ++j) + object.trainingPhrases[j] = $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.toObject(message.trainingPhrases[j], options); + } + if (message.action != null && message.hasOwnProperty("action")) + object.action = message.action; + if (message.outputContexts && message.outputContexts.length) { + object.outputContexts = []; + for (var j = 0; j < message.outputContexts.length; ++j) + object.outputContexts[j] = $root.google.cloud.dialogflow.v2beta1.Context.toObject(message.outputContexts[j], options); + } + if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) + object.resetContexts = message.resetContexts; + if (message.parameters && message.parameters.length) { + object.parameters = []; + for (var j = 0; j < message.parameters.length; ++j) + object.parameters[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Parameter.toObject(message.parameters[j], options); + } + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.toObject(message.messages[j], options); + } + if (message.defaultResponsePlatforms && message.defaultResponsePlatforms.length) { + object.defaultResponsePlatforms = []; + for (var j = 0; j < message.defaultResponsePlatforms.length; ++j) + object.defaultResponsePlatforms[j] = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.Platform[message.defaultResponsePlatforms[j]] : message.defaultResponsePlatforms[j]; + } + if (message.rootFollowupIntentName != null && message.hasOwnProperty("rootFollowupIntentName")) + object.rootFollowupIntentName = message.rootFollowupIntentName; + if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) + object.parentFollowupIntentName = message.parentFollowupIntentName; + if (message.followupIntentInfo && message.followupIntentInfo.length) { + object.followupIntentInfo = []; + for (var j = 0; j < message.followupIntentInfo.length; ++j) + object.followupIntentInfo[j] = $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.toObject(message.followupIntentInfo[j], options); + } + if (message.mlDisabled != null && message.hasOwnProperty("mlDisabled")) + object.mlDisabled = message.mlDisabled; + if (message.liveAgentHandoff != null && message.hasOwnProperty("liveAgentHandoff")) + object.liveAgentHandoff = message.liveAgentHandoff; + if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) + object.endInteraction = message.endInteraction; + return object; + }; + + /** + * Converts this Intent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @instance + * @returns {Object.} JSON object + */ + Intent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Intent.TrainingPhrase = (function() { + + /** + * Properties of a TrainingPhrase. + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @interface ITrainingPhrase + * @property {string|null} [name] TrainingPhrase name + * @property {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type|null} [type] TrainingPhrase type + * @property {Array.|null} [parts] TrainingPhrase parts + * @property {number|null} [timesAddedCount] TrainingPhrase timesAddedCount + */ + + /** + * Constructs a new TrainingPhrase. + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @classdesc Represents a TrainingPhrase. + * @implements ITrainingPhrase + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase=} [properties] Properties to set + */ + function TrainingPhrase(properties) { + this.parts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TrainingPhrase name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.name = ""; + + /** + * TrainingPhrase type. + * @member {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type} type + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.type = 0; + + /** + * TrainingPhrase parts. + * @member {Array.} parts + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.parts = $util.emptyArray; + + /** + * TrainingPhrase timesAddedCount. + * @member {number} timesAddedCount + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @instance + */ + TrainingPhrase.prototype.timesAddedCount = 0; + + /** + * Creates a new TrainingPhrase instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase} TrainingPhrase instance + */ + TrainingPhrase.create = function create(properties) { + return new TrainingPhrase(properties); + }; + + /** + * Encodes the specified TrainingPhrase message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase} message TrainingPhrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainingPhrase.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.parts != null && message.parts.length) + for (var i = 0; i < message.parts.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.encode(message.parts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.timesAddedCount != null && Object.hasOwnProperty.call(message, "timesAddedCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.timesAddedCount); + return writer; + }; + + /** + * Encodes the specified TrainingPhrase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.ITrainingPhrase} message TrainingPhrase message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TrainingPhrase.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase} TrainingPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainingPhrase.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.type = reader.int32(); + break; + case 3: + if (!(message.parts && message.parts.length)) + message.parts = []; + message.parts.push($root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.decode(reader, reader.uint32())); + break; + case 4: + message.timesAddedCount = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TrainingPhrase message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase} TrainingPhrase + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TrainingPhrase.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TrainingPhrase message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TrainingPhrase.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.parts != null && message.hasOwnProperty("parts")) { + if (!Array.isArray(message.parts)) + return "parts: array expected"; + for (var i = 0; i < message.parts.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.verify(message.parts[i]); + if (error) + return "parts." + error; + } + } + if (message.timesAddedCount != null && message.hasOwnProperty("timesAddedCount")) + if (!$util.isInteger(message.timesAddedCount)) + return "timesAddedCount: integer expected"; + return null; + }; + + /** + * Creates a TrainingPhrase message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase} TrainingPhrase + */ + TrainingPhrase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase(); + if (object.name != null) + message.name = String(object.name); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "EXAMPLE": + case 1: + message.type = 1; + break; + case "TEMPLATE": + case 2: + message.type = 2; + break; + } + if (object.parts) { + if (!Array.isArray(object.parts)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.parts: array expected"); + message.parts = []; + for (var i = 0; i < object.parts.length; ++i) { + if (typeof object.parts[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.parts: object expected"); + message.parts[i] = $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.fromObject(object.parts[i]); + } + } + if (object.timesAddedCount != null) + message.timesAddedCount = object.timesAddedCount | 0; + return message; + }; + + /** + * Creates a plain object from a TrainingPhrase message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase} message TrainingPhrase + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TrainingPhrase.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.parts = []; + if (options.defaults) { + object.name = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.timesAddedCount = 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type[message.type] : message.type; + if (message.parts && message.parts.length) { + object.parts = []; + for (var j = 0; j < message.parts.length; ++j) + object.parts[j] = $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.toObject(message.parts[j], options); + } + if (message.timesAddedCount != null && message.hasOwnProperty("timesAddedCount")) + object.timesAddedCount = message.timesAddedCount; + return object; + }; + + /** + * Converts this TrainingPhrase to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @instance + * @returns {Object.} JSON object + */ + TrainingPhrase.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + TrainingPhrase.Part = (function() { + + /** + * Properties of a Part. + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @interface IPart + * @property {string|null} [text] Part text + * @property {string|null} [entityType] Part entityType + * @property {string|null} [alias] Part alias + * @property {boolean|null} [userDefined] Part userDefined + */ + + /** + * Constructs a new Part. + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase + * @classdesc Represents a Part. + * @implements IPart + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart=} [properties] Properties to set + */ + function Part(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Part text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @instance + */ + Part.prototype.text = ""; + + /** + * Part entityType. + * @member {string} entityType + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @instance + */ + Part.prototype.entityType = ""; + + /** + * Part alias. + * @member {string} alias + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @instance + */ + Part.prototype.alias = ""; + + /** + * Part userDefined. + * @member {boolean} userDefined + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @instance + */ + Part.prototype.userDefined = false; + + /** + * Creates a new Part instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part} Part instance + */ + Part.create = function create(properties) { + return new Part(properties); + }; + + /** + * Encodes the specified Part message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityType); + if (message.alias != null && Object.hasOwnProperty.call(message, "alias")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.alias); + if (message.userDefined != null && Object.hasOwnProperty.call(message, "userDefined")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.userDefined); + return writer; + }; + + /** + * Encodes the specified Part message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.IPart} message Part message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Part.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Part message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.entityType = reader.string(); + break; + case 3: + message.alias = reader.string(); + break; + case 4: + message.userDefined = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Part message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part} Part + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Part.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Part message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Part.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) + if (!$util.isString(message.entityType)) + return "entityType: string expected"; + if (message.alias != null && message.hasOwnProperty("alias")) + if (!$util.isString(message.alias)) + return "alias: string expected"; + if (message.userDefined != null && message.hasOwnProperty("userDefined")) + if (typeof message.userDefined !== "boolean") + return "userDefined: boolean expected"; + return null; + }; + + /** + * Creates a Part message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part} Part + */ + Part.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part(); + if (object.text != null) + message.text = String(object.text); + if (object.entityType != null) + message.entityType = String(object.entityType); + if (object.alias != null) + message.alias = String(object.alias); + if (object.userDefined != null) + message.userDefined = Boolean(object.userDefined); + return message; + }; + + /** + * Creates a plain object from a Part message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part} message Part + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Part.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.entityType = ""; + object.alias = ""; + object.userDefined = false; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = message.entityType; + if (message.alias != null && message.hasOwnProperty("alias")) + object.alias = message.alias; + if (message.userDefined != null && message.hasOwnProperty("userDefined")) + object.userDefined = message.userDefined; + return object; + }; + + /** + * Converts this Part to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Part + * @instance + * @returns {Object.} JSON object + */ + Part.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Part; + })(); + + /** + * Type enum. + * @name google.cloud.dialogflow.v2beta1.Intent.TrainingPhrase.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} EXAMPLE=1 EXAMPLE value + * @property {number} TEMPLATE=2 TEMPLATE value + */ + TrainingPhrase.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "EXAMPLE"] = 1; + values[valuesById[2] = "TEMPLATE"] = 2; + return values; + })(); + + return TrainingPhrase; + })(); + + Intent.Parameter = (function() { + + /** + * Properties of a Parameter. + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @interface IParameter + * @property {string|null} [name] Parameter name + * @property {string|null} [displayName] Parameter displayName + * @property {string|null} [value] Parameter value + * @property {string|null} [defaultValue] Parameter defaultValue + * @property {string|null} [entityTypeDisplayName] Parameter entityTypeDisplayName + * @property {boolean|null} [mandatory] Parameter mandatory + * @property {Array.|null} [prompts] Parameter prompts + * @property {boolean|null} [isList] Parameter isList + */ + + /** + * Constructs a new Parameter. + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @classdesc Represents a Parameter. + * @implements IParameter + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.IParameter=} [properties] Properties to set + */ + function Parameter(properties) { + this.prompts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Parameter name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @instance + */ + Parameter.prototype.name = ""; + + /** + * Parameter displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @instance + */ + Parameter.prototype.displayName = ""; + + /** + * Parameter value. + * @member {string} value + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @instance + */ + Parameter.prototype.value = ""; + + /** + * Parameter defaultValue. + * @member {string} defaultValue + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @instance + */ + Parameter.prototype.defaultValue = ""; + + /** + * Parameter entityTypeDisplayName. + * @member {string} entityTypeDisplayName + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @instance + */ + Parameter.prototype.entityTypeDisplayName = ""; + + /** + * Parameter mandatory. + * @member {boolean} mandatory + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @instance + */ + Parameter.prototype.mandatory = false; + + /** + * Parameter prompts. + * @member {Array.} prompts + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @instance + */ + Parameter.prototype.prompts = $util.emptyArray; + + /** + * Parameter isList. + * @member {boolean} isList + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @instance + */ + Parameter.prototype.isList = false; + + /** + * Creates a new Parameter instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.IParameter=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Parameter} Parameter instance + */ + Parameter.create = function create(properties) { + return new Parameter(properties); + }; + + /** + * Encodes the specified Parameter message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Parameter.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.value); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.defaultValue); + if (message.entityTypeDisplayName != null && Object.hasOwnProperty.call(message, "entityTypeDisplayName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.entityTypeDisplayName); + if (message.mandatory != null && Object.hasOwnProperty.call(message, "mandatory")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.mandatory); + if (message.prompts != null && message.prompts.length) + for (var i = 0; i < message.prompts.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.prompts[i]); + if (message.isList != null && Object.hasOwnProperty.call(message, "isList")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.isList); + return writer; + }; + + /** + * Encodes the specified Parameter message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Parameter.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.IParameter} message Parameter message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Parameter.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Parameter message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Parameter(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.value = reader.string(); + break; + case 4: + message.defaultValue = reader.string(); + break; + case 5: + message.entityTypeDisplayName = reader.string(); + break; + case 6: + message.mandatory = reader.bool(); + break; + case 7: + if (!(message.prompts && message.prompts.length)) + message.prompts = []; + message.prompts.push(reader.string()); + break; + case 8: + message.isList = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Parameter message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Parameter} Parameter + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Parameter.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Parameter message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Parameter.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.entityTypeDisplayName != null && message.hasOwnProperty("entityTypeDisplayName")) + if (!$util.isString(message.entityTypeDisplayName)) + return "entityTypeDisplayName: string expected"; + if (message.mandatory != null && message.hasOwnProperty("mandatory")) + if (typeof message.mandatory !== "boolean") + return "mandatory: boolean expected"; + if (message.prompts != null && message.hasOwnProperty("prompts")) { + if (!Array.isArray(message.prompts)) + return "prompts: array expected"; + for (var i = 0; i < message.prompts.length; ++i) + if (!$util.isString(message.prompts[i])) + return "prompts: string[] expected"; + } + if (message.isList != null && message.hasOwnProperty("isList")) + if (typeof message.isList !== "boolean") + return "isList: boolean expected"; + return null; + }; + + /** + * Creates a Parameter message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Parameter} Parameter + */ + Parameter.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Parameter) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Parameter(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.value != null) + message.value = String(object.value); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.entityTypeDisplayName != null) + message.entityTypeDisplayName = String(object.entityTypeDisplayName); + if (object.mandatory != null) + message.mandatory = Boolean(object.mandatory); + if (object.prompts) { + if (!Array.isArray(object.prompts)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Parameter.prompts: array expected"); + message.prompts = []; + for (var i = 0; i < object.prompts.length; ++i) + message.prompts[i] = String(object.prompts[i]); + } + if (object.isList != null) + message.isList = Boolean(object.isList); + return message; + }; + + /** + * Creates a plain object from a Parameter message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Parameter} message Parameter + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Parameter.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.prompts = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.value = ""; + object.defaultValue = ""; + object.entityTypeDisplayName = ""; + object.mandatory = false; + object.isList = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.entityTypeDisplayName != null && message.hasOwnProperty("entityTypeDisplayName")) + object.entityTypeDisplayName = message.entityTypeDisplayName; + if (message.mandatory != null && message.hasOwnProperty("mandatory")) + object.mandatory = message.mandatory; + if (message.prompts && message.prompts.length) { + object.prompts = []; + for (var j = 0; j < message.prompts.length; ++j) + object.prompts[j] = message.prompts[j]; + } + if (message.isList != null && message.hasOwnProperty("isList")) + object.isList = message.isList; + return object; + }; + + /** + * Converts this Parameter to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Parameter + * @instance + * @returns {Object.} JSON object + */ + Parameter.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Parameter; + })(); + + Intent.Message = (function() { + + /** + * Properties of a Message. + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @interface IMessage + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IText|null} [text] Message text + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [image] Message image + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies|null} [quickReplies] Message quickReplies + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ICard|null} [card] Message card + * @property {google.protobuf.IStruct|null} [payload] Message payload + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses|null} [simpleResponses] Message simpleResponses + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard|null} [basicCard] Message basicCard + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions|null} [suggestions] Message suggestions + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion|null} [linkOutSuggestion] Message linkOutSuggestion + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect|null} [listSelect] Message listSelect + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect|null} [carouselSelect] Message carouselSelect + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio|null} [telephonyPlayAudio] Message telephonyPlayAudio + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech|null} [telephonySynthesizeSpeech] Message telephonySynthesizeSpeech + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall|null} [telephonyTransferCall] Message telephonyTransferCall + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText|null} [rbmText] Message rbmText + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard|null} [rbmStandaloneRichCard] Message rbmStandaloneRichCard + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard|null} [rbmCarouselRichCard] Message rbmCarouselRichCard + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard|null} [browseCarouselCard] Message browseCarouselCard + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard|null} [tableCard] Message tableCard + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent|null} [mediaContent] Message mediaContent + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.Platform|null} [platform] Message platform + */ + + /** + * Constructs a new Message. + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @classdesc Represents a Message. + * @implements IMessage + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.IMessage=} [properties] Properties to set + */ + function Message(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Message text. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IText|null|undefined} text + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.text = null; + + /** + * Message image. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} image + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.image = null; + + /** + * Message quickReplies. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies|null|undefined} quickReplies + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.quickReplies = null; + + /** + * Message card. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ICard|null|undefined} card + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.card = null; + + /** + * Message payload. + * @member {google.protobuf.IStruct|null|undefined} payload + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.payload = null; + + /** + * Message simpleResponses. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses|null|undefined} simpleResponses + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.simpleResponses = null; + + /** + * Message basicCard. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard|null|undefined} basicCard + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.basicCard = null; + + /** + * Message suggestions. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions|null|undefined} suggestions + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.suggestions = null; + + /** + * Message linkOutSuggestion. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion|null|undefined} linkOutSuggestion + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.linkOutSuggestion = null; + + /** + * Message listSelect. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect|null|undefined} listSelect + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.listSelect = null; + + /** + * Message carouselSelect. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect|null|undefined} carouselSelect + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.carouselSelect = null; + + /** + * Message telephonyPlayAudio. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio|null|undefined} telephonyPlayAudio + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.telephonyPlayAudio = null; + + /** + * Message telephonySynthesizeSpeech. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech|null|undefined} telephonySynthesizeSpeech + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.telephonySynthesizeSpeech = null; + + /** + * Message telephonyTransferCall. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall|null|undefined} telephonyTransferCall + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.telephonyTransferCall = null; + + /** + * Message rbmText. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText|null|undefined} rbmText + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.rbmText = null; + + /** + * Message rbmStandaloneRichCard. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard|null|undefined} rbmStandaloneRichCard + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.rbmStandaloneRichCard = null; + + /** + * Message rbmCarouselRichCard. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard|null|undefined} rbmCarouselRichCard + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.rbmCarouselRichCard = null; + + /** + * Message browseCarouselCard. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard|null|undefined} browseCarouselCard + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.browseCarouselCard = null; + + /** + * Message tableCard. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard|null|undefined} tableCard + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.tableCard = null; + + /** + * Message mediaContent. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent|null|undefined} mediaContent + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.mediaContent = null; + + /** + * Message platform. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.Platform} platform + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Message.prototype.platform = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Message message. + * @member {"text"|"image"|"quickReplies"|"card"|"payload"|"simpleResponses"|"basicCard"|"suggestions"|"linkOutSuggestion"|"listSelect"|"carouselSelect"|"telephonyPlayAudio"|"telephonySynthesizeSpeech"|"telephonyTransferCall"|"rbmText"|"rbmStandaloneRichCard"|"rbmCarouselRichCard"|"browseCarouselCard"|"tableCard"|"mediaContent"|undefined} message + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + */ + Object.defineProperty(Message.prototype, "message", { + get: $util.oneOfGetter($oneOfFields = ["text", "image", "quickReplies", "card", "payload", "simpleResponses", "basicCard", "suggestions", "linkOutSuggestion", "listSelect", "carouselSelect", "telephonyPlayAudio", "telephonySynthesizeSpeech", "telephonyTransferCall", "rbmText", "rbmStandaloneRichCard", "rbmCarouselRichCard", "browseCarouselCard", "tableCard", "mediaContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Message instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.IMessage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message} Message instance + */ + Message.create = function create(properties) { + return new Message(properties); + }; + + /** + * Encodes the specified Message message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text.encode(message.text, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.image, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.quickReplies != null && Object.hasOwnProperty.call(message, "quickReplies")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.encode(message.quickReplies, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.card != null && Object.hasOwnProperty.call(message, "card")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.encode(message.card, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) + $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.platform != null && Object.hasOwnProperty.call(message, "platform")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.platform); + if (message.simpleResponses != null && Object.hasOwnProperty.call(message, "simpleResponses")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.encode(message.simpleResponses, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.basicCard != null && Object.hasOwnProperty.call(message, "basicCard")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.encode(message.basicCard, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.suggestions != null && Object.hasOwnProperty.call(message, "suggestions")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.encode(message.suggestions, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.linkOutSuggestion != null && Object.hasOwnProperty.call(message, "linkOutSuggestion")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.encode(message.linkOutSuggestion, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.listSelect != null && Object.hasOwnProperty.call(message, "listSelect")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.encode(message.listSelect, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.carouselSelect != null && Object.hasOwnProperty.call(message, "carouselSelect")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.encode(message.carouselSelect, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.telephonyPlayAudio != null && Object.hasOwnProperty.call(message, "telephonyPlayAudio")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.encode(message.telephonyPlayAudio, writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); + if (message.telephonySynthesizeSpeech != null && Object.hasOwnProperty.call(message, "telephonySynthesizeSpeech")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.encode(message.telephonySynthesizeSpeech, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.telephonyTransferCall != null && Object.hasOwnProperty.call(message, "telephonyTransferCall")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.encode(message.telephonyTransferCall, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.rbmText != null && Object.hasOwnProperty.call(message, "rbmText")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.encode(message.rbmText, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.rbmStandaloneRichCard != null && Object.hasOwnProperty.call(message, "rbmStandaloneRichCard")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.encode(message.rbmStandaloneRichCard, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.rbmCarouselRichCard != null && Object.hasOwnProperty.call(message, "rbmCarouselRichCard")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.encode(message.rbmCarouselRichCard, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.browseCarouselCard != null && Object.hasOwnProperty.call(message, "browseCarouselCard")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.encode(message.browseCarouselCard, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.tableCard != null && Object.hasOwnProperty.call(message, "tableCard")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.encode(message.tableCard, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.mediaContent != null && Object.hasOwnProperty.call(message, "mediaContent")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.encode(message.mediaContent, writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Message message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.IMessage} message Message message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Message.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Message message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text.decode(reader, reader.uint32()); + break; + case 2: + message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); + break; + case 3: + message.quickReplies = $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.decode(reader, reader.uint32()); + break; + case 4: + message.card = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.decode(reader, reader.uint32()); + break; + case 5: + message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 7: + message.simpleResponses = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.decode(reader, reader.uint32()); + break; + case 8: + message.basicCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.decode(reader, reader.uint32()); + break; + case 9: + message.suggestions = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.decode(reader, reader.uint32()); + break; + case 10: + message.linkOutSuggestion = $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.decode(reader, reader.uint32()); + break; + case 11: + message.listSelect = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.decode(reader, reader.uint32()); + break; + case 12: + message.carouselSelect = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.decode(reader, reader.uint32()); + break; + case 13: + message.telephonyPlayAudio = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.decode(reader, reader.uint32()); + break; + case 14: + message.telephonySynthesizeSpeech = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.decode(reader, reader.uint32()); + break; + case 15: + message.telephonyTransferCall = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.decode(reader, reader.uint32()); + break; + case 18: + message.rbmText = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.decode(reader, reader.uint32()); + break; + case 19: + message.rbmStandaloneRichCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.decode(reader, reader.uint32()); + break; + case 20: + message.rbmCarouselRichCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.decode(reader, reader.uint32()); + break; + case 22: + message.browseCarouselCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.decode(reader, reader.uint32()); + break; + case 23: + message.tableCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.decode(reader, reader.uint32()); + break; + case 24: + message.mediaContent = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.decode(reader, reader.uint32()); + break; + case 6: + message.platform = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Message message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message} Message + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Message.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Message message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Message.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text.verify(message.text); + if (error) + return "text." + error; + } + } + if (message.image != null && message.hasOwnProperty("image")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + } + if (message.quickReplies != null && message.hasOwnProperty("quickReplies")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.verify(message.quickReplies); + if (error) + return "quickReplies." + error; + } + } + if (message.card != null && message.hasOwnProperty("card")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.verify(message.card); + if (error) + return "card." + error; + } + } + if (message.payload != null && message.hasOwnProperty("payload")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.protobuf.Struct.verify(message.payload); + if (error) + return "payload." + error; + } + } + if (message.simpleResponses != null && message.hasOwnProperty("simpleResponses")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.verify(message.simpleResponses); + if (error) + return "simpleResponses." + error; + } + } + if (message.basicCard != null && message.hasOwnProperty("basicCard")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.verify(message.basicCard); + if (error) + return "basicCard." + error; + } + } + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.verify(message.suggestions); + if (error) + return "suggestions." + error; + } + } + if (message.linkOutSuggestion != null && message.hasOwnProperty("linkOutSuggestion")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.verify(message.linkOutSuggestion); + if (error) + return "linkOutSuggestion." + error; + } + } + if (message.listSelect != null && message.hasOwnProperty("listSelect")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.verify(message.listSelect); + if (error) + return "listSelect." + error; + } + } + if (message.carouselSelect != null && message.hasOwnProperty("carouselSelect")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.verify(message.carouselSelect); + if (error) + return "carouselSelect." + error; + } + } + if (message.telephonyPlayAudio != null && message.hasOwnProperty("telephonyPlayAudio")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.verify(message.telephonyPlayAudio); + if (error) + return "telephonyPlayAudio." + error; + } + } + if (message.telephonySynthesizeSpeech != null && message.hasOwnProperty("telephonySynthesizeSpeech")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.verify(message.telephonySynthesizeSpeech); + if (error) + return "telephonySynthesizeSpeech." + error; + } + } + if (message.telephonyTransferCall != null && message.hasOwnProperty("telephonyTransferCall")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.verify(message.telephonyTransferCall); + if (error) + return "telephonyTransferCall." + error; + } + } + if (message.rbmText != null && message.hasOwnProperty("rbmText")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.verify(message.rbmText); + if (error) + return "rbmText." + error; + } + } + if (message.rbmStandaloneRichCard != null && message.hasOwnProperty("rbmStandaloneRichCard")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.verify(message.rbmStandaloneRichCard); + if (error) + return "rbmStandaloneRichCard." + error; + } + } + if (message.rbmCarouselRichCard != null && message.hasOwnProperty("rbmCarouselRichCard")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.verify(message.rbmCarouselRichCard); + if (error) + return "rbmCarouselRichCard." + error; + } + } + if (message.browseCarouselCard != null && message.hasOwnProperty("browseCarouselCard")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.verify(message.browseCarouselCard); + if (error) + return "browseCarouselCard." + error; + } + } + if (message.tableCard != null && message.hasOwnProperty("tableCard")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.verify(message.tableCard); + if (error) + return "tableCard." + error; + } + } + if (message.mediaContent != null && message.hasOwnProperty("mediaContent")) { + if (properties.message === 1) + return "message: multiple values"; + properties.message = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.verify(message.mediaContent); + if (error) + return "mediaContent." + error; + } + } + if (message.platform != null && message.hasOwnProperty("platform")) + switch (message.platform) { + default: + return "platform: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 10: + case 11: + break; + } + return null; + }; + + /** + * Creates a Message message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message} Message + */ + Message.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message(); + if (object.text != null) { + if (typeof object.text !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.text: object expected"); + message.text = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text.fromObject(object.text); + } + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.image: object expected"); + message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.image); + } + if (object.quickReplies != null) { + if (typeof object.quickReplies !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.quickReplies: object expected"); + message.quickReplies = $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.fromObject(object.quickReplies); + } + if (object.card != null) { + if (typeof object.card !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.card: object expected"); + message.card = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.fromObject(object.card); + } + if (object.payload != null) { + if (typeof object.payload !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.payload: object expected"); + message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + } + if (object.simpleResponses != null) { + if (typeof object.simpleResponses !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.simpleResponses: object expected"); + message.simpleResponses = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.fromObject(object.simpleResponses); + } + if (object.basicCard != null) { + if (typeof object.basicCard !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.basicCard: object expected"); + message.basicCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.fromObject(object.basicCard); + } + if (object.suggestions != null) { + if (typeof object.suggestions !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.suggestions: object expected"); + message.suggestions = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.fromObject(object.suggestions); + } + if (object.linkOutSuggestion != null) { + if (typeof object.linkOutSuggestion !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.linkOutSuggestion: object expected"); + message.linkOutSuggestion = $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.fromObject(object.linkOutSuggestion); + } + if (object.listSelect != null) { + if (typeof object.listSelect !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.listSelect: object expected"); + message.listSelect = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.fromObject(object.listSelect); + } + if (object.carouselSelect != null) { + if (typeof object.carouselSelect !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.carouselSelect: object expected"); + message.carouselSelect = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.fromObject(object.carouselSelect); + } + if (object.telephonyPlayAudio != null) { + if (typeof object.telephonyPlayAudio !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.telephonyPlayAudio: object expected"); + message.telephonyPlayAudio = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.fromObject(object.telephonyPlayAudio); + } + if (object.telephonySynthesizeSpeech != null) { + if (typeof object.telephonySynthesizeSpeech !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.telephonySynthesizeSpeech: object expected"); + message.telephonySynthesizeSpeech = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.fromObject(object.telephonySynthesizeSpeech); + } + if (object.telephonyTransferCall != null) { + if (typeof object.telephonyTransferCall !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.telephonyTransferCall: object expected"); + message.telephonyTransferCall = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.fromObject(object.telephonyTransferCall); + } + if (object.rbmText != null) { + if (typeof object.rbmText !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.rbmText: object expected"); + message.rbmText = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.fromObject(object.rbmText); + } + if (object.rbmStandaloneRichCard != null) { + if (typeof object.rbmStandaloneRichCard !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.rbmStandaloneRichCard: object expected"); + message.rbmStandaloneRichCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.fromObject(object.rbmStandaloneRichCard); + } + if (object.rbmCarouselRichCard != null) { + if (typeof object.rbmCarouselRichCard !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.rbmCarouselRichCard: object expected"); + message.rbmCarouselRichCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.fromObject(object.rbmCarouselRichCard); + } + if (object.browseCarouselCard != null) { + if (typeof object.browseCarouselCard !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.browseCarouselCard: object expected"); + message.browseCarouselCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.fromObject(object.browseCarouselCard); + } + if (object.tableCard != null) { + if (typeof object.tableCard !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.tableCard: object expected"); + message.tableCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.fromObject(object.tableCard); + } + if (object.mediaContent != null) { + if (typeof object.mediaContent !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.mediaContent: object expected"); + message.mediaContent = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.fromObject(object.mediaContent); + } + switch (object.platform) { + case "PLATFORM_UNSPECIFIED": + case 0: + message.platform = 0; + break; + case "FACEBOOK": + case 1: + message.platform = 1; + break; + case "SLACK": + case 2: + message.platform = 2; + break; + case "TELEGRAM": + case 3: + message.platform = 3; + break; + case "KIK": + case 4: + message.platform = 4; + break; + case "SKYPE": + case 5: + message.platform = 5; + break; + case "LINE": + case 6: + message.platform = 6; + break; + case "VIBER": + case 7: + message.platform = 7; + break; + case "ACTIONS_ON_GOOGLE": + case 8: + message.platform = 8; + break; + case "TELEPHONY": + case 10: + message.platform = 10; + break; + case "GOOGLE_HANGOUTS": + case 11: + message.platform = 11; + break; + } + return message; + }; + + /** + * Creates a plain object from a Message message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message} message Message + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Message.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.platform = options.enums === String ? "PLATFORM_UNSPECIFIED" : 0; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text.toObject(message.text, options); + if (options.oneofs) + object.message = "text"; + } + if (message.image != null && message.hasOwnProperty("image")) { + object.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.image, options); + if (options.oneofs) + object.message = "image"; + } + if (message.quickReplies != null && message.hasOwnProperty("quickReplies")) { + object.quickReplies = $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.toObject(message.quickReplies, options); + if (options.oneofs) + object.message = "quickReplies"; + } + if (message.card != null && message.hasOwnProperty("card")) { + object.card = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.toObject(message.card, options); + if (options.oneofs) + object.message = "card"; + } + if (message.payload != null && message.hasOwnProperty("payload")) { + object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); + if (options.oneofs) + object.message = "payload"; + } + if (message.platform != null && message.hasOwnProperty("platform")) + object.platform = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.Platform[message.platform] : message.platform; + if (message.simpleResponses != null && message.hasOwnProperty("simpleResponses")) { + object.simpleResponses = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.toObject(message.simpleResponses, options); + if (options.oneofs) + object.message = "simpleResponses"; + } + if (message.basicCard != null && message.hasOwnProperty("basicCard")) { + object.basicCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.toObject(message.basicCard, options); + if (options.oneofs) + object.message = "basicCard"; + } + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + object.suggestions = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.toObject(message.suggestions, options); + if (options.oneofs) + object.message = "suggestions"; + } + if (message.linkOutSuggestion != null && message.hasOwnProperty("linkOutSuggestion")) { + object.linkOutSuggestion = $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.toObject(message.linkOutSuggestion, options); + if (options.oneofs) + object.message = "linkOutSuggestion"; + } + if (message.listSelect != null && message.hasOwnProperty("listSelect")) { + object.listSelect = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.toObject(message.listSelect, options); + if (options.oneofs) + object.message = "listSelect"; + } + if (message.carouselSelect != null && message.hasOwnProperty("carouselSelect")) { + object.carouselSelect = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.toObject(message.carouselSelect, options); + if (options.oneofs) + object.message = "carouselSelect"; + } + if (message.telephonyPlayAudio != null && message.hasOwnProperty("telephonyPlayAudio")) { + object.telephonyPlayAudio = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.toObject(message.telephonyPlayAudio, options); + if (options.oneofs) + object.message = "telephonyPlayAudio"; + } + if (message.telephonySynthesizeSpeech != null && message.hasOwnProperty("telephonySynthesizeSpeech")) { + object.telephonySynthesizeSpeech = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.toObject(message.telephonySynthesizeSpeech, options); + if (options.oneofs) + object.message = "telephonySynthesizeSpeech"; + } + if (message.telephonyTransferCall != null && message.hasOwnProperty("telephonyTransferCall")) { + object.telephonyTransferCall = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.toObject(message.telephonyTransferCall, options); + if (options.oneofs) + object.message = "telephonyTransferCall"; + } + if (message.rbmText != null && message.hasOwnProperty("rbmText")) { + object.rbmText = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.toObject(message.rbmText, options); + if (options.oneofs) + object.message = "rbmText"; + } + if (message.rbmStandaloneRichCard != null && message.hasOwnProperty("rbmStandaloneRichCard")) { + object.rbmStandaloneRichCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.toObject(message.rbmStandaloneRichCard, options); + if (options.oneofs) + object.message = "rbmStandaloneRichCard"; + } + if (message.rbmCarouselRichCard != null && message.hasOwnProperty("rbmCarouselRichCard")) { + object.rbmCarouselRichCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.toObject(message.rbmCarouselRichCard, options); + if (options.oneofs) + object.message = "rbmCarouselRichCard"; + } + if (message.browseCarouselCard != null && message.hasOwnProperty("browseCarouselCard")) { + object.browseCarouselCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.toObject(message.browseCarouselCard, options); + if (options.oneofs) + object.message = "browseCarouselCard"; + } + if (message.tableCard != null && message.hasOwnProperty("tableCard")) { + object.tableCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.toObject(message.tableCard, options); + if (options.oneofs) + object.message = "tableCard"; + } + if (message.mediaContent != null && message.hasOwnProperty("mediaContent")) { + object.mediaContent = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.toObject(message.mediaContent, options); + if (options.oneofs) + object.message = "mediaContent"; + } + return object; + }; + + /** + * Converts this Message to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @instance + * @returns {Object.} JSON object + */ + Message.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Message.Text = (function() { + + /** + * Properties of a Text. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IText + * @property {Array.|null} [text] Text text + */ + + /** + * Constructs a new Text. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a Text. + * @implements IText + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IText=} [properties] Properties to set + */ + function Text(properties) { + this.text = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Text text. + * @member {Array.} text + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text + * @instance + */ + Text.prototype.text = $util.emptyArray; + + /** + * Creates a new Text instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IText=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Text} Text instance + */ + Text.create = function create(properties) { + return new Text(properties); + }; + + /** + * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Text.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IText} message Text message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Text.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && message.text.length) + for (var i = 0; i < message.text.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text[i]); + return writer; + }; + + /** + * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Text.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IText} message Text message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Text.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Text message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Text} Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Text.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.text && message.text.length)) + message.text = []; + message.text.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Text message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Text} Text + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Text.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Text message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Text.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) { + if (!Array.isArray(message.text)) + return "text: array expected"; + for (var i = 0; i < message.text.length; ++i) + if (!$util.isString(message.text[i])) + return "text: string[] expected"; + } + return null; + }; + + /** + * Creates a Text message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Text} Text + */ + Text.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text(); + if (object.text) { + if (!Array.isArray(object.text)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.Text.text: array expected"); + message.text = []; + for (var i = 0; i < object.text.length; ++i) + message.text[i] = String(object.text[i]); + } + return message; + }; + + /** + * Creates a plain object from a Text message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Text} message Text + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Text.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.text = []; + if (message.text && message.text.length) { + object.text = []; + for (var j = 0; j < message.text.length; ++j) + object.text[j] = message.text[j]; + } + return object; + }; + + /** + * Converts this Text to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text + * @instance + * @returns {Object.} JSON object + */ + Text.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Text; + })(); + + Message.Image = (function() { + + /** + * Properties of an Image. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IImage + * @property {string|null} [imageUri] Image imageUri + * @property {string|null} [accessibilityText] Image accessibilityText + */ + + /** + * Constructs a new Image. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents an Image. + * @implements IImage + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IImage=} [properties] Properties to set + */ + function Image(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Image imageUri. + * @member {string} imageUri + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image + * @instance + */ + Image.prototype.imageUri = ""; + + /** + * Image accessibilityText. + * @member {string} accessibilityText + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image + * @instance + */ + Image.prototype.accessibilityText = ""; + + /** + * Creates a new Image instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IImage=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Image} Image instance + */ + Image.create = function create(properties) { + return new Image(properties); + }; + + /** + * Encodes the specified Image message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); + if (message.accessibilityText != null && Object.hasOwnProperty.call(message, "accessibilityText")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.accessibilityText); + return writer; + }; + + /** + * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IImage} message Image message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Image.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Image message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.imageUri = reader.string(); + break; + case 2: + message.accessibilityText = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Image message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Image} Image + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Image.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Image message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Image.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.accessibilityText != null && message.hasOwnProperty("accessibilityText")) + if (!$util.isString(message.accessibilityText)) + return "accessibilityText: string expected"; + return null; + }; + + /** + * Creates an Image message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Image} Image + */ + Image.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image(); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.accessibilityText != null) + message.accessibilityText = String(object.accessibilityText); + return message; + }; + + /** + * Creates a plain object from an Image message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Image} message Image + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Image.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.imageUri = ""; + object.accessibilityText = ""; + } + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.accessibilityText != null && message.hasOwnProperty("accessibilityText")) + object.accessibilityText = message.accessibilityText; + return object; + }; + + /** + * Converts this Image to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image + * @instance + * @returns {Object.} JSON object + */ + Image.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Image; + })(); + + Message.QuickReplies = (function() { + + /** + * Properties of a QuickReplies. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IQuickReplies + * @property {string|null} [title] QuickReplies title + * @property {Array.|null} [quickReplies] QuickReplies quickReplies + */ + + /** + * Constructs a new QuickReplies. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a QuickReplies. + * @implements IQuickReplies + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies=} [properties] Properties to set + */ + function QuickReplies(properties) { + this.quickReplies = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * QuickReplies title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies + * @instance + */ + QuickReplies.prototype.title = ""; + + /** + * QuickReplies quickReplies. + * @member {Array.} quickReplies + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies + * @instance + */ + QuickReplies.prototype.quickReplies = $util.emptyArray; + + /** + * Creates a new QuickReplies instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies} QuickReplies instance + */ + QuickReplies.create = function create(properties) { + return new QuickReplies(properties); + }; + + /** + * Encodes the specified QuickReplies message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies} message QuickReplies message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuickReplies.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.quickReplies != null && message.quickReplies.length) + for (var i = 0; i < message.quickReplies.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.quickReplies[i]); + return writer; + }; + + /** + * Encodes the specified QuickReplies message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies} message QuickReplies message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuickReplies.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuickReplies message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies} QuickReplies + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuickReplies.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + if (!(message.quickReplies && message.quickReplies.length)) + message.quickReplies = []; + message.quickReplies.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuickReplies message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies} QuickReplies + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuickReplies.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuickReplies message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuickReplies.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.quickReplies != null && message.hasOwnProperty("quickReplies")) { + if (!Array.isArray(message.quickReplies)) + return "quickReplies: array expected"; + for (var i = 0; i < message.quickReplies.length; ++i) + if (!$util.isString(message.quickReplies[i])) + return "quickReplies: string[] expected"; + } + return null; + }; + + /** + * Creates a QuickReplies message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies} QuickReplies + */ + QuickReplies.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies(); + if (object.title != null) + message.title = String(object.title); + if (object.quickReplies) { + if (!Array.isArray(object.quickReplies)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.quickReplies: array expected"); + message.quickReplies = []; + for (var i = 0; i < object.quickReplies.length; ++i) + message.quickReplies[i] = String(object.quickReplies[i]); + } + return message; + }; + + /** + * Creates a plain object from a QuickReplies message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies} message QuickReplies + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuickReplies.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quickReplies = []; + if (options.defaults) + object.title = ""; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.quickReplies && message.quickReplies.length) { + object.quickReplies = []; + for (var j = 0; j < message.quickReplies.length; ++j) + object.quickReplies[j] = message.quickReplies[j]; + } + return object; + }; + + /** + * Converts this QuickReplies to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies + * @instance + * @returns {Object.} JSON object + */ + QuickReplies.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuickReplies; + })(); + + Message.Card = (function() { + + /** + * Properties of a Card. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ICard + * @property {string|null} [title] Card title + * @property {string|null} [subtitle] Card subtitle + * @property {string|null} [imageUri] Card imageUri + * @property {Array.|null} [buttons] Card buttons + */ + + /** + * Constructs a new Card. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a Card. + * @implements ICard + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICard=} [properties] Properties to set + */ + function Card(properties) { + this.buttons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Card title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @instance + */ + Card.prototype.title = ""; + + /** + * Card subtitle. + * @member {string} subtitle + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @instance + */ + Card.prototype.subtitle = ""; + + /** + * Card imageUri. + * @member {string} imageUri + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @instance + */ + Card.prototype.imageUri = ""; + + /** + * Card buttons. + * @member {Array.} buttons + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @instance + */ + Card.prototype.buttons = $util.emptyArray; + + /** + * Creates a new Card instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICard=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card} Card instance + */ + Card.create = function create(properties) { + return new Card(properties); + }; + + /** + * Encodes the specified Card message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICard} message Card message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Card.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); + if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageUri); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.encode(message.buttons[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Card message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICard} message Card message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Card.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Card message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card} Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Card.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.subtitle = reader.string(); + break; + case 3: + message.imageUri = reader.string(); + break; + case 4: + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Card message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card} Card + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Card.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Card message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Card.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + if (!$util.isString(message.imageUri)) + return "imageUri: string expected"; + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } + } + return null; + }; + + /** + * Creates a Card message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card} Card + */ + Card.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card(); + if (object.title != null) + message.title = String(object.title); + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + if (object.imageUri != null) + message.imageUri = String(object.imageUri); + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.Card.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.Card.buttons: object expected"); + message.buttons[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.fromObject(object.buttons[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Card message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Card} message Card + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Card.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buttons = []; + if (options.defaults) { + object.title = ""; + object.subtitle = ""; + object.imageUri = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + if (message.imageUri != null && message.hasOwnProperty("imageUri")) + object.imageUri = message.imageUri; + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.toObject(message.buttons[j], options); + } + return object; + }; + + /** + * Converts this Card to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @instance + * @returns {Object.} JSON object + */ + Card.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Card.Button = (function() { + + /** + * Properties of a Button. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @interface IButton + * @property {string|null} [text] Button text + * @property {string|null} [postback] Button postback + */ + + /** + * Constructs a new Button. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card + * @classdesc Represents a Button. + * @implements IButton + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton=} [properties] Properties to set + */ + function Button(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Button text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button + * @instance + */ + Button.prototype.text = ""; + + /** + * Button postback. + * @member {string} postback + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button + * @instance + */ + Button.prototype.postback = ""; + + /** + * Creates a new Button instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button} Button instance + */ + Button.create = function create(properties) { + return new Button(properties); + }; + + /** + * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton} message Button message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Button.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.postback != null && Object.hasOwnProperty.call(message, "postback")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.postback); + return writer; + }; + + /** + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton} message Button message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Button.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Button message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button} Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Button.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.postback = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Button message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button} Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Button.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Button message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Button.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.postback != null && message.hasOwnProperty("postback")) + if (!$util.isString(message.postback)) + return "postback: string expected"; + return null; + }; + + /** + * Creates a Button message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button} Button + */ + Button.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button(); + if (object.text != null) + message.text = String(object.text); + if (object.postback != null) + message.postback = String(object.postback); + return message; + }; + + /** + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button} message Button + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Button.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.postback = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.postback != null && message.hasOwnProperty("postback")) + object.postback = message.postback; + return object; + }; + + /** + * Converts this Button to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button + * @instance + * @returns {Object.} JSON object + */ + Button.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Button; + })(); + + return Card; + })(); + + Message.SimpleResponse = (function() { + + /** + * Properties of a SimpleResponse. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ISimpleResponse + * @property {string|null} [textToSpeech] SimpleResponse textToSpeech + * @property {string|null} [ssml] SimpleResponse ssml + * @property {string|null} [displayText] SimpleResponse displayText + */ + + /** + * Constructs a new SimpleResponse. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a SimpleResponse. + * @implements ISimpleResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse=} [properties] Properties to set + */ + function SimpleResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimpleResponse textToSpeech. + * @member {string} textToSpeech + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse + * @instance + */ + SimpleResponse.prototype.textToSpeech = ""; + + /** + * SimpleResponse ssml. + * @member {string} ssml + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse + * @instance + */ + SimpleResponse.prototype.ssml = ""; + + /** + * SimpleResponse displayText. + * @member {string} displayText + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse + * @instance + */ + SimpleResponse.prototype.displayText = ""; + + /** + * Creates a new SimpleResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse} SimpleResponse instance + */ + SimpleResponse.create = function create(properties) { + return new SimpleResponse(properties); + }; + + /** + * Encodes the specified SimpleResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse} message SimpleResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.textToSpeech != null && Object.hasOwnProperty.call(message, "textToSpeech")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.textToSpeech); + if (message.ssml != null && Object.hasOwnProperty.call(message, "ssml")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ssml); + if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayText); + return writer; + }; + + /** + * Encodes the specified SimpleResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse} message SimpleResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimpleResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse} SimpleResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.textToSpeech = reader.string(); + break; + case 2: + message.ssml = reader.string(); + break; + case 3: + message.displayText = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimpleResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse} SimpleResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimpleResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimpleResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.textToSpeech != null && message.hasOwnProperty("textToSpeech")) + if (!$util.isString(message.textToSpeech)) + return "textToSpeech: string expected"; + if (message.ssml != null && message.hasOwnProperty("ssml")) + if (!$util.isString(message.ssml)) + return "ssml: string expected"; + if (message.displayText != null && message.hasOwnProperty("displayText")) + if (!$util.isString(message.displayText)) + return "displayText: string expected"; + return null; + }; + + /** + * Creates a SimpleResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse} SimpleResponse + */ + SimpleResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse(); + if (object.textToSpeech != null) + message.textToSpeech = String(object.textToSpeech); + if (object.ssml != null) + message.ssml = String(object.ssml); + if (object.displayText != null) + message.displayText = String(object.displayText); + return message; + }; + + /** + * Creates a plain object from a SimpleResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse} message SimpleResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimpleResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.textToSpeech = ""; + object.ssml = ""; + object.displayText = ""; + } + if (message.textToSpeech != null && message.hasOwnProperty("textToSpeech")) + object.textToSpeech = message.textToSpeech; + if (message.ssml != null && message.hasOwnProperty("ssml")) + object.ssml = message.ssml; + if (message.displayText != null && message.hasOwnProperty("displayText")) + object.displayText = message.displayText; + return object; + }; + + /** + * Converts this SimpleResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse + * @instance + * @returns {Object.} JSON object + */ + SimpleResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SimpleResponse; + })(); + + Message.SimpleResponses = (function() { + + /** + * Properties of a SimpleResponses. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ISimpleResponses + * @property {Array.|null} [simpleResponses] SimpleResponses simpleResponses + */ + + /** + * Constructs a new SimpleResponses. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a SimpleResponses. + * @implements ISimpleResponses + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses=} [properties] Properties to set + */ + function SimpleResponses(properties) { + this.simpleResponses = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SimpleResponses simpleResponses. + * @member {Array.} simpleResponses + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses + * @instance + */ + SimpleResponses.prototype.simpleResponses = $util.emptyArray; + + /** + * Creates a new SimpleResponses instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses} SimpleResponses instance + */ + SimpleResponses.create = function create(properties) { + return new SimpleResponses(properties); + }; + + /** + * Encodes the specified SimpleResponses message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses} message SimpleResponses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleResponses.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.simpleResponses != null && message.simpleResponses.length) + for (var i = 0; i < message.simpleResponses.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.encode(message.simpleResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SimpleResponses message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses} message SimpleResponses message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SimpleResponses.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SimpleResponses message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses} SimpleResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleResponses.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.simpleResponses && message.simpleResponses.length)) + message.simpleResponses = []; + message.simpleResponses.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SimpleResponses message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses} SimpleResponses + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SimpleResponses.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SimpleResponses message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SimpleResponses.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.simpleResponses != null && message.hasOwnProperty("simpleResponses")) { + if (!Array.isArray(message.simpleResponses)) + return "simpleResponses: array expected"; + for (var i = 0; i < message.simpleResponses.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.verify(message.simpleResponses[i]); + if (error) + return "simpleResponses." + error; + } + } + return null; + }; + + /** + * Creates a SimpleResponses message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses} SimpleResponses + */ + SimpleResponses.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses(); + if (object.simpleResponses) { + if (!Array.isArray(object.simpleResponses)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.simpleResponses: array expected"); + message.simpleResponses = []; + for (var i = 0; i < object.simpleResponses.length; ++i) { + if (typeof object.simpleResponses[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.simpleResponses: object expected"); + message.simpleResponses[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.fromObject(object.simpleResponses[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SimpleResponses message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses} message SimpleResponses + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SimpleResponses.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.simpleResponses = []; + if (message.simpleResponses && message.simpleResponses.length) { + object.simpleResponses = []; + for (var j = 0; j < message.simpleResponses.length; ++j) + object.simpleResponses[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.toObject(message.simpleResponses[j], options); + } + return object; + }; + + /** + * Converts this SimpleResponses to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses + * @instance + * @returns {Object.} JSON object + */ + SimpleResponses.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SimpleResponses; + })(); + + Message.BasicCard = (function() { + + /** + * Properties of a BasicCard. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IBasicCard + * @property {string|null} [title] BasicCard title + * @property {string|null} [subtitle] BasicCard subtitle + * @property {string|null} [formattedText] BasicCard formattedText + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [image] BasicCard image + * @property {Array.|null} [buttons] BasicCard buttons + */ + + /** + * Constructs a new BasicCard. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a BasicCard. + * @implements IBasicCard + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard=} [properties] Properties to set + */ + function BasicCard(properties) { + this.buttons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BasicCard title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @instance + */ + BasicCard.prototype.title = ""; + + /** + * BasicCard subtitle. + * @member {string} subtitle + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @instance + */ + BasicCard.prototype.subtitle = ""; + + /** + * BasicCard formattedText. + * @member {string} formattedText + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @instance + */ + BasicCard.prototype.formattedText = ""; + + /** + * BasicCard image. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} image + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @instance + */ + BasicCard.prototype.image = null; + + /** + * BasicCard buttons. + * @member {Array.} buttons + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @instance + */ + BasicCard.prototype.buttons = $util.emptyArray; + + /** + * Creates a new BasicCard instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard} BasicCard instance + */ + BasicCard.create = function create(properties) { + return new BasicCard(properties); + }; + + /** + * Encodes the specified BasicCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard} message BasicCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicCard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); + if (message.formattedText != null && Object.hasOwnProperty.call(message, "formattedText")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.formattedText); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.encode(message.buttons[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BasicCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard} message BasicCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BasicCard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BasicCard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard} BasicCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicCard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.subtitle = reader.string(); + break; + case 3: + message.formattedText = reader.string(); + break; + case 4: + message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); + break; + case 5: + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BasicCard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard} BasicCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BasicCard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BasicCard message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BasicCard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + if (message.formattedText != null && message.hasOwnProperty("formattedText")) + if (!$util.isString(message.formattedText)) + return "formattedText: string expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } + } + return null; + }; + + /** + * Creates a BasicCard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard} BasicCard + */ + BasicCard.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard(); + if (object.title != null) + message.title = String(object.title); + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + if (object.formattedText != null) + message.formattedText = String(object.formattedText); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.image: object expected"); + message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.image); + } + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.buttons: object expected"); + message.buttons[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.fromObject(object.buttons[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BasicCard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard} message BasicCard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BasicCard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.buttons = []; + if (options.defaults) { + object.title = ""; + object.subtitle = ""; + object.formattedText = ""; + object.image = null; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + if (message.formattedText != null && message.hasOwnProperty("formattedText")) + object.formattedText = message.formattedText; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.image, options); + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.toObject(message.buttons[j], options); + } + return object; + }; + + /** + * Converts this BasicCard to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @instance + * @returns {Object.} JSON object + */ + BasicCard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + BasicCard.Button = (function() { + + /** + * Properties of a Button. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @interface IButton + * @property {string|null} [title] Button title + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction|null} [openUriAction] Button openUriAction + */ + + /** + * Constructs a new Button. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard + * @classdesc Represents a Button. + * @implements IButton + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton=} [properties] Properties to set + */ + function Button(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Button title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @instance + */ + Button.prototype.title = ""; + + /** + * Button openUriAction. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction|null|undefined} openUriAction + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @instance + */ + Button.prototype.openUriAction = null; + + /** + * Creates a new Button instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button} Button instance + */ + Button.create = function create(properties) { + return new Button(properties); + }; + + /** + * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton} message Button message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Button.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.openUriAction != null && Object.hasOwnProperty.call(message, "openUriAction")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.encode(message.openUriAction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton} message Button message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Button.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Button message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button} Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Button.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.openUriAction = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Button message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button} Button + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Button.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Button message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Button.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.verify(message.openUriAction); + if (error) + return "openUriAction." + error; + } + return null; + }; + + /** + * Creates a Button message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button} Button + */ + Button.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button(); + if (object.title != null) + message.title = String(object.title); + if (object.openUriAction != null) { + if (typeof object.openUriAction !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.openUriAction: object expected"); + message.openUriAction = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.fromObject(object.openUriAction); + } + return message; + }; + + /** + * Creates a plain object from a Button message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button} message Button + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Button.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.title = ""; + object.openUriAction = null; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) + object.openUriAction = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.toObject(message.openUriAction, options); + return object; + }; + + /** + * Converts this Button to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @instance + * @returns {Object.} JSON object + */ + Button.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Button.OpenUriAction = (function() { + + /** + * Properties of an OpenUriAction. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @interface IOpenUriAction + * @property {string|null} [uri] OpenUriAction uri + */ + + /** + * Constructs a new OpenUriAction. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button + * @classdesc Represents an OpenUriAction. + * @implements IOpenUriAction + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction=} [properties] Properties to set + */ + function OpenUriAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenUriAction uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction + * @instance + */ + OpenUriAction.prototype.uri = ""; + + /** + * Creates a new OpenUriAction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction instance + */ + OpenUriAction.create = function create(properties) { + return new OpenUriAction(properties); + }; + + /** + * Encodes the specified OpenUriAction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction} message OpenUriAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenUriAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified OpenUriAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction} message OpenUriAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenUriAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenUriAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenUriAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenUriAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenUriAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenUriAction message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenUriAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates an OpenUriAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction + */ + OpenUriAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from an OpenUriAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction} message OpenUriAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenUriAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this OpenUriAction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction + * @instance + * @returns {Object.} JSON object + */ + OpenUriAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OpenUriAction; + })(); + + return Button; + })(); + + return BasicCard; + })(); + + Message.Suggestion = (function() { + + /** + * Properties of a Suggestion. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ISuggestion + * @property {string|null} [title] Suggestion title + */ + + /** + * Constructs a new Suggestion. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a Suggestion. + * @implements ISuggestion + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion=} [properties] Properties to set + */ + function Suggestion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Suggestion title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion + * @instance + */ + Suggestion.prototype.title = ""; + + /** + * Creates a new Suggestion instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion} Suggestion instance + */ + Suggestion.create = function create(properties) { + return new Suggestion(properties); + }; + + /** + * Encodes the specified Suggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion} message Suggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + return writer; + }; + + /** + * Encodes the specified Suggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion} message Suggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Suggestion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion} Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Suggestion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion} Suggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Suggestion message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Suggestion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + return null; + }; + + /** + * Creates a Suggestion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion} Suggestion + */ + Suggestion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion(); + if (object.title != null) + message.title = String(object.title); + return message; + }; + + /** + * Creates a plain object from a Suggestion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion} message Suggestion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Suggestion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.title = ""; + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + return object; + }; + + /** + * Converts this Suggestion to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion + * @instance + * @returns {Object.} JSON object + */ + Suggestion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Suggestion; + })(); + + Message.Suggestions = (function() { + + /** + * Properties of a Suggestions. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ISuggestions + * @property {Array.|null} [suggestions] Suggestions suggestions + */ + + /** + * Constructs a new Suggestions. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a Suggestions. + * @implements ISuggestions + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions=} [properties] Properties to set + */ + function Suggestions(properties) { + this.suggestions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Suggestions suggestions. + * @member {Array.} suggestions + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions + * @instance + */ + Suggestions.prototype.suggestions = $util.emptyArray; + + /** + * Creates a new Suggestions instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions} Suggestions instance + */ + Suggestions.create = function create(properties) { + return new Suggestions(properties); + }; + + /** + * Encodes the specified Suggestions message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions} message Suggestions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.suggestions != null && message.suggestions.length) + for (var i = 0; i < message.suggestions.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.encode(message.suggestions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Suggestions message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions} message Suggestions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Suggestions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Suggestions message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions} Suggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestions.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.suggestions && message.suggestions.length)) + message.suggestions = []; + message.suggestions.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Suggestions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions} Suggestions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Suggestions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Suggestions message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Suggestions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + if (!Array.isArray(message.suggestions)) + return "suggestions: array expected"; + for (var i = 0; i < message.suggestions.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.verify(message.suggestions[i]); + if (error) + return "suggestions." + error; + } + } + return null; + }; + + /** + * Creates a Suggestions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions} Suggestions + */ + Suggestions.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions(); + if (object.suggestions) { + if (!Array.isArray(object.suggestions)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.suggestions: array expected"); + message.suggestions = []; + for (var i = 0; i < object.suggestions.length; ++i) { + if (typeof object.suggestions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.suggestions: object expected"); + message.suggestions[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.fromObject(object.suggestions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Suggestions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions} message Suggestions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Suggestions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.suggestions = []; + if (message.suggestions && message.suggestions.length) { + object.suggestions = []; + for (var j = 0; j < message.suggestions.length; ++j) + object.suggestions[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.toObject(message.suggestions[j], options); + } + return object; + }; + + /** + * Converts this Suggestions to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions + * @instance + * @returns {Object.} JSON object + */ + Suggestions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Suggestions; + })(); + + Message.LinkOutSuggestion = (function() { + + /** + * Properties of a LinkOutSuggestion. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ILinkOutSuggestion + * @property {string|null} [destinationName] LinkOutSuggestion destinationName + * @property {string|null} [uri] LinkOutSuggestion uri + */ + + /** + * Constructs a new LinkOutSuggestion. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a LinkOutSuggestion. + * @implements ILinkOutSuggestion + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion=} [properties] Properties to set + */ + function LinkOutSuggestion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * LinkOutSuggestion destinationName. + * @member {string} destinationName + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion + * @instance + */ + LinkOutSuggestion.prototype.destinationName = ""; + + /** + * LinkOutSuggestion uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion + * @instance + */ + LinkOutSuggestion.prototype.uri = ""; + + /** + * Creates a new LinkOutSuggestion instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion} LinkOutSuggestion instance + */ + LinkOutSuggestion.create = function create(properties) { + return new LinkOutSuggestion(properties); + }; + + /** + * Encodes the specified LinkOutSuggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion} message LinkOutSuggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkOutSuggestion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.destinationName != null && Object.hasOwnProperty.call(message, "destinationName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationName); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); + return writer; + }; + + /** + * Encodes the specified LinkOutSuggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion} message LinkOutSuggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LinkOutSuggestion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a LinkOutSuggestion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion} LinkOutSuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkOutSuggestion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.destinationName = reader.string(); + break; + case 2: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a LinkOutSuggestion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion} LinkOutSuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LinkOutSuggestion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a LinkOutSuggestion message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LinkOutSuggestion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.destinationName != null && message.hasOwnProperty("destinationName")) + if (!$util.isString(message.destinationName)) + return "destinationName: string expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a LinkOutSuggestion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion} LinkOutSuggestion + */ + LinkOutSuggestion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion(); + if (object.destinationName != null) + message.destinationName = String(object.destinationName); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a LinkOutSuggestion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion} message LinkOutSuggestion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LinkOutSuggestion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.destinationName = ""; + object.uri = ""; + } + if (message.destinationName != null && message.hasOwnProperty("destinationName")) + object.destinationName = message.destinationName; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this LinkOutSuggestion to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion + * @instance + * @returns {Object.} JSON object + */ + LinkOutSuggestion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return LinkOutSuggestion; + })(); + + Message.ListSelect = (function() { + + /** + * Properties of a ListSelect. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IListSelect + * @property {string|null} [title] ListSelect title + * @property {Array.|null} [items] ListSelect items + * @property {string|null} [subtitle] ListSelect subtitle + */ + + /** + * Constructs a new ListSelect. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a ListSelect. + * @implements IListSelect + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect=} [properties] Properties to set + */ + function ListSelect(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSelect title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @instance + */ + ListSelect.prototype.title = ""; + + /** + * ListSelect items. + * @member {Array.} items + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @instance + */ + ListSelect.prototype.items = $util.emptyArray; + + /** + * ListSelect subtitle. + * @member {string} subtitle + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @instance + */ + ListSelect.prototype.subtitle = ""; + + /** + * Creates a new ListSelect instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect} ListSelect instance + */ + ListSelect.create = function create(properties) { + return new ListSelect(properties); + }; + + /** + * Encodes the specified ListSelect message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect} message ListSelect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSelect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.subtitle); + return writer; + }; + + /** + * Encodes the specified ListSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect} message ListSelect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSelect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSelect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect} ListSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSelect.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.decode(reader, reader.uint32())); + break; + case 3: + message.subtitle = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListSelect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect} ListSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSelect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListSelect message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSelect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + return null; + }; + + /** + * Creates a ListSelect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect} ListSelect + */ + ListSelect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect(); + if (object.title != null) + message.title = String(object.title); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.items: object expected"); + message.items[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.fromObject(object.items[i]); + } + } + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + return message; + }; + + /** + * Creates a plain object from a ListSelect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect} message ListSelect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSelect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) { + object.title = ""; + object.subtitle = ""; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.toObject(message.items[j], options); + } + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + return object; + }; + + /** + * Converts this ListSelect to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @instance + * @returns {Object.} JSON object + */ + ListSelect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + ListSelect.Item = (function() { + + /** + * Properties of an Item. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @interface IItem + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null} [info] Item info + * @property {string|null} [title] Item title + * @property {string|null} [description] Item description + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [image] Item image + */ + + /** + * Constructs a new Item. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem=} [properties] Properties to set + */ + function Item(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Item info. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null|undefined} info + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @instance + */ + Item.prototype.info = null; + + /** + * Item title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @instance + */ + Item.prototype.title = ""; + + /** + * Item description. + * @member {string} description + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @instance + */ + Item.prototype.description = ""; + + /** + * Item image. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} image + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @instance + */ + Item.prototype.image = null; + + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.decode(reader, reader.uint32()); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.info != null && message.hasOwnProperty("info")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.verify(message.info); + if (error) + return "info." + error; + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + return null; + }; + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item(); + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.info: object expected"); + message.info = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.fromObject(object.info); + } + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.image: object expected"); + message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.image); + } + return message; + }; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.info = null; + object.title = ""; + object.description = ""; + object.image = null; + } + if (message.info != null && message.hasOwnProperty("info")) + object.info = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.toObject(message.info, options); + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.image, options); + return object; + }; + + /** + * Converts this Item to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Item; + })(); + + return ListSelect; + })(); + + Message.CarouselSelect = (function() { + + /** + * Properties of a CarouselSelect. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ICarouselSelect + * @property {Array.|null} [items] CarouselSelect items + */ + + /** + * Constructs a new CarouselSelect. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a CarouselSelect. + * @implements ICarouselSelect + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect=} [properties] Properties to set + */ + function CarouselSelect(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CarouselSelect items. + * @member {Array.} items + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect + * @instance + */ + CarouselSelect.prototype.items = $util.emptyArray; + + /** + * Creates a new CarouselSelect instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect} CarouselSelect instance + */ + CarouselSelect.create = function create(properties) { + return new CarouselSelect(properties); + }; + + /** + * Encodes the specified CarouselSelect message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect} message CarouselSelect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CarouselSelect.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CarouselSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect} message CarouselSelect message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CarouselSelect.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CarouselSelect message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect} CarouselSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CarouselSelect.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CarouselSelect message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect} CarouselSelect + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CarouselSelect.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CarouselSelect message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CarouselSelect.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates a CarouselSelect message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect} CarouselSelect + */ + CarouselSelect.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.items: object expected"); + message.items[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a CarouselSelect message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect} message CarouselSelect + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CarouselSelect.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this CarouselSelect to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect + * @instance + * @returns {Object.} JSON object + */ + CarouselSelect.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + CarouselSelect.Item = (function() { + + /** + * Properties of an Item. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect + * @interface IItem + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null} [info] Item info + * @property {string|null} [title] Item title + * @property {string|null} [description] Item description + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [image] Item image + */ + + /** + * Constructs a new Item. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect + * @classdesc Represents an Item. + * @implements IItem + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem=} [properties] Properties to set + */ + function Item(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Item info. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null|undefined} info + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @instance + */ + Item.prototype.info = null; + + /** + * Item title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @instance + */ + Item.prototype.title = ""; + + /** + * Item description. + * @member {string} description + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @instance + */ + Item.prototype.description = ""; + + /** + * Item image. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} image + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @instance + */ + Item.prototype.image = null; + + /** + * Creates a new Item instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item} Item instance + */ + Item.create = function create(properties) { + return new Item(properties); + }; + + /** + * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.info != null && Object.hasOwnProperty.call(message, "info")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem} message Item message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Item.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Item message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.info = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.decode(reader, reader.uint32()); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Item message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item} Item + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Item.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Item message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Item.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.info != null && message.hasOwnProperty("info")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.verify(message.info); + if (error) + return "info." + error; + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + return null; + }; + + /** + * Creates an Item message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item} Item + */ + Item.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item(); + if (object.info != null) { + if (typeof object.info !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.info: object expected"); + message.info = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.fromObject(object.info); + } + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.image: object expected"); + message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.image); + } + return message; + }; + + /** + * Creates a plain object from an Item message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item} message Item + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Item.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.info = null; + object.title = ""; + object.description = ""; + object.image = null; + } + if (message.info != null && message.hasOwnProperty("info")) + object.info = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.toObject(message.info, options); + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.image, options); + return object; + }; + + /** + * Converts this Item to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item + * @instance + * @returns {Object.} JSON object + */ + Item.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Item; + })(); + + return CarouselSelect; + })(); + + Message.SelectItemInfo = (function() { + + /** + * Properties of a SelectItemInfo. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ISelectItemInfo + * @property {string|null} [key] SelectItemInfo key + * @property {Array.|null} [synonyms] SelectItemInfo synonyms + */ + + /** + * Constructs a new SelectItemInfo. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a SelectItemInfo. + * @implements ISelectItemInfo + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo=} [properties] Properties to set + */ + function SelectItemInfo(properties) { + this.synonyms = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SelectItemInfo key. + * @member {string} key + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo + * @instance + */ + SelectItemInfo.prototype.key = ""; + + /** + * SelectItemInfo synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo + * @instance + */ + SelectItemInfo.prototype.synonyms = $util.emptyArray; + + /** + * Creates a new SelectItemInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo} SelectItemInfo instance + */ + SelectItemInfo.create = function create(properties) { + return new SelectItemInfo(properties); + }; + + /** + * Encodes the specified SelectItemInfo message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo} message SelectItemInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectItemInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.synonyms[i]); + return writer; + }; + + /** + * Encodes the specified SelectItemInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo} message SelectItemInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SelectItemInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SelectItemInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo} SelectItemInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectItemInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.string(); + break; + case 2: + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SelectItemInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo} SelectItemInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SelectItemInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SelectItemInfo message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SelectItemInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!$util.isString(message.key)) + return "key: string expected"; + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) + if (!$util.isString(message.synonyms[i])) + return "synonyms: string[] expected"; + } + return null; + }; + + /** + * Creates a SelectItemInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo} SelectItemInfo + */ + SelectItemInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo(); + if (object.key != null) + message.key = String(object.key); + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) + message.synonyms[i] = String(object.synonyms[i]); + } + return message; + }; + + /** + * Creates a plain object from a SelectItemInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo} message SelectItemInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SelectItemInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.synonyms = []; + if (options.defaults) + object.key = ""; + if (message.key != null && message.hasOwnProperty("key")) + object.key = message.key; + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = message.synonyms[j]; + } + return object; + }; + + /** + * Converts this SelectItemInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo + * @instance + * @returns {Object.} JSON object + */ + SelectItemInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SelectItemInfo; + })(); + + Message.TelephonyPlayAudio = (function() { + + /** + * Properties of a TelephonyPlayAudio. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ITelephonyPlayAudio + * @property {string|null} [audioUri] TelephonyPlayAudio audioUri + */ + + /** + * Constructs a new TelephonyPlayAudio. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a TelephonyPlayAudio. + * @implements ITelephonyPlayAudio + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio=} [properties] Properties to set + */ + function TelephonyPlayAudio(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TelephonyPlayAudio audioUri. + * @member {string} audioUri + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio + * @instance + */ + TelephonyPlayAudio.prototype.audioUri = ""; + + /** + * Creates a new TelephonyPlayAudio instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio} TelephonyPlayAudio instance + */ + TelephonyPlayAudio.create = function create(properties) { + return new TelephonyPlayAudio(properties); + }; + + /** + * Encodes the specified TelephonyPlayAudio message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio} message TelephonyPlayAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonyPlayAudio.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.audioUri != null && Object.hasOwnProperty.call(message, "audioUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.audioUri); + return writer; + }; + + /** + * Encodes the specified TelephonyPlayAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio} message TelephonyPlayAudio message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonyPlayAudio.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TelephonyPlayAudio message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio} TelephonyPlayAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonyPlayAudio.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.audioUri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TelephonyPlayAudio message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio} TelephonyPlayAudio + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonyPlayAudio.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TelephonyPlayAudio message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TelephonyPlayAudio.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.audioUri != null && message.hasOwnProperty("audioUri")) + if (!$util.isString(message.audioUri)) + return "audioUri: string expected"; + return null; + }; + + /** + * Creates a TelephonyPlayAudio message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio} TelephonyPlayAudio + */ + TelephonyPlayAudio.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio(); + if (object.audioUri != null) + message.audioUri = String(object.audioUri); + return message; + }; + + /** + * Creates a plain object from a TelephonyPlayAudio message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio} message TelephonyPlayAudio + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TelephonyPlayAudio.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.audioUri = ""; + if (message.audioUri != null && message.hasOwnProperty("audioUri")) + object.audioUri = message.audioUri; + return object; + }; + + /** + * Converts this TelephonyPlayAudio to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio + * @instance + * @returns {Object.} JSON object + */ + TelephonyPlayAudio.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TelephonyPlayAudio; + })(); + + Message.TelephonySynthesizeSpeech = (function() { + + /** + * Properties of a TelephonySynthesizeSpeech. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ITelephonySynthesizeSpeech + * @property {string|null} [text] TelephonySynthesizeSpeech text + * @property {string|null} [ssml] TelephonySynthesizeSpeech ssml + */ + + /** + * Constructs a new TelephonySynthesizeSpeech. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a TelephonySynthesizeSpeech. + * @implements ITelephonySynthesizeSpeech + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech=} [properties] Properties to set + */ + function TelephonySynthesizeSpeech(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TelephonySynthesizeSpeech text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech + * @instance + */ + TelephonySynthesizeSpeech.prototype.text = ""; + + /** + * TelephonySynthesizeSpeech ssml. + * @member {string} ssml + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech + * @instance + */ + TelephonySynthesizeSpeech.prototype.ssml = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TelephonySynthesizeSpeech source. + * @member {"text"|"ssml"|undefined} source + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech + * @instance + */ + Object.defineProperty(TelephonySynthesizeSpeech.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["text", "ssml"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TelephonySynthesizeSpeech instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech} TelephonySynthesizeSpeech instance + */ + TelephonySynthesizeSpeech.create = function create(properties) { + return new TelephonySynthesizeSpeech(properties); + }; + + /** + * Encodes the specified TelephonySynthesizeSpeech message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech} message TelephonySynthesizeSpeech message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonySynthesizeSpeech.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.ssml != null && Object.hasOwnProperty.call(message, "ssml")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ssml); + return writer; + }; + + /** + * Encodes the specified TelephonySynthesizeSpeech message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech} message TelephonySynthesizeSpeech message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonySynthesizeSpeech.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TelephonySynthesizeSpeech message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech} TelephonySynthesizeSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonySynthesizeSpeech.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.ssml = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TelephonySynthesizeSpeech message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech} TelephonySynthesizeSpeech + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonySynthesizeSpeech.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TelephonySynthesizeSpeech message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TelephonySynthesizeSpeech.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) { + properties.source = 1; + if (!$util.isString(message.text)) + return "text: string expected"; + } + if (message.ssml != null && message.hasOwnProperty("ssml")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.ssml)) + return "ssml: string expected"; + } + return null; + }; + + /** + * Creates a TelephonySynthesizeSpeech message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech} TelephonySynthesizeSpeech + */ + TelephonySynthesizeSpeech.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech(); + if (object.text != null) + message.text = String(object.text); + if (object.ssml != null) + message.ssml = String(object.ssml); + return message; + }; + + /** + * Creates a plain object from a TelephonySynthesizeSpeech message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech} message TelephonySynthesizeSpeech + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TelephonySynthesizeSpeech.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.text != null && message.hasOwnProperty("text")) { + object.text = message.text; + if (options.oneofs) + object.source = "text"; + } + if (message.ssml != null && message.hasOwnProperty("ssml")) { + object.ssml = message.ssml; + if (options.oneofs) + object.source = "ssml"; + } + return object; + }; + + /** + * Converts this TelephonySynthesizeSpeech to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech + * @instance + * @returns {Object.} JSON object + */ + TelephonySynthesizeSpeech.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TelephonySynthesizeSpeech; + })(); + + Message.TelephonyTransferCall = (function() { + + /** + * Properties of a TelephonyTransferCall. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ITelephonyTransferCall + * @property {string|null} [phoneNumber] TelephonyTransferCall phoneNumber + */ + + /** + * Constructs a new TelephonyTransferCall. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a TelephonyTransferCall. + * @implements ITelephonyTransferCall + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall=} [properties] Properties to set + */ + function TelephonyTransferCall(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TelephonyTransferCall phoneNumber. + * @member {string} phoneNumber + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall + * @instance + */ + TelephonyTransferCall.prototype.phoneNumber = ""; + + /** + * Creates a new TelephonyTransferCall instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall} TelephonyTransferCall instance + */ + TelephonyTransferCall.create = function create(properties) { + return new TelephonyTransferCall(properties); + }; + + /** + * Encodes the specified TelephonyTransferCall message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall} message TelephonyTransferCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonyTransferCall.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phoneNumber); + return writer; + }; + + /** + * Encodes the specified TelephonyTransferCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall} message TelephonyTransferCall message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TelephonyTransferCall.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TelephonyTransferCall message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall} TelephonyTransferCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonyTransferCall.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.phoneNumber = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TelephonyTransferCall message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall} TelephonyTransferCall + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TelephonyTransferCall.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TelephonyTransferCall message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TelephonyTransferCall.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + return null; + }; + + /** + * Creates a TelephonyTransferCall message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall} TelephonyTransferCall + */ + TelephonyTransferCall.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall(); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + return message; + }; + + /** + * Creates a plain object from a TelephonyTransferCall message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall} message TelephonyTransferCall + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TelephonyTransferCall.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.phoneNumber = ""; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; + return object; + }; + + /** + * Converts this TelephonyTransferCall to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall + * @instance + * @returns {Object.} JSON object + */ + TelephonyTransferCall.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TelephonyTransferCall; + })(); + + Message.RbmText = (function() { + + /** + * Properties of a RbmText. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IRbmText + * @property {string|null} [text] RbmText text + * @property {Array.|null} [rbmSuggestion] RbmText rbmSuggestion + */ + + /** + * Constructs a new RbmText. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a RbmText. + * @implements IRbmText + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText=} [properties] Properties to set + */ + function RbmText(properties) { + this.rbmSuggestion = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RbmText text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText + * @instance + */ + RbmText.prototype.text = ""; + + /** + * RbmText rbmSuggestion. + * @member {Array.} rbmSuggestion + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText + * @instance + */ + RbmText.prototype.rbmSuggestion = $util.emptyArray; + + /** + * Creates a new RbmText instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmText} RbmText instance + */ + RbmText.create = function create(properties) { + return new RbmText(properties); + }; + + /** + * Encodes the specified RbmText message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText} message RbmText message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmText.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.rbmSuggestion != null && message.rbmSuggestion.length) + for (var i = 0; i < message.rbmSuggestion.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.encode(message.rbmSuggestion[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RbmText message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText} message RbmText message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmText.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RbmText message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmText} RbmText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmText.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + if (!(message.rbmSuggestion && message.rbmSuggestion.length)) + message.rbmSuggestion = []; + message.rbmSuggestion.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RbmText message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmText} RbmText + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmText.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RbmText message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RbmText.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.rbmSuggestion != null && message.hasOwnProperty("rbmSuggestion")) { + if (!Array.isArray(message.rbmSuggestion)) + return "rbmSuggestion: array expected"; + for (var i = 0; i < message.rbmSuggestion.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.verify(message.rbmSuggestion[i]); + if (error) + return "rbmSuggestion." + error; + } + } + return null; + }; + + /** + * Creates a RbmText message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmText} RbmText + */ + RbmText.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText(); + if (object.text != null) + message.text = String(object.text); + if (object.rbmSuggestion) { + if (!Array.isArray(object.rbmSuggestion)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.rbmSuggestion: array expected"); + message.rbmSuggestion = []; + for (var i = 0; i < object.rbmSuggestion.length; ++i) { + if (typeof object.rbmSuggestion[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.rbmSuggestion: object expected"); + message.rbmSuggestion[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.fromObject(object.rbmSuggestion[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RbmText message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmText} message RbmText + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RbmText.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rbmSuggestion = []; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.rbmSuggestion && message.rbmSuggestion.length) { + object.rbmSuggestion = []; + for (var j = 0; j < message.rbmSuggestion.length; ++j) + object.rbmSuggestion[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.toObject(message.rbmSuggestion[j], options); + } + return object; + }; + + /** + * Converts this RbmText to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText + * @instance + * @returns {Object.} JSON object + */ + RbmText.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RbmText; + })(); + + Message.RbmCarouselCard = (function() { + + /** + * Properties of a RbmCarouselCard. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IRbmCarouselCard + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth|null} [cardWidth] RbmCarouselCard cardWidth + * @property {Array.|null} [cardContents] RbmCarouselCard cardContents + */ + + /** + * Constructs a new RbmCarouselCard. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a RbmCarouselCard. + * @implements IRbmCarouselCard + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard=} [properties] Properties to set + */ + function RbmCarouselCard(properties) { + this.cardContents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RbmCarouselCard cardWidth. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth} cardWidth + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard + * @instance + */ + RbmCarouselCard.prototype.cardWidth = 0; + + /** + * RbmCarouselCard cardContents. + * @member {Array.} cardContents + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard + * @instance + */ + RbmCarouselCard.prototype.cardContents = $util.emptyArray; + + /** + * Creates a new RbmCarouselCard instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard} RbmCarouselCard instance + */ + RbmCarouselCard.create = function create(properties) { + return new RbmCarouselCard(properties); + }; + + /** + * Encodes the specified RbmCarouselCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard} message RbmCarouselCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmCarouselCard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cardWidth != null && Object.hasOwnProperty.call(message, "cardWidth")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cardWidth); + if (message.cardContents != null && message.cardContents.length) + for (var i = 0; i < message.cardContents.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.encode(message.cardContents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RbmCarouselCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard} message RbmCarouselCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmCarouselCard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RbmCarouselCard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard} RbmCarouselCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmCarouselCard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cardWidth = reader.int32(); + break; + case 2: + if (!(message.cardContents && message.cardContents.length)) + message.cardContents = []; + message.cardContents.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RbmCarouselCard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard} RbmCarouselCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmCarouselCard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RbmCarouselCard message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RbmCarouselCard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cardWidth != null && message.hasOwnProperty("cardWidth")) + switch (message.cardWidth) { + default: + return "cardWidth: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.cardContents != null && message.hasOwnProperty("cardContents")) { + if (!Array.isArray(message.cardContents)) + return "cardContents: array expected"; + for (var i = 0; i < message.cardContents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.verify(message.cardContents[i]); + if (error) + return "cardContents." + error; + } + } + return null; + }; + + /** + * Creates a RbmCarouselCard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard} RbmCarouselCard + */ + RbmCarouselCard.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard(); + switch (object.cardWidth) { + case "CARD_WIDTH_UNSPECIFIED": + case 0: + message.cardWidth = 0; + break; + case "SMALL": + case 1: + message.cardWidth = 1; + break; + case "MEDIUM": + case 2: + message.cardWidth = 2; + break; + } + if (object.cardContents) { + if (!Array.isArray(object.cardContents)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.cardContents: array expected"); + message.cardContents = []; + for (var i = 0; i < object.cardContents.length; ++i) { + if (typeof object.cardContents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.cardContents: object expected"); + message.cardContents[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.fromObject(object.cardContents[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RbmCarouselCard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard} message RbmCarouselCard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RbmCarouselCard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cardContents = []; + if (options.defaults) + object.cardWidth = options.enums === String ? "CARD_WIDTH_UNSPECIFIED" : 0; + if (message.cardWidth != null && message.hasOwnProperty("cardWidth")) + object.cardWidth = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth[message.cardWidth] : message.cardWidth; + if (message.cardContents && message.cardContents.length) { + object.cardContents = []; + for (var j = 0; j < message.cardContents.length; ++j) + object.cardContents[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.toObject(message.cardContents[j], options); + } + return object; + }; + + /** + * Converts this RbmCarouselCard to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard + * @instance + * @returns {Object.} JSON object + */ + RbmCarouselCard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CardWidth enum. + * @name google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth + * @enum {number} + * @property {number} CARD_WIDTH_UNSPECIFIED=0 CARD_WIDTH_UNSPECIFIED value + * @property {number} SMALL=1 SMALL value + * @property {number} MEDIUM=2 MEDIUM value + */ + RbmCarouselCard.CardWidth = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CARD_WIDTH_UNSPECIFIED"] = 0; + values[valuesById[1] = "SMALL"] = 1; + values[valuesById[2] = "MEDIUM"] = 2; + return values; + })(); + + return RbmCarouselCard; + })(); + + Message.RbmStandaloneCard = (function() { + + /** + * Properties of a RbmStandaloneCard. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IRbmStandaloneCard + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation|null} [cardOrientation] RbmStandaloneCard cardOrientation + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment|null} [thumbnailImageAlignment] RbmStandaloneCard thumbnailImageAlignment + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent|null} [cardContent] RbmStandaloneCard cardContent + */ + + /** + * Constructs a new RbmStandaloneCard. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a RbmStandaloneCard. + * @implements IRbmStandaloneCard + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard=} [properties] Properties to set + */ + function RbmStandaloneCard(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RbmStandaloneCard cardOrientation. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation} cardOrientation + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard + * @instance + */ + RbmStandaloneCard.prototype.cardOrientation = 0; + + /** + * RbmStandaloneCard thumbnailImageAlignment. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment} thumbnailImageAlignment + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard + * @instance + */ + RbmStandaloneCard.prototype.thumbnailImageAlignment = 0; + + /** + * RbmStandaloneCard cardContent. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent|null|undefined} cardContent + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard + * @instance + */ + RbmStandaloneCard.prototype.cardContent = null; + + /** + * Creates a new RbmStandaloneCard instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard} RbmStandaloneCard instance + */ + RbmStandaloneCard.create = function create(properties) { + return new RbmStandaloneCard(properties); + }; + + /** + * Encodes the specified RbmStandaloneCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard} message RbmStandaloneCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmStandaloneCard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cardOrientation != null && Object.hasOwnProperty.call(message, "cardOrientation")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cardOrientation); + if (message.thumbnailImageAlignment != null && Object.hasOwnProperty.call(message, "thumbnailImageAlignment")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.thumbnailImageAlignment); + if (message.cardContent != null && Object.hasOwnProperty.call(message, "cardContent")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.encode(message.cardContent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RbmStandaloneCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard} message RbmStandaloneCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmStandaloneCard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RbmStandaloneCard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard} RbmStandaloneCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmStandaloneCard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.cardOrientation = reader.int32(); + break; + case 2: + message.thumbnailImageAlignment = reader.int32(); + break; + case 3: + message.cardContent = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RbmStandaloneCard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard} RbmStandaloneCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmStandaloneCard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RbmStandaloneCard message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RbmStandaloneCard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cardOrientation != null && message.hasOwnProperty("cardOrientation")) + switch (message.cardOrientation) { + default: + return "cardOrientation: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.thumbnailImageAlignment != null && message.hasOwnProperty("thumbnailImageAlignment")) + switch (message.thumbnailImageAlignment) { + default: + return "thumbnailImageAlignment: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.cardContent != null && message.hasOwnProperty("cardContent")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.verify(message.cardContent); + if (error) + return "cardContent." + error; + } + return null; + }; + + /** + * Creates a RbmStandaloneCard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard} RbmStandaloneCard + */ + RbmStandaloneCard.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard(); + switch (object.cardOrientation) { + case "CARD_ORIENTATION_UNSPECIFIED": + case 0: + message.cardOrientation = 0; + break; + case "HORIZONTAL": + case 1: + message.cardOrientation = 1; + break; + case "VERTICAL": + case 2: + message.cardOrientation = 2; + break; + } + switch (object.thumbnailImageAlignment) { + case "THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED": + case 0: + message.thumbnailImageAlignment = 0; + break; + case "LEFT": + case 1: + message.thumbnailImageAlignment = 1; + break; + case "RIGHT": + case 2: + message.thumbnailImageAlignment = 2; + break; + } + if (object.cardContent != null) { + if (typeof object.cardContent !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.cardContent: object expected"); + message.cardContent = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.fromObject(object.cardContent); + } + return message; + }; + + /** + * Creates a plain object from a RbmStandaloneCard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard} message RbmStandaloneCard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RbmStandaloneCard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.cardOrientation = options.enums === String ? "CARD_ORIENTATION_UNSPECIFIED" : 0; + object.thumbnailImageAlignment = options.enums === String ? "THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED" : 0; + object.cardContent = null; + } + if (message.cardOrientation != null && message.hasOwnProperty("cardOrientation")) + object.cardOrientation = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation[message.cardOrientation] : message.cardOrientation; + if (message.thumbnailImageAlignment != null && message.hasOwnProperty("thumbnailImageAlignment")) + object.thumbnailImageAlignment = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment[message.thumbnailImageAlignment] : message.thumbnailImageAlignment; + if (message.cardContent != null && message.hasOwnProperty("cardContent")) + object.cardContent = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.toObject(message.cardContent, options); + return object; + }; + + /** + * Converts this RbmStandaloneCard to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard + * @instance + * @returns {Object.} JSON object + */ + RbmStandaloneCard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CardOrientation enum. + * @name google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation + * @enum {number} + * @property {number} CARD_ORIENTATION_UNSPECIFIED=0 CARD_ORIENTATION_UNSPECIFIED value + * @property {number} HORIZONTAL=1 HORIZONTAL value + * @property {number} VERTICAL=2 VERTICAL value + */ + RbmStandaloneCard.CardOrientation = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CARD_ORIENTATION_UNSPECIFIED"] = 0; + values[valuesById[1] = "HORIZONTAL"] = 1; + values[valuesById[2] = "VERTICAL"] = 2; + return values; + })(); + + /** + * ThumbnailImageAlignment enum. + * @name google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment + * @enum {number} + * @property {number} THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED=0 THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED value + * @property {number} LEFT=1 LEFT value + * @property {number} RIGHT=2 RIGHT value + */ + RbmStandaloneCard.ThumbnailImageAlignment = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "LEFT"] = 1; + values[valuesById[2] = "RIGHT"] = 2; + return values; + })(); + + return RbmStandaloneCard; + })(); + + Message.RbmCardContent = (function() { + + /** + * Properties of a RbmCardContent. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IRbmCardContent + * @property {string|null} [title] RbmCardContent title + * @property {string|null} [description] RbmCardContent description + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia|null} [media] RbmCardContent media + * @property {Array.|null} [suggestions] RbmCardContent suggestions + */ + + /** + * Constructs a new RbmCardContent. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a RbmCardContent. + * @implements IRbmCardContent + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent=} [properties] Properties to set + */ + function RbmCardContent(properties) { + this.suggestions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RbmCardContent title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @instance + */ + RbmCardContent.prototype.title = ""; + + /** + * RbmCardContent description. + * @member {string} description + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @instance + */ + RbmCardContent.prototype.description = ""; + + /** + * RbmCardContent media. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia|null|undefined} media + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @instance + */ + RbmCardContent.prototype.media = null; + + /** + * RbmCardContent suggestions. + * @member {Array.} suggestions + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @instance + */ + RbmCardContent.prototype.suggestions = $util.emptyArray; + + /** + * Creates a new RbmCardContent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent} RbmCardContent instance + */ + RbmCardContent.create = function create(properties) { + return new RbmCardContent(properties); + }; + + /** + * Encodes the specified RbmCardContent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent} message RbmCardContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmCardContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.media != null && Object.hasOwnProperty.call(message, "media")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.encode(message.media, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.suggestions != null && message.suggestions.length) + for (var i = 0; i < message.suggestions.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.encode(message.suggestions[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RbmCardContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent} message RbmCardContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmCardContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RbmCardContent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent} RbmCardContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmCardContent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.media = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.suggestions && message.suggestions.length)) + message.suggestions = []; + message.suggestions.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RbmCardContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent} RbmCardContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmCardContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RbmCardContent message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RbmCardContent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.media != null && message.hasOwnProperty("media")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.verify(message.media); + if (error) + return "media." + error; + } + if (message.suggestions != null && message.hasOwnProperty("suggestions")) { + if (!Array.isArray(message.suggestions)) + return "suggestions: array expected"; + for (var i = 0; i < message.suggestions.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.verify(message.suggestions[i]); + if (error) + return "suggestions." + error; + } + } + return null; + }; + + /** + * Creates a RbmCardContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent} RbmCardContent + */ + RbmCardContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent(); + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.media != null) { + if (typeof object.media !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.media: object expected"); + message.media = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.fromObject(object.media); + } + if (object.suggestions) { + if (!Array.isArray(object.suggestions)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.suggestions: array expected"); + message.suggestions = []; + for (var i = 0; i < object.suggestions.length; ++i) { + if (typeof object.suggestions[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.suggestions: object expected"); + message.suggestions[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.fromObject(object.suggestions[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a RbmCardContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent} message RbmCardContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RbmCardContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.suggestions = []; + if (options.defaults) { + object.title = ""; + object.description = ""; + object.media = null; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.media != null && message.hasOwnProperty("media")) + object.media = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.toObject(message.media, options); + if (message.suggestions && message.suggestions.length) { + object.suggestions = []; + for (var j = 0; j < message.suggestions.length; ++j) + object.suggestions[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.toObject(message.suggestions[j], options); + } + return object; + }; + + /** + * Converts this RbmCardContent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @instance + * @returns {Object.} JSON object + */ + RbmCardContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + RbmCardContent.RbmMedia = (function() { + + /** + * Properties of a RbmMedia. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @interface IRbmMedia + * @property {string|null} [fileUri] RbmMedia fileUri + * @property {string|null} [thumbnailUri] RbmMedia thumbnailUri + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height|null} [height] RbmMedia height + */ + + /** + * Constructs a new RbmMedia. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent + * @classdesc Represents a RbmMedia. + * @implements IRbmMedia + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia=} [properties] Properties to set + */ + function RbmMedia(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RbmMedia fileUri. + * @member {string} fileUri + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia + * @instance + */ + RbmMedia.prototype.fileUri = ""; + + /** + * RbmMedia thumbnailUri. + * @member {string} thumbnailUri + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia + * @instance + */ + RbmMedia.prototype.thumbnailUri = ""; + + /** + * RbmMedia height. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height} height + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia + * @instance + */ + RbmMedia.prototype.height = 0; + + /** + * Creates a new RbmMedia instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia} RbmMedia instance + */ + RbmMedia.create = function create(properties) { + return new RbmMedia(properties); + }; + + /** + * Encodes the specified RbmMedia message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia} message RbmMedia message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmMedia.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fileUri != null && Object.hasOwnProperty.call(message, "fileUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.fileUri); + if (message.thumbnailUri != null && Object.hasOwnProperty.call(message, "thumbnailUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.thumbnailUri); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.height); + return writer; + }; + + /** + * Encodes the specified RbmMedia message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia} message RbmMedia message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmMedia.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RbmMedia message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia} RbmMedia + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmMedia.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.fileUri = reader.string(); + break; + case 2: + message.thumbnailUri = reader.string(); + break; + case 3: + message.height = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RbmMedia message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia} RbmMedia + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmMedia.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RbmMedia message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RbmMedia.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fileUri != null && message.hasOwnProperty("fileUri")) + if (!$util.isString(message.fileUri)) + return "fileUri: string expected"; + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + if (!$util.isString(message.thumbnailUri)) + return "thumbnailUri: string expected"; + if (message.height != null && message.hasOwnProperty("height")) + switch (message.height) { + default: + return "height: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a RbmMedia message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia} RbmMedia + */ + RbmMedia.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia(); + if (object.fileUri != null) + message.fileUri = String(object.fileUri); + if (object.thumbnailUri != null) + message.thumbnailUri = String(object.thumbnailUri); + switch (object.height) { + case "HEIGHT_UNSPECIFIED": + case 0: + message.height = 0; + break; + case "SHORT": + case 1: + message.height = 1; + break; + case "MEDIUM": + case 2: + message.height = 2; + break; + case "TALL": + case 3: + message.height = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a RbmMedia message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia} message RbmMedia + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RbmMedia.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.fileUri = ""; + object.thumbnailUri = ""; + object.height = options.enums === String ? "HEIGHT_UNSPECIFIED" : 0; + } + if (message.fileUri != null && message.hasOwnProperty("fileUri")) + object.fileUri = message.fileUri; + if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) + object.thumbnailUri = message.thumbnailUri; + if (message.height != null && message.hasOwnProperty("height")) + object.height = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height[message.height] : message.height; + return object; + }; + + /** + * Converts this RbmMedia to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia + * @instance + * @returns {Object.} JSON object + */ + RbmMedia.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Height enum. + * @name google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height + * @enum {number} + * @property {number} HEIGHT_UNSPECIFIED=0 HEIGHT_UNSPECIFIED value + * @property {number} SHORT=1 SHORT value + * @property {number} MEDIUM=2 MEDIUM value + * @property {number} TALL=3 TALL value + */ + RbmMedia.Height = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HEIGHT_UNSPECIFIED"] = 0; + values[valuesById[1] = "SHORT"] = 1; + values[valuesById[2] = "MEDIUM"] = 2; + values[valuesById[3] = "TALL"] = 3; + return values; + })(); + + return RbmMedia; + })(); + + return RbmCardContent; + })(); + + Message.RbmSuggestion = (function() { + + /** + * Properties of a RbmSuggestion. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IRbmSuggestion + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply|null} [reply] RbmSuggestion reply + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction|null} [action] RbmSuggestion action + */ + + /** + * Constructs a new RbmSuggestion. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a RbmSuggestion. + * @implements IRbmSuggestion + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion=} [properties] Properties to set + */ + function RbmSuggestion(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RbmSuggestion reply. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply|null|undefined} reply + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion + * @instance + */ + RbmSuggestion.prototype.reply = null; + + /** + * RbmSuggestion action. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction|null|undefined} action + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion + * @instance + */ + RbmSuggestion.prototype.action = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RbmSuggestion suggestion. + * @member {"reply"|"action"|undefined} suggestion + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion + * @instance + */ + Object.defineProperty(RbmSuggestion.prototype, "suggestion", { + get: $util.oneOfGetter($oneOfFields = ["reply", "action"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RbmSuggestion instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion} RbmSuggestion instance + */ + RbmSuggestion.create = function create(properties) { + return new RbmSuggestion(properties); + }; + + /** + * Encodes the specified RbmSuggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion} message RbmSuggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmSuggestion.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.reply != null && Object.hasOwnProperty.call(message, "reply")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.encode(message.reply, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.action != null && Object.hasOwnProperty.call(message, "action")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RbmSuggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion} message RbmSuggestion message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmSuggestion.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RbmSuggestion message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion} RbmSuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmSuggestion.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.reply = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.decode(reader, reader.uint32()); + break; + case 2: + message.action = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RbmSuggestion message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion} RbmSuggestion + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmSuggestion.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RbmSuggestion message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RbmSuggestion.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.reply != null && message.hasOwnProperty("reply")) { + properties.suggestion = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.verify(message.reply); + if (error) + return "reply." + error; + } + } + if (message.action != null && message.hasOwnProperty("action")) { + if (properties.suggestion === 1) + return "suggestion: multiple values"; + properties.suggestion = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.verify(message.action); + if (error) + return "action." + error; + } + } + return null; + }; + + /** + * Creates a RbmSuggestion message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion} RbmSuggestion + */ + RbmSuggestion.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion(); + if (object.reply != null) { + if (typeof object.reply !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.reply: object expected"); + message.reply = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.fromObject(object.reply); + } + if (object.action != null) { + if (typeof object.action !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.action: object expected"); + message.action = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.fromObject(object.action); + } + return message; + }; + + /** + * Creates a plain object from a RbmSuggestion message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion} message RbmSuggestion + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RbmSuggestion.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.reply != null && message.hasOwnProperty("reply")) { + object.reply = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.toObject(message.reply, options); + if (options.oneofs) + object.suggestion = "reply"; + } + if (message.action != null && message.hasOwnProperty("action")) { + object.action = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.toObject(message.action, options); + if (options.oneofs) + object.suggestion = "action"; + } + return object; + }; + + /** + * Converts this RbmSuggestion to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion + * @instance + * @returns {Object.} JSON object + */ + RbmSuggestion.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RbmSuggestion; + })(); + + Message.RbmSuggestedReply = (function() { + + /** + * Properties of a RbmSuggestedReply. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IRbmSuggestedReply + * @property {string|null} [text] RbmSuggestedReply text + * @property {string|null} [postbackData] RbmSuggestedReply postbackData + */ + + /** + * Constructs a new RbmSuggestedReply. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a RbmSuggestedReply. + * @implements IRbmSuggestedReply + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply=} [properties] Properties to set + */ + function RbmSuggestedReply(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RbmSuggestedReply text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply + * @instance + */ + RbmSuggestedReply.prototype.text = ""; + + /** + * RbmSuggestedReply postbackData. + * @member {string} postbackData + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply + * @instance + */ + RbmSuggestedReply.prototype.postbackData = ""; + + /** + * Creates a new RbmSuggestedReply instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply} RbmSuggestedReply instance + */ + RbmSuggestedReply.create = function create(properties) { + return new RbmSuggestedReply(properties); + }; + + /** + * Encodes the specified RbmSuggestedReply message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply} message RbmSuggestedReply message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmSuggestedReply.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.postbackData != null && Object.hasOwnProperty.call(message, "postbackData")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.postbackData); + return writer; + }; + + /** + * Encodes the specified RbmSuggestedReply message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply} message RbmSuggestedReply message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmSuggestedReply.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RbmSuggestedReply message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply} RbmSuggestedReply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmSuggestedReply.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.postbackData = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RbmSuggestedReply message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply} RbmSuggestedReply + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmSuggestedReply.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RbmSuggestedReply message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RbmSuggestedReply.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.postbackData != null && message.hasOwnProperty("postbackData")) + if (!$util.isString(message.postbackData)) + return "postbackData: string expected"; + return null; + }; + + /** + * Creates a RbmSuggestedReply message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply} RbmSuggestedReply + */ + RbmSuggestedReply.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply(); + if (object.text != null) + message.text = String(object.text); + if (object.postbackData != null) + message.postbackData = String(object.postbackData); + return message; + }; + + /** + * Creates a plain object from a RbmSuggestedReply message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply} message RbmSuggestedReply + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RbmSuggestedReply.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.postbackData = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.postbackData != null && message.hasOwnProperty("postbackData")) + object.postbackData = message.postbackData; + return object; + }; + + /** + * Converts this RbmSuggestedReply to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply + * @instance + * @returns {Object.} JSON object + */ + RbmSuggestedReply.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RbmSuggestedReply; + })(); + + Message.RbmSuggestedAction = (function() { + + /** + * Properties of a RbmSuggestedAction. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IRbmSuggestedAction + * @property {string|null} [text] RbmSuggestedAction text + * @property {string|null} [postbackData] RbmSuggestedAction postbackData + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial|null} [dial] RbmSuggestedAction dial + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri|null} [openUrl] RbmSuggestedAction openUrl + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation|null} [shareLocation] RbmSuggestedAction shareLocation + */ + + /** + * Constructs a new RbmSuggestedAction. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a RbmSuggestedAction. + * @implements IRbmSuggestedAction + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction=} [properties] Properties to set + */ + function RbmSuggestedAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RbmSuggestedAction text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @instance + */ + RbmSuggestedAction.prototype.text = ""; + + /** + * RbmSuggestedAction postbackData. + * @member {string} postbackData + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @instance + */ + RbmSuggestedAction.prototype.postbackData = ""; + + /** + * RbmSuggestedAction dial. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial|null|undefined} dial + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @instance + */ + RbmSuggestedAction.prototype.dial = null; + + /** + * RbmSuggestedAction openUrl. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri|null|undefined} openUrl + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @instance + */ + RbmSuggestedAction.prototype.openUrl = null; + + /** + * RbmSuggestedAction shareLocation. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation|null|undefined} shareLocation + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @instance + */ + RbmSuggestedAction.prototype.shareLocation = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RbmSuggestedAction action. + * @member {"dial"|"openUrl"|"shareLocation"|undefined} action + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @instance + */ + Object.defineProperty(RbmSuggestedAction.prototype, "action", { + get: $util.oneOfGetter($oneOfFields = ["dial", "openUrl", "shareLocation"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RbmSuggestedAction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction} RbmSuggestedAction instance + */ + RbmSuggestedAction.create = function create(properties) { + return new RbmSuggestedAction(properties); + }; + + /** + * Encodes the specified RbmSuggestedAction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction} message RbmSuggestedAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmSuggestedAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + if (message.postbackData != null && Object.hasOwnProperty.call(message, "postbackData")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.postbackData); + if (message.dial != null && Object.hasOwnProperty.call(message, "dial")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.encode(message.dial, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.openUrl != null && Object.hasOwnProperty.call(message, "openUrl")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.encode(message.openUrl, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.shareLocation != null && Object.hasOwnProperty.call(message, "shareLocation")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.encode(message.shareLocation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RbmSuggestedAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction} message RbmSuggestedAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmSuggestedAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RbmSuggestedAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction} RbmSuggestedAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmSuggestedAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + case 2: + message.postbackData = reader.string(); + break; + case 3: + message.dial = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.decode(reader, reader.uint32()); + break; + case 4: + message.openUrl = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.decode(reader, reader.uint32()); + break; + case 5: + message.shareLocation = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RbmSuggestedAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction} RbmSuggestedAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmSuggestedAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RbmSuggestedAction message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RbmSuggestedAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + if (message.postbackData != null && message.hasOwnProperty("postbackData")) + if (!$util.isString(message.postbackData)) + return "postbackData: string expected"; + if (message.dial != null && message.hasOwnProperty("dial")) { + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.verify(message.dial); + if (error) + return "dial." + error; + } + } + if (message.openUrl != null && message.hasOwnProperty("openUrl")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.verify(message.openUrl); + if (error) + return "openUrl." + error; + } + } + if (message.shareLocation != null && message.hasOwnProperty("shareLocation")) { + if (properties.action === 1) + return "action: multiple values"; + properties.action = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.verify(message.shareLocation); + if (error) + return "shareLocation." + error; + } + } + return null; + }; + + /** + * Creates a RbmSuggestedAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction} RbmSuggestedAction + */ + RbmSuggestedAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction(); + if (object.text != null) + message.text = String(object.text); + if (object.postbackData != null) + message.postbackData = String(object.postbackData); + if (object.dial != null) { + if (typeof object.dial !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.dial: object expected"); + message.dial = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.fromObject(object.dial); + } + if (object.openUrl != null) { + if (typeof object.openUrl !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.openUrl: object expected"); + message.openUrl = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.fromObject(object.openUrl); + } + if (object.shareLocation != null) { + if (typeof object.shareLocation !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.shareLocation: object expected"); + message.shareLocation = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.fromObject(object.shareLocation); + } + return message; + }; + + /** + * Creates a plain object from a RbmSuggestedAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction} message RbmSuggestedAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RbmSuggestedAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.text = ""; + object.postbackData = ""; + } + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + if (message.postbackData != null && message.hasOwnProperty("postbackData")) + object.postbackData = message.postbackData; + if (message.dial != null && message.hasOwnProperty("dial")) { + object.dial = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.toObject(message.dial, options); + if (options.oneofs) + object.action = "dial"; + } + if (message.openUrl != null && message.hasOwnProperty("openUrl")) { + object.openUrl = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.toObject(message.openUrl, options); + if (options.oneofs) + object.action = "openUrl"; + } + if (message.shareLocation != null && message.hasOwnProperty("shareLocation")) { + object.shareLocation = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.toObject(message.shareLocation, options); + if (options.oneofs) + object.action = "shareLocation"; + } + return object; + }; + + /** + * Converts this RbmSuggestedAction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @instance + * @returns {Object.} JSON object + */ + RbmSuggestedAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + RbmSuggestedAction.RbmSuggestedActionDial = (function() { + + /** + * Properties of a RbmSuggestedActionDial. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @interface IRbmSuggestedActionDial + * @property {string|null} [phoneNumber] RbmSuggestedActionDial phoneNumber + */ + + /** + * Constructs a new RbmSuggestedActionDial. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @classdesc Represents a RbmSuggestedActionDial. + * @implements IRbmSuggestedActionDial + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial=} [properties] Properties to set + */ + function RbmSuggestedActionDial(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RbmSuggestedActionDial phoneNumber. + * @member {string} phoneNumber + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial + * @instance + */ + RbmSuggestedActionDial.prototype.phoneNumber = ""; + + /** + * Creates a new RbmSuggestedActionDial instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial} RbmSuggestedActionDial instance + */ + RbmSuggestedActionDial.create = function create(properties) { + return new RbmSuggestedActionDial(properties); + }; + + /** + * Encodes the specified RbmSuggestedActionDial message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial} message RbmSuggestedActionDial message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmSuggestedActionDial.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.phoneNumber); + return writer; + }; + + /** + * Encodes the specified RbmSuggestedActionDial message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial} message RbmSuggestedActionDial message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmSuggestedActionDial.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RbmSuggestedActionDial message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial} RbmSuggestedActionDial + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmSuggestedActionDial.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.phoneNumber = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RbmSuggestedActionDial message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial} RbmSuggestedActionDial + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmSuggestedActionDial.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RbmSuggestedActionDial message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RbmSuggestedActionDial.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + return null; + }; + + /** + * Creates a RbmSuggestedActionDial message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial} RbmSuggestedActionDial + */ + RbmSuggestedActionDial.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial(); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + return message; + }; + + /** + * Creates a plain object from a RbmSuggestedActionDial message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial} message RbmSuggestedActionDial + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RbmSuggestedActionDial.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.phoneNumber = ""; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; + return object; + }; + + /** + * Converts this RbmSuggestedActionDial to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial + * @instance + * @returns {Object.} JSON object + */ + RbmSuggestedActionDial.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RbmSuggestedActionDial; + })(); + + RbmSuggestedAction.RbmSuggestedActionOpenUri = (function() { + + /** + * Properties of a RbmSuggestedActionOpenUri. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @interface IRbmSuggestedActionOpenUri + * @property {string|null} [uri] RbmSuggestedActionOpenUri uri + */ + + /** + * Constructs a new RbmSuggestedActionOpenUri. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @classdesc Represents a RbmSuggestedActionOpenUri. + * @implements IRbmSuggestedActionOpenUri + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri=} [properties] Properties to set + */ + function RbmSuggestedActionOpenUri(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RbmSuggestedActionOpenUri uri. + * @member {string} uri + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri + * @instance + */ + RbmSuggestedActionOpenUri.prototype.uri = ""; + + /** + * Creates a new RbmSuggestedActionOpenUri instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri} RbmSuggestedActionOpenUri instance + */ + RbmSuggestedActionOpenUri.create = function create(properties) { + return new RbmSuggestedActionOpenUri(properties); + }; + + /** + * Encodes the specified RbmSuggestedActionOpenUri message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri} message RbmSuggestedActionOpenUri message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmSuggestedActionOpenUri.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); + return writer; + }; + + /** + * Encodes the specified RbmSuggestedActionOpenUri message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri} message RbmSuggestedActionOpenUri message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmSuggestedActionOpenUri.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RbmSuggestedActionOpenUri message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri} RbmSuggestedActionOpenUri + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmSuggestedActionOpenUri.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.uri = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RbmSuggestedActionOpenUri message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri} RbmSuggestedActionOpenUri + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmSuggestedActionOpenUri.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RbmSuggestedActionOpenUri message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RbmSuggestedActionOpenUri.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uri != null && message.hasOwnProperty("uri")) + if (!$util.isString(message.uri)) + return "uri: string expected"; + return null; + }; + + /** + * Creates a RbmSuggestedActionOpenUri message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri} RbmSuggestedActionOpenUri + */ + RbmSuggestedActionOpenUri.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri(); + if (object.uri != null) + message.uri = String(object.uri); + return message; + }; + + /** + * Creates a plain object from a RbmSuggestedActionOpenUri message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri} message RbmSuggestedActionOpenUri + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RbmSuggestedActionOpenUri.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.uri = ""; + if (message.uri != null && message.hasOwnProperty("uri")) + object.uri = message.uri; + return object; + }; + + /** + * Converts this RbmSuggestedActionOpenUri to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri + * @instance + * @returns {Object.} JSON object + */ + RbmSuggestedActionOpenUri.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RbmSuggestedActionOpenUri; + })(); + + RbmSuggestedAction.RbmSuggestedActionShareLocation = (function() { + + /** + * Properties of a RbmSuggestedActionShareLocation. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @interface IRbmSuggestedActionShareLocation + */ + + /** + * Constructs a new RbmSuggestedActionShareLocation. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction + * @classdesc Represents a RbmSuggestedActionShareLocation. + * @implements IRbmSuggestedActionShareLocation + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation=} [properties] Properties to set + */ + function RbmSuggestedActionShareLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Creates a new RbmSuggestedActionShareLocation instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation} RbmSuggestedActionShareLocation instance + */ + RbmSuggestedActionShareLocation.create = function create(properties) { + return new RbmSuggestedActionShareLocation(properties); + }; + + /** + * Encodes the specified RbmSuggestedActionShareLocation message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation} message RbmSuggestedActionShareLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmSuggestedActionShareLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + return writer; + }; + + /** + * Encodes the specified RbmSuggestedActionShareLocation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation} message RbmSuggestedActionShareLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RbmSuggestedActionShareLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RbmSuggestedActionShareLocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation} RbmSuggestedActionShareLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmSuggestedActionShareLocation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RbmSuggestedActionShareLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation} RbmSuggestedActionShareLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RbmSuggestedActionShareLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RbmSuggestedActionShareLocation message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RbmSuggestedActionShareLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + return null; + }; + + /** + * Creates a RbmSuggestedActionShareLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation} RbmSuggestedActionShareLocation + */ + RbmSuggestedActionShareLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation) + return object; + return new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation(); + }; + + /** + * Creates a plain object from a RbmSuggestedActionShareLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation} message RbmSuggestedActionShareLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RbmSuggestedActionShareLocation.toObject = function toObject() { + return {}; + }; + + /** + * Converts this RbmSuggestedActionShareLocation to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation + * @instance + * @returns {Object.} JSON object + */ + RbmSuggestedActionShareLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return RbmSuggestedActionShareLocation; + })(); + + return RbmSuggestedAction; + })(); + + Message.MediaContent = (function() { + + /** + * Properties of a MediaContent. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IMediaContent + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType|null} [mediaType] MediaContent mediaType + * @property {Array.|null} [mediaObjects] MediaContent mediaObjects + */ + + /** + * Constructs a new MediaContent. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a MediaContent. + * @implements IMediaContent + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent=} [properties] Properties to set + */ + function MediaContent(properties) { + this.mediaObjects = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * MediaContent mediaType. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType} mediaType + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @instance + */ + MediaContent.prototype.mediaType = 0; + + /** + * MediaContent mediaObjects. + * @member {Array.} mediaObjects + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @instance + */ + MediaContent.prototype.mediaObjects = $util.emptyArray; + + /** + * Creates a new MediaContent instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent} MediaContent instance + */ + MediaContent.create = function create(properties) { + return new MediaContent(properties); + }; + + /** + * Encodes the specified MediaContent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent} message MediaContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MediaContent.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.mediaType != null && Object.hasOwnProperty.call(message, "mediaType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mediaType); + if (message.mediaObjects != null && message.mediaObjects.length) + for (var i = 0; i < message.mediaObjects.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.encode(message.mediaObjects[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MediaContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent} message MediaContent message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MediaContent.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MediaContent message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent} MediaContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MediaContent.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.mediaType = reader.int32(); + break; + case 2: + if (!(message.mediaObjects && message.mediaObjects.length)) + message.mediaObjects = []; + message.mediaObjects.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MediaContent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent} MediaContent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MediaContent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MediaContent message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MediaContent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mediaType != null && message.hasOwnProperty("mediaType")) + switch (message.mediaType) { + default: + return "mediaType: enum value expected"; + case 0: + case 1: + break; + } + if (message.mediaObjects != null && message.hasOwnProperty("mediaObjects")) { + if (!Array.isArray(message.mediaObjects)) + return "mediaObjects: array expected"; + for (var i = 0; i < message.mediaObjects.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.verify(message.mediaObjects[i]); + if (error) + return "mediaObjects." + error; + } + } + return null; + }; + + /** + * Creates a MediaContent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent} MediaContent + */ + MediaContent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent(); + switch (object.mediaType) { + case "RESPONSE_MEDIA_TYPE_UNSPECIFIED": + case 0: + message.mediaType = 0; + break; + case "AUDIO": + case 1: + message.mediaType = 1; + break; + } + if (object.mediaObjects) { + if (!Array.isArray(object.mediaObjects)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.mediaObjects: array expected"); + message.mediaObjects = []; + for (var i = 0; i < object.mediaObjects.length; ++i) { + if (typeof object.mediaObjects[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.mediaObjects: object expected"); + message.mediaObjects[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.fromObject(object.mediaObjects[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MediaContent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent} message MediaContent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MediaContent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.mediaObjects = []; + if (options.defaults) + object.mediaType = options.enums === String ? "RESPONSE_MEDIA_TYPE_UNSPECIFIED" : 0; + if (message.mediaType != null && message.hasOwnProperty("mediaType")) + object.mediaType = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType[message.mediaType] : message.mediaType; + if (message.mediaObjects && message.mediaObjects.length) { + object.mediaObjects = []; + for (var j = 0; j < message.mediaObjects.length; ++j) + object.mediaObjects[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.toObject(message.mediaObjects[j], options); + } + return object; + }; + + /** + * Converts this MediaContent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @instance + * @returns {Object.} JSON object + */ + MediaContent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + MediaContent.ResponseMediaObject = (function() { + + /** + * Properties of a ResponseMediaObject. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @interface IResponseMediaObject + * @property {string|null} [name] ResponseMediaObject name + * @property {string|null} [description] ResponseMediaObject description + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [largeImage] ResponseMediaObject largeImage + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [icon] ResponseMediaObject icon + * @property {string|null} [contentUrl] ResponseMediaObject contentUrl + */ + + /** + * Constructs a new ResponseMediaObject. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent + * @classdesc Represents a ResponseMediaObject. + * @implements IResponseMediaObject + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject=} [properties] Properties to set + */ + function ResponseMediaObject(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResponseMediaObject name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @instance + */ + ResponseMediaObject.prototype.name = ""; + + /** + * ResponseMediaObject description. + * @member {string} description + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @instance + */ + ResponseMediaObject.prototype.description = ""; + + /** + * ResponseMediaObject largeImage. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} largeImage + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @instance + */ + ResponseMediaObject.prototype.largeImage = null; + + /** + * ResponseMediaObject icon. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} icon + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @instance + */ + ResponseMediaObject.prototype.icon = null; + + /** + * ResponseMediaObject contentUrl. + * @member {string} contentUrl + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @instance + */ + ResponseMediaObject.prototype.contentUrl = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ResponseMediaObject image. + * @member {"largeImage"|"icon"|undefined} image + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @instance + */ + Object.defineProperty(ResponseMediaObject.prototype, "image", { + get: $util.oneOfGetter($oneOfFields = ["largeImage", "icon"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ResponseMediaObject instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject instance + */ + ResponseMediaObject.create = function create(properties) { + return new ResponseMediaObject(properties); + }; + + /** + * Encodes the specified ResponseMediaObject message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject} message ResponseMediaObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMediaObject.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.largeImage != null && Object.hasOwnProperty.call(message, "largeImage")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.largeImage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.icon, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.contentUrl != null && Object.hasOwnProperty.call(message, "contentUrl")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.contentUrl); + return writer; + }; + + /** + * Encodes the specified ResponseMediaObject message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject} message ResponseMediaObject message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResponseMediaObject.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResponseMediaObject message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMediaObject.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.description = reader.string(); + break; + case 3: + message.largeImage = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); + break; + case 4: + message.icon = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); + break; + case 5: + message.contentUrl = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResponseMediaObject message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResponseMediaObject.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResponseMediaObject message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResponseMediaObject.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.largeImage != null && message.hasOwnProperty("largeImage")) { + properties.image = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.largeImage); + if (error) + return "largeImage." + error; + } + } + if (message.icon != null && message.hasOwnProperty("icon")) { + if (properties.image === 1) + return "image: multiple values"; + properties.image = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.icon); + if (error) + return "icon." + error; + } + } + if (message.contentUrl != null && message.hasOwnProperty("contentUrl")) + if (!$util.isString(message.contentUrl)) + return "contentUrl: string expected"; + return null; + }; + + /** + * Creates a ResponseMediaObject message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject + */ + ResponseMediaObject.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.largeImage != null) { + if (typeof object.largeImage !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.largeImage: object expected"); + message.largeImage = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.largeImage); + } + if (object.icon != null) { + if (typeof object.icon !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.icon: object expected"); + message.icon = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.icon); + } + if (object.contentUrl != null) + message.contentUrl = String(object.contentUrl); + return message; + }; + + /** + * Creates a plain object from a ResponseMediaObject message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject} message ResponseMediaObject + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResponseMediaObject.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.contentUrl = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.largeImage != null && message.hasOwnProperty("largeImage")) { + object.largeImage = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.largeImage, options); + if (options.oneofs) + object.image = "largeImage"; + } + if (message.icon != null && message.hasOwnProperty("icon")) { + object.icon = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.icon, options); + if (options.oneofs) + object.image = "icon"; + } + if (message.contentUrl != null && message.hasOwnProperty("contentUrl")) + object.contentUrl = message.contentUrl; + return object; + }; + + /** + * Converts this ResponseMediaObject to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject + * @instance + * @returns {Object.} JSON object + */ + ResponseMediaObject.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ResponseMediaObject; + })(); + + /** + * ResponseMediaType enum. + * @name google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType + * @enum {number} + * @property {number} RESPONSE_MEDIA_TYPE_UNSPECIFIED=0 RESPONSE_MEDIA_TYPE_UNSPECIFIED value + * @property {number} AUDIO=1 AUDIO value + */ + MediaContent.ResponseMediaType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESPONSE_MEDIA_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUDIO"] = 1; + return values; + })(); + + return MediaContent; + })(); + + Message.BrowseCarouselCard = (function() { + + /** + * Properties of a BrowseCarouselCard. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IBrowseCarouselCard + * @property {Array.|null} [items] BrowseCarouselCard items + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|null} [imageDisplayOptions] BrowseCarouselCard imageDisplayOptions + */ + + /** + * Constructs a new BrowseCarouselCard. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a BrowseCarouselCard. + * @implements IBrowseCarouselCard + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard=} [properties] Properties to set + */ + function BrowseCarouselCard(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BrowseCarouselCard items. + * @member {Array.} items + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @instance + */ + BrowseCarouselCard.prototype.items = $util.emptyArray; + + /** + * BrowseCarouselCard imageDisplayOptions. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions} imageDisplayOptions + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @instance + */ + BrowseCarouselCard.prototype.imageDisplayOptions = 0; + + /** + * Creates a new BrowseCarouselCard instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard} BrowseCarouselCard instance + */ + BrowseCarouselCard.create = function create(properties) { + return new BrowseCarouselCard(properties); + }; + + /** + * Encodes the specified BrowseCarouselCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard} message BrowseCarouselCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BrowseCarouselCard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.imageDisplayOptions != null && Object.hasOwnProperty.call(message, "imageDisplayOptions")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.imageDisplayOptions); + return writer; + }; + + /** + * Encodes the specified BrowseCarouselCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard} message BrowseCarouselCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BrowseCarouselCard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BrowseCarouselCard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard} BrowseCarouselCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BrowseCarouselCard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.decode(reader, reader.uint32())); + break; + case 2: + message.imageDisplayOptions = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BrowseCarouselCard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard} BrowseCarouselCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BrowseCarouselCard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BrowseCarouselCard message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BrowseCarouselCard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify(message.items[i]); + if (error) + return "items." + error; + } + } + if (message.imageDisplayOptions != null && message.hasOwnProperty("imageDisplayOptions")) + switch (message.imageDisplayOptions) { + default: + return "imageDisplayOptions: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a BrowseCarouselCard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard} BrowseCarouselCard + */ + BrowseCarouselCard.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.items: object expected"); + message.items[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.fromObject(object.items[i]); + } + } + switch (object.imageDisplayOptions) { + case "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED": + case 0: + message.imageDisplayOptions = 0; + break; + case "GRAY": + case 1: + message.imageDisplayOptions = 1; + break; + case "WHITE": + case 2: + message.imageDisplayOptions = 2; + break; + case "CROPPED": + case 3: + message.imageDisplayOptions = 3; + break; + case "BLURRED_BACKGROUND": + case 4: + message.imageDisplayOptions = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a BrowseCarouselCard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard} message BrowseCarouselCard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BrowseCarouselCard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (options.defaults) + object.imageDisplayOptions = options.enums === String ? "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED" : 0; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.toObject(message.items[j], options); + } + if (message.imageDisplayOptions != null && message.hasOwnProperty("imageDisplayOptions")) + object.imageDisplayOptions = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions[message.imageDisplayOptions] : message.imageDisplayOptions; + return object; + }; + + /** + * Converts this BrowseCarouselCard to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @instance + * @returns {Object.} JSON object + */ + BrowseCarouselCard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + BrowseCarouselCard.BrowseCarouselCardItem = (function() { + + /** + * Properties of a BrowseCarouselCardItem. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @interface IBrowseCarouselCardItem + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null} [openUriAction] BrowseCarouselCardItem openUriAction + * @property {string|null} [title] BrowseCarouselCardItem title + * @property {string|null} [description] BrowseCarouselCardItem description + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [image] BrowseCarouselCardItem image + * @property {string|null} [footer] BrowseCarouselCardItem footer + */ + + /** + * Constructs a new BrowseCarouselCardItem. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard + * @classdesc Represents a BrowseCarouselCardItem. + * @implements IBrowseCarouselCardItem + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem=} [properties] Properties to set + */ + function BrowseCarouselCardItem(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BrowseCarouselCardItem openUriAction. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null|undefined} openUriAction + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @instance + */ + BrowseCarouselCardItem.prototype.openUriAction = null; + + /** + * BrowseCarouselCardItem title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @instance + */ + BrowseCarouselCardItem.prototype.title = ""; + + /** + * BrowseCarouselCardItem description. + * @member {string} description + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @instance + */ + BrowseCarouselCardItem.prototype.description = ""; + + /** + * BrowseCarouselCardItem image. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} image + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @instance + */ + BrowseCarouselCardItem.prototype.image = null; + + /** + * BrowseCarouselCardItem footer. + * @member {string} footer + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @instance + */ + BrowseCarouselCardItem.prototype.footer = ""; + + /** + * Creates a new BrowseCarouselCardItem instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem instance + */ + BrowseCarouselCardItem.create = function create(properties) { + return new BrowseCarouselCardItem(properties); + }; + + /** + * Encodes the specified BrowseCarouselCardItem message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem} message BrowseCarouselCardItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BrowseCarouselCardItem.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.openUriAction != null && Object.hasOwnProperty.call(message, "openUriAction")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.encode(message.openUriAction, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.footer != null && Object.hasOwnProperty.call(message, "footer")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.footer); + return writer; + }; + + /** + * Encodes the specified BrowseCarouselCardItem message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem} message BrowseCarouselCardItem message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BrowseCarouselCardItem.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BrowseCarouselCardItem message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BrowseCarouselCardItem.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.openUriAction = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.decode(reader, reader.uint32()); + break; + case 2: + message.title = reader.string(); + break; + case 3: + message.description = reader.string(); + break; + case 4: + message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); + break; + case 5: + message.footer = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BrowseCarouselCardItem message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BrowseCarouselCardItem.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BrowseCarouselCardItem message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BrowseCarouselCardItem.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify(message.openUriAction); + if (error) + return "openUriAction." + error; + } + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.footer != null && message.hasOwnProperty("footer")) + if (!$util.isString(message.footer)) + return "footer: string expected"; + return null; + }; + + /** + * Creates a BrowseCarouselCardItem message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem + */ + BrowseCarouselCardItem.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem(); + if (object.openUriAction != null) { + if (typeof object.openUriAction !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.openUriAction: object expected"); + message.openUriAction = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.fromObject(object.openUriAction); + } + if (object.title != null) + message.title = String(object.title); + if (object.description != null) + message.description = String(object.description); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.image: object expected"); + message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.image); + } + if (object.footer != null) + message.footer = String(object.footer); + return message; + }; + + /** + * Creates a plain object from a BrowseCarouselCardItem message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} message BrowseCarouselCardItem + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BrowseCarouselCardItem.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.openUriAction = null; + object.title = ""; + object.description = ""; + object.image = null; + object.footer = ""; + } + if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) + object.openUriAction = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.toObject(message.openUriAction, options); + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.image, options); + if (message.footer != null && message.hasOwnProperty("footer")) + object.footer = message.footer; + return object; + }; + + /** + * Converts this BrowseCarouselCardItem to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @instance + * @returns {Object.} JSON object + */ + BrowseCarouselCardItem.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + BrowseCarouselCardItem.OpenUrlAction = (function() { + + /** + * Properties of an OpenUrlAction. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @interface IOpenUrlAction + * @property {string|null} [url] OpenUrlAction url + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|null} [urlTypeHint] OpenUrlAction urlTypeHint + */ + + /** + * Constructs a new OpenUrlAction. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem + * @classdesc Represents an OpenUrlAction. + * @implements IOpenUrlAction + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction=} [properties] Properties to set + */ + function OpenUrlAction(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OpenUrlAction url. + * @member {string} url + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @instance + */ + OpenUrlAction.prototype.url = ""; + + /** + * OpenUrlAction urlTypeHint. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint} urlTypeHint + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @instance + */ + OpenUrlAction.prototype.urlTypeHint = 0; + + /** + * Creates a new OpenUrlAction instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction instance + */ + OpenUrlAction.create = function create(properties) { + return new OpenUrlAction(properties); + }; + + /** + * Encodes the specified OpenUrlAction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction} message OpenUrlAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenUrlAction.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.url != null && Object.hasOwnProperty.call(message, "url")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); + if (message.urlTypeHint != null && Object.hasOwnProperty.call(message, "urlTypeHint")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.urlTypeHint); + return writer; + }; + + /** + * Encodes the specified OpenUrlAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction} message OpenUrlAction message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OpenUrlAction.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OpenUrlAction message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenUrlAction.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.url = reader.string(); + break; + case 3: + message.urlTypeHint = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OpenUrlAction message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OpenUrlAction.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OpenUrlAction message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OpenUrlAction.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.url != null && message.hasOwnProperty("url")) + if (!$util.isString(message.url)) + return "url: string expected"; + if (message.urlTypeHint != null && message.hasOwnProperty("urlTypeHint")) + switch (message.urlTypeHint) { + default: + return "urlTypeHint: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates an OpenUrlAction message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction + */ + OpenUrlAction.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction(); + if (object.url != null) + message.url = String(object.url); + switch (object.urlTypeHint) { + case "URL_TYPE_HINT_UNSPECIFIED": + case 0: + message.urlTypeHint = 0; + break; + case "AMP_ACTION": + case 1: + message.urlTypeHint = 1; + break; + case "AMP_CONTENT": + case 2: + message.urlTypeHint = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an OpenUrlAction message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} message OpenUrlAction + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OpenUrlAction.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.url = ""; + object.urlTypeHint = options.enums === String ? "URL_TYPE_HINT_UNSPECIFIED" : 0; + } + if (message.url != null && message.hasOwnProperty("url")) + object.url = message.url; + if (message.urlTypeHint != null && message.hasOwnProperty("urlTypeHint")) + object.urlTypeHint = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint[message.urlTypeHint] : message.urlTypeHint; + return object; + }; + + /** + * Converts this OpenUrlAction to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction + * @instance + * @returns {Object.} JSON object + */ + OpenUrlAction.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * UrlTypeHint enum. + * @name google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint + * @enum {number} + * @property {number} URL_TYPE_HINT_UNSPECIFIED=0 URL_TYPE_HINT_UNSPECIFIED value + * @property {number} AMP_ACTION=1 AMP_ACTION value + * @property {number} AMP_CONTENT=2 AMP_CONTENT value + */ + OpenUrlAction.UrlTypeHint = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "URL_TYPE_HINT_UNSPECIFIED"] = 0; + values[valuesById[1] = "AMP_ACTION"] = 1; + values[valuesById[2] = "AMP_CONTENT"] = 2; + return values; + })(); + + return OpenUrlAction; + })(); + + return BrowseCarouselCardItem; + })(); + + /** + * ImageDisplayOptions enum. + * @name google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions + * @enum {number} + * @property {number} IMAGE_DISPLAY_OPTIONS_UNSPECIFIED=0 IMAGE_DISPLAY_OPTIONS_UNSPECIFIED value + * @property {number} GRAY=1 GRAY value + * @property {number} WHITE=2 WHITE value + * @property {number} CROPPED=3 CROPPED value + * @property {number} BLURRED_BACKGROUND=4 BLURRED_BACKGROUND value + */ + BrowseCarouselCard.ImageDisplayOptions = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED"] = 0; + values[valuesById[1] = "GRAY"] = 1; + values[valuesById[2] = "WHITE"] = 2; + values[valuesById[3] = "CROPPED"] = 3; + values[valuesById[4] = "BLURRED_BACKGROUND"] = 4; + return values; + })(); + + return BrowseCarouselCard; + })(); + + Message.TableCard = (function() { + + /** + * Properties of a TableCard. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ITableCard + * @property {string|null} [title] TableCard title + * @property {string|null} [subtitle] TableCard subtitle + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [image] TableCard image + * @property {Array.|null} [columnProperties] TableCard columnProperties + * @property {Array.|null} [rows] TableCard rows + * @property {Array.|null} [buttons] TableCard buttons + */ + + /** + * Constructs a new TableCard. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a TableCard. + * @implements ITableCard + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard=} [properties] Properties to set + */ + function TableCard(properties) { + this.columnProperties = []; + this.rows = []; + this.buttons = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableCard title. + * @member {string} title + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @instance + */ + TableCard.prototype.title = ""; + + /** + * TableCard subtitle. + * @member {string} subtitle + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @instance + */ + TableCard.prototype.subtitle = ""; + + /** + * TableCard image. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} image + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @instance + */ + TableCard.prototype.image = null; + + /** + * TableCard columnProperties. + * @member {Array.} columnProperties + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @instance + */ + TableCard.prototype.columnProperties = $util.emptyArray; + + /** + * TableCard rows. + * @member {Array.} rows + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @instance + */ + TableCard.prototype.rows = $util.emptyArray; + + /** + * TableCard buttons. + * @member {Array.} buttons + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @instance + */ + TableCard.prototype.buttons = $util.emptyArray; + + /** + * Creates a new TableCard instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCard} TableCard instance + */ + TableCard.create = function create(properties) { + return new TableCard(properties); + }; + + /** + * Encodes the specified TableCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard} message TableCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCard.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.title != null && Object.hasOwnProperty.call(message, "title")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); + if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); + if (message.image != null && Object.hasOwnProperty.call(message, "image")) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.image, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.columnProperties != null && message.columnProperties.length) + for (var i = 0; i < message.columnProperties.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.encode(message.columnProperties[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.rows != null && message.rows.length) + for (var i = 0; i < message.rows.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.encode(message.rows[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.buttons != null && message.buttons.length) + for (var i = 0; i < message.buttons.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.encode(message.buttons[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TableCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard} message TableCard message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCard.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableCard message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCard} TableCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCard.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.title = reader.string(); + break; + case 2: + message.subtitle = reader.string(); + break; + case 3: + message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.columnProperties && message.columnProperties.length)) + message.columnProperties = []; + message.columnProperties.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.rows && message.rows.length)) + message.rows = []; + message.rows.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.buttons && message.buttons.length)) + message.buttons = []; + message.buttons.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableCard message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCard} TableCard + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCard.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableCard message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableCard.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.title != null && message.hasOwnProperty("title")) + if (!$util.isString(message.title)) + return "title: string expected"; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + if (!$util.isString(message.subtitle)) + return "subtitle: string expected"; + if (message.image != null && message.hasOwnProperty("image")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.image); + if (error) + return "image." + error; + } + if (message.columnProperties != null && message.hasOwnProperty("columnProperties")) { + if (!Array.isArray(message.columnProperties)) + return "columnProperties: array expected"; + for (var i = 0; i < message.columnProperties.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.verify(message.columnProperties[i]); + if (error) + return "columnProperties." + error; + } + } + if (message.rows != null && message.hasOwnProperty("rows")) { + if (!Array.isArray(message.rows)) + return "rows: array expected"; + for (var i = 0; i < message.rows.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.verify(message.rows[i]); + if (error) + return "rows." + error; + } + } + if (message.buttons != null && message.hasOwnProperty("buttons")) { + if (!Array.isArray(message.buttons)) + return "buttons: array expected"; + for (var i = 0; i < message.buttons.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.verify(message.buttons[i]); + if (error) + return "buttons." + error; + } + } + return null; + }; + + /** + * Creates a TableCard message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCard} TableCard + */ + TableCard.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard(); + if (object.title != null) + message.title = String(object.title); + if (object.subtitle != null) + message.subtitle = String(object.subtitle); + if (object.image != null) { + if (typeof object.image !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.image: object expected"); + message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.image); + } + if (object.columnProperties) { + if (!Array.isArray(object.columnProperties)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.columnProperties: array expected"); + message.columnProperties = []; + for (var i = 0; i < object.columnProperties.length; ++i) { + if (typeof object.columnProperties[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.columnProperties: object expected"); + message.columnProperties[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.fromObject(object.columnProperties[i]); + } + } + if (object.rows) { + if (!Array.isArray(object.rows)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.rows: array expected"); + message.rows = []; + for (var i = 0; i < object.rows.length; ++i) { + if (typeof object.rows[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.rows: object expected"); + message.rows[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.fromObject(object.rows[i]); + } + } + if (object.buttons) { + if (!Array.isArray(object.buttons)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.buttons: array expected"); + message.buttons = []; + for (var i = 0; i < object.buttons.length; ++i) { + if (typeof object.buttons[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.buttons: object expected"); + message.buttons[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.fromObject(object.buttons[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a TableCard message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.TableCard} message TableCard + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableCard.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.columnProperties = []; + object.rows = []; + object.buttons = []; + } + if (options.defaults) { + object.title = ""; + object.subtitle = ""; + object.image = null; + } + if (message.title != null && message.hasOwnProperty("title")) + object.title = message.title; + if (message.subtitle != null && message.hasOwnProperty("subtitle")) + object.subtitle = message.subtitle; + if (message.image != null && message.hasOwnProperty("image")) + object.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.image, options); + if (message.columnProperties && message.columnProperties.length) { + object.columnProperties = []; + for (var j = 0; j < message.columnProperties.length; ++j) + object.columnProperties[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.toObject(message.columnProperties[j], options); + } + if (message.rows && message.rows.length) { + object.rows = []; + for (var j = 0; j < message.rows.length; ++j) + object.rows[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.toObject(message.rows[j], options); + } + if (message.buttons && message.buttons.length) { + object.buttons = []; + for (var j = 0; j < message.buttons.length; ++j) + object.buttons[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.toObject(message.buttons[j], options); + } + return object; + }; + + /** + * Converts this TableCard to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard + * @instance + * @returns {Object.} JSON object + */ + TableCard.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableCard; + })(); + + Message.ColumnProperties = (function() { + + /** + * Properties of a ColumnProperties. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface IColumnProperties + * @property {string|null} [header] ColumnProperties header + * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment|null} [horizontalAlignment] ColumnProperties horizontalAlignment + */ + + /** + * Constructs a new ColumnProperties. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a ColumnProperties. + * @implements IColumnProperties + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties=} [properties] Properties to set + */ + function ColumnProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ColumnProperties header. + * @member {string} header + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties + * @instance + */ + ColumnProperties.prototype.header = ""; + + /** + * ColumnProperties horizontalAlignment. + * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment} horizontalAlignment + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties + * @instance + */ + ColumnProperties.prototype.horizontalAlignment = 0; + + /** + * Creates a new ColumnProperties instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties} ColumnProperties instance + */ + ColumnProperties.create = function create(properties) { + return new ColumnProperties(properties); + }; + + /** + * Encodes the specified ColumnProperties message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties} message ColumnProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.header != null && Object.hasOwnProperty.call(message, "header")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.header); + if (message.horizontalAlignment != null && Object.hasOwnProperty.call(message, "horizontalAlignment")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.horizontalAlignment); + return writer; + }; + + /** + * Encodes the specified ColumnProperties message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties} message ColumnProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ColumnProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ColumnProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties} ColumnProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnProperties.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.header = reader.string(); + break; + case 2: + message.horizontalAlignment = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ColumnProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties} ColumnProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ColumnProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ColumnProperties message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ColumnProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.header != null && message.hasOwnProperty("header")) + if (!$util.isString(message.header)) + return "header: string expected"; + if (message.horizontalAlignment != null && message.hasOwnProperty("horizontalAlignment")) + switch (message.horizontalAlignment) { + default: + return "horizontalAlignment: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + return null; + }; + + /** + * Creates a ColumnProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties} ColumnProperties + */ + ColumnProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties(); + if (object.header != null) + message.header = String(object.header); + switch (object.horizontalAlignment) { + case "HORIZONTAL_ALIGNMENT_UNSPECIFIED": + case 0: + message.horizontalAlignment = 0; + break; + case "LEADING": + case 1: + message.horizontalAlignment = 1; + break; + case "CENTER": + case 2: + message.horizontalAlignment = 2; + break; + case "TRAILING": + case 3: + message.horizontalAlignment = 3; + break; + } + return message; + }; + + /** + * Creates a plain object from a ColumnProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties} message ColumnProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ColumnProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.header = ""; + object.horizontalAlignment = options.enums === String ? "HORIZONTAL_ALIGNMENT_UNSPECIFIED" : 0; + } + if (message.header != null && message.hasOwnProperty("header")) + object.header = message.header; + if (message.horizontalAlignment != null && message.hasOwnProperty("horizontalAlignment")) + object.horizontalAlignment = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment[message.horizontalAlignment] : message.horizontalAlignment; + return object; + }; + + /** + * Converts this ColumnProperties to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties + * @instance + * @returns {Object.} JSON object + */ + ColumnProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * HorizontalAlignment enum. + * @name google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment + * @enum {number} + * @property {number} HORIZONTAL_ALIGNMENT_UNSPECIFIED=0 HORIZONTAL_ALIGNMENT_UNSPECIFIED value + * @property {number} LEADING=1 LEADING value + * @property {number} CENTER=2 CENTER value + * @property {number} TRAILING=3 TRAILING value + */ + ColumnProperties.HorizontalAlignment = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "HORIZONTAL_ALIGNMENT_UNSPECIFIED"] = 0; + values[valuesById[1] = "LEADING"] = 1; + values[valuesById[2] = "CENTER"] = 2; + values[valuesById[3] = "TRAILING"] = 3; + return values; + })(); + + return ColumnProperties; + })(); + + Message.TableCardRow = (function() { + + /** + * Properties of a TableCardRow. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ITableCardRow + * @property {Array.|null} [cells] TableCardRow cells + * @property {boolean|null} [dividerAfter] TableCardRow dividerAfter + */ + + /** + * Constructs a new TableCardRow. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a TableCardRow. + * @implements ITableCardRow + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow=} [properties] Properties to set + */ + function TableCardRow(properties) { + this.cells = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableCardRow cells. + * @member {Array.} cells + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow + * @instance + */ + TableCardRow.prototype.cells = $util.emptyArray; + + /** + * TableCardRow dividerAfter. + * @member {boolean} dividerAfter + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow + * @instance + */ + TableCardRow.prototype.dividerAfter = false; + + /** + * Creates a new TableCardRow instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow} TableCardRow instance + */ + TableCardRow.create = function create(properties) { + return new TableCardRow(properties); + }; + + /** + * Encodes the specified TableCardRow message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow} message TableCardRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCardRow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.cells != null && message.cells.length) + for (var i = 0; i < message.cells.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.encode(message.cells[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dividerAfter != null && Object.hasOwnProperty.call(message, "dividerAfter")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.dividerAfter); + return writer; + }; + + /** + * Encodes the specified TableCardRow message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow} message TableCardRow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCardRow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableCardRow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow} TableCardRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCardRow.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.cells && message.cells.length)) + message.cells = []; + message.cells.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.decode(reader, reader.uint32())); + break; + case 2: + message.dividerAfter = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableCardRow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow} TableCardRow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCardRow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableCardRow message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableCardRow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.cells != null && message.hasOwnProperty("cells")) { + if (!Array.isArray(message.cells)) + return "cells: array expected"; + for (var i = 0; i < message.cells.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.verify(message.cells[i]); + if (error) + return "cells." + error; + } + } + if (message.dividerAfter != null && message.hasOwnProperty("dividerAfter")) + if (typeof message.dividerAfter !== "boolean") + return "dividerAfter: boolean expected"; + return null; + }; + + /** + * Creates a TableCardRow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow} TableCardRow + */ + TableCardRow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow(); + if (object.cells) { + if (!Array.isArray(object.cells)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.cells: array expected"); + message.cells = []; + for (var i = 0; i < object.cells.length; ++i) { + if (typeof object.cells[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.cells: object expected"); + message.cells[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.fromObject(object.cells[i]); + } + } + if (object.dividerAfter != null) + message.dividerAfter = Boolean(object.dividerAfter); + return message; + }; + + /** + * Creates a plain object from a TableCardRow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow} message TableCardRow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableCardRow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.cells = []; + if (options.defaults) + object.dividerAfter = false; + if (message.cells && message.cells.length) { + object.cells = []; + for (var j = 0; j < message.cells.length; ++j) + object.cells[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.toObject(message.cells[j], options); + } + if (message.dividerAfter != null && message.hasOwnProperty("dividerAfter")) + object.dividerAfter = message.dividerAfter; + return object; + }; + + /** + * Converts this TableCardRow to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow + * @instance + * @returns {Object.} JSON object + */ + TableCardRow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableCardRow; + })(); + + Message.TableCardCell = (function() { + + /** + * Properties of a TableCardCell. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @interface ITableCardCell + * @property {string|null} [text] TableCardCell text + */ + + /** + * Constructs a new TableCardCell. + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message + * @classdesc Represents a TableCardCell. + * @implements ITableCardCell + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell=} [properties] Properties to set + */ + function TableCardCell(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TableCardCell text. + * @member {string} text + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell + * @instance + */ + TableCardCell.prototype.text = ""; + + /** + * Creates a new TableCardCell instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell} TableCardCell instance + */ + TableCardCell.create = function create(properties) { + return new TableCardCell(properties); + }; + + /** + * Encodes the specified TableCardCell message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell} message TableCardCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCardCell.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.text != null && Object.hasOwnProperty.call(message, "text")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); + return writer; + }; + + /** + * Encodes the specified TableCardCell message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell} message TableCardCell message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TableCardCell.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TableCardCell message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell} TableCardCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCardCell.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.text = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TableCardCell message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell} TableCardCell + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TableCardCell.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TableCardCell message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TableCardCell.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.text != null && message.hasOwnProperty("text")) + if (!$util.isString(message.text)) + return "text: string expected"; + return null; + }; + + /** + * Creates a TableCardCell message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell} TableCardCell + */ + TableCardCell.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell(); + if (object.text != null) + message.text = String(object.text); + return message; + }; + + /** + * Creates a plain object from a TableCardCell message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell} message TableCardCell + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TableCardCell.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.text = ""; + if (message.text != null && message.hasOwnProperty("text")) + object.text = message.text; + return object; + }; + + /** + * Converts this TableCardCell to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell + * @instance + * @returns {Object.} JSON object + */ + TableCardCell.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return TableCardCell; + })(); + + /** + * Platform enum. + * @name google.cloud.dialogflow.v2beta1.Intent.Message.Platform + * @enum {number} + * @property {number} PLATFORM_UNSPECIFIED=0 PLATFORM_UNSPECIFIED value + * @property {number} FACEBOOK=1 FACEBOOK value + * @property {number} SLACK=2 SLACK value + * @property {number} TELEGRAM=3 TELEGRAM value + * @property {number} KIK=4 KIK value + * @property {number} SKYPE=5 SKYPE value + * @property {number} LINE=6 LINE value + * @property {number} VIBER=7 VIBER value + * @property {number} ACTIONS_ON_GOOGLE=8 ACTIONS_ON_GOOGLE value + * @property {number} TELEPHONY=10 TELEPHONY value + * @property {number} GOOGLE_HANGOUTS=11 GOOGLE_HANGOUTS value + */ + Message.Platform = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PLATFORM_UNSPECIFIED"] = 0; + values[valuesById[1] = "FACEBOOK"] = 1; + values[valuesById[2] = "SLACK"] = 2; + values[valuesById[3] = "TELEGRAM"] = 3; + values[valuesById[4] = "KIK"] = 4; + values[valuesById[5] = "SKYPE"] = 5; + values[valuesById[6] = "LINE"] = 6; + values[valuesById[7] = "VIBER"] = 7; + values[valuesById[8] = "ACTIONS_ON_GOOGLE"] = 8; + values[valuesById[10] = "TELEPHONY"] = 10; + values[valuesById[11] = "GOOGLE_HANGOUTS"] = 11; + return values; + })(); + + return Message; + })(); + + Intent.FollowupIntentInfo = (function() { + + /** + * Properties of a FollowupIntentInfo. + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @interface IFollowupIntentInfo + * @property {string|null} [followupIntentName] FollowupIntentInfo followupIntentName + * @property {string|null} [parentFollowupIntentName] FollowupIntentInfo parentFollowupIntentName + */ + + /** + * Constructs a new FollowupIntentInfo. + * @memberof google.cloud.dialogflow.v2beta1.Intent + * @classdesc Represents a FollowupIntentInfo. + * @implements IFollowupIntentInfo + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo=} [properties] Properties to set + */ + function FollowupIntentInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FollowupIntentInfo followupIntentName. + * @member {string} followupIntentName + * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo + * @instance + */ + FollowupIntentInfo.prototype.followupIntentName = ""; + + /** + * FollowupIntentInfo parentFollowupIntentName. + * @member {string} parentFollowupIntentName + * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo + * @instance + */ + FollowupIntentInfo.prototype.parentFollowupIntentName = ""; + + /** + * Creates a new FollowupIntentInfo instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo} FollowupIntentInfo instance + */ + FollowupIntentInfo.create = function create(properties) { + return new FollowupIntentInfo(properties); + }; + + /** + * Encodes the specified FollowupIntentInfo message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo} message FollowupIntentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FollowupIntentInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.followupIntentName != null && Object.hasOwnProperty.call(message, "followupIntentName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.followupIntentName); + if (message.parentFollowupIntentName != null && Object.hasOwnProperty.call(message, "parentFollowupIntentName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.parentFollowupIntentName); + return writer; + }; + + /** + * Encodes the specified FollowupIntentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo} message FollowupIntentInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FollowupIntentInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FollowupIntentInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo} FollowupIntentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FollowupIntentInfo.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.followupIntentName = reader.string(); + break; + case 2: + message.parentFollowupIntentName = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FollowupIntentInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo} FollowupIntentInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FollowupIntentInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FollowupIntentInfo message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FollowupIntentInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.followupIntentName != null && message.hasOwnProperty("followupIntentName")) + if (!$util.isString(message.followupIntentName)) + return "followupIntentName: string expected"; + if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) + if (!$util.isString(message.parentFollowupIntentName)) + return "parentFollowupIntentName: string expected"; + return null; + }; + + /** + * Creates a FollowupIntentInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo} FollowupIntentInfo + */ + FollowupIntentInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo(); + if (object.followupIntentName != null) + message.followupIntentName = String(object.followupIntentName); + if (object.parentFollowupIntentName != null) + message.parentFollowupIntentName = String(object.parentFollowupIntentName); + return message; + }; + + /** + * Creates a plain object from a FollowupIntentInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo + * @static + * @param {google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo} message FollowupIntentInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FollowupIntentInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.followupIntentName = ""; + object.parentFollowupIntentName = ""; + } + if (message.followupIntentName != null && message.hasOwnProperty("followupIntentName")) + object.followupIntentName = message.followupIntentName; + if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) + object.parentFollowupIntentName = message.parentFollowupIntentName; + return object; + }; + + /** + * Converts this FollowupIntentInfo to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo + * @instance + * @returns {Object.} JSON object + */ + FollowupIntentInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FollowupIntentInfo; + })(); + + /** + * WebhookState enum. + * @name google.cloud.dialogflow.v2beta1.Intent.WebhookState + * @enum {number} + * @property {number} WEBHOOK_STATE_UNSPECIFIED=0 WEBHOOK_STATE_UNSPECIFIED value + * @property {number} WEBHOOK_STATE_ENABLED=1 WEBHOOK_STATE_ENABLED value + * @property {number} WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING=2 WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING value + */ + Intent.WebhookState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEBHOOK_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "WEBHOOK_STATE_ENABLED"] = 1; + values[valuesById[2] = "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING"] = 2; + return values; + })(); + + return Intent; + })(); + + v2beta1.ListIntentsRequest = (function() { + + /** + * Properties of a ListIntentsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListIntentsRequest + * @property {string|null} [parent] ListIntentsRequest parent + * @property {string|null} [languageCode] ListIntentsRequest languageCode + * @property {google.cloud.dialogflow.v2beta1.IntentView|null} [intentView] ListIntentsRequest intentView + * @property {number|null} [pageSize] ListIntentsRequest pageSize + * @property {string|null} [pageToken] ListIntentsRequest pageToken + */ + + /** + * Constructs a new ListIntentsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListIntentsRequest. + * @implements IListIntentsRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListIntentsRequest=} [properties] Properties to set + */ + function ListIntentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListIntentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.parent = ""; + + /** + * ListIntentsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.languageCode = ""; + + /** + * ListIntentsRequest intentView. + * @member {google.cloud.dialogflow.v2beta1.IntentView} intentView + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.intentView = 0; + + /** + * ListIntentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.pageSize = 0; + + /** + * ListIntentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @instance + */ + ListIntentsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListIntentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListIntentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListIntentsRequest} ListIntentsRequest instance + */ + ListIntentsRequest.create = function create(properties) { + return new ListIntentsRequest(properties); + }; + + /** + * Encodes the specified ListIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListIntentsRequest} message ListIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.intentView); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + return writer; + }; + + /** + * Encodes the specified ListIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListIntentsRequest} message ListIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListIntentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListIntentsRequest} ListIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIntentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListIntentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + case 3: + message.intentView = reader.int32(); + break; + case 4: + message.pageSize = reader.int32(); + break; + case 5: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListIntentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListIntentsRequest} ListIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIntentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListIntentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListIntentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.intentView != null && message.hasOwnProperty("intentView")) + switch (message.intentView) { + default: + return "intentView: enum value expected"; + case 0: + case 1: + break; + } + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; + + /** + * Creates a ListIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListIntentsRequest} ListIntentsRequest + */ + ListIntentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListIntentsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListIntentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.intentView) { + case "INTENT_VIEW_UNSPECIFIED": + case 0: + message.intentView = 0; + break; + case "INTENT_VIEW_FULL": + case 1: + message.intentView = 1; + break; + } + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListIntentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ListIntentsRequest} message ListIntentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListIntentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.intentView != null && message.hasOwnProperty("intentView")) + object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.IntentView[message.intentView] : message.intentView; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; + + /** + * Converts this ListIntentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @instance + * @returns {Object.} JSON object + */ + ListIntentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListIntentsRequest; + })(); + + v2beta1.ListIntentsResponse = (function() { + + /** + * Properties of a ListIntentsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListIntentsResponse + * @property {Array.|null} [intents] ListIntentsResponse intents + * @property {string|null} [nextPageToken] ListIntentsResponse nextPageToken + */ + + /** + * Constructs a new ListIntentsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListIntentsResponse. + * @implements IListIntentsResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListIntentsResponse=} [properties] Properties to set + */ + function ListIntentsResponse(properties) { + this.intents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListIntentsResponse intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @instance + */ + ListIntentsResponse.prototype.intents = $util.emptyArray; + + /** + * ListIntentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @instance + */ + ListIntentsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListIntentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListIntentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListIntentsResponse} ListIntentsResponse instance + */ + ListIntentsResponse.create = function create(properties) { + return new ListIntentsResponse(properties); + }; + + /** + * Encodes the specified ListIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListIntentsResponse} message ListIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListIntentsResponse} message ListIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListIntentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListIntentsResponse} ListIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIntentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListIntentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListIntentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListIntentsResponse} ListIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListIntentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListIntentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListIntentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intents[i]); + if (error) + return "intents." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListIntentsResponse} ListIntentsResponse + */ + ListIntentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListIntentsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListIntentsResponse(); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListIntentsResponse.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListIntentsResponse.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intents[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListIntentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ListIntentsResponse} message ListIntentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListIntentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intents[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListIntentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @instance + * @returns {Object.} JSON object + */ + ListIntentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListIntentsResponse; + })(); + + v2beta1.GetIntentRequest = (function() { + + /** + * Properties of a GetIntentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IGetIntentRequest + * @property {string|null} [name] GetIntentRequest name + * @property {string|null} [languageCode] GetIntentRequest languageCode + * @property {google.cloud.dialogflow.v2beta1.IntentView|null} [intentView] GetIntentRequest intentView + */ + + /** + * Constructs a new GetIntentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a GetIntentRequest. + * @implements IGetIntentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IGetIntentRequest=} [properties] Properties to set + */ + function GetIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIntentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @instance + */ + GetIntentRequest.prototype.name = ""; + + /** + * GetIntentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @instance + */ + GetIntentRequest.prototype.languageCode = ""; + + /** + * GetIntentRequest intentView. + * @member {google.cloud.dialogflow.v2beta1.IntentView} intentView + * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @instance + */ + GetIntentRequest.prototype.intentView = 0; + + /** + * Creates a new GetIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GetIntentRequest} GetIntentRequest instance + */ + GetIntentRequest.create = function create(properties) { + return new GetIntentRequest(properties); + }; + + /** + * Encodes the specified GetIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetIntentRequest} message GetIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.intentView); + return writer; + }; + + /** + * Encodes the specified GetIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetIntentRequest} message GetIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.GetIntentRequest} GetIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIntentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + case 3: + message.intentView = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.GetIntentRequest} GetIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIntentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.intentView != null && message.hasOwnProperty("intentView")) + switch (message.intentView) { + default: + return "intentView: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a GetIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.GetIntentRequest} GetIntentRequest + */ + GetIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetIntentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.GetIntentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.intentView) { + case "INTENT_VIEW_UNSPECIFIED": + case 0: + message.intentView = 0; + break; + case "INTENT_VIEW_FULL": + case 1: + message.intentView = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.GetIntentRequest} message GetIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.intentView != null && message.hasOwnProperty("intentView")) + object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.IntentView[message.intentView] : message.intentView; + return object; + }; + + /** + * Converts this GetIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @instance + * @returns {Object.} JSON object + */ + GetIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIntentRequest; + })(); + + v2beta1.CreateIntentRequest = (function() { + + /** + * Properties of a CreateIntentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ICreateIntentRequest + * @property {string|null} [parent] CreateIntentRequest parent + * @property {google.cloud.dialogflow.v2beta1.IIntent|null} [intent] CreateIntentRequest intent + * @property {string|null} [languageCode] CreateIntentRequest languageCode + * @property {google.cloud.dialogflow.v2beta1.IntentView|null} [intentView] CreateIntentRequest intentView + */ + + /** + * Constructs a new CreateIntentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a CreateIntentRequest. + * @implements ICreateIntentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ICreateIntentRequest=} [properties] Properties to set + */ + function CreateIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateIntentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @instance + */ + CreateIntentRequest.prototype.parent = ""; + + /** + * CreateIntentRequest intent. + * @member {google.cloud.dialogflow.v2beta1.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @instance + */ + CreateIntentRequest.prototype.intent = null; + + /** + * CreateIntentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @instance + */ + CreateIntentRequest.prototype.languageCode = ""; + + /** + * CreateIntentRequest intentView. + * @member {google.cloud.dialogflow.v2beta1.IntentView} intentView + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @instance + */ + CreateIntentRequest.prototype.intentView = 0; + + /** + * Creates a new CreateIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CreateIntentRequest} CreateIntentRequest instance + */ + CreateIntentRequest.create = function create(properties) { + return new CreateIntentRequest(properties); + }; + + /** + * Encodes the specified CreateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateIntentRequest} message CreateIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.intentView); + return writer; + }; + + /** + * Encodes the specified CreateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateIntentRequest} message CreateIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CreateIntentRequest} CreateIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateIntentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.intent = $root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32()); + break; + case 3: + message.languageCode = reader.string(); + break; + case 4: + message.intentView = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CreateIntentRequest} CreateIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateIntentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intent); + if (error) + return "intent." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.intentView != null && message.hasOwnProperty("intentView")) + switch (message.intentView) { + default: + return "intentView: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a CreateIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CreateIntentRequest} CreateIntentRequest + */ + CreateIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateIntentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CreateIntentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CreateIntentRequest.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intent); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + switch (object.intentView) { + case "INTENT_VIEW_UNSPECIFIED": + case 0: + message.intentView = 0; + break; + case "INTENT_VIEW_FULL": + case 1: + message.intentView = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a CreateIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.CreateIntentRequest} message CreateIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.intent = null; + object.languageCode = ""; + object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intent, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.intentView != null && message.hasOwnProperty("intentView")) + object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.IntentView[message.intentView] : message.intentView; + return object; + }; + + /** + * Converts this CreateIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateIntentRequest; + })(); + + v2beta1.UpdateIntentRequest = (function() { + + /** + * Properties of an UpdateIntentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IUpdateIntentRequest + * @property {google.cloud.dialogflow.v2beta1.IIntent|null} [intent] UpdateIntentRequest intent + * @property {string|null} [languageCode] UpdateIntentRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateIntentRequest updateMask + * @property {google.cloud.dialogflow.v2beta1.IntentView|null} [intentView] UpdateIntentRequest intentView + */ + + /** + * Constructs a new UpdateIntentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an UpdateIntentRequest. + * @implements IUpdateIntentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IUpdateIntentRequest=} [properties] Properties to set + */ + function UpdateIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateIntentRequest intent. + * @member {google.cloud.dialogflow.v2beta1.IIntent|null|undefined} intent + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.intent = null; + + /** + * UpdateIntentRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.languageCode = ""; + + /** + * UpdateIntentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.updateMask = null; + + /** + * UpdateIntentRequest intentView. + * @member {google.cloud.dialogflow.v2beta1.IntentView} intentView + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @instance + */ + UpdateIntentRequest.prototype.intentView = 0; + + /** + * Creates a new UpdateIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.UpdateIntentRequest} UpdateIntentRequest instance + */ + UpdateIntentRequest.create = function create(properties) { + return new UpdateIntentRequest(properties); + }; + + /** + * Encodes the specified UpdateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateIntentRequest} message UpdateIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) + $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.intentView); + return writer; + }; + + /** + * Encodes the specified UpdateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateIntentRequest} message UpdateIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.UpdateIntentRequest} UpdateIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateIntentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.intent = $root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32()); + break; + case 2: + message.languageCode = reader.string(); + break; + case 3: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 4: + message.intentView = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.UpdateIntentRequest} UpdateIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateIntentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.intent != null && message.hasOwnProperty("intent")) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intent); + if (error) + return "intent." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.intentView != null && message.hasOwnProperty("intentView")) + switch (message.intentView) { + default: + return "intentView: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates an UpdateIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.UpdateIntentRequest} UpdateIntentRequest + */ + UpdateIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateIntentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.UpdateIntentRequest(); + if (object.intent != null) { + if (typeof object.intent !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateIntentRequest.intent: object expected"); + message.intent = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intent); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateIntentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + switch (object.intentView) { + case "INTENT_VIEW_UNSPECIFIED": + case 0: + message.intentView = 0; + break; + case "INTENT_VIEW_FULL": + case 1: + message.intentView = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from an UpdateIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.UpdateIntentRequest} message UpdateIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.intent = null; + object.languageCode = ""; + object.updateMask = null; + object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; + } + if (message.intent != null && message.hasOwnProperty("intent")) + object.intent = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intent, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.intentView != null && message.hasOwnProperty("intentView")) + object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.IntentView[message.intentView] : message.intentView; + return object; + }; + + /** + * Converts this UpdateIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UpdateIntentRequest; + })(); + + v2beta1.DeleteIntentRequest = (function() { + + /** + * Properties of a DeleteIntentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IDeleteIntentRequest + * @property {string|null} [name] DeleteIntentRequest name + */ + + /** + * Constructs a new DeleteIntentRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a DeleteIntentRequest. + * @implements IDeleteIntentRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IDeleteIntentRequest=} [properties] Properties to set + */ + function DeleteIntentRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteIntentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest + * @instance + */ + DeleteIntentRequest.prototype.name = ""; + + /** + * Creates a new DeleteIntentRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteIntentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DeleteIntentRequest} DeleteIntentRequest instance + */ + DeleteIntentRequest.create = function create(properties) { + return new DeleteIntentRequest(properties); + }; + + /** + * Encodes the specified DeleteIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteIntentRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteIntentRequest} message DeleteIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteIntentRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteIntentRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteIntentRequest} message DeleteIntentRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteIntentRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.DeleteIntentRequest} DeleteIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteIntentRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteIntentRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteIntentRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.DeleteIntentRequest} DeleteIntentRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteIntentRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteIntentRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteIntentRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteIntentRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.DeleteIntentRequest} DeleteIntentRequest + */ + DeleteIntentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteIntentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.DeleteIntentRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteIntentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.DeleteIntentRequest} message DeleteIntentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteIntentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteIntentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteIntentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteIntentRequest; + })(); + + v2beta1.BatchUpdateIntentsRequest = (function() { + + /** + * Properties of a BatchUpdateIntentsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IBatchUpdateIntentsRequest + * @property {string|null} [parent] BatchUpdateIntentsRequest parent + * @property {string|null} [intentBatchUri] BatchUpdateIntentsRequest intentBatchUri + * @property {google.cloud.dialogflow.v2beta1.IIntentBatch|null} [intentBatchInline] BatchUpdateIntentsRequest intentBatchInline + * @property {string|null} [languageCode] BatchUpdateIntentsRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateIntentsRequest updateMask + * @property {google.cloud.dialogflow.v2beta1.IntentView|null} [intentView] BatchUpdateIntentsRequest intentView + */ + + /** + * Constructs a new BatchUpdateIntentsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a BatchUpdateIntentsRequest. + * @implements IBatchUpdateIntentsRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest=} [properties] Properties to set + */ + function BatchUpdateIntentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchUpdateIntentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @instance + */ + BatchUpdateIntentsRequest.prototype.parent = ""; + + /** + * BatchUpdateIntentsRequest intentBatchUri. + * @member {string} intentBatchUri + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @instance + */ + BatchUpdateIntentsRequest.prototype.intentBatchUri = ""; + + /** + * BatchUpdateIntentsRequest intentBatchInline. + * @member {google.cloud.dialogflow.v2beta1.IIntentBatch|null|undefined} intentBatchInline + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @instance + */ + BatchUpdateIntentsRequest.prototype.intentBatchInline = null; - /** - * Creates a Message message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message} Message - */ - Message.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message(); - if (object.text != null) { - if (typeof object.text !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.text: object expected"); - message.text = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text.fromObject(object.text); - } - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.image: object expected"); - message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.image); - } - if (object.quickReplies != null) { - if (typeof object.quickReplies !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.quickReplies: object expected"); - message.quickReplies = $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.fromObject(object.quickReplies); - } - if (object.card != null) { - if (typeof object.card !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.card: object expected"); - message.card = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.fromObject(object.card); - } - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.payload: object expected"); - message.payload = $root.google.protobuf.Struct.fromObject(object.payload); - } - if (object.simpleResponses != null) { - if (typeof object.simpleResponses !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.simpleResponses: object expected"); - message.simpleResponses = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.fromObject(object.simpleResponses); - } - if (object.basicCard != null) { - if (typeof object.basicCard !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.basicCard: object expected"); - message.basicCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.fromObject(object.basicCard); - } - if (object.suggestions != null) { - if (typeof object.suggestions !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.suggestions: object expected"); - message.suggestions = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.fromObject(object.suggestions); - } - if (object.linkOutSuggestion != null) { - if (typeof object.linkOutSuggestion !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.linkOutSuggestion: object expected"); - message.linkOutSuggestion = $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.fromObject(object.linkOutSuggestion); - } - if (object.listSelect != null) { - if (typeof object.listSelect !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.listSelect: object expected"); - message.listSelect = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.fromObject(object.listSelect); - } - if (object.carouselSelect != null) { - if (typeof object.carouselSelect !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.carouselSelect: object expected"); - message.carouselSelect = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.fromObject(object.carouselSelect); - } - if (object.telephonyPlayAudio != null) { - if (typeof object.telephonyPlayAudio !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.telephonyPlayAudio: object expected"); - message.telephonyPlayAudio = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.fromObject(object.telephonyPlayAudio); - } - if (object.telephonySynthesizeSpeech != null) { - if (typeof object.telephonySynthesizeSpeech !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.telephonySynthesizeSpeech: object expected"); - message.telephonySynthesizeSpeech = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.fromObject(object.telephonySynthesizeSpeech); - } - if (object.telephonyTransferCall != null) { - if (typeof object.telephonyTransferCall !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.telephonyTransferCall: object expected"); - message.telephonyTransferCall = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.fromObject(object.telephonyTransferCall); - } - if (object.rbmText != null) { - if (typeof object.rbmText !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.rbmText: object expected"); - message.rbmText = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.fromObject(object.rbmText); + /** + * BatchUpdateIntentsRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @instance + */ + BatchUpdateIntentsRequest.prototype.languageCode = ""; + + /** + * BatchUpdateIntentsRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @instance + */ + BatchUpdateIntentsRequest.prototype.updateMask = null; + + /** + * BatchUpdateIntentsRequest intentView. + * @member {google.cloud.dialogflow.v2beta1.IntentView} intentView + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @instance + */ + BatchUpdateIntentsRequest.prototype.intentView = 0; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BatchUpdateIntentsRequest intentBatch. + * @member {"intentBatchUri"|"intentBatchInline"|undefined} intentBatch + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @instance + */ + Object.defineProperty(BatchUpdateIntentsRequest.prototype, "intentBatch", { + get: $util.oneOfGetter($oneOfFields = ["intentBatchUri", "intentBatchInline"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BatchUpdateIntentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest instance + */ + BatchUpdateIntentsRequest.create = function create(properties) { + return new BatchUpdateIntentsRequest(properties); + }; + + /** + * Encodes the specified BatchUpdateIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest} message BatchUpdateIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateIntentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.intentBatchUri != null && Object.hasOwnProperty.call(message, "intentBatchUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.intentBatchUri); + if (message.intentBatchInline != null && Object.hasOwnProperty.call(message, "intentBatchInline")) + $root.google.cloud.dialogflow.v2beta1.IntentBatch.encode(message.intentBatchInline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.intentView); + return writer; + }; + + /** + * Encodes the specified BatchUpdateIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest} message BatchUpdateIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateIntentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.intentBatchUri = reader.string(); + break; + case 3: + message.intentBatchInline = $root.google.cloud.dialogflow.v2beta1.IntentBatch.decode(reader, reader.uint32()); + break; + case 4: + message.languageCode = reader.string(); + break; + case 5: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + case 6: + message.intentView = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; } - if (object.rbmStandaloneRichCard != null) { - if (typeof object.rbmStandaloneRichCard !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.rbmStandaloneRichCard: object expected"); - message.rbmStandaloneRichCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.fromObject(object.rbmStandaloneRichCard); + } + return message; + }; + + /** + * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateIntentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchUpdateIntentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchUpdateIntentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.intentBatchUri != null && message.hasOwnProperty("intentBatchUri")) { + properties.intentBatch = 1; + if (!$util.isString(message.intentBatchUri)) + return "intentBatchUri: string expected"; + } + if (message.intentBatchInline != null && message.hasOwnProperty("intentBatchInline")) { + if (properties.intentBatch === 1) + return "intentBatch: multiple values"; + properties.intentBatch = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.IntentBatch.verify(message.intentBatchInline); + if (error) + return "intentBatchInline." + error; } - if (object.rbmCarouselRichCard != null) { - if (typeof object.rbmCarouselRichCard !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.rbmCarouselRichCard: object expected"); - message.rbmCarouselRichCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.fromObject(object.rbmCarouselRichCard); + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.intentView != null && message.hasOwnProperty("intentView")) + switch (message.intentView) { + default: + return "intentView: enum value expected"; + case 0: + case 1: + break; } - if (object.browseCarouselCard != null) { - if (typeof object.browseCarouselCard !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.browseCarouselCard: object expected"); - message.browseCarouselCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.fromObject(object.browseCarouselCard); + return null; + }; + + /** + * Creates a BatchUpdateIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest + */ + BatchUpdateIntentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.intentBatchUri != null) + message.intentBatchUri = String(object.intentBatchUri); + if (object.intentBatchInline != null) { + if (typeof object.intentBatchInline !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.intentBatchInline: object expected"); + message.intentBatchInline = $root.google.cloud.dialogflow.v2beta1.IntentBatch.fromObject(object.intentBatchInline); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + switch (object.intentView) { + case "INTENT_VIEW_UNSPECIFIED": + case 0: + message.intentView = 0; + break; + case "INTENT_VIEW_FULL": + case 1: + message.intentView = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a BatchUpdateIntentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest} message BatchUpdateIntentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchUpdateIntentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.updateMask = null; + object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.intentBatchUri != null && message.hasOwnProperty("intentBatchUri")) { + object.intentBatchUri = message.intentBatchUri; + if (options.oneofs) + object.intentBatch = "intentBatchUri"; + } + if (message.intentBatchInline != null && message.hasOwnProperty("intentBatchInline")) { + object.intentBatchInline = $root.google.cloud.dialogflow.v2beta1.IntentBatch.toObject(message.intentBatchInline, options); + if (options.oneofs) + object.intentBatch = "intentBatchInline"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.intentView != null && message.hasOwnProperty("intentView")) + object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.IntentView[message.intentView] : message.intentView; + return object; + }; + + /** + * Converts this BatchUpdateIntentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchUpdateIntentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchUpdateIntentsRequest; + })(); + + v2beta1.BatchUpdateIntentsResponse = (function() { + + /** + * Properties of a BatchUpdateIntentsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IBatchUpdateIntentsResponse + * @property {Array.|null} [intents] BatchUpdateIntentsResponse intents + */ + + /** + * Constructs a new BatchUpdateIntentsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a BatchUpdateIntentsResponse. + * @implements IBatchUpdateIntentsResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse=} [properties] Properties to set + */ + function BatchUpdateIntentsResponse(properties) { + this.intents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchUpdateIntentsResponse intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse + * @instance + */ + BatchUpdateIntentsResponse.prototype.intents = $util.emptyArray; + + /** + * Creates a new BatchUpdateIntentsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse instance + */ + BatchUpdateIntentsResponse.create = function create(properties) { + return new BatchUpdateIntentsResponse(properties); + }; + + /** + * Encodes the specified BatchUpdateIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse} message BatchUpdateIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateIntentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchUpdateIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse} message BatchUpdateIntentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateIntentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } - if (object.tableCard != null) { - if (typeof object.tableCard !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.tableCard: object expected"); - message.tableCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.fromObject(object.tableCard); + } + return message; + }; + + /** + * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateIntentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchUpdateIntentsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchUpdateIntentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intents[i]); + if (error) + return "intents." + error; } - if (object.mediaContent != null) { - if (typeof object.mediaContent !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.mediaContent: object expected"); - message.mediaContent = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.fromObject(object.mediaContent); + } + return null; + }; + + /** + * Creates a BatchUpdateIntentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse + */ + BatchUpdateIntentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse(); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intents[i]); } - switch (object.platform) { - case "PLATFORM_UNSPECIFIED": - case 0: - message.platform = 0; - break; - case "FACEBOOK": + } + return message; + }; + + /** + * Creates a plain object from a BatchUpdateIntentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse} message BatchUpdateIntentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchUpdateIntentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intents = []; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intents[j], options); + } + return object; + }; + + /** + * Converts this BatchUpdateIntentsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse + * @instance + * @returns {Object.} JSON object + */ + BatchUpdateIntentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchUpdateIntentsResponse; + })(); + + v2beta1.BatchDeleteIntentsRequest = (function() { + + /** + * Properties of a BatchDeleteIntentsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IBatchDeleteIntentsRequest + * @property {string|null} [parent] BatchDeleteIntentsRequest parent + * @property {Array.|null} [intents] BatchDeleteIntentsRequest intents + */ + + /** + * Constructs a new BatchDeleteIntentsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a BatchDeleteIntentsRequest. + * @implements IBatchDeleteIntentsRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest=} [properties] Properties to set + */ + function BatchDeleteIntentsRequest(properties) { + this.intents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BatchDeleteIntentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest + * @instance + */ + BatchDeleteIntentsRequest.prototype.parent = ""; + + /** + * BatchDeleteIntentsRequest intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest + * @instance + */ + BatchDeleteIntentsRequest.prototype.intents = $util.emptyArray; + + /** + * Creates a new BatchDeleteIntentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest instance + */ + BatchDeleteIntentsRequest.create = function create(properties) { + return new BatchDeleteIntentsRequest(properties); + }; + + /** + * Encodes the specified BatchDeleteIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest} message BatchDeleteIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteIntentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchDeleteIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest} message BatchDeleteIntentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteIntentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { case 1: - message.platform = 1; + message.parent = reader.string(); break; - case "SLACK": case 2: - message.platform = 2; - break; - case "TELEGRAM": - case 3: - message.platform = 3; - break; - case "KIK": - case 4: - message.platform = 4; - break; - case "SKYPE": - case 5: - message.platform = 5; - break; - case "LINE": - case 6: - message.platform = 6; - break; - case "VIBER": - case 7: - message.platform = 7; - break; - case "ACTIONS_ON_GOOGLE": - case 8: - message.platform = 8; - break; - case "TELEPHONY": - case 10: - message.platform = 10; + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32())); break; - case "GOOGLE_HANGOUTS": - case 11: - message.platform = 11; + default: + reader.skipType(tag & 7); break; } - return message; - }; + } + return message; + }; - /** - * Creates a plain object from a Message message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message} message Message - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Message.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.platform = options.enums === String ? "PLATFORM_UNSPECIFIED" : 0; - if (message.text != null && message.hasOwnProperty("text")) { - object.text = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text.toObject(message.text, options); - if (options.oneofs) - object.message = "text"; - } - if (message.image != null && message.hasOwnProperty("image")) { - object.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.image, options); - if (options.oneofs) - object.message = "image"; - } - if (message.quickReplies != null && message.hasOwnProperty("quickReplies")) { - object.quickReplies = $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.toObject(message.quickReplies, options); - if (options.oneofs) - object.message = "quickReplies"; - } - if (message.card != null && message.hasOwnProperty("card")) { - object.card = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.toObject(message.card, options); - if (options.oneofs) - object.message = "card"; - } - if (message.payload != null && message.hasOwnProperty("payload")) { - object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); - if (options.oneofs) - object.message = "payload"; - } - if (message.platform != null && message.hasOwnProperty("platform")) - object.platform = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.Platform[message.platform] : message.platform; - if (message.simpleResponses != null && message.hasOwnProperty("simpleResponses")) { - object.simpleResponses = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.toObject(message.simpleResponses, options); - if (options.oneofs) - object.message = "simpleResponses"; - } - if (message.basicCard != null && message.hasOwnProperty("basicCard")) { - object.basicCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.toObject(message.basicCard, options); - if (options.oneofs) - object.message = "basicCard"; - } - if (message.suggestions != null && message.hasOwnProperty("suggestions")) { - object.suggestions = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.toObject(message.suggestions, options); - if (options.oneofs) - object.message = "suggestions"; - } - if (message.linkOutSuggestion != null && message.hasOwnProperty("linkOutSuggestion")) { - object.linkOutSuggestion = $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.toObject(message.linkOutSuggestion, options); - if (options.oneofs) - object.message = "linkOutSuggestion"; - } - if (message.listSelect != null && message.hasOwnProperty("listSelect")) { - object.listSelect = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.toObject(message.listSelect, options); - if (options.oneofs) - object.message = "listSelect"; - } - if (message.carouselSelect != null && message.hasOwnProperty("carouselSelect")) { - object.carouselSelect = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.toObject(message.carouselSelect, options); - if (options.oneofs) - object.message = "carouselSelect"; - } - if (message.telephonyPlayAudio != null && message.hasOwnProperty("telephonyPlayAudio")) { - object.telephonyPlayAudio = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.toObject(message.telephonyPlayAudio, options); - if (options.oneofs) - object.message = "telephonyPlayAudio"; - } - if (message.telephonySynthesizeSpeech != null && message.hasOwnProperty("telephonySynthesizeSpeech")) { - object.telephonySynthesizeSpeech = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.toObject(message.telephonySynthesizeSpeech, options); - if (options.oneofs) - object.message = "telephonySynthesizeSpeech"; - } - if (message.telephonyTransferCall != null && message.hasOwnProperty("telephonyTransferCall")) { - object.telephonyTransferCall = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.toObject(message.telephonyTransferCall, options); - if (options.oneofs) - object.message = "telephonyTransferCall"; - } - if (message.rbmText != null && message.hasOwnProperty("rbmText")) { - object.rbmText = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.toObject(message.rbmText, options); - if (options.oneofs) - object.message = "rbmText"; - } - if (message.rbmStandaloneRichCard != null && message.hasOwnProperty("rbmStandaloneRichCard")) { - object.rbmStandaloneRichCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.toObject(message.rbmStandaloneRichCard, options); - if (options.oneofs) - object.message = "rbmStandaloneRichCard"; - } - if (message.rbmCarouselRichCard != null && message.hasOwnProperty("rbmCarouselRichCard")) { - object.rbmCarouselRichCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.toObject(message.rbmCarouselRichCard, options); - if (options.oneofs) - object.message = "rbmCarouselRichCard"; + /** + * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteIntentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchDeleteIntentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteIntentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intents[i]); + if (error) + return "intents." + error; } - if (message.browseCarouselCard != null && message.hasOwnProperty("browseCarouselCard")) { - object.browseCarouselCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.toObject(message.browseCarouselCard, options); - if (options.oneofs) - object.message = "browseCarouselCard"; + } + return null; + }; + + /** + * Creates a BatchDeleteIntentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest + */ + BatchDeleteIntentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intents[i]); } - if (message.tableCard != null && message.hasOwnProperty("tableCard")) { - object.tableCard = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.toObject(message.tableCard, options); - if (options.oneofs) - object.message = "tableCard"; + } + return message; + }; + + /** + * Creates a plain object from a BatchDeleteIntentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest} message BatchDeleteIntentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteIntentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intents = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intents[j], options); + } + return object; + }; + + /** + * Converts this BatchDeleteIntentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteIntentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BatchDeleteIntentsRequest; + })(); + + v2beta1.IntentBatch = (function() { + + /** + * Properties of an IntentBatch. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IIntentBatch + * @property {Array.|null} [intents] IntentBatch intents + */ + + /** + * Constructs a new IntentBatch. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an IntentBatch. + * @implements IIntentBatch + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IIntentBatch=} [properties] Properties to set + */ + function IntentBatch(properties) { + this.intents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * IntentBatch intents. + * @member {Array.} intents + * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @instance + */ + IntentBatch.prototype.intents = $util.emptyArray; + + /** + * Creates a new IntentBatch instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @static + * @param {google.cloud.dialogflow.v2beta1.IIntentBatch=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.IntentBatch} IntentBatch instance + */ + IntentBatch.create = function create(properties) { + return new IntentBatch(properties); + }; + + /** + * Encodes the specified IntentBatch message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.IntentBatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @static + * @param {google.cloud.dialogflow.v2beta1.IIntentBatch} message IntentBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.intents != null && message.intents.length) + for (var i = 0; i < message.intents.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified IntentBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.IntentBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @static + * @param {google.cloud.dialogflow.v2beta1.IIntentBatch} message IntentBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + IntentBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an IntentBatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.IntentBatch} IntentBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentBatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.IntentBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.intents && message.intents.length)) + message.intents = []; + message.intents.push($root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; } - if (message.mediaContent != null && message.hasOwnProperty("mediaContent")) { - object.mediaContent = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.toObject(message.mediaContent, options); - if (options.oneofs) - object.message = "mediaContent"; + } + return message; + }; + + /** + * Decodes an IntentBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.IntentBatch} IntentBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + IntentBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an IntentBatch message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + IntentBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.intents != null && message.hasOwnProperty("intents")) { + if (!Array.isArray(message.intents)) + return "intents: array expected"; + for (var i = 0; i < message.intents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intents[i]); + if (error) + return "intents." + error; } + } + return null; + }; + + /** + * Creates an IntentBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.IntentBatch} IntentBatch + */ + IntentBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.IntentBatch) return object; - }; + var message = new $root.google.cloud.dialogflow.v2beta1.IntentBatch(); + if (object.intents) { + if (!Array.isArray(object.intents)) + throw TypeError(".google.cloud.dialogflow.v2beta1.IntentBatch.intents: array expected"); + message.intents = []; + for (var i = 0; i < object.intents.length; ++i) { + if (typeof object.intents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.IntentBatch.intents: object expected"); + message.intents[i] = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intents[i]); + } + } + return message; + }; - /** - * Converts this Message to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @instance - * @returns {Object.} JSON object - */ - Message.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from an IntentBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @static + * @param {google.cloud.dialogflow.v2beta1.IntentBatch} message IntentBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + IntentBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.intents = []; + if (message.intents && message.intents.length) { + object.intents = []; + for (var j = 0; j < message.intents.length; ++j) + object.intents[j] = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intents[j], options); + } + return object; + }; - Message.Text = (function() { + /** + * Converts this IntentBatch to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @instance + * @returns {Object.} JSON object + */ + IntentBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a Text. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IText - * @property {Array.|null} [text] Text text - */ + return IntentBatch; + })(); - /** - * Constructs a new Text. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a Text. - * @implements IText - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IText=} [properties] Properties to set - */ - function Text(properties) { - this.text = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * IntentView enum. + * @name google.cloud.dialogflow.v2beta1.IntentView + * @enum {number} + * @property {number} INTENT_VIEW_UNSPECIFIED=0 INTENT_VIEW_UNSPECIFIED value + * @property {number} INTENT_VIEW_FULL=1 INTENT_VIEW_FULL value + */ + v2beta1.IntentView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INTENT_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "INTENT_VIEW_FULL"] = 1; + return values; + })(); - /** - * Text text. - * @member {Array.} text - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text - * @instance - */ - Text.prototype.text = $util.emptyArray; + v2beta1.SessionEntityTypes = (function() { - /** - * Creates a new Text instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IText=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Text} Text instance - */ - Text.create = function create(properties) { - return new Text(properties); - }; + /** + * Constructs a new SessionEntityTypes service. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SessionEntityTypes + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function SessionEntityTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Encodes the specified Text message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Text.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IText} message Text message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Text.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && message.text.length) - for (var i = 0; i < message.text.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text[i]); - return writer; - }; + (SessionEntityTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionEntityTypes; - /** - * Encodes the specified Text message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Text.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IText} message Text message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Text.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates new SessionEntityTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {SessionEntityTypes} RPC service. Useful where requests and/or responses are streamed. + */ + SessionEntityTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Decodes a Text message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Text} Text - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Text.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.text && message.text.length)) - message.text = []; - message.text.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#listSessionEntityTypes}. + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @typedef ListSessionEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse} [response] ListSessionEntityTypesResponse + */ + + /** + * Calls ListSessionEntityTypes. + * @function listSessionEntityTypes + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest} request ListSessionEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.SessionEntityTypes.ListSessionEntityTypesCallback} callback Node-style callback called with the error, if any, and ListSessionEntityTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.listSessionEntityTypes = function listSessionEntityTypes(request, callback) { + return this.rpcCall(listSessionEntityTypes, $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest, $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse, request, callback); + }, "name", { value: "ListSessionEntityTypes" }); + + /** + * Calls ListSessionEntityTypes. + * @function listSessionEntityTypes + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest} request ListSessionEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#getSessionEntityType}. + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @typedef GetSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.SessionEntityType} [response] SessionEntityType + */ + + /** + * Calls GetSessionEntityType. + * @function getSessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest} request GetSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.SessionEntityTypes.GetSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.getSessionEntityType = function getSessionEntityType(request, callback) { + return this.rpcCall(getSessionEntityType, $root.google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest, $root.google.cloud.dialogflow.v2beta1.SessionEntityType, request, callback); + }, "name", { value: "GetSessionEntityType" }); + + /** + * Calls GetSessionEntityType. + * @function getSessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest} request GetSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#createSessionEntityType}. + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @typedef CreateSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.SessionEntityType} [response] SessionEntityType + */ + + /** + * Calls CreateSessionEntityType. + * @function createSessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest} request CreateSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.SessionEntityTypes.CreateSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.createSessionEntityType = function createSessionEntityType(request, callback) { + return this.rpcCall(createSessionEntityType, $root.google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest, $root.google.cloud.dialogflow.v2beta1.SessionEntityType, request, callback); + }, "name", { value: "CreateSessionEntityType" }); + + /** + * Calls CreateSessionEntityType. + * @function createSessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest} request CreateSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#updateSessionEntityType}. + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @typedef UpdateSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.SessionEntityType} [response] SessionEntityType + */ + + /** + * Calls UpdateSessionEntityType. + * @function updateSessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest} request UpdateSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.SessionEntityTypes.UpdateSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.updateSessionEntityType = function updateSessionEntityType(request, callback) { + return this.rpcCall(updateSessionEntityType, $root.google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest, $root.google.cloud.dialogflow.v2beta1.SessionEntityType, request, callback); + }, "name", { value: "UpdateSessionEntityType" }); + + /** + * Calls UpdateSessionEntityType. + * @function updateSessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest} request UpdateSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#deleteSessionEntityType}. + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @typedef DeleteSessionEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ + + /** + * Calls DeleteSessionEntityType. + * @function deleteSessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest} request DeleteSessionEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.SessionEntityTypes.DeleteSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(SessionEntityTypes.prototype.deleteSessionEntityType = function deleteSessionEntityType(request, callback) { + return this.rpcCall(deleteSessionEntityType, $root.google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteSessionEntityType" }); + + /** + * Calls DeleteSessionEntityType. + * @function deleteSessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest} request DeleteSessionEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return SessionEntityTypes; + })(); + + v2beta1.SessionEntityType = (function() { + + /** + * Properties of a SessionEntityType. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ISessionEntityType + * @property {string|null} [name] SessionEntityType name + * @property {google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode|null} [entityOverrideMode] SessionEntityType entityOverrideMode + * @property {Array.|null} [entities] SessionEntityType entities + */ + + /** + * Constructs a new SessionEntityType. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a SessionEntityType. + * @implements ISessionEntityType + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ISessionEntityType=} [properties] Properties to set + */ + function SessionEntityType(properties) { + this.entities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SessionEntityType name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @instance + */ + SessionEntityType.prototype.name = ""; - /** - * Decodes a Text message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Text} Text - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Text.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * SessionEntityType entityOverrideMode. + * @member {google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode} entityOverrideMode + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @instance + */ + SessionEntityType.prototype.entityOverrideMode = 0; - /** - * Verifies a Text message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Text.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) { - if (!Array.isArray(message.text)) - return "text: array expected"; - for (var i = 0; i < message.text.length; ++i) - if (!$util.isString(message.text[i])) - return "text: string[] expected"; - } - return null; - }; + /** + * SessionEntityType entities. + * @member {Array.} entities + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @instance + */ + SessionEntityType.prototype.entities = $util.emptyArray; - /** - * Creates a Text message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Text} Text - */ - Text.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Text(); - if (object.text) { - if (!Array.isArray(object.text)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.Text.text: array expected"); - message.text = []; - for (var i = 0; i < object.text.length; ++i) - message.text[i] = String(object.text[i]); - } - return message; - }; + /** + * Creates a new SessionEntityType instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @static + * @param {google.cloud.dialogflow.v2beta1.ISessionEntityType=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.SessionEntityType} SessionEntityType instance + */ + SessionEntityType.create = function create(properties) { + return new SessionEntityType(properties); + }; - /** - * Creates a plain object from a Text message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Text} message Text - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Text.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.text = []; - if (message.text && message.text.length) { - object.text = []; - for (var j = 0; j < message.text.length; ++j) - object.text[j] = message.text[j]; - } - return object; - }; + /** + * Encodes the specified SessionEntityType message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SessionEntityType.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @static + * @param {google.cloud.dialogflow.v2beta1.ISessionEntityType} message SessionEntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionEntityType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.entityOverrideMode != null && Object.hasOwnProperty.call(message, "entityOverrideMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.entityOverrideMode); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Converts this Text to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Text - * @instance - * @returns {Object.} JSON object - */ - Text.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified SessionEntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SessionEntityType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @static + * @param {google.cloud.dialogflow.v2beta1.ISessionEntityType} message SessionEntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SessionEntityType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return Text; - })(); + /** + * Decodes a SessionEntityType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.SessionEntityType} SessionEntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionEntityType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SessionEntityType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.entityOverrideMode = reader.int32(); + break; + case 3: + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dialogflow.v2beta1.EntityType.Entity.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - Message.Image = (function() { + /** + * Decodes a SessionEntityType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.SessionEntityType} SessionEntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SessionEntityType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of an Image. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IImage - * @property {string|null} [imageUri] Image imageUri - * @property {string|null} [accessibilityText] Image accessibilityText - */ + /** + * Verifies a SessionEntityType message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SessionEntityType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.entityOverrideMode != null && message.hasOwnProperty("entityOverrideMode")) + switch (message.entityOverrideMode) { + default: + return "entityOverrideMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + return null; + }; - /** - * Constructs a new Image. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents an Image. - * @implements IImage - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IImage=} [properties] Properties to set - */ - function Image(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Creates a SessionEntityType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.SessionEntityType} SessionEntityType + */ + SessionEntityType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.SessionEntityType) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.SessionEntityType(); + if (object.name != null) + message.name = String(object.name); + switch (object.entityOverrideMode) { + case "ENTITY_OVERRIDE_MODE_UNSPECIFIED": + case 0: + message.entityOverrideMode = 0; + break; + case "ENTITY_OVERRIDE_MODE_OVERRIDE": + case 1: + message.entityOverrideMode = 1; + break; + case "ENTITY_OVERRIDE_MODE_SUPPLEMENT": + case 2: + message.entityOverrideMode = 2; + break; + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dialogflow.v2beta1.SessionEntityType.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.SessionEntityType.entities: object expected"); + message.entities[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.fromObject(object.entities[i]); } + } + return message; + }; - /** - * Image imageUri. - * @member {string} imageUri - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image - * @instance - */ - Image.prototype.imageUri = ""; + /** + * Creates a plain object from a SessionEntityType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @static + * @param {google.cloud.dialogflow.v2beta1.SessionEntityType} message SessionEntityType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SessionEntityType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) { + object.name = ""; + object.entityOverrideMode = options.enums === String ? "ENTITY_OVERRIDE_MODE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.entityOverrideMode != null && message.hasOwnProperty("entityOverrideMode")) + object.entityOverrideMode = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode[message.entityOverrideMode] : message.entityOverrideMode; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.toObject(message.entities[j], options); + } + return object; + }; - /** - * Image accessibilityText. - * @member {string} accessibilityText - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image - * @instance - */ - Image.prototype.accessibilityText = ""; + /** + * Converts this SessionEntityType to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @instance + * @returns {Object.} JSON object + */ + SessionEntityType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new Image instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IImage=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Image} Image instance - */ - Image.create = function create(properties) { - return new Image(properties); - }; + /** + * EntityOverrideMode enum. + * @name google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode + * @enum {number} + * @property {number} ENTITY_OVERRIDE_MODE_UNSPECIFIED=0 ENTITY_OVERRIDE_MODE_UNSPECIFIED value + * @property {number} ENTITY_OVERRIDE_MODE_OVERRIDE=1 ENTITY_OVERRIDE_MODE_OVERRIDE value + * @property {number} ENTITY_OVERRIDE_MODE_SUPPLEMENT=2 ENTITY_OVERRIDE_MODE_SUPPLEMENT value + */ + SessionEntityType.EntityOverrideMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ENTITY_OVERRIDE_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENTITY_OVERRIDE_MODE_OVERRIDE"] = 1; + values[valuesById[2] = "ENTITY_OVERRIDE_MODE_SUPPLEMENT"] = 2; + return values; + })(); - /** - * Encodes the specified Image message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.imageUri); - if (message.accessibilityText != null && Object.hasOwnProperty.call(message, "accessibilityText")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.accessibilityText); - return writer; - }; + return SessionEntityType; + })(); - /** - * Encodes the specified Image message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IImage} message Image message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Image.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v2beta1.ListSessionEntityTypesRequest = (function() { - /** - * Decodes an Image message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.imageUri = reader.string(); - break; - case 2: - message.accessibilityText = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a ListSessionEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListSessionEntityTypesRequest + * @property {string|null} [parent] ListSessionEntityTypesRequest parent + * @property {number|null} [pageSize] ListSessionEntityTypesRequest pageSize + * @property {string|null} [pageToken] ListSessionEntityTypesRequest pageToken + */ - /** - * Decodes an Image message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Image} Image - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Image.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new ListSessionEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListSessionEntityTypesRequest. + * @implements IListSessionEntityTypesRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest=} [properties] Properties to set + */ + function ListSessionEntityTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListSessionEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @instance + */ + ListSessionEntityTypesRequest.prototype.parent = ""; + + /** + * ListSessionEntityTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @instance + */ + ListSessionEntityTypesRequest.prototype.pageSize = 0; + + /** + * ListSessionEntityTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @instance + */ + ListSessionEntityTypesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListSessionEntityTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest instance + */ + ListSessionEntityTypesRequest.create = function create(properties) { + return new ListSessionEntityTypesRequest(properties); + }; - /** - * Verifies an Image message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Image.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.accessibilityText != null && message.hasOwnProperty("accessibilityText")) - if (!$util.isString(message.accessibilityText)) - return "accessibilityText: string expected"; - return null; - }; + /** + * Encodes the specified ListSessionEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest} message ListSessionEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionEntityTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; - /** - * Creates an Image message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Image} Image - */ - Image.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image(); - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.accessibilityText != null) - message.accessibilityText = String(object.accessibilityText); - return message; - }; + /** + * Encodes the specified ListSessionEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest} message ListSessionEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from an Image message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Image} message Image - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Image.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.imageUri = ""; - object.accessibilityText = ""; - } - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.accessibilityText != null && message.hasOwnProperty("accessibilityText")) - object.accessibilityText = message.accessibilityText; - return object; - }; + /** + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionEntityTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this Image to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Image - * @instance - * @returns {Object.} JSON object - */ - Image.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return Image; - })(); + /** + * Verifies a ListSessionEntityTypesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionEntityTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; - Message.QuickReplies = (function() { + /** + * Creates a ListSessionEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest + */ + ListSessionEntityTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; - /** - * Properties of a QuickReplies. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IQuickReplies - * @property {string|null} [title] QuickReplies title - * @property {Array.|null} [quickReplies] QuickReplies quickReplies - */ + /** + * Creates a plain object from a ListSessionEntityTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest} message ListSessionEntityTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionEntityTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; - /** - * Constructs a new QuickReplies. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a QuickReplies. - * @implements IQuickReplies - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies=} [properties] Properties to set - */ - function QuickReplies(properties) { - this.quickReplies = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Converts this ListSessionEntityTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListSessionEntityTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * QuickReplies title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies - * @instance - */ - QuickReplies.prototype.title = ""; + return ListSessionEntityTypesRequest; + })(); - /** - * QuickReplies quickReplies. - * @member {Array.} quickReplies - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies - * @instance - */ - QuickReplies.prototype.quickReplies = $util.emptyArray; + v2beta1.ListSessionEntityTypesResponse = (function() { - /** - * Creates a new QuickReplies instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies} QuickReplies instance - */ - QuickReplies.create = function create(properties) { - return new QuickReplies(properties); - }; + /** + * Properties of a ListSessionEntityTypesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListSessionEntityTypesResponse + * @property {Array.|null} [sessionEntityTypes] ListSessionEntityTypesResponse sessionEntityTypes + * @property {string|null} [nextPageToken] ListSessionEntityTypesResponse nextPageToken + */ - /** - * Encodes the specified QuickReplies message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies} message QuickReplies message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuickReplies.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.quickReplies != null && message.quickReplies.length) - for (var i = 0; i < message.quickReplies.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.quickReplies[i]); - return writer; - }; + /** + * Constructs a new ListSessionEntityTypesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListSessionEntityTypesResponse. + * @implements IListSessionEntityTypesResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse=} [properties] Properties to set + */ + function ListSessionEntityTypesResponse(properties) { + this.sessionEntityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified QuickReplies message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IQuickReplies} message QuickReplies message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuickReplies.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ListSessionEntityTypesResponse sessionEntityTypes. + * @member {Array.} sessionEntityTypes + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @instance + */ + ListSessionEntityTypesResponse.prototype.sessionEntityTypes = $util.emptyArray; - /** - * Decodes a QuickReplies message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies} QuickReplies - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuickReplies.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - if (!(message.quickReplies && message.quickReplies.length)) - message.quickReplies = []; - message.quickReplies.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ListSessionEntityTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @instance + */ + ListSessionEntityTypesResponse.prototype.nextPageToken = ""; - /** - * Decodes a QuickReplies message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies} QuickReplies - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuickReplies.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new ListSessionEntityTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse instance + */ + ListSessionEntityTypesResponse.create = function create(properties) { + return new ListSessionEntityTypesResponse(properties); + }; - /** - * Verifies a QuickReplies message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuickReplies.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.quickReplies != null && message.hasOwnProperty("quickReplies")) { - if (!Array.isArray(message.quickReplies)) - return "quickReplies: array expected"; - for (var i = 0; i < message.quickReplies.length; ++i) - if (!$util.isString(message.quickReplies[i])) - return "quickReplies: string[] expected"; - } - return null; - }; + /** + * Encodes the specified ListSessionEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse} message ListSessionEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionEntityTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) + for (var i = 0; i < message.sessionEntityTypes.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SessionEntityType.encode(message.sessionEntityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; - /** - * Creates a QuickReplies message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies} QuickReplies - */ - QuickReplies.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies(); - if (object.title != null) - message.title = String(object.title); - if (object.quickReplies) { - if (!Array.isArray(object.quickReplies)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies.quickReplies: array expected"); - message.quickReplies = []; - for (var i = 0; i < object.quickReplies.length; ++i) - message.quickReplies[i] = String(object.quickReplies[i]); - } - return message; - }; + /** + * Encodes the specified ListSessionEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse} message ListSessionEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListSessionEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionEntityTypesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) + message.sessionEntityTypes = []; + message.sessionEntityTypes.push($root.google.cloud.dialogflow.v2beta1.SessionEntityType.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a plain object from a QuickReplies message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies} message QuickReplies - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuickReplies.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.quickReplies = []; - if (options.defaults) - object.title = ""; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.quickReplies && message.quickReplies.length) { - object.quickReplies = []; - for (var j = 0; j < message.quickReplies.length; ++j) - object.quickReplies[j] = message.quickReplies[j]; - } - return object; - }; + /** + * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListSessionEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Converts this QuickReplies to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.QuickReplies - * @instance - * @returns {Object.} JSON object - */ - QuickReplies.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Verifies a ListSessionEntityTypesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListSessionEntityTypesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { + if (!Array.isArray(message.sessionEntityTypes)) + return "sessionEntityTypes: array expected"; + for (var i = 0; i < message.sessionEntityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.verify(message.sessionEntityTypes[i]); + if (error) + return "sessionEntityTypes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - return QuickReplies; - })(); + /** + * Creates a ListSessionEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse + */ + ListSessionEntityTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse(); + if (object.sessionEntityTypes) { + if (!Array.isArray(object.sessionEntityTypes)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse.sessionEntityTypes: array expected"); + message.sessionEntityTypes = []; + for (var i = 0; i < object.sessionEntityTypes.length; ++i) { + if (typeof object.sessionEntityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse.sessionEntityTypes: object expected"); + message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.fromObject(object.sessionEntityTypes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - Message.Card = (function() { + /** + * Creates a plain object from a ListSessionEntityTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse} message ListSessionEntityTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListSessionEntityTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.sessionEntityTypes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.sessionEntityTypes && message.sessionEntityTypes.length) { + object.sessionEntityTypes = []; + for (var j = 0; j < message.sessionEntityTypes.length; ++j) + object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.toObject(message.sessionEntityTypes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * Properties of a Card. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ICard - * @property {string|null} [title] Card title - * @property {string|null} [subtitle] Card subtitle - * @property {string|null} [imageUri] Card imageUri - * @property {Array.|null} [buttons] Card buttons - */ + /** + * Converts this ListSessionEntityTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ListSessionEntityTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new Card. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a Card. - * @implements ICard - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICard=} [properties] Properties to set - */ - function Card(properties) { - this.buttons = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return ListSessionEntityTypesResponse; + })(); - /** - * Card title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @instance - */ - Card.prototype.title = ""; + v2beta1.GetSessionEntityTypeRequest = (function() { - /** - * Card subtitle. - * @member {string} subtitle - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @instance - */ - Card.prototype.subtitle = ""; + /** + * Properties of a GetSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IGetSessionEntityTypeRequest + * @property {string|null} [name] GetSessionEntityTypeRequest name + */ - /** - * Card imageUri. - * @member {string} imageUri - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @instance - */ - Card.prototype.imageUri = ""; + /** + * Constructs a new GetSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a GetSessionEntityTypeRequest. + * @implements IGetSessionEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest=} [properties] Properties to set + */ + function GetSessionEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Card buttons. - * @member {Array.} buttons - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @instance - */ - Card.prototype.buttons = $util.emptyArray; + /** + * GetSessionEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @instance + */ + GetSessionEntityTypeRequest.prototype.name = ""; - /** - * Creates a new Card instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICard=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card} Card instance - */ - Card.create = function create(properties) { - return new Card(properties); - }; + /** + * Creates a new GetSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest instance + */ + GetSessionEntityTypeRequest.create = function create(properties) { + return new GetSessionEntityTypeRequest(properties); + }; - /** - * Encodes the specified Card message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICard} message Card message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Card.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); - if (message.imageUri != null && Object.hasOwnProperty.call(message, "imageUri")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.imageUri); - if (message.buttons != null && message.buttons.length) - for (var i = 0; i < message.buttons.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.encode(message.buttons[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Encodes the specified GetSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest} message GetSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * Encodes the specified Card message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICard} message Card message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Card.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified GetSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest} message GetSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Card message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card} Card - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Card.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.subtitle = reader.string(); - break; - case 3: - message.imageUri = reader.string(); - break; - case 4: - if (!(message.buttons && message.buttons.length)) - message.buttons = []; - message.buttons.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionEntityTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a Card message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card} Card - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Card.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a Card message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Card.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - if (!$util.isString(message.subtitle)) - return "subtitle: string expected"; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - if (!$util.isString(message.imageUri)) - return "imageUri: string expected"; - if (message.buttons != null && message.hasOwnProperty("buttons")) { - if (!Array.isArray(message.buttons)) - return "buttons: array expected"; - for (var i = 0; i < message.buttons.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.verify(message.buttons[i]); - if (error) - return "buttons." + error; - } - } - return null; - }; + /** + * Verifies a GetSessionEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetSessionEntityTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Creates a Card message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card} Card - */ - Card.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card(); - if (object.title != null) - message.title = String(object.title); - if (object.subtitle != null) - message.subtitle = String(object.subtitle); - if (object.imageUri != null) - message.imageUri = String(object.imageUri); - if (object.buttons) { - if (!Array.isArray(object.buttons)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.Card.buttons: array expected"); - message.buttons = []; - for (var i = 0; i < object.buttons.length; ++i) { - if (typeof object.buttons[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.Card.buttons: object expected"); - message.buttons[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.fromObject(object.buttons[i]); - } - } - return message; - }; + /** + * Creates a GetSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest + */ + GetSessionEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetSessionEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest} message GetSessionEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetSessionEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Creates a plain object from a Card message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Card} message Card - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Card.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.buttons = []; - if (options.defaults) { - object.title = ""; - object.subtitle = ""; - object.imageUri = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - object.subtitle = message.subtitle; - if (message.imageUri != null && message.hasOwnProperty("imageUri")) - object.imageUri = message.imageUri; - if (message.buttons && message.buttons.length) { - object.buttons = []; - for (var j = 0; j < message.buttons.length; ++j) - object.buttons[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.toObject(message.buttons[j], options); - } - return object; - }; + /** + * Converts this GetSessionEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this Card to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @instance - * @returns {Object.} JSON object - */ - Card.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return GetSessionEntityTypeRequest; + })(); - Card.Button = (function() { + v2beta1.CreateSessionEntityTypeRequest = (function() { - /** - * Properties of a Button. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @interface IButton - * @property {string|null} [text] Button text - * @property {string|null} [postback] Button postback - */ + /** + * Properties of a CreateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ICreateSessionEntityTypeRequest + * @property {string|null} [parent] CreateSessionEntityTypeRequest parent + * @property {google.cloud.dialogflow.v2beta1.ISessionEntityType|null} [sessionEntityType] CreateSessionEntityTypeRequest sessionEntityType + */ - /** - * Constructs a new Button. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card - * @classdesc Represents a Button. - * @implements IButton - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton=} [properties] Properties to set - */ - function Button(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new CreateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a CreateSessionEntityTypeRequest. + * @implements ICreateSessionEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest=} [properties] Properties to set + */ + function CreateSessionEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Button text. - * @member {string} text - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button - * @instance - */ - Button.prototype.text = ""; + /** + * CreateSessionEntityTypeRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @instance + */ + CreateSessionEntityTypeRequest.prototype.parent = ""; - /** - * Button postback. - * @member {string} postback - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button - * @instance - */ - Button.prototype.postback = ""; + /** + * CreateSessionEntityTypeRequest sessionEntityType. + * @member {google.cloud.dialogflow.v2beta1.ISessionEntityType|null|undefined} sessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @instance + */ + CreateSessionEntityTypeRequest.prototype.sessionEntityType = null; - /** - * Creates a new Button instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button} Button instance - */ - Button.create = function create(properties) { - return new Button(properties); - }; + /** + * Creates a new CreateSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest instance + */ + CreateSessionEntityTypeRequest.create = function create(properties) { + return new CreateSessionEntityTypeRequest(properties); + }; - /** - * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton} message Button message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Button.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.postback != null && Object.hasOwnProperty.call(message, "postback")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.postback); - return writer; - }; + /** + * Encodes the specified CreateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.sessionEntityType != null && Object.hasOwnProperty.call(message, "sessionEntityType")) + $root.google.cloud.dialogflow.v2beta1.SessionEntityType.encode(message.sessionEntityType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Card.IButton} message Button message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Button.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified CreateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Button message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button} Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Button.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = reader.string(); - break; - case 2: - message.postback = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionEntityTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.sessionEntityType = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a Button message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button} Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Button.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a Button message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Button.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.postback != null && message.hasOwnProperty("postback")) - if (!$util.isString(message.postback)) - return "postback: string expected"; - return null; - }; + /** + * Verifies a CreateSessionEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateSessionEntityTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) { + var error = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.verify(message.sessionEntityType); + if (error) + return "sessionEntityType." + error; + } + return null; + }; - /** - * Creates a Button message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button} Button - */ - Button.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button(); - if (object.text != null) - message.text = String(object.text); - if (object.postback != null) - message.postback = String(object.postback); - return message; - }; + /** + * Creates a CreateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest + */ + CreateSessionEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.sessionEntityType != null) { + if (typeof object.sessionEntityType !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest.sessionEntityType: object expected"); + message.sessionEntityType = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.fromObject(object.sessionEntityType); + } + return message; + }; - /** - * Creates a plain object from a Button message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button} message Button - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Button.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.postback = ""; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.postback != null && message.hasOwnProperty("postback")) - object.postback = message.postback; - return object; - }; + /** + * Creates a plain object from a CreateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateSessionEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.sessionEntityType = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) + object.sessionEntityType = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.toObject(message.sessionEntityType, options); + return object; + }; - /** - * Converts this Button to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Card.Button - * @instance - * @returns {Object.} JSON object - */ - Button.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this CreateSessionEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + CreateSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Button; - })(); + return CreateSessionEntityTypeRequest; + })(); - return Card; - })(); + v2beta1.UpdateSessionEntityTypeRequest = (function() { - Message.SimpleResponse = (function() { + /** + * Properties of an UpdateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IUpdateSessionEntityTypeRequest + * @property {google.cloud.dialogflow.v2beta1.ISessionEntityType|null} [sessionEntityType] UpdateSessionEntityTypeRequest sessionEntityType + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSessionEntityTypeRequest updateMask + */ - /** - * Properties of a SimpleResponse. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ISimpleResponse - * @property {string|null} [textToSpeech] SimpleResponse textToSpeech - * @property {string|null} [ssml] SimpleResponse ssml - * @property {string|null} [displayText] SimpleResponse displayText - */ + /** + * Constructs a new UpdateSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an UpdateSessionEntityTypeRequest. + * @implements IUpdateSessionEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest=} [properties] Properties to set + */ + function UpdateSessionEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new SimpleResponse. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a SimpleResponse. - * @implements ISimpleResponse - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse=} [properties] Properties to set - */ - function SimpleResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * UpdateSessionEntityTypeRequest sessionEntityType. + * @member {google.cloud.dialogflow.v2beta1.ISessionEntityType|null|undefined} sessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @instance + */ + UpdateSessionEntityTypeRequest.prototype.sessionEntityType = null; - /** - * SimpleResponse textToSpeech. - * @member {string} textToSpeech - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse - * @instance - */ - SimpleResponse.prototype.textToSpeech = ""; + /** + * UpdateSessionEntityTypeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @instance + */ + UpdateSessionEntityTypeRequest.prototype.updateMask = null; - /** - * SimpleResponse ssml. - * @member {string} ssml - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse - * @instance - */ - SimpleResponse.prototype.ssml = ""; + /** + * Creates a new UpdateSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest instance + */ + UpdateSessionEntityTypeRequest.create = function create(properties) { + return new UpdateSessionEntityTypeRequest(properties); + }; - /** - * SimpleResponse displayText. - * @member {string} displayText - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse - * @instance - */ - SimpleResponse.prototype.displayText = ""; + /** + * Encodes the specified UpdateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSessionEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sessionEntityType != null && Object.hasOwnProperty.call(message, "sessionEntityType")) + $root.google.cloud.dialogflow.v2beta1.SessionEntityType.encode(message.sessionEntityType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - /** - * Creates a new SimpleResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse} SimpleResponse instance - */ - SimpleResponse.create = function create(properties) { - return new SimpleResponse(properties); - }; + /** + * Encodes the specified UpdateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified SimpleResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse} message SimpleResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.textToSpeech != null && Object.hasOwnProperty.call(message, "textToSpeech")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.textToSpeech); - if (message.ssml != null && Object.hasOwnProperty.call(message, "ssml")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ssml); - if (message.displayText != null && Object.hasOwnProperty.call(message, "displayText")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.displayText); - return writer; - }; + /** + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSessionEntityTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sessionEntityType = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified SimpleResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponse} message SimpleResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a SimpleResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse} SimpleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.textToSpeech = reader.string(); - break; - case 2: - message.ssml = reader.string(); - break; - case 3: - message.displayText = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies an UpdateSessionEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateSessionEntityTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) { + var error = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.verify(message.sessionEntityType); + if (error) + return "sessionEntityType." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; - /** - * Decodes a SimpleResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse} SimpleResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates an UpdateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest + */ + UpdateSessionEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest(); + if (object.sessionEntityType != null) { + if (typeof object.sessionEntityType !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest.sessionEntityType: object expected"); + message.sessionEntityType = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.fromObject(object.sessionEntityType); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; - /** - * Verifies a SimpleResponse message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SimpleResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.textToSpeech != null && message.hasOwnProperty("textToSpeech")) - if (!$util.isString(message.textToSpeech)) - return "textToSpeech: string expected"; - if (message.ssml != null && message.hasOwnProperty("ssml")) - if (!$util.isString(message.ssml)) - return "ssml: string expected"; - if (message.displayText != null && message.hasOwnProperty("displayText")) - if (!$util.isString(message.displayText)) - return "displayText: string expected"; - return null; - }; + /** + * Creates a plain object from an UpdateSessionEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateSessionEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.sessionEntityType = null; + object.updateMask = null; + } + if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) + object.sessionEntityType = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.toObject(message.sessionEntityType, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; - /** - * Creates a SimpleResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse} SimpleResponse - */ - SimpleResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse(); - if (object.textToSpeech != null) - message.textToSpeech = String(object.textToSpeech); - if (object.ssml != null) - message.ssml = String(object.ssml); - if (object.displayText != null) - message.displayText = String(object.displayText); - return message; - }; + /** + * Converts this UpdateSessionEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a SimpleResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse} message SimpleResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SimpleResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.textToSpeech = ""; - object.ssml = ""; - object.displayText = ""; - } - if (message.textToSpeech != null && message.hasOwnProperty("textToSpeech")) - object.textToSpeech = message.textToSpeech; - if (message.ssml != null && message.hasOwnProperty("ssml")) - object.ssml = message.ssml; - if (message.displayText != null && message.hasOwnProperty("displayText")) - object.displayText = message.displayText; - return object; - }; + return UpdateSessionEntityTypeRequest; + })(); - /** - * Converts this SimpleResponse to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse - * @instance - * @returns {Object.} JSON object - */ - SimpleResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + v2beta1.DeleteSessionEntityTypeRequest = (function() { - return SimpleResponse; - })(); + /** + * Properties of a DeleteSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IDeleteSessionEntityTypeRequest + * @property {string|null} [name] DeleteSessionEntityTypeRequest name + */ - Message.SimpleResponses = (function() { + /** + * Constructs a new DeleteSessionEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a DeleteSessionEntityTypeRequest. + * @implements IDeleteSessionEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest=} [properties] Properties to set + */ + function DeleteSessionEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a SimpleResponses. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ISimpleResponses - * @property {Array.|null} [simpleResponses] SimpleResponses simpleResponses - */ + /** + * DeleteSessionEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @instance + */ + DeleteSessionEntityTypeRequest.prototype.name = ""; - /** - * Constructs a new SimpleResponses. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a SimpleResponses. - * @implements ISimpleResponses - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses=} [properties] Properties to set - */ - function SimpleResponses(properties) { - this.simpleResponses = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a new DeleteSessionEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest instance + */ + DeleteSessionEntityTypeRequest.create = function create(properties) { + return new DeleteSessionEntityTypeRequest(properties); + }; - /** - * SimpleResponses simpleResponses. - * @member {Array.} simpleResponses - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses - * @instance - */ - SimpleResponses.prototype.simpleResponses = $util.emptyArray; + /** + * Encodes the specified DeleteSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * Creates a new SimpleResponses instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses} SimpleResponses instance - */ - SimpleResponses.create = function create(properties) { - return new SimpleResponses(properties); - }; + /** + * Encodes the specified DeleteSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified SimpleResponses message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses} message SimpleResponses message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleResponses.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.simpleResponses != null && message.simpleResponses.length) - for (var i = 0; i < message.simpleResponses.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.encode(message.simpleResponses[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionEntityTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified SimpleResponses message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISimpleResponses} message SimpleResponses message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SimpleResponses.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a SimpleResponses message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses} SimpleResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleResponses.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.simpleResponses && message.simpleResponses.length)) - message.simpleResponses = []; - message.simpleResponses.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a DeleteSessionEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteSessionEntityTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Decodes a SimpleResponses message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses} SimpleResponses - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SimpleResponses.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a DeleteSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest + */ + DeleteSessionEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Verifies a SimpleResponses message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SimpleResponses.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.simpleResponses != null && message.hasOwnProperty("simpleResponses")) { - if (!Array.isArray(message.simpleResponses)) - return "simpleResponses: array expected"; - for (var i = 0; i < message.simpleResponses.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.verify(message.simpleResponses[i]); - if (error) - return "simpleResponses." + error; - } - } - return null; - }; + /** + * Creates a plain object from a DeleteSessionEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteSessionEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Creates a SimpleResponses message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses} SimpleResponses - */ - SimpleResponses.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses(); - if (object.simpleResponses) { - if (!Array.isArray(object.simpleResponses)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.simpleResponses: array expected"); - message.simpleResponses = []; - for (var i = 0; i < object.simpleResponses.length; ++i) { - if (typeof object.simpleResponses[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses.simpleResponses: object expected"); - message.simpleResponses[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.fromObject(object.simpleResponses[i]); - } - } - return message; - }; + /** + * Converts this DeleteSessionEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a SimpleResponses message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses} message SimpleResponses - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SimpleResponses.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.simpleResponses = []; - if (message.simpleResponses && message.simpleResponses.length) { - object.simpleResponses = []; - for (var j = 0; j < message.simpleResponses.length; ++j) - object.simpleResponses[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponse.toObject(message.simpleResponses[j], options); - } - return object; - }; + return DeleteSessionEntityTypeRequest; + })(); - /** - * Converts this SimpleResponses to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SimpleResponses - * @instance - * @returns {Object.} JSON object - */ - SimpleResponses.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + v2beta1.EntityTypes = (function() { - return SimpleResponses; - })(); + /** + * Constructs a new EntityTypes service. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an EntityTypes + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function EntityTypes(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - Message.BasicCard = (function() { + (EntityTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = EntityTypes; - /** - * Properties of a BasicCard. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IBasicCard - * @property {string|null} [title] BasicCard title - * @property {string|null} [subtitle] BasicCard subtitle - * @property {string|null} [formattedText] BasicCard formattedText - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [image] BasicCard image - * @property {Array.|null} [buttons] BasicCard buttons - */ + /** + * Creates new EntityTypes service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {EntityTypes} RPC service. Useful where requests and/or responses are streamed. + */ + EntityTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Constructs a new BasicCard. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a BasicCard. - * @implements IBasicCard - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard=} [properties] Properties to set - */ - function BasicCard(properties) { - this.buttons = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#listEntityTypes}. + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @typedef ListEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListEntityTypesResponse} [response] ListEntityTypesResponse + */ - /** - * BasicCard title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @instance - */ - BasicCard.prototype.title = ""; + /** + * Calls ListEntityTypes. + * @function listEntityTypes + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesRequest} request ListEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.EntityTypes.ListEntityTypesCallback} callback Node-style callback called with the error, if any, and ListEntityTypesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.listEntityTypes = function listEntityTypes(request, callback) { + return this.rpcCall(listEntityTypes, $root.google.cloud.dialogflow.v2beta1.ListEntityTypesRequest, $root.google.cloud.dialogflow.v2beta1.ListEntityTypesResponse, request, callback); + }, "name", { value: "ListEntityTypes" }); - /** - * BasicCard subtitle. - * @member {string} subtitle - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @instance - */ - BasicCard.prototype.subtitle = ""; + /** + * Calls ListEntityTypes. + * @function listEntityTypes + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesRequest} request ListEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * BasicCard formattedText. - * @member {string} formattedText - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @instance - */ - BasicCard.prototype.formattedText = ""; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#getEntityType}. + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @typedef GetEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.EntityType} [response] EntityType + */ - /** - * BasicCard image. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} image - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @instance - */ - BasicCard.prototype.image = null; + /** + * Calls GetEntityType. + * @function getEntityType + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest} request GetEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.EntityTypes.GetEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.getEntityType = function getEntityType(request, callback) { + return this.rpcCall(getEntityType, $root.google.cloud.dialogflow.v2beta1.GetEntityTypeRequest, $root.google.cloud.dialogflow.v2beta1.EntityType, request, callback); + }, "name", { value: "GetEntityType" }); - /** - * BasicCard buttons. - * @member {Array.} buttons - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @instance - */ - BasicCard.prototype.buttons = $util.emptyArray; + /** + * Calls GetEntityType. + * @function getEntityType + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest} request GetEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a new BasicCard instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard} BasicCard instance - */ - BasicCard.create = function create(properties) { - return new BasicCard(properties); - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#createEntityType}. + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @typedef CreateEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.EntityType} [response] EntityType + */ - /** - * Encodes the specified BasicCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard} message BasicCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BasicCard.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); - if (message.formattedText != null && Object.hasOwnProperty.call(message, "formattedText")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.formattedText); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.buttons != null && message.buttons.length) - for (var i = 0; i < message.buttons.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.encode(message.buttons[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; + /** + * Calls CreateEntityType. + * @function createEntityType + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest} request CreateEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.EntityTypes.CreateEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.createEntityType = function createEntityType(request, callback) { + return this.rpcCall(createEntityType, $root.google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest, $root.google.cloud.dialogflow.v2beta1.EntityType, request, callback); + }, "name", { value: "CreateEntityType" }); - /** - * Encodes the specified BasicCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBasicCard} message BasicCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BasicCard.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls CreateEntityType. + * @function createEntityType + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest} request CreateEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a BasicCard message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard} BasicCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BasicCard.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.subtitle = reader.string(); - break; - case 3: - message.formattedText = reader.string(); - break; - case 4: - message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); - break; - case 5: - if (!(message.buttons && message.buttons.length)) - message.buttons = []; - message.buttons.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#updateEntityType}. + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @typedef UpdateEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.EntityType} [response] EntityType + */ + + /** + * Calls UpdateEntityType. + * @function updateEntityType + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest} request UpdateEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.EntityTypes.UpdateEntityTypeCallback} callback Node-style callback called with the error, if any, and EntityType + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.updateEntityType = function updateEntityType(request, callback) { + return this.rpcCall(updateEntityType, $root.google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest, $root.google.cloud.dialogflow.v2beta1.EntityType, request, callback); + }, "name", { value: "UpdateEntityType" }); - /** - * Decodes a BasicCard message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard} BasicCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BasicCard.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls UpdateEntityType. + * @function updateEntityType + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest} request UpdateEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Verifies a BasicCard message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BasicCard.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - if (!$util.isString(message.subtitle)) - return "subtitle: string expected"; - if (message.formattedText != null && message.hasOwnProperty("formattedText")) - if (!$util.isString(message.formattedText)) - return "formattedText: string expected"; - if (message.image != null && message.hasOwnProperty("image")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.image); - if (error) - return "image." + error; - } - if (message.buttons != null && message.hasOwnProperty("buttons")) { - if (!Array.isArray(message.buttons)) - return "buttons: array expected"; - for (var i = 0; i < message.buttons.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.verify(message.buttons[i]); - if (error) - return "buttons." + error; - } - } - return null; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#deleteEntityType}. + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @typedef DeleteEntityTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * Creates a BasicCard message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard} BasicCard - */ - BasicCard.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard(); - if (object.title != null) - message.title = String(object.title); - if (object.subtitle != null) - message.subtitle = String(object.subtitle); - if (object.formattedText != null) - message.formattedText = String(object.formattedText); - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.image: object expected"); - message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.image); - } - if (object.buttons) { - if (!Array.isArray(object.buttons)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.buttons: array expected"); - message.buttons = []; - for (var i = 0; i < object.buttons.length; ++i) { - if (typeof object.buttons[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.buttons: object expected"); - message.buttons[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.fromObject(object.buttons[i]); - } - } - return message; - }; + /** + * Calls DeleteEntityType. + * @function deleteEntityType + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest} request DeleteEntityTypeRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.EntityTypes.DeleteEntityTypeCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.deleteEntityType = function deleteEntityType(request, callback) { + return this.rpcCall(deleteEntityType, $root.google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteEntityType" }); - /** - * Creates a plain object from a BasicCard message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard} message BasicCard - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BasicCard.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.buttons = []; - if (options.defaults) { - object.title = ""; - object.subtitle = ""; - object.formattedText = ""; - object.image = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - object.subtitle = message.subtitle; - if (message.formattedText != null && message.hasOwnProperty("formattedText")) - object.formattedText = message.formattedText; - if (message.image != null && message.hasOwnProperty("image")) - object.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.image, options); - if (message.buttons && message.buttons.length) { - object.buttons = []; - for (var j = 0; j < message.buttons.length; ++j) - object.buttons[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.toObject(message.buttons[j], options); - } - return object; - }; + /** + * Calls DeleteEntityType. + * @function deleteEntityType + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest} request DeleteEntityTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Converts this BasicCard to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @instance - * @returns {Object.} JSON object - */ - BasicCard.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchUpdateEntityTypes}. + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @typedef BatchUpdateEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - BasicCard.Button = (function() { + /** + * Calls BatchUpdateEntityTypes. + * @function batchUpdateEntityTypes + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest} request BatchUpdateEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.EntityTypes.BatchUpdateEntityTypesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.batchUpdateEntityTypes = function batchUpdateEntityTypes(request, callback) { + return this.rpcCall(batchUpdateEntityTypes, $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchUpdateEntityTypes" }); - /** - * Properties of a Button. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @interface IButton - * @property {string|null} [title] Button title - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction|null} [openUriAction] Button openUriAction - */ + /** + * Calls BatchUpdateEntityTypes. + * @function batchUpdateEntityTypes + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest} request BatchUpdateEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Constructs a new Button. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard - * @classdesc Represents a Button. - * @implements IButton - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton=} [properties] Properties to set - */ - function Button(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchDeleteEntityTypes}. + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @typedef BatchDeleteEntityTypesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Button title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @instance - */ - Button.prototype.title = ""; + /** + * Calls BatchDeleteEntityTypes. + * @function batchDeleteEntityTypes + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest} request BatchDeleteEntityTypesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntityTypesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.batchDeleteEntityTypes = function batchDeleteEntityTypes(request, callback) { + return this.rpcCall(batchDeleteEntityTypes, $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchDeleteEntityTypes" }); - /** - * Button openUriAction. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction|null|undefined} openUriAction - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @instance - */ - Button.prototype.openUriAction = null; + /** + * Calls BatchDeleteEntityTypes. + * @function batchDeleteEntityTypes + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest} request BatchDeleteEntityTypesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a new Button instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button} Button instance - */ - Button.create = function create(properties) { - return new Button(properties); - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchCreateEntities}. + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @typedef BatchCreateEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Encodes the specified Button message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton} message Button message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Button.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.openUriAction != null && Object.hasOwnProperty.call(message, "openUriAction")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.encode(message.openUriAction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Calls BatchCreateEntities. + * @function batchCreateEntities + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest} request BatchCreateEntitiesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.EntityTypes.BatchCreateEntitiesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.batchCreateEntities = function batchCreateEntities(request, callback) { + return this.rpcCall(batchCreateEntities, $root.google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchCreateEntities" }); - /** - * Encodes the specified Button message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.IButton} message Button message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Button.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls BatchCreateEntities. + * @function batchCreateEntities + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest} request BatchCreateEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a Button message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button} Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Button.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.openUriAction = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchUpdateEntities}. + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @typedef BatchUpdateEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Decodes a Button message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button} Button - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Button.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls BatchUpdateEntities. + * @function batchUpdateEntities + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest} request BatchUpdateEntitiesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.EntityTypes.BatchUpdateEntitiesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.batchUpdateEntities = function batchUpdateEntities(request, callback) { + return this.rpcCall(batchUpdateEntities, $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchUpdateEntities" }); - /** - * Verifies a Button message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Button.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.verify(message.openUriAction); - if (error) - return "openUriAction." + error; - } - return null; - }; + /** + * Calls BatchUpdateEntities. + * @function batchUpdateEntities + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest} request BatchUpdateEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a Button message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button} Button - */ - Button.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button(); - if (object.title != null) - message.title = String(object.title); - if (object.openUriAction != null) { - if (typeof object.openUriAction !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.openUriAction: object expected"); - message.openUriAction = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.fromObject(object.openUriAction); - } - return message; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.EntityTypes#batchDeleteEntities}. + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @typedef BatchDeleteEntitiesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ - /** - * Creates a plain object from a Button message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button} message Button - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Button.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.title = ""; - object.openUriAction = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) - object.openUriAction = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.toObject(message.openUriAction, options); - return object; - }; + /** + * Calls BatchDeleteEntities. + * @function batchDeleteEntities + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest} request BatchDeleteEntitiesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.EntityTypes.BatchDeleteEntitiesCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(EntityTypes.prototype.batchDeleteEntities = function batchDeleteEntities(request, callback) { + return this.rpcCall(batchDeleteEntities, $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "BatchDeleteEntities" }); + + /** + * Calls BatchDeleteEntities. + * @function batchDeleteEntities + * @memberof google.cloud.dialogflow.v2beta1.EntityTypes + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest} request BatchDeleteEntitiesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Converts this Button to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @instance - * @returns {Object.} JSON object - */ - Button.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return EntityTypes; + })(); - Button.OpenUriAction = (function() { + v2beta1.EntityType = (function() { - /** - * Properties of an OpenUriAction. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @interface IOpenUriAction - * @property {string|null} [uri] OpenUriAction uri - */ + /** + * Properties of an EntityType. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IEntityType + * @property {string|null} [name] EntityType name + * @property {string|null} [displayName] EntityType displayName + * @property {google.cloud.dialogflow.v2beta1.EntityType.Kind|null} [kind] EntityType kind + * @property {google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode|null} [autoExpansionMode] EntityType autoExpansionMode + * @property {Array.|null} [entities] EntityType entities + * @property {boolean|null} [enableFuzzyExtraction] EntityType enableFuzzyExtraction + */ - /** - * Constructs a new OpenUriAction. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button - * @classdesc Represents an OpenUriAction. - * @implements IOpenUriAction - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction=} [properties] Properties to set - */ - function OpenUriAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new EntityType. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an EntityType. + * @implements IEntityType + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IEntityType=} [properties] Properties to set + */ + function EntityType(properties) { + this.entities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * OpenUriAction uri. - * @member {string} uri - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction - * @instance - */ - OpenUriAction.prototype.uri = ""; + /** + * EntityType name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @instance + */ + EntityType.prototype.name = ""; - /** - * Creates a new OpenUriAction instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction instance - */ - OpenUriAction.create = function create(properties) { - return new OpenUriAction(properties); - }; + /** + * EntityType displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @instance + */ + EntityType.prototype.displayName = ""; - /** - * Encodes the specified OpenUriAction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction} message OpenUriAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenUriAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - return writer; - }; + /** + * EntityType kind. + * @member {google.cloud.dialogflow.v2beta1.EntityType.Kind} kind + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @instance + */ + EntityType.prototype.kind = 0; - /** - * Encodes the specified OpenUriAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.IOpenUriAction} message OpenUriAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenUriAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * EntityType autoExpansionMode. + * @member {google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode} autoExpansionMode + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @instance + */ + EntityType.prototype.autoExpansionMode = 0; - /** - * Decodes an OpenUriAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenUriAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.uri = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * EntityType entities. + * @member {Array.} entities + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @instance + */ + EntityType.prototype.entities = $util.emptyArray; - /** - * Decodes an OpenUriAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenUriAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * EntityType enableFuzzyExtraction. + * @member {boolean} enableFuzzyExtraction + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @instance + */ + EntityType.prototype.enableFuzzyExtraction = false; - /** - * Verifies an OpenUriAction message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OpenUriAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; + /** + * Creates a new EntityType instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @static + * @param {google.cloud.dialogflow.v2beta1.IEntityType=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.EntityType} EntityType instance + */ + EntityType.create = function create(properties) { + return new EntityType(properties); + }; - /** - * Creates an OpenUriAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction} OpenUriAction - */ - OpenUriAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction(); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; + /** + * Encodes the specified EntityType message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @static + * @param {google.cloud.dialogflow.v2beta1.IEntityType} message EntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityType.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.kind); + if (message.autoExpansionMode != null && Object.hasOwnProperty.call(message, "autoExpansionMode")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.autoExpansionMode); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.enableFuzzyExtraction != null && Object.hasOwnProperty.call(message, "enableFuzzyExtraction")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.enableFuzzyExtraction); + return writer; + }; - /** - * Creates a plain object from an OpenUriAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction} message OpenUriAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OpenUriAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.uri = ""; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; + /** + * Encodes the specified EntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @static + * @param {google.cloud.dialogflow.v2beta1.IEntityType} message EntityType message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityType.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Converts this OpenUriAction to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.OpenUriAction - * @instance - * @returns {Object.} JSON object - */ - OpenUriAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes an EntityType message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.EntityType} EntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityType.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.EntityType(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.displayName = reader.string(); + break; + case 3: + message.kind = reader.int32(); + break; + case 4: + message.autoExpansionMode = reader.int32(); + break; + case 6: + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dialogflow.v2beta1.EntityType.Entity.decode(reader, reader.uint32())); + break; + case 7: + message.enableFuzzyExtraction = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return OpenUriAction; - })(); + /** + * Decodes an EntityType message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.EntityType} EntityType + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityType.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EntityType message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityType.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.kind != null && message.hasOwnProperty("kind")) + switch (message.kind) { + default: + return "kind: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.autoExpansionMode != null && message.hasOwnProperty("autoExpansionMode")) + switch (message.autoExpansionMode) { + default: + return "autoExpansionMode: enum value expected"; + case 0: + case 1: + break; + } + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.enableFuzzyExtraction != null && message.hasOwnProperty("enableFuzzyExtraction")) + if (typeof message.enableFuzzyExtraction !== "boolean") + return "enableFuzzyExtraction: boolean expected"; + return null; + }; + + /** + * Creates an EntityType message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.EntityType} EntityType + */ + EntityType.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.EntityType) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.EntityType(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + switch (object.kind) { + case "KIND_UNSPECIFIED": + case 0: + message.kind = 0; + break; + case "KIND_MAP": + case 1: + message.kind = 1; + break; + case "KIND_LIST": + case 2: + message.kind = 2; + break; + case "KIND_REGEXP": + case 3: + message.kind = 3; + break; + } + switch (object.autoExpansionMode) { + case "AUTO_EXPANSION_MODE_UNSPECIFIED": + case 0: + message.autoExpansionMode = 0; + break; + case "AUTO_EXPANSION_MODE_DEFAULT": + case 1: + message.autoExpansionMode = 1; + break; + } + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dialogflow.v2beta1.EntityType.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.EntityType.entities: object expected"); + message.entities[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.fromObject(object.entities[i]); + } + } + if (object.enableFuzzyExtraction != null) + message.enableFuzzyExtraction = Boolean(object.enableFuzzyExtraction); + return message; + }; + + /** + * Creates a plain object from an EntityType message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @static + * @param {google.cloud.dialogflow.v2beta1.EntityType} message EntityType + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityType.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.kind = options.enums === String ? "KIND_UNSPECIFIED" : 0; + object.autoExpansionMode = options.enums === String ? "AUTO_EXPANSION_MODE_UNSPECIFIED" : 0; + object.enableFuzzyExtraction = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.kind != null && message.hasOwnProperty("kind")) + object.kind = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.EntityType.Kind[message.kind] : message.kind; + if (message.autoExpansionMode != null && message.hasOwnProperty("autoExpansionMode")) + object.autoExpansionMode = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode[message.autoExpansionMode] : message.autoExpansionMode; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.toObject(message.entities[j], options); + } + if (message.enableFuzzyExtraction != null && message.hasOwnProperty("enableFuzzyExtraction")) + object.enableFuzzyExtraction = message.enableFuzzyExtraction; + return object; + }; - return Button; - })(); + /** + * Converts this EntityType to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @instance + * @returns {Object.} JSON object + */ + EntityType.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return BasicCard; - })(); + EntityType.Entity = (function() { - Message.Suggestion = (function() { + /** + * Properties of an Entity. + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @interface IEntity + * @property {string|null} [value] Entity value + * @property {Array.|null} [synonyms] Entity synonyms + */ - /** - * Properties of a Suggestion. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ISuggestion - * @property {string|null} [title] Suggestion title - */ + /** + * Constructs a new Entity. + * @memberof google.cloud.dialogflow.v2beta1.EntityType + * @classdesc Represents an Entity. + * @implements IEntity + * @constructor + * @param {google.cloud.dialogflow.v2beta1.EntityType.IEntity=} [properties] Properties to set + */ + function Entity(properties) { + this.synonyms = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new Suggestion. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a Suggestion. - * @implements ISuggestion - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion=} [properties] Properties to set - */ - function Suggestion(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Entity value. + * @member {string} value + * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity + * @instance + */ + Entity.prototype.value = ""; - /** - * Suggestion title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion - * @instance - */ - Suggestion.prototype.title = ""; + /** + * Entity synonyms. + * @member {Array.} synonyms + * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity + * @instance + */ + Entity.prototype.synonyms = $util.emptyArray; - /** - * Creates a new Suggestion instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion} Suggestion instance - */ - Suggestion.create = function create(properties) { - return new Suggestion(properties); - }; + /** + * Creates a new Entity instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.v2beta1.EntityType.IEntity=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.EntityType.Entity} Entity instance + */ + Entity.create = function create(properties) { + return new Entity(properties); + }; - /** - * Encodes the specified Suggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion} message Suggestion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Suggestion.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - return writer; - }; + /** + * Encodes the specified Entity message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.Entity.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.v2beta1.EntityType.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + if (message.synonyms != null && message.synonyms.length) + for (var i = 0; i < message.synonyms.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.synonyms[i]); + return writer; + }; - /** - * Encodes the specified Suggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestion} message Suggestion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Suggestion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified Entity message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityType.Entity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.v2beta1.EntityType.IEntity} message Entity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a Suggestion message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion} Suggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Suggestion.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Decodes an Entity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.EntityType.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.EntityType.Entity(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + case 2: + if (!(message.synonyms && message.synonyms.length)) + message.synonyms = []; + message.synonyms.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; } - return message; - }; - - /** - * Decodes a Suggestion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion} Suggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Suggestion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + } + return message; + }; - /** - * Verifies a Suggestion message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Suggestion.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - return null; - }; + /** + * Decodes an Entity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.EntityType.Entity} Entity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a Suggestion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion} Suggestion - */ - Suggestion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion(); - if (object.title != null) - message.title = String(object.title); - return message; - }; + /** + * Verifies an Entity message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + if (message.synonyms != null && message.hasOwnProperty("synonyms")) { + if (!Array.isArray(message.synonyms)) + return "synonyms: array expected"; + for (var i = 0; i < message.synonyms.length; ++i) + if (!$util.isString(message.synonyms[i])) + return "synonyms: string[] expected"; + } + return null; + }; - /** - * Creates a plain object from a Suggestion message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion} message Suggestion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Suggestion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.title = ""; - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; + /** + * Creates an Entity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.EntityType.Entity} Entity + */ + Entity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.EntityType.Entity) return object; - }; - - /** - * Converts this Suggestion to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion - * @instance - * @returns {Object.} JSON object - */ - Suggestion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Suggestion; - })(); - - Message.Suggestions = (function() { - - /** - * Properties of a Suggestions. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ISuggestions - * @property {Array.|null} [suggestions] Suggestions suggestions - */ - - /** - * Constructs a new Suggestions. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a Suggestions. - * @implements ISuggestions - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions=} [properties] Properties to set - */ - function Suggestions(properties) { - this.suggestions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + var message = new $root.google.cloud.dialogflow.v2beta1.EntityType.Entity(); + if (object.value != null) + message.value = String(object.value); + if (object.synonyms) { + if (!Array.isArray(object.synonyms)) + throw TypeError(".google.cloud.dialogflow.v2beta1.EntityType.Entity.synonyms: array expected"); + message.synonyms = []; + for (var i = 0; i < object.synonyms.length; ++i) + message.synonyms[i] = String(object.synonyms[i]); } + return message; + }; - /** - * Suggestions suggestions. - * @member {Array.} suggestions - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions - * @instance - */ - Suggestions.prototype.suggestions = $util.emptyArray; - - /** - * Creates a new Suggestions instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions} Suggestions instance - */ - Suggestions.create = function create(properties) { - return new Suggestions(properties); - }; + /** + * Creates a plain object from an Entity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity + * @static + * @param {google.cloud.dialogflow.v2beta1.EntityType.Entity} message Entity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.synonyms = []; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + if (message.synonyms && message.synonyms.length) { + object.synonyms = []; + for (var j = 0; j < message.synonyms.length; ++j) + object.synonyms[j] = message.synonyms[j]; + } + return object; + }; - /** - * Encodes the specified Suggestions message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions} message Suggestions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Suggestions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.suggestions != null && message.suggestions.length) - for (var i = 0; i < message.suggestions.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.encode(message.suggestions[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Converts this Entity to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.EntityType.Entity + * @instance + * @returns {Object.} JSON object + */ + Entity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified Suggestions message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISuggestions} message Suggestions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Suggestions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return Entity; + })(); - /** - * Decodes a Suggestions message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions} Suggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Suggestions.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.suggestions && message.suggestions.length)) - message.suggestions = []; - message.suggestions.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Kind enum. + * @name google.cloud.dialogflow.v2beta1.EntityType.Kind + * @enum {number} + * @property {number} KIND_UNSPECIFIED=0 KIND_UNSPECIFIED value + * @property {number} KIND_MAP=1 KIND_MAP value + * @property {number} KIND_LIST=2 KIND_LIST value + * @property {number} KIND_REGEXP=3 KIND_REGEXP value + */ + EntityType.Kind = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KIND_UNSPECIFIED"] = 0; + values[valuesById[1] = "KIND_MAP"] = 1; + values[valuesById[2] = "KIND_LIST"] = 2; + values[valuesById[3] = "KIND_REGEXP"] = 3; + return values; + })(); - /** - * Decodes a Suggestions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions} Suggestions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Suggestions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * AutoExpansionMode enum. + * @name google.cloud.dialogflow.v2beta1.EntityType.AutoExpansionMode + * @enum {number} + * @property {number} AUTO_EXPANSION_MODE_UNSPECIFIED=0 AUTO_EXPANSION_MODE_UNSPECIFIED value + * @property {number} AUTO_EXPANSION_MODE_DEFAULT=1 AUTO_EXPANSION_MODE_DEFAULT value + */ + EntityType.AutoExpansionMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "AUTO_EXPANSION_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "AUTO_EXPANSION_MODE_DEFAULT"] = 1; + return values; + })(); - /** - * Verifies a Suggestions message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Suggestions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.suggestions != null && message.hasOwnProperty("suggestions")) { - if (!Array.isArray(message.suggestions)) - return "suggestions: array expected"; - for (var i = 0; i < message.suggestions.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.verify(message.suggestions[i]); - if (error) - return "suggestions." + error; - } - } - return null; - }; + return EntityType; + })(); - /** - * Creates a Suggestions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions} Suggestions - */ - Suggestions.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions(); - if (object.suggestions) { - if (!Array.isArray(object.suggestions)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.suggestions: array expected"); - message.suggestions = []; - for (var i = 0; i < object.suggestions.length; ++i) { - if (typeof object.suggestions[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions.suggestions: object expected"); - message.suggestions[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.fromObject(object.suggestions[i]); - } - } - return message; - }; + v2beta1.ListEntityTypesRequest = (function() { - /** - * Creates a plain object from a Suggestions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions} message Suggestions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Suggestions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.suggestions = []; - if (message.suggestions && message.suggestions.length) { - object.suggestions = []; - for (var j = 0; j < message.suggestions.length; ++j) - object.suggestions[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Suggestion.toObject(message.suggestions[j], options); - } - return object; - }; + /** + * Properties of a ListEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListEntityTypesRequest + * @property {string|null} [parent] ListEntityTypesRequest parent + * @property {string|null} [languageCode] ListEntityTypesRequest languageCode + * @property {number|null} [pageSize] ListEntityTypesRequest pageSize + * @property {string|null} [pageToken] ListEntityTypesRequest pageToken + */ - /** - * Converts this Suggestions to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.Suggestions - * @instance - * @returns {Object.} JSON object - */ - Suggestions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new ListEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListEntityTypesRequest. + * @implements IListEntityTypesRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesRequest=} [properties] Properties to set + */ + function ListEntityTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return Suggestions; - })(); + /** + * ListEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @instance + */ + ListEntityTypesRequest.prototype.parent = ""; - Message.LinkOutSuggestion = (function() { + /** + * ListEntityTypesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @instance + */ + ListEntityTypesRequest.prototype.languageCode = ""; - /** - * Properties of a LinkOutSuggestion. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ILinkOutSuggestion - * @property {string|null} [destinationName] LinkOutSuggestion destinationName - * @property {string|null} [uri] LinkOutSuggestion uri - */ + /** + * ListEntityTypesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @instance + */ + ListEntityTypesRequest.prototype.pageSize = 0; - /** - * Constructs a new LinkOutSuggestion. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a LinkOutSuggestion. - * @implements ILinkOutSuggestion - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion=} [properties] Properties to set - */ - function LinkOutSuggestion(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ListEntityTypesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @instance + */ + ListEntityTypesRequest.prototype.pageToken = ""; - /** - * LinkOutSuggestion destinationName. - * @member {string} destinationName - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion - * @instance - */ - LinkOutSuggestion.prototype.destinationName = ""; + /** + * Creates a new ListEntityTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesRequest} ListEntityTypesRequest instance + */ + ListEntityTypesRequest.create = function create(properties) { + return new ListEntityTypesRequest(properties); + }; - /** - * LinkOutSuggestion uri. - * @member {string} uri - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion - * @instance - */ - LinkOutSuggestion.prototype.uri = ""; + /** + * Encodes the specified ListEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesRequest} message ListEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntityTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + return writer; + }; - /** - * Creates a new LinkOutSuggestion instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion} LinkOutSuggestion instance - */ - LinkOutSuggestion.create = function create(properties) { - return new LinkOutSuggestion(properties); - }; + /** + * Encodes the specified ListEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesRequest} message ListEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified LinkOutSuggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion} message LinkOutSuggestion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LinkOutSuggestion.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.destinationName != null && Object.hasOwnProperty.call(message, "destinationName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.destinationName); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uri); - return writer; - }; + /** + * Decodes a ListEntityTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesRequest} ListEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntityTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListEntityTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + case 3: + message.pageSize = reader.int32(); + break; + case 4: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified LinkOutSuggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ILinkOutSuggestion} message LinkOutSuggestion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - LinkOutSuggestion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a ListEntityTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesRequest} ListEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a LinkOutSuggestion message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion} LinkOutSuggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LinkOutSuggestion.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.destinationName = reader.string(); - break; - case 2: - message.uri = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Verifies a ListEntityTypesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEntityTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; - /** - * Decodes a LinkOutSuggestion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion} LinkOutSuggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - LinkOutSuggestion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a ListEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesRequest} ListEntityTypesRequest + */ + ListEntityTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListEntityTypesRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; - /** - * Verifies a LinkOutSuggestion message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - LinkOutSuggestion.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.destinationName != null && message.hasOwnProperty("destinationName")) - if (!$util.isString(message.destinationName)) - return "destinationName: string expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; + /** + * Creates a plain object from a ListEntityTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ListEntityTypesRequest} message ListEntityTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEntityTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; - /** - * Creates a LinkOutSuggestion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion} LinkOutSuggestion - */ - LinkOutSuggestion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion(); - if (object.destinationName != null) - message.destinationName = String(object.destinationName); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; + /** + * Converts this ListEntityTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesRequest + * @instance + * @returns {Object.} JSON object + */ + ListEntityTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a LinkOutSuggestion message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion} message LinkOutSuggestion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - LinkOutSuggestion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.destinationName = ""; - object.uri = ""; - } - if (message.destinationName != null && message.hasOwnProperty("destinationName")) - object.destinationName = message.destinationName; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; + return ListEntityTypesRequest; + })(); - /** - * Converts this LinkOutSuggestion to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.LinkOutSuggestion - * @instance - * @returns {Object.} JSON object - */ - LinkOutSuggestion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + v2beta1.ListEntityTypesResponse = (function() { - return LinkOutSuggestion; - })(); + /** + * Properties of a ListEntityTypesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListEntityTypesResponse + * @property {Array.|null} [entityTypes] ListEntityTypesResponse entityTypes + * @property {string|null} [nextPageToken] ListEntityTypesResponse nextPageToken + */ - Message.ListSelect = (function() { + /** + * Constructs a new ListEntityTypesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListEntityTypesResponse. + * @implements IListEntityTypesResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesResponse=} [properties] Properties to set + */ + function ListEntityTypesResponse(properties) { + this.entityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a ListSelect. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IListSelect - * @property {string|null} [title] ListSelect title - * @property {Array.|null} [items] ListSelect items - * @property {string|null} [subtitle] ListSelect subtitle - */ + /** + * ListEntityTypesResponse entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @instance + */ + ListEntityTypesResponse.prototype.entityTypes = $util.emptyArray; - /** - * Constructs a new ListSelect. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a ListSelect. - * @implements IListSelect - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect=} [properties] Properties to set - */ - function ListSelect(properties) { - this.items = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ListEntityTypesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @instance + */ + ListEntityTypesResponse.prototype.nextPageToken = ""; - /** - * ListSelect title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @instance - */ - ListSelect.prototype.title = ""; + /** + * Creates a new ListEntityTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesResponse} ListEntityTypesResponse instance + */ + ListEntityTypesResponse.create = function create(properties) { + return new ListEntityTypesResponse(properties); + }; - /** - * ListSelect items. - * @member {Array.} items - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @instance - */ - ListSelect.prototype.items = $util.emptyArray; + /** + * Encodes the specified ListEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesResponse} message ListEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntityTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + $root.google.cloud.dialogflow.v2beta1.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; - /** - * ListSelect subtitle. - * @member {string} subtitle - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @instance - */ - ListSelect.prototype.subtitle = ""; + /** + * Encodes the specified ListEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListEntityTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListEntityTypesResponse} message ListEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a new ListSelect instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect} ListSelect instance - */ - ListSelect.create = function create(properties) { - return new ListSelect(properties); - }; + /** + * Decodes a ListEntityTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesResponse} ListEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntityTypesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListEntityTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push($root.google.cloud.dialogflow.v2beta1.EntityType.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Encodes the specified ListSelect message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect} message ListSelect message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSelect.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.items != null && message.items.length) - for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.encode(message.items[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.subtitle); - return writer; - }; + /** + * Decodes a ListEntityTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesResponse} ListEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified ListSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IListSelect} message ListSelect message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListSelect.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a ListEntityTypesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListEntityTypesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.EntityType.verify(message.entityTypes[i]); + if (error) + return "entityTypes." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * Decodes a ListSelect message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect} ListSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSelect.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - if (!(message.items && message.items.length)) - message.items = []; - message.items.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.decode(reader, reader.uint32())); - break; - case 3: - message.subtitle = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a ListEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListEntityTypesResponse} ListEntityTypesResponse + */ + ListEntityTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListEntityTypesResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListEntityTypesResponse(); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListEntityTypesResponse.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) { + if (typeof object.entityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListEntityTypesResponse.entityTypes: object expected"); + message.entityTypes[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.fromObject(object.entityTypes[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * Decodes a ListSelect message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect} ListSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListSelect.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a ListEntityTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ListEntityTypesResponse} message ListEntityTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListEntityTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityTypes = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.toObject(message.entityTypes[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * Verifies a ListSelect message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListSelect.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!Array.isArray(message.items)) - return "items: array expected"; - for (var i = 0; i < message.items.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.verify(message.items[i]); - if (error) - return "items." + error; - } - } - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - if (!$util.isString(message.subtitle)) - return "subtitle: string expected"; - return null; - }; + /** + * Converts this ListEntityTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListEntityTypesResponse + * @instance + * @returns {Object.} JSON object + */ + ListEntityTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a ListSelect message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect} ListSelect - */ - ListSelect.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect(); - if (object.title != null) - message.title = String(object.title); - if (object.items) { - if (!Array.isArray(object.items)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.items: array expected"); - message.items = []; - for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.items: object expected"); - message.items[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.fromObject(object.items[i]); - } - } - if (object.subtitle != null) - message.subtitle = String(object.subtitle); - return message; - }; + return ListEntityTypesResponse; + })(); - /** - * Creates a plain object from a ListSelect message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect} message ListSelect - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListSelect.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.items = []; - if (options.defaults) { - object.title = ""; - object.subtitle = ""; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.items && message.items.length) { - object.items = []; - for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.toObject(message.items[j], options); - } - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - object.subtitle = message.subtitle; - return object; - }; + v2beta1.GetEntityTypeRequest = (function() { + + /** + * Properties of a GetEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IGetEntityTypeRequest + * @property {string|null} [name] GetEntityTypeRequest name + * @property {string|null} [languageCode] GetEntityTypeRequest languageCode + */ + + /** + * Constructs a new GetEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a GetEntityTypeRequest. + * @implements IGetEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest=} [properties] Properties to set + */ + function GetEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @instance + */ + GetEntityTypeRequest.prototype.name = ""; - /** - * Converts this ListSelect to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @instance - * @returns {Object.} JSON object - */ - ListSelect.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * GetEntityTypeRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @instance + */ + GetEntityTypeRequest.prototype.languageCode = ""; - ListSelect.Item = (function() { + /** + * Creates a new GetEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GetEntityTypeRequest} GetEntityTypeRequest instance + */ + GetEntityTypeRequest.create = function create(properties) { + return new GetEntityTypeRequest(properties); + }; - /** - * Properties of an Item. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @interface IItem - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null} [info] Item info - * @property {string|null} [title] Item title - * @property {string|null} [description] Item description - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [image] Item image - */ + /** + * Encodes the specified GetEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest} message GetEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + return writer; + }; - /** - * Constructs a new Item. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect - * @classdesc Represents an Item. - * @implements IItem - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem=} [properties] Properties to set - */ - function Item(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified GetEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetEntityTypeRequest} message GetEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Item info. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null|undefined} info - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @instance - */ - Item.prototype.info = null; + /** + * Decodes a GetEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.GetEntityTypeRequest} GetEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEntityTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Item title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @instance - */ - Item.prototype.title = ""; + /** + * Decodes a GetEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.GetEntityTypeRequest} GetEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Item description. - * @member {string} description - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @instance - */ - Item.prototype.description = ""; + /** + * Verifies a GetEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetEntityTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; - /** - * Item image. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} image - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @instance - */ - Item.prototype.image = null; + /** + * Creates a GetEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.GetEntityTypeRequest} GetEntityTypeRequest + */ + GetEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetEntityTypeRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.GetEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; - /** - * Creates a new Item instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item} Item instance - */ - Item.create = function create(properties) { - return new Item(properties); - }; + /** + * Creates a plain object from a GetEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.GetEntityTypeRequest} message GetEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.languageCode = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; - /** - * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem} message Item message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Item.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Converts this GetEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.GetEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + GetEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.IItem} message Item message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Item.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return GetEntityTypeRequest; + })(); - /** - * Decodes an Item message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item} Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Item.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.info = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.decode(reader, reader.uint32()); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v2beta1.CreateEntityTypeRequest = (function() { - /** - * Decodes an Item message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item} Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Item.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of a CreateEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ICreateEntityTypeRequest + * @property {string|null} [parent] CreateEntityTypeRequest parent + * @property {google.cloud.dialogflow.v2beta1.IEntityType|null} [entityType] CreateEntityTypeRequest entityType + * @property {string|null} [languageCode] CreateEntityTypeRequest languageCode + */ - /** - * Verifies an Item message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Item.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.info != null && message.hasOwnProperty("info")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.verify(message.info); - if (error) - return "info." + error; - } - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.image != null && message.hasOwnProperty("image")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.image); - if (error) - return "image." + error; - } - return null; - }; + /** + * Constructs a new CreateEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a CreateEntityTypeRequest. + * @implements ICreateEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest=} [properties] Properties to set + */ + function CreateEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates an Item message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item} Item - */ - Item.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item(); - if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.info: object expected"); - message.info = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.fromObject(object.info); - } - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item.image: object expected"); - message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.image); - } - return message; - }; + /** + * CreateEntityTypeRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @instance + */ + CreateEntityTypeRequest.prototype.parent = ""; - /** - * Creates a plain object from an Item message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item} message Item - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Item.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.info = null; - object.title = ""; - object.description = ""; - object.image = null; - } - if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.toObject(message.info, options); - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.image != null && message.hasOwnProperty("image")) - object.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.image, options); - return object; - }; + /** + * CreateEntityTypeRequest entityType. + * @member {google.cloud.dialogflow.v2beta1.IEntityType|null|undefined} entityType + * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @instance + */ + CreateEntityTypeRequest.prototype.entityType = null; - /** - * Converts this Item to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ListSelect.Item - * @instance - * @returns {Object.} JSON object - */ - Item.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * CreateEntityTypeRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @instance + */ + CreateEntityTypeRequest.prototype.languageCode = ""; - return Item; - })(); + /** + * Creates a new CreateEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest} CreateEntityTypeRequest instance + */ + CreateEntityTypeRequest.create = function create(properties) { + return new CreateEntityTypeRequest(properties); + }; - return ListSelect; - })(); + /** + * Encodes the specified CreateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest} message CreateEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + $root.google.cloud.dialogflow.v2beta1.EntityType.encode(message.entityType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; + + /** + * Encodes the specified CreateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateEntityTypeRequest} message CreateEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - Message.CarouselSelect = (function() { + /** + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest} CreateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntityTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.entityType = $root.google.cloud.dialogflow.v2beta1.EntityType.decode(reader, reader.uint32()); + break; + case 3: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a CarouselSelect. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ICarouselSelect - * @property {Array.|null} [items] CarouselSelect items - */ + /** + * Decodes a CreateEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest} CreateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new CarouselSelect. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a CarouselSelect. - * @implements ICarouselSelect - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect=} [properties] Properties to set - */ - function CarouselSelect(properties) { - this.items = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Verifies a CreateEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateEntityTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) { + var error = $root.google.cloud.dialogflow.v2beta1.EntityType.verify(message.entityType); + if (error) + return "entityType." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; - /** - * CarouselSelect items. - * @member {Array.} items - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect - * @instance - */ - CarouselSelect.prototype.items = $util.emptyArray; + /** + * Creates a CreateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest} CreateEntityTypeRequest + */ + CreateEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityType != null) { + if (typeof object.entityType !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest.entityType: object expected"); + message.entityType = $root.google.cloud.dialogflow.v2beta1.EntityType.fromObject(object.entityType); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; - /** - * Creates a new CarouselSelect instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect} CarouselSelect instance - */ - CarouselSelect.create = function create(properties) { - return new CarouselSelect(properties); - }; + /** + * Creates a plain object from a CreateEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest} message CreateEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.entityType = null; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = $root.google.cloud.dialogflow.v2beta1.EntityType.toObject(message.entityType, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; - /** - * Encodes the specified CarouselSelect message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect} message CarouselSelect message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CarouselSelect.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.items != null && message.items.length) - for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + /** + * Converts this CreateEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CreateEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + CreateEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified CarouselSelect message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ICarouselSelect} message CarouselSelect message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CarouselSelect.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return CreateEntityTypeRequest; + })(); - /** - * Decodes a CarouselSelect message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect} CarouselSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CarouselSelect.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.items && message.items.length)) - message.items = []; - message.items.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v2beta1.UpdateEntityTypeRequest = (function() { - /** - * Decodes a CarouselSelect message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect} CarouselSelect - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CarouselSelect.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of an UpdateEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IUpdateEntityTypeRequest + * @property {google.cloud.dialogflow.v2beta1.IEntityType|null} [entityType] UpdateEntityTypeRequest entityType + * @property {string|null} [languageCode] UpdateEntityTypeRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateEntityTypeRequest updateMask + */ - /** - * Verifies a CarouselSelect message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CarouselSelect.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!Array.isArray(message.items)) - return "items: array expected"; - for (var i = 0; i < message.items.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.verify(message.items[i]); - if (error) - return "items." + error; - } - } - return null; - }; + /** + * Constructs a new UpdateEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an UpdateEntityTypeRequest. + * @implements IUpdateEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest=} [properties] Properties to set + */ + function UpdateEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a CarouselSelect message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect} CarouselSelect - */ - CarouselSelect.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect(); - if (object.items) { - if (!Array.isArray(object.items)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.items: array expected"); - message.items = []; - for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.items: object expected"); - message.items[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.fromObject(object.items[i]); - } - } - return message; - }; + /** + * UpdateEntityTypeRequest entityType. + * @member {google.cloud.dialogflow.v2beta1.IEntityType|null|undefined} entityType + * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @instance + */ + UpdateEntityTypeRequest.prototype.entityType = null; - /** - * Creates a plain object from a CarouselSelect message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect} message CarouselSelect - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CarouselSelect.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.items = []; - if (message.items && message.items.length) { - object.items = []; - for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.toObject(message.items[j], options); - } - return object; - }; + /** + * UpdateEntityTypeRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @instance + */ + UpdateEntityTypeRequest.prototype.languageCode = ""; - /** - * Converts this CarouselSelect to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect - * @instance - * @returns {Object.} JSON object - */ - CarouselSelect.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * UpdateEntityTypeRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @instance + */ + UpdateEntityTypeRequest.prototype.updateMask = null; - CarouselSelect.Item = (function() { + /** + * Creates a new UpdateEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest} UpdateEntityTypeRequest instance + */ + UpdateEntityTypeRequest.create = function create(properties) { + return new UpdateEntityTypeRequest(properties); + }; - /** - * Properties of an Item. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect - * @interface IItem - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null} [info] Item info - * @property {string|null} [title] Item title - * @property {string|null} [description] Item description - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [image] Item image - */ + /** + * Encodes the specified UpdateEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest} message UpdateEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityType != null && Object.hasOwnProperty.call(message, "entityType")) + $root.google.cloud.dialogflow.v2beta1.EntityType.encode(message.entityType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Constructs a new Item. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect - * @classdesc Represents an Item. - * @implements IItem - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem=} [properties] Properties to set - */ - function Item(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified UpdateEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IUpdateEntityTypeRequest} message UpdateEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Item info. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo|null|undefined} info - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @instance - */ - Item.prototype.info = null; + /** + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest} UpdateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEntityTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.entityType = $root.google.cloud.dialogflow.v2beta1.EntityType.decode(reader, reader.uint32()); + break; + case 2: + message.languageCode = reader.string(); + break; + case 3: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Item title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @instance - */ - Item.prototype.title = ""; + /** + * Decodes an UpdateEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest} UpdateEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Item description. - * @member {string} description - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @instance - */ - Item.prototype.description = ""; + /** + * Verifies an UpdateEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateEntityTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityType != null && message.hasOwnProperty("entityType")) { + var error = $root.google.cloud.dialogflow.v2beta1.EntityType.verify(message.entityType); + if (error) + return "entityType." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; - /** - * Item image. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} image - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @instance - */ - Item.prototype.image = null; + /** + * Creates an UpdateEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest} UpdateEntityTypeRequest + */ + UpdateEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest(); + if (object.entityType != null) { + if (typeof object.entityType !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest.entityType: object expected"); + message.entityType = $root.google.cloud.dialogflow.v2beta1.EntityType.fromObject(object.entityType); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; - /** - * Creates a new Item instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item} Item instance - */ - Item.create = function create(properties) { - return new Item(properties); - }; + /** + * Creates a plain object from an UpdateEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest} message UpdateEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.entityType = null; + object.languageCode = ""; + object.updateMask = null; + } + if (message.entityType != null && message.hasOwnProperty("entityType")) + object.entityType = $root.google.cloud.dialogflow.v2beta1.EntityType.toObject(message.entityType, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; - /** - * Encodes the specified Item message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem} message Item message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Item.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.info != null && Object.hasOwnProperty.call(message, "info")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.encode(message.info, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + /** + * Converts this UpdateEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.UpdateEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified Item message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.IItem} message Item message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Item.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return UpdateEntityTypeRequest; + })(); - /** - * Decodes an Item message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item} Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Item.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.info = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.decode(reader, reader.uint32()); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v2beta1.DeleteEntityTypeRequest = (function() { - /** - * Decodes an Item message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item} Item - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Item.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of a DeleteEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IDeleteEntityTypeRequest + * @property {string|null} [name] DeleteEntityTypeRequest name + */ - /** - * Verifies an Item message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Item.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.info != null && message.hasOwnProperty("info")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.verify(message.info); - if (error) - return "info." + error; - } - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.image != null && message.hasOwnProperty("image")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.image); - if (error) - return "image." + error; - } - return null; - }; + /** + * Constructs a new DeleteEntityTypeRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a DeleteEntityTypeRequest. + * @implements IDeleteEntityTypeRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest=} [properties] Properties to set + */ + function DeleteEntityTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates an Item message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item} Item - */ - Item.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item(); - if (object.info != null) { - if (typeof object.info !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.info: object expected"); - message.info = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.fromObject(object.info); - } - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item.image: object expected"); - message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.image); - } - return message; - }; + /** + * DeleteEntityTypeRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @instance + */ + DeleteEntityTypeRequest.prototype.name = ""; - /** - * Creates a plain object from an Item message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item} message Item - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Item.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.info = null; - object.title = ""; - object.description = ""; - object.image = null; - } - if (message.info != null && message.hasOwnProperty("info")) - object.info = $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.toObject(message.info, options); - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.image != null && message.hasOwnProperty("image")) - object.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.image, options); - return object; - }; + /** + * Creates a new DeleteEntityTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest instance + */ + DeleteEntityTypeRequest.create = function create(properties) { + return new DeleteEntityTypeRequest(properties); + }; - /** - * Converts this Item to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.CarouselSelect.Item - * @instance - * @returns {Object.} JSON object - */ - Item.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified DeleteEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest} message DeleteEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEntityTypeRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - return Item; - })(); + /** + * Encodes the specified DeleteEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteEntityTypeRequest} message DeleteEntityTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return CarouselSelect; - })(); + /** + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEntityTypeRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - Message.SelectItemInfo = (function() { + /** + * Decodes a DeleteEntityTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of a SelectItemInfo. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ISelectItemInfo - * @property {string|null} [key] SelectItemInfo key - * @property {Array.|null} [synonyms] SelectItemInfo synonyms - */ + /** + * Verifies a DeleteEntityTypeRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteEntityTypeRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Constructs a new SelectItemInfo. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a SelectItemInfo. - * @implements ISelectItemInfo - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo=} [properties] Properties to set - */ - function SelectItemInfo(properties) { - this.synonyms = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a DeleteEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest} DeleteEntityTypeRequest + */ + DeleteEntityTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * SelectItemInfo key. - * @member {string} key - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo - * @instance - */ - SelectItemInfo.prototype.key = ""; + /** + * Creates a plain object from a DeleteEntityTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest} message DeleteEntityTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteEntityTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * SelectItemInfo synonyms. - * @member {Array.} synonyms - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo - * @instance - */ - SelectItemInfo.prototype.synonyms = $util.emptyArray; + /** + * Converts this DeleteEntityTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.DeleteEntityTypeRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteEntityTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new SelectItemInfo instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo} SelectItemInfo instance - */ - SelectItemInfo.create = function create(properties) { - return new SelectItemInfo(properties); - }; + return DeleteEntityTypeRequest; + })(); - /** - * Encodes the specified SelectItemInfo message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo} message SelectItemInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SelectItemInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.synonyms != null && message.synonyms.length) - for (var i = 0; i < message.synonyms.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.synonyms[i]); - return writer; - }; + v2beta1.BatchUpdateEntityTypesRequest = (function() { - /** - * Encodes the specified SelectItemInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ISelectItemInfo} message SelectItemInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SelectItemInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a BatchUpdateEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IBatchUpdateEntityTypesRequest + * @property {string|null} [parent] BatchUpdateEntityTypesRequest parent + * @property {string|null} [entityTypeBatchUri] BatchUpdateEntityTypesRequest entityTypeBatchUri + * @property {google.cloud.dialogflow.v2beta1.IEntityTypeBatch|null} [entityTypeBatchInline] BatchUpdateEntityTypesRequest entityTypeBatchInline + * @property {string|null} [languageCode] BatchUpdateEntityTypesRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateEntityTypesRequest updateMask + */ - /** - * Decodes a SelectItemInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo} SelectItemInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SelectItemInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.key = reader.string(); - break; - case 2: - if (!(message.synonyms && message.synonyms.length)) - message.synonyms = []; - message.synonyms.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new BatchUpdateEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a BatchUpdateEntityTypesRequest. + * @implements IBatchUpdateEntityTypesRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest=} [properties] Properties to set + */ + function BatchUpdateEntityTypesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a SelectItemInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo} SelectItemInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SelectItemInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * BatchUpdateEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @instance + */ + BatchUpdateEntityTypesRequest.prototype.parent = ""; - /** - * Verifies a SelectItemInfo message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SelectItemInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.key != null && message.hasOwnProperty("key")) - if (!$util.isString(message.key)) - return "key: string expected"; - if (message.synonyms != null && message.hasOwnProperty("synonyms")) { - if (!Array.isArray(message.synonyms)) - return "synonyms: array expected"; - for (var i = 0; i < message.synonyms.length; ++i) - if (!$util.isString(message.synonyms[i])) - return "synonyms: string[] expected"; - } - return null; - }; + /** + * BatchUpdateEntityTypesRequest entityTypeBatchUri. + * @member {string} entityTypeBatchUri + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @instance + */ + BatchUpdateEntityTypesRequest.prototype.entityTypeBatchUri = ""; - /** - * Creates a SelectItemInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo} SelectItemInfo - */ - SelectItemInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo(); - if (object.key != null) - message.key = String(object.key); - if (object.synonyms) { - if (!Array.isArray(object.synonyms)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo.synonyms: array expected"); - message.synonyms = []; - for (var i = 0; i < object.synonyms.length; ++i) - message.synonyms[i] = String(object.synonyms[i]); - } - return message; - }; + /** + * BatchUpdateEntityTypesRequest entityTypeBatchInline. + * @member {google.cloud.dialogflow.v2beta1.IEntityTypeBatch|null|undefined} entityTypeBatchInline + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @instance + */ + BatchUpdateEntityTypesRequest.prototype.entityTypeBatchInline = null; - /** - * Creates a plain object from a SelectItemInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo} message SelectItemInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SelectItemInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.synonyms = []; - if (options.defaults) - object.key = ""; - if (message.key != null && message.hasOwnProperty("key")) - object.key = message.key; - if (message.synonyms && message.synonyms.length) { - object.synonyms = []; - for (var j = 0; j < message.synonyms.length; ++j) - object.synonyms[j] = message.synonyms[j]; - } - return object; - }; + /** + * BatchUpdateEntityTypesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @instance + */ + BatchUpdateEntityTypesRequest.prototype.languageCode = ""; - /** - * Converts this SelectItemInfo to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.SelectItemInfo - * @instance - * @returns {Object.} JSON object - */ - SelectItemInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * BatchUpdateEntityTypesRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @instance + */ + BatchUpdateEntityTypesRequest.prototype.updateMask = null; - return SelectItemInfo; - })(); + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - Message.TelephonyPlayAudio = (function() { + /** + * BatchUpdateEntityTypesRequest entityTypeBatch. + * @member {"entityTypeBatchUri"|"entityTypeBatchInline"|undefined} entityTypeBatch + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @instance + */ + Object.defineProperty(BatchUpdateEntityTypesRequest.prototype, "entityTypeBatch", { + get: $util.oneOfGetter($oneOfFields = ["entityTypeBatchUri", "entityTypeBatchInline"]), + set: $util.oneOfSetter($oneOfFields) + }); - /** - * Properties of a TelephonyPlayAudio. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ITelephonyPlayAudio - * @property {string|null} [audioUri] TelephonyPlayAudio audioUri - */ + /** + * Creates a new BatchUpdateEntityTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest instance + */ + BatchUpdateEntityTypesRequest.create = function create(properties) { + return new BatchUpdateEntityTypesRequest(properties); + }; - /** - * Constructs a new TelephonyPlayAudio. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a TelephonyPlayAudio. - * @implements ITelephonyPlayAudio - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio=} [properties] Properties to set - */ - function TelephonyPlayAudio(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Encodes the specified BatchUpdateEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest} message BatchUpdateEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateEntityTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.entityTypeBatchUri != null && Object.hasOwnProperty.call(message, "entityTypeBatchUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityTypeBatchUri); + if (message.entityTypeBatchInline != null && Object.hasOwnProperty.call(message, "entityTypeBatchInline")) + $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch.encode(message.entityTypeBatchInline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchUpdateEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesRequest} message BatchUpdateEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateEntityTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.entityTypeBatchUri = reader.string(); + break; + case 3: + message.entityTypeBatchInline = $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch.decode(reader, reader.uint32()); + break; + case 4: + message.languageCode = reader.string(); + break; + case 5: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * TelephonyPlayAudio audioUri. - * @member {string} audioUri - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio - * @instance - */ - TelephonyPlayAudio.prototype.audioUri = ""; + /** + * Decodes a BatchUpdateEntityTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a new TelephonyPlayAudio instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio} TelephonyPlayAudio instance - */ - TelephonyPlayAudio.create = function create(properties) { - return new TelephonyPlayAudio(properties); - }; + /** + * Verifies a BatchUpdateEntityTypesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchUpdateEntityTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityTypeBatchUri != null && message.hasOwnProperty("entityTypeBatchUri")) { + properties.entityTypeBatch = 1; + if (!$util.isString(message.entityTypeBatchUri)) + return "entityTypeBatchUri: string expected"; + } + if (message.entityTypeBatchInline != null && message.hasOwnProperty("entityTypeBatchInline")) { + if (properties.entityTypeBatch === 1) + return "entityTypeBatch: multiple values"; + properties.entityTypeBatch = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch.verify(message.entityTypeBatchInline); + if (error) + return "entityTypeBatchInline." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; - /** - * Encodes the specified TelephonyPlayAudio message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio} message TelephonyPlayAudio message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TelephonyPlayAudio.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.audioUri != null && Object.hasOwnProperty.call(message, "audioUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.audioUri); - return writer; - }; + /** + * Creates a BatchUpdateEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest} BatchUpdateEntityTypesRequest + */ + BatchUpdateEntityTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityTypeBatchUri != null) + message.entityTypeBatchUri = String(object.entityTypeBatchUri); + if (object.entityTypeBatchInline != null) { + if (typeof object.entityTypeBatchInline !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.entityTypeBatchInline: object expected"); + message.entityTypeBatchInline = $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch.fromObject(object.entityTypeBatchInline); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; - /** - * Encodes the specified TelephonyPlayAudio message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyPlayAudio} message TelephonyPlayAudio message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TelephonyPlayAudio.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a plain object from a BatchUpdateEntityTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest} message BatchUpdateEntityTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchUpdateEntityTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.updateMask = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityTypeBatchUri != null && message.hasOwnProperty("entityTypeBatchUri")) { + object.entityTypeBatchUri = message.entityTypeBatchUri; + if (options.oneofs) + object.entityTypeBatch = "entityTypeBatchUri"; + } + if (message.entityTypeBatchInline != null && message.hasOwnProperty("entityTypeBatchInline")) { + object.entityTypeBatchInline = $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch.toObject(message.entityTypeBatchInline, options); + if (options.oneofs) + object.entityTypeBatch = "entityTypeBatchInline"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; + + /** + * Converts this BatchUpdateEntityTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchUpdateEntityTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a TelephonyPlayAudio message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio} TelephonyPlayAudio - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TelephonyPlayAudio.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.audioUri = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return BatchUpdateEntityTypesRequest; + })(); - /** - * Decodes a TelephonyPlayAudio message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio} TelephonyPlayAudio - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TelephonyPlayAudio.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + v2beta1.BatchUpdateEntityTypesResponse = (function() { - /** - * Verifies a TelephonyPlayAudio message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TelephonyPlayAudio.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.audioUri != null && message.hasOwnProperty("audioUri")) - if (!$util.isString(message.audioUri)) - return "audioUri: string expected"; - return null; - }; + /** + * Properties of a BatchUpdateEntityTypesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IBatchUpdateEntityTypesResponse + * @property {Array.|null} [entityTypes] BatchUpdateEntityTypesResponse entityTypes + */ - /** - * Creates a TelephonyPlayAudio message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio} TelephonyPlayAudio - */ - TelephonyPlayAudio.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio(); - if (object.audioUri != null) - message.audioUri = String(object.audioUri); - return message; - }; + /** + * Constructs a new BatchUpdateEntityTypesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a BatchUpdateEntityTypesResponse. + * @implements IBatchUpdateEntityTypesResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse=} [properties] Properties to set + */ + function BatchUpdateEntityTypesResponse(properties) { + this.entityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a plain object from a TelephonyPlayAudio message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio} message TelephonyPlayAudio - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TelephonyPlayAudio.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.audioUri = ""; - if (message.audioUri != null && message.hasOwnProperty("audioUri")) - object.audioUri = message.audioUri; - return object; - }; + /** + * BatchUpdateEntityTypesResponse entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @instance + */ + BatchUpdateEntityTypesResponse.prototype.entityTypes = $util.emptyArray; - /** - * Converts this TelephonyPlayAudio to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyPlayAudio - * @instance - * @returns {Object.} JSON object - */ - TelephonyPlayAudio.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new BatchUpdateEntityTypesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse instance + */ + BatchUpdateEntityTypesResponse.create = function create(properties) { + return new BatchUpdateEntityTypesResponse(properties); + }; - return TelephonyPlayAudio; - })(); + /** + * Encodes the specified BatchUpdateEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse} message BatchUpdateEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateEntityTypesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + $root.google.cloud.dialogflow.v2beta1.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - Message.TelephonySynthesizeSpeech = (function() { + /** + * Encodes the specified BatchUpdateEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntityTypesResponse} message BatchUpdateEntityTypesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Properties of a TelephonySynthesizeSpeech. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ITelephonySynthesizeSpeech - * @property {string|null} [text] TelephonySynthesizeSpeech text - * @property {string|null} [ssml] TelephonySynthesizeSpeech ssml - */ + /** + * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateEntityTypesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push($root.google.cloud.dialogflow.v2beta1.EntityType.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Constructs a new TelephonySynthesizeSpeech. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a TelephonySynthesizeSpeech. - * @implements ITelephonySynthesizeSpeech - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech=} [properties] Properties to set - */ - function TelephonySynthesizeSpeech(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a BatchUpdateEntityTypesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchUpdateEntityTypesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchUpdateEntityTypesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.EntityType.verify(message.entityTypes[i]); + if (error) + return "entityTypes." + error; } + } + return null; + }; - /** - * TelephonySynthesizeSpeech text. - * @member {string} text - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech - * @instance - */ - TelephonySynthesizeSpeech.prototype.text = ""; + /** + * Creates a BatchUpdateEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse} BatchUpdateEntityTypesResponse + */ + BatchUpdateEntityTypesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse(); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) { + if (typeof object.entityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse.entityTypes: object expected"); + message.entityTypes[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.fromObject(object.entityTypes[i]); + } + } + return message; + }; - /** - * TelephonySynthesizeSpeech ssml. - * @member {string} ssml - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech - * @instance - */ - TelephonySynthesizeSpeech.prototype.ssml = ""; + /** + * Creates a plain object from a BatchUpdateEntityTypesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse} message BatchUpdateEntityTypesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchUpdateEntityTypesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityTypes = []; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.toObject(message.entityTypes[j], options); + } + return object; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Converts this BatchUpdateEntityTypesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchUpdateEntityTypesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * TelephonySynthesizeSpeech source. - * @member {"text"|"ssml"|undefined} source - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech - * @instance - */ - Object.defineProperty(TelephonySynthesizeSpeech.prototype, "source", { - get: $util.oneOfGetter($oneOfFields = ["text", "ssml"]), - set: $util.oneOfSetter($oneOfFields) - }); + return BatchUpdateEntityTypesResponse; + })(); - /** - * Creates a new TelephonySynthesizeSpeech instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech} TelephonySynthesizeSpeech instance - */ - TelephonySynthesizeSpeech.create = function create(properties) { - return new TelephonySynthesizeSpeech(properties); - }; + v2beta1.BatchDeleteEntityTypesRequest = (function() { - /** - * Encodes the specified TelephonySynthesizeSpeech message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech} message TelephonySynthesizeSpeech message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TelephonySynthesizeSpeech.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.ssml != null && Object.hasOwnProperty.call(message, "ssml")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ssml); - return writer; - }; + /** + * Properties of a BatchDeleteEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IBatchDeleteEntityTypesRequest + * @property {string|null} [parent] BatchDeleteEntityTypesRequest parent + * @property {Array.|null} [entityTypeNames] BatchDeleteEntityTypesRequest entityTypeNames + */ - /** - * Encodes the specified TelephonySynthesizeSpeech message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonySynthesizeSpeech} message TelephonySynthesizeSpeech message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TelephonySynthesizeSpeech.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new BatchDeleteEntityTypesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a BatchDeleteEntityTypesRequest. + * @implements IBatchDeleteEntityTypesRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest=} [properties] Properties to set + */ + function BatchDeleteEntityTypesRequest(properties) { + this.entityTypeNames = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a TelephonySynthesizeSpeech message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech} TelephonySynthesizeSpeech - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TelephonySynthesizeSpeech.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = reader.string(); - break; - case 2: - message.ssml = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * BatchDeleteEntityTypesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest + * @instance + */ + BatchDeleteEntityTypesRequest.prototype.parent = ""; - /** - * Decodes a TelephonySynthesizeSpeech message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech} TelephonySynthesizeSpeech - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TelephonySynthesizeSpeech.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * BatchDeleteEntityTypesRequest entityTypeNames. + * @member {Array.} entityTypeNames + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest + * @instance + */ + BatchDeleteEntityTypesRequest.prototype.entityTypeNames = $util.emptyArray; - /** - * Verifies a TelephonySynthesizeSpeech message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TelephonySynthesizeSpeech.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.text != null && message.hasOwnProperty("text")) { - properties.source = 1; - if (!$util.isString(message.text)) - return "text: string expected"; - } - if (message.ssml != null && message.hasOwnProperty("ssml")) { - if (properties.source === 1) - return "source: multiple values"; - properties.source = 1; - if (!$util.isString(message.ssml)) - return "ssml: string expected"; - } - return null; - }; + /** + * Creates a new BatchDeleteEntityTypesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest instance + */ + BatchDeleteEntityTypesRequest.create = function create(properties) { + return new BatchDeleteEntityTypesRequest(properties); + }; - /** - * Creates a TelephonySynthesizeSpeech message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech} TelephonySynthesizeSpeech - */ - TelephonySynthesizeSpeech.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech(); - if (object.text != null) - message.text = String(object.text); - if (object.ssml != null) - message.ssml = String(object.ssml); - return message; - }; + /** + * Encodes the specified BatchDeleteEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest} message BatchDeleteEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteEntityTypesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.entityTypeNames != null && message.entityTypeNames.length) + for (var i = 0; i < message.entityTypeNames.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityTypeNames[i]); + return writer; + }; - /** - * Creates a plain object from a TelephonySynthesizeSpeech message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech} message TelephonySynthesizeSpeech - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TelephonySynthesizeSpeech.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.text != null && message.hasOwnProperty("text")) { - object.text = message.text; - if (options.oneofs) - object.source = "text"; - } - if (message.ssml != null && message.hasOwnProperty("ssml")) { - object.ssml = message.ssml; - if (options.oneofs) - object.source = "ssml"; - } - return object; - }; + /** + * Encodes the specified BatchDeleteEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntityTypesRequest} message BatchDeleteEntityTypesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Converts this TelephonySynthesizeSpeech to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonySynthesizeSpeech - * @instance - * @returns {Object.} JSON object - */ - TelephonySynthesizeSpeech.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteEntityTypesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + if (!(message.entityTypeNames && message.entityTypeNames.length)) + message.entityTypeNames = []; + message.entityTypeNames.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return TelephonySynthesizeSpeech; - })(); + /** + * Decodes a BatchDeleteEntityTypesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - Message.TelephonyTransferCall = (function() { + /** + * Verifies a BatchDeleteEntityTypesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteEntityTypesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityTypeNames != null && message.hasOwnProperty("entityTypeNames")) { + if (!Array.isArray(message.entityTypeNames)) + return "entityTypeNames: array expected"; + for (var i = 0; i < message.entityTypeNames.length; ++i) + if (!$util.isString(message.entityTypeNames[i])) + return "entityTypeNames: string[] expected"; + } + return null; + }; - /** - * Properties of a TelephonyTransferCall. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ITelephonyTransferCall - * @property {string|null} [phoneNumber] TelephonyTransferCall phoneNumber - */ + /** + * Creates a BatchDeleteEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest} BatchDeleteEntityTypesRequest + */ + BatchDeleteEntityTypesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityTypeNames) { + if (!Array.isArray(object.entityTypeNames)) + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest.entityTypeNames: array expected"); + message.entityTypeNames = []; + for (var i = 0; i < object.entityTypeNames.length; ++i) + message.entityTypeNames[i] = String(object.entityTypeNames[i]); + } + return message; + }; - /** - * Constructs a new TelephonyTransferCall. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a TelephonyTransferCall. - * @implements ITelephonyTransferCall - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall=} [properties] Properties to set - */ - function TelephonyTransferCall(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a plain object from a BatchDeleteEntityTypesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest} message BatchDeleteEntityTypesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteEntityTypesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityTypeNames = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityTypeNames && message.entityTypeNames.length) { + object.entityTypeNames = []; + for (var j = 0; j < message.entityTypeNames.length; ++j) + object.entityTypeNames[j] = message.entityTypeNames[j]; + } + return object; + }; - /** - * TelephonyTransferCall phoneNumber. - * @member {string} phoneNumber - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall - * @instance - */ - TelephonyTransferCall.prototype.phoneNumber = ""; + /** + * Converts this BatchDeleteEntityTypesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntityTypesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteEntityTypesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new TelephonyTransferCall instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall} TelephonyTransferCall instance - */ - TelephonyTransferCall.create = function create(properties) { - return new TelephonyTransferCall(properties); - }; + return BatchDeleteEntityTypesRequest; + })(); - /** - * Encodes the specified TelephonyTransferCall message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall} message TelephonyTransferCall message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TelephonyTransferCall.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.phoneNumber); - return writer; - }; + v2beta1.BatchCreateEntitiesRequest = (function() { - /** - * Encodes the specified TelephonyTransferCall message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITelephonyTransferCall} message TelephonyTransferCall message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TelephonyTransferCall.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a BatchCreateEntitiesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IBatchCreateEntitiesRequest + * @property {string|null} [parent] BatchCreateEntitiesRequest parent + * @property {Array.|null} [entities] BatchCreateEntitiesRequest entities + * @property {string|null} [languageCode] BatchCreateEntitiesRequest languageCode + */ - /** - * Decodes a TelephonyTransferCall message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall} TelephonyTransferCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TelephonyTransferCall.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.phoneNumber = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new BatchCreateEntitiesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a BatchCreateEntitiesRequest. + * @implements IBatchCreateEntitiesRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest=} [properties] Properties to set + */ + function BatchCreateEntitiesRequest(properties) { + this.entities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a TelephonyTransferCall message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall} TelephonyTransferCall - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TelephonyTransferCall.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * BatchCreateEntitiesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest + * @instance + */ + BatchCreateEntitiesRequest.prototype.parent = ""; - /** - * Verifies a TelephonyTransferCall message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TelephonyTransferCall.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - if (!$util.isString(message.phoneNumber)) - return "phoneNumber: string expected"; - return null; - }; + /** + * BatchCreateEntitiesRequest entities. + * @member {Array.} entities + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest + * @instance + */ + BatchCreateEntitiesRequest.prototype.entities = $util.emptyArray; - /** - * Creates a TelephonyTransferCall message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall} TelephonyTransferCall - */ - TelephonyTransferCall.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall(); - if (object.phoneNumber != null) - message.phoneNumber = String(object.phoneNumber); - return message; - }; + /** + * BatchCreateEntitiesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest + * @instance + */ + BatchCreateEntitiesRequest.prototype.languageCode = ""; - /** - * Creates a plain object from a TelephonyTransferCall message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall} message TelephonyTransferCall - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TelephonyTransferCall.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.phoneNumber = ""; - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - object.phoneNumber = message.phoneNumber; - return object; - }; + /** + * Creates a new BatchCreateEntitiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest instance + */ + BatchCreateEntitiesRequest.create = function create(properties) { + return new BatchCreateEntitiesRequest(properties); + }; - /** - * Converts this TelephonyTransferCall to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TelephonyTransferCall - * @instance - * @returns {Object.} JSON object - */ - TelephonyTransferCall.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified BatchCreateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest} message BatchCreateEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateEntitiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; - return TelephonyTransferCall; - })(); + /** + * Encodes the specified BatchCreateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateEntitiesRequest} message BatchCreateEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - Message.RbmText = (function() { + /** + * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateEntitiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dialogflow.v2beta1.EntityType.Entity.decode(reader, reader.uint32())); + break; + case 3: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a RbmText. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IRbmText - * @property {string|null} [text] RbmText text - * @property {Array.|null} [rbmSuggestion] RbmText rbmSuggestion - */ + /** + * Decodes a BatchCreateEntitiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new RbmText. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a RbmText. - * @implements IRbmText - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText=} [properties] Properties to set - */ - function RbmText(properties) { - this.rbmSuggestion = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Verifies a BatchCreateEntitiesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateEntitiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; - /** - * RbmText text. - * @member {string} text - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText - * @instance - */ - RbmText.prototype.text = ""; + /** + * Creates a BatchCreateEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest} BatchCreateEntitiesRequest + */ + BatchCreateEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest.entities: object expected"); + message.entities[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.fromObject(object.entities[i]); + } + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; - /** - * RbmText rbmSuggestion. - * @member {Array.} rbmSuggestion - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText - * @instance - */ - RbmText.prototype.rbmSuggestion = $util.emptyArray; + /** + * Creates a plain object from a BatchCreateEntitiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest} message BatchCreateEntitiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateEntitiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.toObject(message.entities[j], options); + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; - /** - * Creates a new RbmText instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmText} RbmText instance - */ - RbmText.create = function create(properties) { - return new RbmText(properties); - }; + /** + * Converts this BatchCreateEntitiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateEntitiesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateEntitiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified RbmText message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText} message RbmText message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmText.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.rbmSuggestion != null && message.rbmSuggestion.length) - for (var i = 0; i < message.rbmSuggestion.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.encode(message.rbmSuggestion[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + return BatchCreateEntitiesRequest; + })(); - /** - * Encodes the specified RbmText message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmText} message RbmText message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmText.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v2beta1.BatchUpdateEntitiesRequest = (function() { - /** - * Decodes a RbmText message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmText} RbmText - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmText.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = reader.string(); - break; - case 2: - if (!(message.rbmSuggestion && message.rbmSuggestion.length)) - message.rbmSuggestion = []; - message.rbmSuggestion.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a BatchUpdateEntitiesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IBatchUpdateEntitiesRequest + * @property {string|null} [parent] BatchUpdateEntitiesRequest parent + * @property {Array.|null} [entities] BatchUpdateEntitiesRequest entities + * @property {string|null} [languageCode] BatchUpdateEntitiesRequest languageCode + * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateEntitiesRequest updateMask + */ - /** - * Decodes a RbmText message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmText} RbmText - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmText.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new BatchUpdateEntitiesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a BatchUpdateEntitiesRequest. + * @implements IBatchUpdateEntitiesRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest=} [properties] Properties to set + */ + function BatchUpdateEntitiesRequest(properties) { + this.entities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Verifies a RbmText message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RbmText.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.rbmSuggestion != null && message.hasOwnProperty("rbmSuggestion")) { - if (!Array.isArray(message.rbmSuggestion)) - return "rbmSuggestion: array expected"; - for (var i = 0; i < message.rbmSuggestion.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.verify(message.rbmSuggestion[i]); - if (error) - return "rbmSuggestion." + error; - } - } - return null; - }; + /** + * BatchUpdateEntitiesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @instance + */ + BatchUpdateEntitiesRequest.prototype.parent = ""; - /** - * Creates a RbmText message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmText} RbmText - */ - RbmText.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmText(); - if (object.text != null) - message.text = String(object.text); - if (object.rbmSuggestion) { - if (!Array.isArray(object.rbmSuggestion)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.rbmSuggestion: array expected"); - message.rbmSuggestion = []; - for (var i = 0; i < object.rbmSuggestion.length; ++i) { - if (typeof object.rbmSuggestion[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmText.rbmSuggestion: object expected"); - message.rbmSuggestion[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.fromObject(object.rbmSuggestion[i]); - } - } - return message; - }; + /** + * BatchUpdateEntitiesRequest entities. + * @member {Array.} entities + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @instance + */ + BatchUpdateEntitiesRequest.prototype.entities = $util.emptyArray; - /** - * Creates a plain object from a RbmText message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmText} message RbmText - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RbmText.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rbmSuggestion = []; - if (options.defaults) - object.text = ""; - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.rbmSuggestion && message.rbmSuggestion.length) { - object.rbmSuggestion = []; - for (var j = 0; j < message.rbmSuggestion.length; ++j) - object.rbmSuggestion[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.toObject(message.rbmSuggestion[j], options); - } - return object; - }; + /** + * BatchUpdateEntitiesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @instance + */ + BatchUpdateEntitiesRequest.prototype.languageCode = ""; - /** - * Converts this RbmText to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmText - * @instance - * @returns {Object.} JSON object - */ - RbmText.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * BatchUpdateEntitiesRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @instance + */ + BatchUpdateEntitiesRequest.prototype.updateMask = null; - return RbmText; - })(); + /** + * Creates a new BatchUpdateEntitiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest instance + */ + BatchUpdateEntitiesRequest.create = function create(properties) { + return new BatchUpdateEntitiesRequest(properties); + }; - Message.RbmCarouselCard = (function() { + /** + * Encodes the specified BatchUpdateEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest} message BatchUpdateEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateEntitiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.entities != null && message.entities.length) + for (var i = 0; i < message.entities.length; ++i) + $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; - /** - * Properties of a RbmCarouselCard. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IRbmCarouselCard - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth|null} [cardWidth] RbmCarouselCard cardWidth - * @property {Array.|null} [cardContents] RbmCarouselCard cardContents - */ + /** + * Encodes the specified BatchUpdateEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateEntitiesRequest} message BatchUpdateEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchUpdateEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new RbmCarouselCard. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a RbmCarouselCard. - * @implements IRbmCarouselCard - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard=} [properties] Properties to set - */ - function RbmCarouselCard(properties) { - this.cardContents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateEntitiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + if (!(message.entities && message.entities.length)) + message.entities = []; + message.entities.push($root.google.cloud.dialogflow.v2beta1.EntityType.Entity.decode(reader, reader.uint32())); + break; + case 3: + message.languageCode = reader.string(); + break; + case 4: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * RbmCarouselCard cardWidth. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth} cardWidth - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard - * @instance - */ - RbmCarouselCard.prototype.cardWidth = 0; + /** + * Decodes a BatchUpdateEntitiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchUpdateEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * RbmCarouselCard cardContents. - * @member {Array.} cardContents - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard - * @instance - */ - RbmCarouselCard.prototype.cardContents = $util.emptyArray; + /** + * Verifies a BatchUpdateEntitiesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchUpdateEntitiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entities != null && message.hasOwnProperty("entities")) { + if (!Array.isArray(message.entities)) + return "entities: array expected"; + for (var i = 0; i < message.entities.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.verify(message.entities[i]); + if (error) + return "entities." + error; + } + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + return null; + }; - /** - * Creates a new RbmCarouselCard instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard} RbmCarouselCard instance - */ - RbmCarouselCard.create = function create(properties) { - return new RbmCarouselCard(properties); - }; + /** + * Creates a BatchUpdateEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest} BatchUpdateEntitiesRequest + */ + BatchUpdateEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entities) { + if (!Array.isArray(object.entities)) + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.entities: array expected"); + message.entities = []; + for (var i = 0; i < object.entities.length; ++i) { + if (typeof object.entities[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.entities: object expected"); + message.entities[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.fromObject(object.entities[i]); + } + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + return message; + }; - /** - * Encodes the specified RbmCarouselCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard} message RbmCarouselCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmCarouselCard.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cardWidth != null && Object.hasOwnProperty.call(message, "cardWidth")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cardWidth); - if (message.cardContents != null && message.cardContents.length) - for (var i = 0; i < message.cardContents.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.encode(message.cardContents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Creates a plain object from a BatchUpdateEntitiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest} message BatchUpdateEntitiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchUpdateEntitiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entities = []; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + object.updateMask = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entities && message.entities.length) { + object.entities = []; + for (var j = 0; j < message.entities.length; ++j) + object.entities[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.toObject(message.entities[j], options); + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + return object; + }; - /** - * Encodes the specified RbmCarouselCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCarouselCard} message RbmCarouselCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmCarouselCard.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this BatchUpdateEntitiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateEntitiesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchUpdateEntitiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a RbmCarouselCard message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard} RbmCarouselCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmCarouselCard.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.cardWidth = reader.int32(); - break; - case 2: - if (!(message.cardContents && message.cardContents.length)) - message.cardContents = []; - message.cardContents.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return BatchUpdateEntitiesRequest; + })(); - /** - * Decodes a RbmCarouselCard message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard} RbmCarouselCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmCarouselCard.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + v2beta1.BatchDeleteEntitiesRequest = (function() { - /** - * Verifies a RbmCarouselCard message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RbmCarouselCard.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cardWidth != null && message.hasOwnProperty("cardWidth")) - switch (message.cardWidth) { - default: - return "cardWidth: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.cardContents != null && message.hasOwnProperty("cardContents")) { - if (!Array.isArray(message.cardContents)) - return "cardContents: array expected"; - for (var i = 0; i < message.cardContents.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.verify(message.cardContents[i]); - if (error) - return "cardContents." + error; - } - } - return null; - }; + /** + * Properties of a BatchDeleteEntitiesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IBatchDeleteEntitiesRequest + * @property {string|null} [parent] BatchDeleteEntitiesRequest parent + * @property {Array.|null} [entityValues] BatchDeleteEntitiesRequest entityValues + * @property {string|null} [languageCode] BatchDeleteEntitiesRequest languageCode + */ - /** - * Creates a RbmCarouselCard message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard} RbmCarouselCard - */ - RbmCarouselCard.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard(); - switch (object.cardWidth) { - case "CARD_WIDTH_UNSPECIFIED": - case 0: - message.cardWidth = 0; - break; - case "SMALL": - case 1: - message.cardWidth = 1; - break; - case "MEDIUM": - case 2: - message.cardWidth = 2; - break; - } - if (object.cardContents) { - if (!Array.isArray(object.cardContents)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.cardContents: array expected"); - message.cardContents = []; - for (var i = 0; i < object.cardContents.length; ++i) { - if (typeof object.cardContents[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.cardContents: object expected"); - message.cardContents[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.fromObject(object.cardContents[i]); - } - } - return message; - }; + /** + * Constructs a new BatchDeleteEntitiesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a BatchDeleteEntitiesRequest. + * @implements IBatchDeleteEntitiesRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest=} [properties] Properties to set + */ + function BatchDeleteEntitiesRequest(properties) { + this.entityValues = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a plain object from a RbmCarouselCard message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard} message RbmCarouselCard - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RbmCarouselCard.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.cardContents = []; - if (options.defaults) - object.cardWidth = options.enums === String ? "CARD_WIDTH_UNSPECIFIED" : 0; - if (message.cardWidth != null && message.hasOwnProperty("cardWidth")) - object.cardWidth = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth[message.cardWidth] : message.cardWidth; - if (message.cardContents && message.cardContents.length) { - object.cardContents = []; - for (var j = 0; j < message.cardContents.length; ++j) - object.cardContents[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.toObject(message.cardContents[j], options); - } - return object; - }; + /** + * BatchDeleteEntitiesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest + * @instance + */ + BatchDeleteEntitiesRequest.prototype.parent = ""; - /** - * Converts this RbmCarouselCard to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard - * @instance - * @returns {Object.} JSON object - */ - RbmCarouselCard.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * BatchDeleteEntitiesRequest entityValues. + * @member {Array.} entityValues + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest + * @instance + */ + BatchDeleteEntitiesRequest.prototype.entityValues = $util.emptyArray; - /** - * CardWidth enum. - * @name google.cloud.dialogflow.v2beta1.Intent.Message.RbmCarouselCard.CardWidth - * @enum {number} - * @property {number} CARD_WIDTH_UNSPECIFIED=0 CARD_WIDTH_UNSPECIFIED value - * @property {number} SMALL=1 SMALL value - * @property {number} MEDIUM=2 MEDIUM value - */ - RbmCarouselCard.CardWidth = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CARD_WIDTH_UNSPECIFIED"] = 0; - values[valuesById[1] = "SMALL"] = 1; - values[valuesById[2] = "MEDIUM"] = 2; - return values; - })(); + /** + * BatchDeleteEntitiesRequest languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest + * @instance + */ + BatchDeleteEntitiesRequest.prototype.languageCode = ""; - return RbmCarouselCard; - })(); + /** + * Creates a new BatchDeleteEntitiesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest instance + */ + BatchDeleteEntitiesRequest.create = function create(properties) { + return new BatchDeleteEntitiesRequest(properties); + }; - Message.RbmStandaloneCard = (function() { + /** + * Encodes the specified BatchDeleteEntitiesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest} message BatchDeleteEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteEntitiesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.entityValues != null && message.entityValues.length) + for (var i = 0; i < message.entityValues.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.entityValues[i]); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + return writer; + }; - /** - * Properties of a RbmStandaloneCard. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IRbmStandaloneCard - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation|null} [cardOrientation] RbmStandaloneCard cardOrientation - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment|null} [thumbnailImageAlignment] RbmStandaloneCard thumbnailImageAlignment - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent|null} [cardContent] RbmStandaloneCard cardContent - */ + /** + * Encodes the specified BatchDeleteEntitiesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteEntitiesRequest} message BatchDeleteEntitiesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchDeleteEntitiesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new RbmStandaloneCard. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a RbmStandaloneCard. - * @implements IRbmStandaloneCard - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard=} [properties] Properties to set - */ - function RbmStandaloneCard(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteEntitiesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + if (!(message.entityValues && message.entityValues.length)) + message.entityValues = []; + message.entityValues.push(reader.string()); + break; + case 3: + message.languageCode = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * RbmStandaloneCard cardOrientation. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation} cardOrientation - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard - * @instance - */ - RbmStandaloneCard.prototype.cardOrientation = 0; - - /** - * RbmStandaloneCard thumbnailImageAlignment. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment} thumbnailImageAlignment - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard - * @instance - */ - RbmStandaloneCard.prototype.thumbnailImageAlignment = 0; + /** + * Decodes a BatchDeleteEntitiesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchDeleteEntitiesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * RbmStandaloneCard cardContent. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent|null|undefined} cardContent - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard - * @instance - */ - RbmStandaloneCard.prototype.cardContent = null; + /** + * Verifies a BatchDeleteEntitiesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchDeleteEntitiesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.entityValues != null && message.hasOwnProperty("entityValues")) { + if (!Array.isArray(message.entityValues)) + return "entityValues: array expected"; + for (var i = 0; i < message.entityValues.length; ++i) + if (!$util.isString(message.entityValues[i])) + return "entityValues: string[] expected"; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; + return null; + }; - /** - * Creates a new RbmStandaloneCard instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard} RbmStandaloneCard instance - */ - RbmStandaloneCard.create = function create(properties) { - return new RbmStandaloneCard(properties); - }; + /** + * Creates a BatchDeleteEntitiesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest} BatchDeleteEntitiesRequest + */ + BatchDeleteEntitiesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.entityValues) { + if (!Array.isArray(object.entityValues)) + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest.entityValues: array expected"); + message.entityValues = []; + for (var i = 0; i < object.entityValues.length; ++i) + message.entityValues[i] = String(object.entityValues[i]); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); + return message; + }; - /** - * Encodes the specified RbmStandaloneCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard} message RbmStandaloneCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmStandaloneCard.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cardOrientation != null && Object.hasOwnProperty.call(message, "cardOrientation")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.cardOrientation); - if (message.thumbnailImageAlignment != null && Object.hasOwnProperty.call(message, "thumbnailImageAlignment")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.thumbnailImageAlignment); - if (message.cardContent != null && Object.hasOwnProperty.call(message, "cardContent")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.encode(message.cardContent, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; + /** + * Creates a plain object from a BatchDeleteEntitiesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest} message BatchDeleteEntitiesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchDeleteEntitiesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityValues = []; + if (options.defaults) { + object.parent = ""; + object.languageCode = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.entityValues && message.entityValues.length) { + object.entityValues = []; + for (var j = 0; j < message.entityValues.length; ++j) + object.entityValues[j] = message.entityValues[j]; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + return object; + }; - /** - * Encodes the specified RbmStandaloneCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmStandaloneCard} message RbmStandaloneCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmStandaloneCard.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this BatchDeleteEntitiesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteEntitiesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchDeleteEntitiesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a RbmStandaloneCard message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard} RbmStandaloneCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmStandaloneCard.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.cardOrientation = reader.int32(); - break; - case 2: - message.thumbnailImageAlignment = reader.int32(); - break; - case 3: - message.cardContent = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return BatchDeleteEntitiesRequest; + })(); - /** - * Decodes a RbmStandaloneCard message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard} RbmStandaloneCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmStandaloneCard.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + v2beta1.EntityTypeBatch = (function() { - /** - * Verifies a RbmStandaloneCard message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RbmStandaloneCard.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cardOrientation != null && message.hasOwnProperty("cardOrientation")) - switch (message.cardOrientation) { - default: - return "cardOrientation: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.thumbnailImageAlignment != null && message.hasOwnProperty("thumbnailImageAlignment")) - switch (message.thumbnailImageAlignment) { - default: - return "thumbnailImageAlignment: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.cardContent != null && message.hasOwnProperty("cardContent")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.verify(message.cardContent); - if (error) - return "cardContent." + error; - } - return null; - }; + /** + * Properties of an EntityTypeBatch. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IEntityTypeBatch + * @property {Array.|null} [entityTypes] EntityTypeBatch entityTypes + */ - /** - * Creates a RbmStandaloneCard message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard} RbmStandaloneCard - */ - RbmStandaloneCard.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard(); - switch (object.cardOrientation) { - case "CARD_ORIENTATION_UNSPECIFIED": - case 0: - message.cardOrientation = 0; - break; - case "HORIZONTAL": - case 1: - message.cardOrientation = 1; - break; - case "VERTICAL": - case 2: - message.cardOrientation = 2; - break; - } - switch (object.thumbnailImageAlignment) { - case "THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED": - case 0: - message.thumbnailImageAlignment = 0; - break; - case "LEFT": - case 1: - message.thumbnailImageAlignment = 1; - break; - case "RIGHT": - case 2: - message.thumbnailImageAlignment = 2; - break; - } - if (object.cardContent != null) { - if (typeof object.cardContent !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.cardContent: object expected"); - message.cardContent = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.fromObject(object.cardContent); - } - return message; - }; + /** + * Constructs a new EntityTypeBatch. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an EntityTypeBatch. + * @implements IEntityTypeBatch + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IEntityTypeBatch=} [properties] Properties to set + */ + function EntityTypeBatch(properties) { + this.entityTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a plain object from a RbmStandaloneCard message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard} message RbmStandaloneCard - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RbmStandaloneCard.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.cardOrientation = options.enums === String ? "CARD_ORIENTATION_UNSPECIFIED" : 0; - object.thumbnailImageAlignment = options.enums === String ? "THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED" : 0; - object.cardContent = null; - } - if (message.cardOrientation != null && message.hasOwnProperty("cardOrientation")) - object.cardOrientation = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation[message.cardOrientation] : message.cardOrientation; - if (message.thumbnailImageAlignment != null && message.hasOwnProperty("thumbnailImageAlignment")) - object.thumbnailImageAlignment = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment[message.thumbnailImageAlignment] : message.thumbnailImageAlignment; - if (message.cardContent != null && message.hasOwnProperty("cardContent")) - object.cardContent = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.toObject(message.cardContent, options); - return object; - }; + /** + * EntityTypeBatch entityTypes. + * @member {Array.} entityTypes + * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch + * @instance + */ + EntityTypeBatch.prototype.entityTypes = $util.emptyArray; - /** - * Converts this RbmStandaloneCard to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard - * @instance - * @returns {Object.} JSON object - */ - RbmStandaloneCard.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new EntityTypeBatch instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch + * @static + * @param {google.cloud.dialogflow.v2beta1.IEntityTypeBatch=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.EntityTypeBatch} EntityTypeBatch instance + */ + EntityTypeBatch.create = function create(properties) { + return new EntityTypeBatch(properties); + }; - /** - * CardOrientation enum. - * @name google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.CardOrientation - * @enum {number} - * @property {number} CARD_ORIENTATION_UNSPECIFIED=0 CARD_ORIENTATION_UNSPECIFIED value - * @property {number} HORIZONTAL=1 HORIZONTAL value - * @property {number} VERTICAL=2 VERTICAL value - */ - RbmStandaloneCard.CardOrientation = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "CARD_ORIENTATION_UNSPECIFIED"] = 0; - values[valuesById[1] = "HORIZONTAL"] = 1; - values[valuesById[2] = "VERTICAL"] = 2; - return values; - })(); + /** + * Encodes the specified EntityTypeBatch message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityTypeBatch.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch + * @static + * @param {google.cloud.dialogflow.v2beta1.IEntityTypeBatch} message EntityTypeBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityTypeBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.entityTypes != null && message.entityTypes.length) + for (var i = 0; i < message.entityTypes.length; ++i) + $root.google.cloud.dialogflow.v2beta1.EntityType.encode(message.entityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; - /** - * ThumbnailImageAlignment enum. - * @name google.cloud.dialogflow.v2beta1.Intent.Message.RbmStandaloneCard.ThumbnailImageAlignment - * @enum {number} - * @property {number} THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED=0 THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED value - * @property {number} LEFT=1 LEFT value - * @property {number} RIGHT=2 RIGHT value - */ - RbmStandaloneCard.ThumbnailImageAlignment = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED"] = 0; - values[valuesById[1] = "LEFT"] = 1; - values[valuesById[2] = "RIGHT"] = 2; - return values; - })(); + /** + * Encodes the specified EntityTypeBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EntityTypeBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch + * @static + * @param {google.cloud.dialogflow.v2beta1.IEntityTypeBatch} message EntityTypeBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EntityTypeBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return RbmStandaloneCard; - })(); + /** + * Decodes an EntityTypeBatch message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.EntityTypeBatch} EntityTypeBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityTypeBatch.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.entityTypes && message.entityTypes.length)) + message.entityTypes = []; + message.entityTypes.push($root.google.cloud.dialogflow.v2beta1.EntityType.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - Message.RbmCardContent = (function() { + /** + * Decodes an EntityTypeBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.EntityTypeBatch} EntityTypeBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EntityTypeBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of a RbmCardContent. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IRbmCardContent - * @property {string|null} [title] RbmCardContent title - * @property {string|null} [description] RbmCardContent description - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia|null} [media] RbmCardContent media - * @property {Array.|null} [suggestions] RbmCardContent suggestions - */ + /** + * Verifies an EntityTypeBatch message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EntityTypeBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.entityTypes != null && message.hasOwnProperty("entityTypes")) { + if (!Array.isArray(message.entityTypes)) + return "entityTypes: array expected"; + for (var i = 0; i < message.entityTypes.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.EntityType.verify(message.entityTypes[i]); + if (error) + return "entityTypes." + error; + } + } + return null; + }; - /** - * Constructs a new RbmCardContent. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a RbmCardContent. - * @implements IRbmCardContent - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent=} [properties] Properties to set - */ - function RbmCardContent(properties) { - this.suggestions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Creates an EntityTypeBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.EntityTypeBatch} EntityTypeBatch + */ + EntityTypeBatch.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.EntityTypeBatch(); + if (object.entityTypes) { + if (!Array.isArray(object.entityTypes)) + throw TypeError(".google.cloud.dialogflow.v2beta1.EntityTypeBatch.entityTypes: array expected"); + message.entityTypes = []; + for (var i = 0; i < object.entityTypes.length; ++i) { + if (typeof object.entityTypes[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.EntityTypeBatch.entityTypes: object expected"); + message.entityTypes[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.fromObject(object.entityTypes[i]); } + } + return message; + }; - /** - * RbmCardContent title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @instance - */ - RbmCardContent.prototype.title = ""; + /** + * Creates a plain object from an EntityTypeBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch + * @static + * @param {google.cloud.dialogflow.v2beta1.EntityTypeBatch} message EntityTypeBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EntityTypeBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.entityTypes = []; + if (message.entityTypes && message.entityTypes.length) { + object.entityTypes = []; + for (var j = 0; j < message.entityTypes.length; ++j) + object.entityTypes[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.toObject(message.entityTypes[j], options); + } + return object; + }; - /** - * RbmCardContent description. - * @member {string} description - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @instance - */ - RbmCardContent.prototype.description = ""; + /** + * Converts this EntityTypeBatch to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.EntityTypeBatch + * @instance + * @returns {Object.} JSON object + */ + EntityTypeBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * RbmCardContent media. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia|null|undefined} media - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @instance - */ - RbmCardContent.prototype.media = null; + return EntityTypeBatch; + })(); - /** - * RbmCardContent suggestions. - * @member {Array.} suggestions - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @instance - */ - RbmCardContent.prototype.suggestions = $util.emptyArray; + v2beta1.Conversations = (function() { - /** - * Creates a new RbmCardContent instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent} RbmCardContent instance - */ - RbmCardContent.create = function create(properties) { - return new RbmCardContent(properties); - }; + /** + * Constructs a new Conversations service. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a Conversations + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Conversations(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } - /** - * Encodes the specified RbmCardContent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent} message RbmCardContent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmCardContent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.media != null && Object.hasOwnProperty.call(message, "media")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.encode(message.media, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.suggestions != null && message.suggestions.length) - for (var i = 0; i < message.suggestions.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.encode(message.suggestions[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; + (Conversations.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Conversations; - /** - * Encodes the specified RbmCardContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmCardContent} message RbmCardContent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmCardContent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates new Conversations service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Conversations} RPC service. Useful where requests and/or responses are streamed. + */ + Conversations.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; - /** - * Decodes a RbmCardContent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent} RbmCardContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmCardContent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.media = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.suggestions && message.suggestions.length)) - message.suggestions = []; - message.suggestions.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#createConversation}. + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @typedef CreateConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Conversation} [response] Conversation + */ - /** - * Decodes a RbmCardContent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent} RbmCardContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmCardContent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls CreateConversation. + * @function createConversation + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateConversationRequest} request CreateConversationRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Conversations.CreateConversationCallback} callback Node-style callback called with the error, if any, and Conversation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.createConversation = function createConversation(request, callback) { + return this.rpcCall(createConversation, $root.google.cloud.dialogflow.v2beta1.CreateConversationRequest, $root.google.cloud.dialogflow.v2beta1.Conversation, request, callback); + }, "name", { value: "CreateConversation" }); - /** - * Verifies a RbmCardContent message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RbmCardContent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.media != null && message.hasOwnProperty("media")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.verify(message.media); - if (error) - return "media." + error; - } - if (message.suggestions != null && message.hasOwnProperty("suggestions")) { - if (!Array.isArray(message.suggestions)) - return "suggestions: array expected"; - for (var i = 0; i < message.suggestions.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.verify(message.suggestions[i]); - if (error) - return "suggestions." + error; - } - } - return null; - }; + /** + * Calls CreateConversation. + * @function createConversation + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateConversationRequest} request CreateConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a RbmCardContent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent} RbmCardContent - */ - RbmCardContent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent(); - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.media != null) { - if (typeof object.media !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.media: object expected"); - message.media = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.fromObject(object.media); - } - if (object.suggestions) { - if (!Array.isArray(object.suggestions)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.suggestions: array expected"); - message.suggestions = []; - for (var i = 0; i < object.suggestions.length; ++i) { - if (typeof object.suggestions[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.suggestions: object expected"); - message.suggestions[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.fromObject(object.suggestions[i]); - } - } - return message; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#listConversations}. + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @typedef ListConversationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListConversationsResponse} [response] ListConversationsResponse + */ - /** - * Creates a plain object from a RbmCardContent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent} message RbmCardContent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RbmCardContent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.suggestions = []; - if (options.defaults) { - object.title = ""; - object.description = ""; - object.media = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.media != null && message.hasOwnProperty("media")) - object.media = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.toObject(message.media, options); - if (message.suggestions && message.suggestions.length) { - object.suggestions = []; - for (var j = 0; j < message.suggestions.length; ++j) - object.suggestions[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.toObject(message.suggestions[j], options); - } - return object; - }; + /** + * Calls ListConversations. + * @function listConversations + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListConversationsRequest} request ListConversationsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Conversations.ListConversationsCallback} callback Node-style callback called with the error, if any, and ListConversationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.listConversations = function listConversations(request, callback) { + return this.rpcCall(listConversations, $root.google.cloud.dialogflow.v2beta1.ListConversationsRequest, $root.google.cloud.dialogflow.v2beta1.ListConversationsResponse, request, callback); + }, "name", { value: "ListConversations" }); - /** - * Converts this RbmCardContent to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @instance - * @returns {Object.} JSON object - */ - RbmCardContent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls ListConversations. + * @function listConversations + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListConversationsRequest} request ListConversationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - RbmCardContent.RbmMedia = (function() { + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#getConversation}. + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @typedef GetConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Conversation} [response] Conversation + */ - /** - * Properties of a RbmMedia. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @interface IRbmMedia - * @property {string|null} [fileUri] RbmMedia fileUri - * @property {string|null} [thumbnailUri] RbmMedia thumbnailUri - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height|null} [height] RbmMedia height - */ + /** + * Calls GetConversation. + * @function getConversation + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetConversationRequest} request GetConversationRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Conversations.GetConversationCallback} callback Node-style callback called with the error, if any, and Conversation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.getConversation = function getConversation(request, callback) { + return this.rpcCall(getConversation, $root.google.cloud.dialogflow.v2beta1.GetConversationRequest, $root.google.cloud.dialogflow.v2beta1.Conversation, request, callback); + }, "name", { value: "GetConversation" }); - /** - * Constructs a new RbmMedia. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent - * @classdesc Represents a RbmMedia. - * @implements IRbmMedia - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia=} [properties] Properties to set - */ - function RbmMedia(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Calls GetConversation. + * @function getConversation + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetConversationRequest} request GetConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * RbmMedia fileUri. - * @member {string} fileUri - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia - * @instance - */ - RbmMedia.prototype.fileUri = ""; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#completeConversation}. + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @typedef CompleteConversationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Conversation} [response] Conversation + */ - /** - * RbmMedia thumbnailUri. - * @member {string} thumbnailUri - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia - * @instance - */ - RbmMedia.prototype.thumbnailUri = ""; + /** + * Calls CompleteConversation. + * @function completeConversation + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICompleteConversationRequest} request CompleteConversationRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Conversations.CompleteConversationCallback} callback Node-style callback called with the error, if any, and Conversation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.completeConversation = function completeConversation(request, callback) { + return this.rpcCall(completeConversation, $root.google.cloud.dialogflow.v2beta1.CompleteConversationRequest, $root.google.cloud.dialogflow.v2beta1.Conversation, request, callback); + }, "name", { value: "CompleteConversation" }); - /** - * RbmMedia height. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height} height - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia - * @instance - */ - RbmMedia.prototype.height = 0; + /** + * Calls CompleteConversation. + * @function completeConversation + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICompleteConversationRequest} request CompleteConversationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a new RbmMedia instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia} RbmMedia instance - */ - RbmMedia.create = function create(properties) { - return new RbmMedia(properties); - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#createCallMatcher}. + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @typedef CreateCallMatcherCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.CallMatcher} [response] CallMatcher + */ - /** - * Encodes the specified RbmMedia message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia} message RbmMedia message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmMedia.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fileUri != null && Object.hasOwnProperty.call(message, "fileUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.fileUri); - if (message.thumbnailUri != null && Object.hasOwnProperty.call(message, "thumbnailUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.thumbnailUri); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.height); - return writer; - }; + /** + * Calls CreateCallMatcher. + * @function createCallMatcher + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest} request CreateCallMatcherRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Conversations.CreateCallMatcherCallback} callback Node-style callback called with the error, if any, and CallMatcher + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.createCallMatcher = function createCallMatcher(request, callback) { + return this.rpcCall(createCallMatcher, $root.google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest, $root.google.cloud.dialogflow.v2beta1.CallMatcher, request, callback); + }, "name", { value: "CreateCallMatcher" }); - /** - * Encodes the specified RbmMedia message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.IRbmMedia} message RbmMedia message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmMedia.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Calls CreateCallMatcher. + * @function createCallMatcher + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest} request CreateCallMatcherRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Decodes a RbmMedia message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia} RbmMedia - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmMedia.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fileUri = reader.string(); - break; - case 2: - message.thumbnailUri = reader.string(); - break; - case 3: - message.height = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#listCallMatchers}. + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @typedef ListCallMatchersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListCallMatchersResponse} [response] ListCallMatchersResponse + */ - /** - * Decodes a RbmMedia message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia} RbmMedia - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmMedia.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Calls ListCallMatchers. + * @function listCallMatchers + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListCallMatchersRequest} request ListCallMatchersRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Conversations.ListCallMatchersCallback} callback Node-style callback called with the error, if any, and ListCallMatchersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.listCallMatchers = function listCallMatchers(request, callback) { + return this.rpcCall(listCallMatchers, $root.google.cloud.dialogflow.v2beta1.ListCallMatchersRequest, $root.google.cloud.dialogflow.v2beta1.ListCallMatchersResponse, request, callback); + }, "name", { value: "ListCallMatchers" }); - /** - * Verifies a RbmMedia message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RbmMedia.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fileUri != null && message.hasOwnProperty("fileUri")) - if (!$util.isString(message.fileUri)) - return "fileUri: string expected"; - if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) - if (!$util.isString(message.thumbnailUri)) - return "thumbnailUri: string expected"; - if (message.height != null && message.hasOwnProperty("height")) - switch (message.height) { - default: - return "height: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; + /** + * Calls ListCallMatchers. + * @function listCallMatchers + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListCallMatchersRequest} request ListCallMatchersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Creates a RbmMedia message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia} RbmMedia - */ - RbmMedia.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia(); - if (object.fileUri != null) - message.fileUri = String(object.fileUri); - if (object.thumbnailUri != null) - message.thumbnailUri = String(object.thumbnailUri); - switch (object.height) { - case "HEIGHT_UNSPECIFIED": - case 0: - message.height = 0; - break; - case "SHORT": - case 1: - message.height = 1; - break; - case "MEDIUM": - case 2: - message.height = 2; - break; - case "TALL": - case 3: - message.height = 3; - break; - } - return message; - }; + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#deleteCallMatcher}. + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @typedef DeleteCallMatcherCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty + */ - /** - * Creates a plain object from a RbmMedia message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia} message RbmMedia - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RbmMedia.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.fileUri = ""; - object.thumbnailUri = ""; - object.height = options.enums === String ? "HEIGHT_UNSPECIFIED" : 0; - } - if (message.fileUri != null && message.hasOwnProperty("fileUri")) - object.fileUri = message.fileUri; - if (message.thumbnailUri != null && message.hasOwnProperty("thumbnailUri")) - object.thumbnailUri = message.thumbnailUri; - if (message.height != null && message.hasOwnProperty("height")) - object.height = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height[message.height] : message.height; - return object; - }; + /** + * Calls DeleteCallMatcher. + * @function deleteCallMatcher + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest} request DeleteCallMatcherRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Conversations.DeleteCallMatcherCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.deleteCallMatcher = function deleteCallMatcher(request, callback) { + return this.rpcCall(deleteCallMatcher, $root.google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteCallMatcher" }); - /** - * Converts this RbmMedia to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia - * @instance - * @returns {Object.} JSON object - */ - RbmMedia.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Calls DeleteCallMatcher. + * @function deleteCallMatcher + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest} request DeleteCallMatcherRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * Height enum. - * @name google.cloud.dialogflow.v2beta1.Intent.Message.RbmCardContent.RbmMedia.Height - * @enum {number} - * @property {number} HEIGHT_UNSPECIFIED=0 HEIGHT_UNSPECIFIED value - * @property {number} SHORT=1 SHORT value - * @property {number} MEDIUM=2 MEDIUM value - * @property {number} TALL=3 TALL value - */ - RbmMedia.Height = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HEIGHT_UNSPECIFIED"] = 0; - values[valuesById[1] = "SHORT"] = 1; - values[valuesById[2] = "MEDIUM"] = 2; - values[valuesById[3] = "TALL"] = 3; - return values; - })(); + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#batchCreateMessages}. + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @typedef BatchCreateMessagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse} [response] BatchCreateMessagesResponse + */ - return RbmMedia; - })(); + /** + * Calls BatchCreateMessages. + * @function batchCreateMessages + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest} request BatchCreateMessagesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Conversations.BatchCreateMessagesCallback} callback Node-style callback called with the error, if any, and BatchCreateMessagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.batchCreateMessages = function batchCreateMessages(request, callback) { + return this.rpcCall(batchCreateMessages, $root.google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest, $root.google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse, request, callback); + }, "name", { value: "BatchCreateMessages" }); - return RbmCardContent; - })(); + /** + * Calls BatchCreateMessages. + * @function batchCreateMessages + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest} request BatchCreateMessagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - Message.RbmSuggestion = (function() { + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Conversations#listMessages}. + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @typedef ListMessagesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListMessagesResponse} [response] ListMessagesResponse + */ - /** - * Properties of a RbmSuggestion. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IRbmSuggestion - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply|null} [reply] RbmSuggestion reply - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction|null} [action] RbmSuggestion action - */ + /** + * Calls ListMessages. + * @function listMessages + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListMessagesRequest} request ListMessagesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Conversations.ListMessagesCallback} callback Node-style callback called with the error, if any, and ListMessagesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Conversations.prototype.listMessages = function listMessages(request, callback) { + return this.rpcCall(listMessages, $root.google.cloud.dialogflow.v2beta1.ListMessagesRequest, $root.google.cloud.dialogflow.v2beta1.ListMessagesResponse, request, callback); + }, "name", { value: "ListMessages" }); - /** - * Constructs a new RbmSuggestion. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a RbmSuggestion. - * @implements IRbmSuggestion - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion=} [properties] Properties to set - */ - function RbmSuggestion(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Calls ListMessages. + * @function listMessages + * @memberof google.cloud.dialogflow.v2beta1.Conversations + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListMessagesRequest} request ListMessagesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ - /** - * RbmSuggestion reply. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply|null|undefined} reply - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion - * @instance - */ - RbmSuggestion.prototype.reply = null; + return Conversations; + })(); - /** - * RbmSuggestion action. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction|null|undefined} action - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion - * @instance - */ - RbmSuggestion.prototype.action = null; + v2beta1.Conversation = (function() { - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Properties of a Conversation. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IConversation + * @property {string|null} [name] Conversation name + * @property {google.cloud.dialogflow.v2beta1.Conversation.LifecycleState|null} [lifecycleState] Conversation lifecycleState + * @property {string|null} [conversationProfile] Conversation conversationProfile + * @property {google.cloud.dialogflow.v2beta1.IConversationPhoneNumber|null} [phoneNumber] Conversation phoneNumber + * @property {google.cloud.dialogflow.v2beta1.Conversation.ConversationStage|null} [conversationStage] Conversation conversationStage + * @property {google.protobuf.ITimestamp|null} [startTime] Conversation startTime + * @property {google.protobuf.ITimestamp|null} [endTime] Conversation endTime + */ - /** - * RbmSuggestion suggestion. - * @member {"reply"|"action"|undefined} suggestion - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion - * @instance - */ - Object.defineProperty(RbmSuggestion.prototype, "suggestion", { - get: $util.oneOfGetter($oneOfFields = ["reply", "action"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Constructs a new Conversation. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a Conversation. + * @implements IConversation + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IConversation=} [properties] Properties to set + */ + function Conversation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new RbmSuggestion instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion} RbmSuggestion instance - */ - RbmSuggestion.create = function create(properties) { - return new RbmSuggestion(properties); - }; + /** + * Conversation name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @instance + */ + Conversation.prototype.name = ""; - /** - * Encodes the specified RbmSuggestion message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion} message RbmSuggestion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmSuggestion.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.reply != null && Object.hasOwnProperty.call(message, "reply")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.encode(message.reply, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.encode(message.action, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Conversation lifecycleState. + * @member {google.cloud.dialogflow.v2beta1.Conversation.LifecycleState} lifecycleState + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @instance + */ + Conversation.prototype.lifecycleState = 0; - /** - * Encodes the specified RbmSuggestion message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestion} message RbmSuggestion message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmSuggestion.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Conversation conversationProfile. + * @member {string} conversationProfile + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @instance + */ + Conversation.prototype.conversationProfile = ""; - /** - * Decodes a RbmSuggestion message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion} RbmSuggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmSuggestion.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.reply = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.decode(reader, reader.uint32()); - break; - case 2: - message.action = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Conversation phoneNumber. + * @member {google.cloud.dialogflow.v2beta1.IConversationPhoneNumber|null|undefined} phoneNumber + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @instance + */ + Conversation.prototype.phoneNumber = null; - /** - * Decodes a RbmSuggestion message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion} RbmSuggestion - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmSuggestion.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Conversation conversationStage. + * @member {google.cloud.dialogflow.v2beta1.Conversation.ConversationStage} conversationStage + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @instance + */ + Conversation.prototype.conversationStage = 0; - /** - * Verifies a RbmSuggestion message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RbmSuggestion.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.reply != null && message.hasOwnProperty("reply")) { - properties.suggestion = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.verify(message.reply); - if (error) - return "reply." + error; - } - } - if (message.action != null && message.hasOwnProperty("action")) { - if (properties.suggestion === 1) - return "suggestion: multiple values"; - properties.suggestion = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.verify(message.action); - if (error) - return "action." + error; - } - } - return null; - }; + /** + * Conversation startTime. + * @member {google.protobuf.ITimestamp|null|undefined} startTime + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @instance + */ + Conversation.prototype.startTime = null; - /** - * Creates a RbmSuggestion message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion} RbmSuggestion - */ - RbmSuggestion.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion(); - if (object.reply != null) { - if (typeof object.reply !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.reply: object expected"); - message.reply = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.fromObject(object.reply); - } - if (object.action != null) { - if (typeof object.action !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion.action: object expected"); - message.action = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.fromObject(object.action); - } - return message; - }; + /** + * Conversation endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @instance + */ + Conversation.prototype.endTime = null; - /** - * Creates a plain object from a RbmSuggestion message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion} message RbmSuggestion - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RbmSuggestion.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.reply != null && message.hasOwnProperty("reply")) { - object.reply = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.toObject(message.reply, options); - if (options.oneofs) - object.suggestion = "reply"; - } - if (message.action != null && message.hasOwnProperty("action")) { - object.action = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.toObject(message.action, options); - if (options.oneofs) - object.suggestion = "action"; - } - return object; - }; + /** + * Creates a new Conversation instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @static + * @param {google.cloud.dialogflow.v2beta1.IConversation=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Conversation} Conversation instance + */ + Conversation.create = function create(properties) { + return new Conversation(properties); + }; - /** - * Converts this RbmSuggestion to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestion - * @instance - * @returns {Object.} JSON object - */ - RbmSuggestion.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified Conversation message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Conversation.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @static + * @param {google.cloud.dialogflow.v2beta1.IConversation} message Conversation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Conversation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.lifecycleState != null && Object.hasOwnProperty.call(message, "lifecycleState")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.lifecycleState); + if (message.conversationProfile != null && Object.hasOwnProperty.call(message, "conversationProfile")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.conversationProfile); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + $root.google.cloud.dialogflow.v2beta1.ConversationPhoneNumber.encode(message.phoneNumber, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.startTime != null && Object.hasOwnProperty.call(message, "startTime")) + $root.google.protobuf.Timestamp.encode(message.startTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.conversationStage != null && Object.hasOwnProperty.call(message, "conversationStage")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.conversationStage); + return writer; + }; - return RbmSuggestion; - })(); + /** + * Encodes the specified Conversation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Conversation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @static + * @param {google.cloud.dialogflow.v2beta1.IConversation} message Conversation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Conversation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - Message.RbmSuggestedReply = (function() { + /** + * Decodes a Conversation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Conversation} Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Conversation.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Conversation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.lifecycleState = reader.int32(); + break; + case 3: + message.conversationProfile = reader.string(); + break; + case 4: + message.phoneNumber = $root.google.cloud.dialogflow.v2beta1.ConversationPhoneNumber.decode(reader, reader.uint32()); + break; + case 7: + message.conversationStage = reader.int32(); + break; + case 5: + message.startTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 6: + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a RbmSuggestedReply. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IRbmSuggestedReply - * @property {string|null} [text] RbmSuggestedReply text - * @property {string|null} [postbackData] RbmSuggestedReply postbackData - */ + /** + * Decodes a Conversation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Conversation} Conversation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Conversation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new RbmSuggestedReply. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a RbmSuggestedReply. - * @implements IRbmSuggestedReply - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply=} [properties] Properties to set - */ - function RbmSuggestedReply(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Verifies a Conversation message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Conversation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.lifecycleState != null && message.hasOwnProperty("lifecycleState")) + switch (message.lifecycleState) { + default: + return "lifecycleState: enum value expected"; + case 0: + case 1: + case 2: + break; } + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) + if (!$util.isString(message.conversationProfile)) + return "conversationProfile: string expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) { + var error = $root.google.cloud.dialogflow.v2beta1.ConversationPhoneNumber.verify(message.phoneNumber); + if (error) + return "phoneNumber." + error; + } + if (message.conversationStage != null && message.hasOwnProperty("conversationStage")) + switch (message.conversationStage) { + default: + return "conversationStage: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.startTime != null && message.hasOwnProperty("startTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.startTime); + if (error) + return "startTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + return null; + }; - /** - * RbmSuggestedReply text. - * @member {string} text - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply - * @instance - */ - RbmSuggestedReply.prototype.text = ""; - - /** - * RbmSuggestedReply postbackData. - * @member {string} postbackData - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply - * @instance - */ - RbmSuggestedReply.prototype.postbackData = ""; + /** + * Creates a Conversation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Conversation} Conversation + */ + Conversation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Conversation) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Conversation(); + if (object.name != null) + message.name = String(object.name); + switch (object.lifecycleState) { + case "LIFECYCLE_STATE_UNSPECIFIED": + case 0: + message.lifecycleState = 0; + break; + case "IN_PROGRESS": + case 1: + message.lifecycleState = 1; + break; + case "COMPLETED": + case 2: + message.lifecycleState = 2; + break; + } + if (object.conversationProfile != null) + message.conversationProfile = String(object.conversationProfile); + if (object.phoneNumber != null) { + if (typeof object.phoneNumber !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Conversation.phoneNumber: object expected"); + message.phoneNumber = $root.google.cloud.dialogflow.v2beta1.ConversationPhoneNumber.fromObject(object.phoneNumber); + } + switch (object.conversationStage) { + case "CONVERSATION_STAGE_UNSPECIFIED": + case 0: + message.conversationStage = 0; + break; + case "VIRTUAL_AGENT_STAGE": + case 1: + message.conversationStage = 1; + break; + case "HUMAN_ASSIST_STAGE": + case 2: + message.conversationStage = 2; + break; + } + if (object.startTime != null) { + if (typeof object.startTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Conversation.startTime: object expected"); + message.startTime = $root.google.protobuf.Timestamp.fromObject(object.startTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Conversation.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + return message; + }; - /** - * Creates a new RbmSuggestedReply instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply} RbmSuggestedReply instance - */ - RbmSuggestedReply.create = function create(properties) { - return new RbmSuggestedReply(properties); - }; + /** + * Creates a plain object from a Conversation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @static + * @param {google.cloud.dialogflow.v2beta1.Conversation} message Conversation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Conversation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.lifecycleState = options.enums === String ? "LIFECYCLE_STATE_UNSPECIFIED" : 0; + object.conversationProfile = ""; + object.phoneNumber = null; + object.startTime = null; + object.endTime = null; + object.conversationStage = options.enums === String ? "CONVERSATION_STAGE_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.lifecycleState != null && message.hasOwnProperty("lifecycleState")) + object.lifecycleState = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Conversation.LifecycleState[message.lifecycleState] : message.lifecycleState; + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) + object.conversationProfile = message.conversationProfile; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = $root.google.cloud.dialogflow.v2beta1.ConversationPhoneNumber.toObject(message.phoneNumber, options); + if (message.startTime != null && message.hasOwnProperty("startTime")) + object.startTime = $root.google.protobuf.Timestamp.toObject(message.startTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.conversationStage != null && message.hasOwnProperty("conversationStage")) + object.conversationStage = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Conversation.ConversationStage[message.conversationStage] : message.conversationStage; + return object; + }; - /** - * Encodes the specified RbmSuggestedReply message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply} message RbmSuggestedReply message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmSuggestedReply.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.postbackData != null && Object.hasOwnProperty.call(message, "postbackData")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.postbackData); - return writer; - }; + /** + * Converts this Conversation to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Conversation + * @instance + * @returns {Object.} JSON object + */ + Conversation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified RbmSuggestedReply message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedReply} message RbmSuggestedReply message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmSuggestedReply.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * LifecycleState enum. + * @name google.cloud.dialogflow.v2beta1.Conversation.LifecycleState + * @enum {number} + * @property {number} LIFECYCLE_STATE_UNSPECIFIED=0 LIFECYCLE_STATE_UNSPECIFIED value + * @property {number} IN_PROGRESS=1 IN_PROGRESS value + * @property {number} COMPLETED=2 COMPLETED value + */ + Conversation.LifecycleState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LIFECYCLE_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN_PROGRESS"] = 1; + values[valuesById[2] = "COMPLETED"] = 2; + return values; + })(); - /** - * Decodes a RbmSuggestedReply message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply} RbmSuggestedReply - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmSuggestedReply.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = reader.string(); - break; - case 2: - message.postbackData = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ConversationStage enum. + * @name google.cloud.dialogflow.v2beta1.Conversation.ConversationStage + * @enum {number} + * @property {number} CONVERSATION_STAGE_UNSPECIFIED=0 CONVERSATION_STAGE_UNSPECIFIED value + * @property {number} VIRTUAL_AGENT_STAGE=1 VIRTUAL_AGENT_STAGE value + * @property {number} HUMAN_ASSIST_STAGE=2 HUMAN_ASSIST_STAGE value + */ + Conversation.ConversationStage = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CONVERSATION_STAGE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VIRTUAL_AGENT_STAGE"] = 1; + values[valuesById[2] = "HUMAN_ASSIST_STAGE"] = 2; + return values; + })(); - /** - * Decodes a RbmSuggestedReply message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply} RbmSuggestedReply - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmSuggestedReply.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + return Conversation; + })(); - /** - * Verifies a RbmSuggestedReply message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RbmSuggestedReply.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.postbackData != null && message.hasOwnProperty("postbackData")) - if (!$util.isString(message.postbackData)) - return "postbackData: string expected"; - return null; - }; + v2beta1.ConversationPhoneNumber = (function() { - /** - * Creates a RbmSuggestedReply message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply} RbmSuggestedReply - */ - RbmSuggestedReply.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply(); - if (object.text != null) - message.text = String(object.text); - if (object.postbackData != null) - message.postbackData = String(object.postbackData); - return message; - }; + /** + * Properties of a ConversationPhoneNumber. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IConversationPhoneNumber + * @property {string|null} [phoneNumber] ConversationPhoneNumber phoneNumber + */ - /** - * Creates a plain object from a RbmSuggestedReply message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply} message RbmSuggestedReply - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RbmSuggestedReply.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.postbackData = ""; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.postbackData != null && message.hasOwnProperty("postbackData")) - object.postbackData = message.postbackData; - return object; - }; + /** + * Constructs a new ConversationPhoneNumber. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ConversationPhoneNumber. + * @implements IConversationPhoneNumber + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IConversationPhoneNumber=} [properties] Properties to set + */ + function ConversationPhoneNumber(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this RbmSuggestedReply to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedReply - * @instance - * @returns {Object.} JSON object - */ - RbmSuggestedReply.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ConversationPhoneNumber phoneNumber. + * @member {string} phoneNumber + * @memberof google.cloud.dialogflow.v2beta1.ConversationPhoneNumber + * @instance + */ + ConversationPhoneNumber.prototype.phoneNumber = ""; - return RbmSuggestedReply; - })(); + /** + * Creates a new ConversationPhoneNumber instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ConversationPhoneNumber + * @static + * @param {google.cloud.dialogflow.v2beta1.IConversationPhoneNumber=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ConversationPhoneNumber} ConversationPhoneNumber instance + */ + ConversationPhoneNumber.create = function create(properties) { + return new ConversationPhoneNumber(properties); + }; - Message.RbmSuggestedAction = (function() { + /** + * Encodes the specified ConversationPhoneNumber message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ConversationPhoneNumber.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ConversationPhoneNumber + * @static + * @param {google.cloud.dialogflow.v2beta1.IConversationPhoneNumber} message ConversationPhoneNumber message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationPhoneNumber.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.phoneNumber); + return writer; + }; - /** - * Properties of a RbmSuggestedAction. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IRbmSuggestedAction - * @property {string|null} [text] RbmSuggestedAction text - * @property {string|null} [postbackData] RbmSuggestedAction postbackData - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial|null} [dial] RbmSuggestedAction dial - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri|null} [openUrl] RbmSuggestedAction openUrl - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation|null} [shareLocation] RbmSuggestedAction shareLocation - */ + /** + * Encodes the specified ConversationPhoneNumber message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ConversationPhoneNumber.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ConversationPhoneNumber + * @static + * @param {google.cloud.dialogflow.v2beta1.IConversationPhoneNumber} message ConversationPhoneNumber message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationPhoneNumber.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new RbmSuggestedAction. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a RbmSuggestedAction. - * @implements IRbmSuggestedAction - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction=} [properties] Properties to set - */ - function RbmSuggestedAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a ConversationPhoneNumber message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ConversationPhoneNumber + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ConversationPhoneNumber} ConversationPhoneNumber + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationPhoneNumber.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ConversationPhoneNumber(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 3: + message.phoneNumber = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * RbmSuggestedAction text. - * @member {string} text - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @instance - */ - RbmSuggestedAction.prototype.text = ""; + /** + * Decodes a ConversationPhoneNumber message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ConversationPhoneNumber + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ConversationPhoneNumber} ConversationPhoneNumber + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationPhoneNumber.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * RbmSuggestedAction postbackData. - * @member {string} postbackData - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @instance - */ - RbmSuggestedAction.prototype.postbackData = ""; + /** + * Verifies a ConversationPhoneNumber message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ConversationPhoneNumber + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationPhoneNumber.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + if (!$util.isString(message.phoneNumber)) + return "phoneNumber: string expected"; + return null; + }; - /** - * RbmSuggestedAction dial. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial|null|undefined} dial - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @instance - */ - RbmSuggestedAction.prototype.dial = null; + /** + * Creates a ConversationPhoneNumber message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ConversationPhoneNumber + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ConversationPhoneNumber} ConversationPhoneNumber + */ + ConversationPhoneNumber.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ConversationPhoneNumber) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ConversationPhoneNumber(); + if (object.phoneNumber != null) + message.phoneNumber = String(object.phoneNumber); + return message; + }; - /** - * RbmSuggestedAction openUrl. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri|null|undefined} openUrl - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @instance - */ - RbmSuggestedAction.prototype.openUrl = null; + /** + * Creates a plain object from a ConversationPhoneNumber message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ConversationPhoneNumber + * @static + * @param {google.cloud.dialogflow.v2beta1.ConversationPhoneNumber} message ConversationPhoneNumber + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationPhoneNumber.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.phoneNumber = ""; + if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) + object.phoneNumber = message.phoneNumber; + return object; + }; - /** - * RbmSuggestedAction shareLocation. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation|null|undefined} shareLocation - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @instance - */ - RbmSuggestedAction.prototype.shareLocation = null; + /** + * Converts this ConversationPhoneNumber to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ConversationPhoneNumber + * @instance + * @returns {Object.} JSON object + */ + ConversationPhoneNumber.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + return ConversationPhoneNumber; + })(); - /** - * RbmSuggestedAction action. - * @member {"dial"|"openUrl"|"shareLocation"|undefined} action - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @instance - */ - Object.defineProperty(RbmSuggestedAction.prototype, "action", { - get: $util.oneOfGetter($oneOfFields = ["dial", "openUrl", "shareLocation"]), - set: $util.oneOfSetter($oneOfFields) - }); + v2beta1.CallMatcher = (function() { - /** - * Creates a new RbmSuggestedAction instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction} RbmSuggestedAction instance - */ - RbmSuggestedAction.create = function create(properties) { - return new RbmSuggestedAction(properties); - }; + /** + * Properties of a CallMatcher. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ICallMatcher + * @property {string|null} [name] CallMatcher name + * @property {string|null} [toHeader] CallMatcher toHeader + * @property {string|null} [fromHeader] CallMatcher fromHeader + * @property {string|null} [callIdHeader] CallMatcher callIdHeader + * @property {google.cloud.dialogflow.v2beta1.CallMatcher.ICustomHeaders|null} [customHeaders] CallMatcher customHeaders + */ - /** - * Encodes the specified RbmSuggestedAction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction} message RbmSuggestedAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmSuggestedAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.postbackData != null && Object.hasOwnProperty.call(message, "postbackData")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.postbackData); - if (message.dial != null && Object.hasOwnProperty.call(message, "dial")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.encode(message.dial, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.openUrl != null && Object.hasOwnProperty.call(message, "openUrl")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.encode(message.openUrl, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.shareLocation != null && Object.hasOwnProperty.call(message, "shareLocation")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.encode(message.shareLocation, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; + /** + * Constructs a new CallMatcher. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a CallMatcher. + * @implements ICallMatcher + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ICallMatcher=} [properties] Properties to set + */ + function CallMatcher(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CallMatcher name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @instance + */ + CallMatcher.prototype.name = ""; - /** - * Encodes the specified RbmSuggestedAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IRbmSuggestedAction} message RbmSuggestedAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmSuggestedAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * CallMatcher toHeader. + * @member {string} toHeader + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @instance + */ + CallMatcher.prototype.toHeader = ""; - /** - * Decodes a RbmSuggestedAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction} RbmSuggestedAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmSuggestedAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = reader.string(); - break; - case 2: - message.postbackData = reader.string(); - break; - case 3: - message.dial = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.decode(reader, reader.uint32()); - break; - case 4: - message.openUrl = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.decode(reader, reader.uint32()); - break; - case 5: - message.shareLocation = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * CallMatcher fromHeader. + * @member {string} fromHeader + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @instance + */ + CallMatcher.prototype.fromHeader = ""; - /** - * Decodes a RbmSuggestedAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction} RbmSuggestedAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmSuggestedAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * CallMatcher callIdHeader. + * @member {string} callIdHeader + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @instance + */ + CallMatcher.prototype.callIdHeader = ""; - /** - * Verifies a RbmSuggestedAction message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RbmSuggestedAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.postbackData != null && message.hasOwnProperty("postbackData")) - if (!$util.isString(message.postbackData)) - return "postbackData: string expected"; - if (message.dial != null && message.hasOwnProperty("dial")) { - properties.action = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.verify(message.dial); - if (error) - return "dial." + error; - } - } - if (message.openUrl != null && message.hasOwnProperty("openUrl")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.verify(message.openUrl); - if (error) - return "openUrl." + error; - } - } - if (message.shareLocation != null && message.hasOwnProperty("shareLocation")) { - if (properties.action === 1) - return "action: multiple values"; - properties.action = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.verify(message.shareLocation); - if (error) - return "shareLocation." + error; - } - } - return null; - }; + /** + * CallMatcher customHeaders. + * @member {google.cloud.dialogflow.v2beta1.CallMatcher.ICustomHeaders|null|undefined} customHeaders + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @instance + */ + CallMatcher.prototype.customHeaders = null; - /** - * Creates a RbmSuggestedAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction} RbmSuggestedAction - */ - RbmSuggestedAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction(); - if (object.text != null) - message.text = String(object.text); - if (object.postbackData != null) - message.postbackData = String(object.postbackData); - if (object.dial != null) { - if (typeof object.dial !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.dial: object expected"); - message.dial = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.fromObject(object.dial); - } - if (object.openUrl != null) { - if (typeof object.openUrl !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.openUrl: object expected"); - message.openUrl = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.fromObject(object.openUrl); - } - if (object.shareLocation != null) { - if (typeof object.shareLocation !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.shareLocation: object expected"); - message.shareLocation = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.fromObject(object.shareLocation); - } - return message; - }; + /** + * Creates a new CallMatcher instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @static + * @param {google.cloud.dialogflow.v2beta1.ICallMatcher=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CallMatcher} CallMatcher instance + */ + CallMatcher.create = function create(properties) { + return new CallMatcher(properties); + }; - /** - * Creates a plain object from a RbmSuggestedAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction} message RbmSuggestedAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RbmSuggestedAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.text = ""; - object.postbackData = ""; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.postbackData != null && message.hasOwnProperty("postbackData")) - object.postbackData = message.postbackData; - if (message.dial != null && message.hasOwnProperty("dial")) { - object.dial = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.toObject(message.dial, options); - if (options.oneofs) - object.action = "dial"; - } - if (message.openUrl != null && message.hasOwnProperty("openUrl")) { - object.openUrl = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.toObject(message.openUrl, options); - if (options.oneofs) - object.action = "openUrl"; - } - if (message.shareLocation != null && message.hasOwnProperty("shareLocation")) { - object.shareLocation = $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.toObject(message.shareLocation, options); - if (options.oneofs) - object.action = "shareLocation"; - } - return object; - }; + /** + * Encodes the specified CallMatcher message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CallMatcher.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @static + * @param {google.cloud.dialogflow.v2beta1.ICallMatcher} message CallMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CallMatcher.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.toHeader != null && Object.hasOwnProperty.call(message, "toHeader")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.toHeader); + if (message.fromHeader != null && Object.hasOwnProperty.call(message, "fromHeader")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.fromHeader); + if (message.callIdHeader != null && Object.hasOwnProperty.call(message, "callIdHeader")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.callIdHeader); + if (message.customHeaders != null && Object.hasOwnProperty.call(message, "customHeaders")) + $root.google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders.encode(message.customHeaders, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; - /** - * Converts this RbmSuggestedAction to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @instance - * @returns {Object.} JSON object - */ - RbmSuggestedAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified CallMatcher message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CallMatcher.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @static + * @param {google.cloud.dialogflow.v2beta1.ICallMatcher} message CallMatcher message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CallMatcher.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - RbmSuggestedAction.RbmSuggestedActionDial = (function() { + /** + * Decodes a CallMatcher message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CallMatcher} CallMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CallMatcher.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CallMatcher(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.toHeader = reader.string(); + break; + case 3: + message.fromHeader = reader.string(); + break; + case 4: + message.callIdHeader = reader.string(); + break; + case 5: + message.customHeaders = $root.google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a RbmSuggestedActionDial. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @interface IRbmSuggestedActionDial - * @property {string|null} [phoneNumber] RbmSuggestedActionDial phoneNumber - */ + /** + * Decodes a CallMatcher message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CallMatcher} CallMatcher + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CallMatcher.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new RbmSuggestedActionDial. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @classdesc Represents a RbmSuggestedActionDial. - * @implements IRbmSuggestedActionDial - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial=} [properties] Properties to set - */ - function RbmSuggestedActionDial(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Verifies a CallMatcher message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CallMatcher.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.toHeader != null && message.hasOwnProperty("toHeader")) + if (!$util.isString(message.toHeader)) + return "toHeader: string expected"; + if (message.fromHeader != null && message.hasOwnProperty("fromHeader")) + if (!$util.isString(message.fromHeader)) + return "fromHeader: string expected"; + if (message.callIdHeader != null && message.hasOwnProperty("callIdHeader")) + if (!$util.isString(message.callIdHeader)) + return "callIdHeader: string expected"; + if (message.customHeaders != null && message.hasOwnProperty("customHeaders")) { + var error = $root.google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders.verify(message.customHeaders); + if (error) + return "customHeaders." + error; + } + return null; + }; - /** - * RbmSuggestedActionDial phoneNumber. - * @member {string} phoneNumber - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial - * @instance - */ - RbmSuggestedActionDial.prototype.phoneNumber = ""; + /** + * Creates a CallMatcher message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CallMatcher} CallMatcher + */ + CallMatcher.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CallMatcher) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CallMatcher(); + if (object.name != null) + message.name = String(object.name); + if (object.toHeader != null) + message.toHeader = String(object.toHeader); + if (object.fromHeader != null) + message.fromHeader = String(object.fromHeader); + if (object.callIdHeader != null) + message.callIdHeader = String(object.callIdHeader); + if (object.customHeaders != null) { + if (typeof object.customHeaders !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CallMatcher.customHeaders: object expected"); + message.customHeaders = $root.google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders.fromObject(object.customHeaders); + } + return message; + }; - /** - * Creates a new RbmSuggestedActionDial instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial} RbmSuggestedActionDial instance - */ - RbmSuggestedActionDial.create = function create(properties) { - return new RbmSuggestedActionDial(properties); - }; + /** + * Creates a plain object from a CallMatcher message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @static + * @param {google.cloud.dialogflow.v2beta1.CallMatcher} message CallMatcher + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CallMatcher.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.toHeader = ""; + object.fromHeader = ""; + object.callIdHeader = ""; + object.customHeaders = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.toHeader != null && message.hasOwnProperty("toHeader")) + object.toHeader = message.toHeader; + if (message.fromHeader != null && message.hasOwnProperty("fromHeader")) + object.fromHeader = message.fromHeader; + if (message.callIdHeader != null && message.hasOwnProperty("callIdHeader")) + object.callIdHeader = message.callIdHeader; + if (message.customHeaders != null && message.hasOwnProperty("customHeaders")) + object.customHeaders = $root.google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders.toObject(message.customHeaders, options); + return object; + }; - /** - * Encodes the specified RbmSuggestedActionDial message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial} message RbmSuggestedActionDial message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmSuggestedActionDial.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.phoneNumber != null && Object.hasOwnProperty.call(message, "phoneNumber")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.phoneNumber); - return writer; - }; + /** + * Converts this CallMatcher to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @instance + * @returns {Object.} JSON object + */ + CallMatcher.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified RbmSuggestedActionDial message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionDial} message RbmSuggestedActionDial message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmSuggestedActionDial.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + CallMatcher.CustomHeaders = (function() { - /** - * Decodes a RbmSuggestedActionDial message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial} RbmSuggestedActionDial - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmSuggestedActionDial.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.phoneNumber = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a CustomHeaders. + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @interface ICustomHeaders + * @property {string|null} [ciscoGuid] CustomHeaders ciscoGuid + */ - /** - * Decodes a RbmSuggestedActionDial message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial} RbmSuggestedActionDial - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmSuggestedActionDial.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new CustomHeaders. + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher + * @classdesc Represents a CustomHeaders. + * @implements ICustomHeaders + * @constructor + * @param {google.cloud.dialogflow.v2beta1.CallMatcher.ICustomHeaders=} [properties] Properties to set + */ + function CustomHeaders(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Verifies a RbmSuggestedActionDial message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RbmSuggestedActionDial.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - if (!$util.isString(message.phoneNumber)) - return "phoneNumber: string expected"; - return null; - }; + /** + * CustomHeaders ciscoGuid. + * @member {string} ciscoGuid + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders + * @instance + */ + CustomHeaders.prototype.ciscoGuid = ""; - /** - * Creates a RbmSuggestedActionDial message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial} RbmSuggestedActionDial - */ - RbmSuggestedActionDial.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial(); - if (object.phoneNumber != null) - message.phoneNumber = String(object.phoneNumber); - return message; - }; + /** + * Creates a new CustomHeaders instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders + * @static + * @param {google.cloud.dialogflow.v2beta1.CallMatcher.ICustomHeaders=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders} CustomHeaders instance + */ + CustomHeaders.create = function create(properties) { + return new CustomHeaders(properties); + }; - /** - * Creates a plain object from a RbmSuggestedActionDial message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial} message RbmSuggestedActionDial - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RbmSuggestedActionDial.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.phoneNumber = ""; - if (message.phoneNumber != null && message.hasOwnProperty("phoneNumber")) - object.phoneNumber = message.phoneNumber; - return object; - }; + /** + * Encodes the specified CustomHeaders message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders + * @static + * @param {google.cloud.dialogflow.v2beta1.CallMatcher.ICustomHeaders} message CustomHeaders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHeaders.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ciscoGuid != null && Object.hasOwnProperty.call(message, "ciscoGuid")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ciscoGuid); + return writer; + }; - /** - * Converts this RbmSuggestedActionDial to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionDial - * @instance - * @returns {Object.} JSON object - */ - RbmSuggestedActionDial.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Encodes the specified CustomHeaders message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders + * @static + * @param {google.cloud.dialogflow.v2beta1.CallMatcher.ICustomHeaders} message CustomHeaders message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomHeaders.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - return RbmSuggestedActionDial; - })(); + /** + * Decodes a CustomHeaders message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders} CustomHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHeaders.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ciscoGuid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - RbmSuggestedAction.RbmSuggestedActionOpenUri = (function() { + /** + * Decodes a CustomHeaders message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders} CustomHeaders + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomHeaders.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Properties of a RbmSuggestedActionOpenUri. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @interface IRbmSuggestedActionOpenUri - * @property {string|null} [uri] RbmSuggestedActionOpenUri uri - */ + /** + * Verifies a CustomHeaders message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomHeaders.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ciscoGuid != null && message.hasOwnProperty("ciscoGuid")) + if (!$util.isString(message.ciscoGuid)) + return "ciscoGuid: string expected"; + return null; + }; - /** - * Constructs a new RbmSuggestedActionOpenUri. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @classdesc Represents a RbmSuggestedActionOpenUri. - * @implements IRbmSuggestedActionOpenUri - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri=} [properties] Properties to set - */ - function RbmSuggestedActionOpenUri(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a CustomHeaders message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders} CustomHeaders + */ + CustomHeaders.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders(); + if (object.ciscoGuid != null) + message.ciscoGuid = String(object.ciscoGuid); + return message; + }; - /** - * RbmSuggestedActionOpenUri uri. - * @member {string} uri - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri - * @instance - */ - RbmSuggestedActionOpenUri.prototype.uri = ""; + /** + * Creates a plain object from a CustomHeaders message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders + * @static + * @param {google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders} message CustomHeaders + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomHeaders.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.ciscoGuid = ""; + if (message.ciscoGuid != null && message.hasOwnProperty("ciscoGuid")) + object.ciscoGuid = message.ciscoGuid; + return object; + }; - /** - * Creates a new RbmSuggestedActionOpenUri instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri} RbmSuggestedActionOpenUri instance - */ - RbmSuggestedActionOpenUri.create = function create(properties) { - return new RbmSuggestedActionOpenUri(properties); - }; + /** + * Converts this CustomHeaders to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CallMatcher.CustomHeaders + * @instance + * @returns {Object.} JSON object + */ + CustomHeaders.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified RbmSuggestedActionOpenUri message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri} message RbmSuggestedActionOpenUri message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmSuggestedActionOpenUri.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uri != null && Object.hasOwnProperty.call(message, "uri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.uri); - return writer; - }; + return CustomHeaders; + })(); - /** - * Encodes the specified RbmSuggestedActionOpenUri message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionOpenUri} message RbmSuggestedActionOpenUri message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmSuggestedActionOpenUri.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return CallMatcher; + })(); - /** - * Decodes a RbmSuggestedActionOpenUri message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri} RbmSuggestedActionOpenUri - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmSuggestedActionOpenUri.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.uri = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + v2beta1.CreateConversationRequest = (function() { - /** - * Decodes a RbmSuggestedActionOpenUri message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri} RbmSuggestedActionOpenUri - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmSuggestedActionOpenUri.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Properties of a CreateConversationRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ICreateConversationRequest + * @property {string|null} [parent] CreateConversationRequest parent + * @property {google.cloud.dialogflow.v2beta1.IConversation|null} [conversation] CreateConversationRequest conversation + * @property {string|null} [conversationId] CreateConversationRequest conversationId + */ - /** - * Verifies a RbmSuggestedActionOpenUri message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RbmSuggestedActionOpenUri.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uri != null && message.hasOwnProperty("uri")) - if (!$util.isString(message.uri)) - return "uri: string expected"; - return null; - }; + /** + * Constructs a new CreateConversationRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a CreateConversationRequest. + * @implements ICreateConversationRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ICreateConversationRequest=} [properties] Properties to set + */ + function CreateConversationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a RbmSuggestedActionOpenUri message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri} RbmSuggestedActionOpenUri - */ - RbmSuggestedActionOpenUri.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri(); - if (object.uri != null) - message.uri = String(object.uri); - return message; - }; + /** + * CreateConversationRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationRequest + * @instance + */ + CreateConversationRequest.prototype.parent = ""; - /** - * Creates a plain object from a RbmSuggestedActionOpenUri message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri} message RbmSuggestedActionOpenUri - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RbmSuggestedActionOpenUri.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.uri = ""; - if (message.uri != null && message.hasOwnProperty("uri")) - object.uri = message.uri; - return object; - }; + /** + * CreateConversationRequest conversation. + * @member {google.cloud.dialogflow.v2beta1.IConversation|null|undefined} conversation + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationRequest + * @instance + */ + CreateConversationRequest.prototype.conversation = null; - /** - * Converts this RbmSuggestedActionOpenUri to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionOpenUri - * @instance - * @returns {Object.} JSON object - */ - RbmSuggestedActionOpenUri.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * CreateConversationRequest conversationId. + * @member {string} conversationId + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationRequest + * @instance + */ + CreateConversationRequest.prototype.conversationId = ""; - return RbmSuggestedActionOpenUri; - })(); + /** + * Creates a new CreateConversationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateConversationRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CreateConversationRequest} CreateConversationRequest instance + */ + CreateConversationRequest.create = function create(properties) { + return new CreateConversationRequest(properties); + }; - RbmSuggestedAction.RbmSuggestedActionShareLocation = (function() { + /** + * Encodes the specified CreateConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateConversationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateConversationRequest} message CreateConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateConversationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + $root.google.cloud.dialogflow.v2beta1.Conversation.encode(message.conversation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.conversationId != null && Object.hasOwnProperty.call(message, "conversationId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.conversationId); + return writer; + }; - /** - * Properties of a RbmSuggestedActionShareLocation. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @interface IRbmSuggestedActionShareLocation - */ + /** + * Encodes the specified CreateConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateConversationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateConversationRequest} message CreateConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new RbmSuggestedActionShareLocation. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction - * @classdesc Represents a RbmSuggestedActionShareLocation. - * @implements IRbmSuggestedActionShareLocation - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation=} [properties] Properties to set - */ - function RbmSuggestedActionShareLocation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Decodes a CreateConversationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CreateConversationRequest} CreateConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateConversationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateConversationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.conversation = $root.google.cloud.dialogflow.v2beta1.Conversation.decode(reader, reader.uint32()); + break; + case 3: + message.conversationId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new RbmSuggestedActionShareLocation instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation} RbmSuggestedActionShareLocation instance - */ - RbmSuggestedActionShareLocation.create = function create(properties) { - return new RbmSuggestedActionShareLocation(properties); - }; + /** + * Decodes a CreateConversationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CreateConversationRequest} CreateConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateConversationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified RbmSuggestedActionShareLocation message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation} message RbmSuggestedActionShareLocation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmSuggestedActionShareLocation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - return writer; - }; + /** + * Verifies a CreateConversationRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateConversationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.conversation != null && message.hasOwnProperty("conversation")) { + var error = $root.google.cloud.dialogflow.v2beta1.Conversation.verify(message.conversation); + if (error) + return "conversation." + error; + } + if (message.conversationId != null && message.hasOwnProperty("conversationId")) + if (!$util.isString(message.conversationId)) + return "conversationId: string expected"; + return null; + }; - /** - * Encodes the specified RbmSuggestedActionShareLocation message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.IRbmSuggestedActionShareLocation} message RbmSuggestedActionShareLocation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RbmSuggestedActionShareLocation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a CreateConversationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CreateConversationRequest} CreateConversationRequest + */ + CreateConversationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateConversationRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CreateConversationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.conversation != null) { + if (typeof object.conversation !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CreateConversationRequest.conversation: object expected"); + message.conversation = $root.google.cloud.dialogflow.v2beta1.Conversation.fromObject(object.conversation); + } + if (object.conversationId != null) + message.conversationId = String(object.conversationId); + return message; + }; - /** - * Decodes a RbmSuggestedActionShareLocation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation} RbmSuggestedActionShareLocation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmSuggestedActionShareLocation.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a CreateConversationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.CreateConversationRequest} message CreateConversationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateConversationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.conversation = null; + object.conversationId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = $root.google.cloud.dialogflow.v2beta1.Conversation.toObject(message.conversation, options); + if (message.conversationId != null && message.hasOwnProperty("conversationId")) + object.conversationId = message.conversationId; + return object; + }; - /** - * Decodes a RbmSuggestedActionShareLocation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation} RbmSuggestedActionShareLocation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RbmSuggestedActionShareLocation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this CreateConversationRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateConversationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a RbmSuggestedActionShareLocation message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RbmSuggestedActionShareLocation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - return null; - }; + return CreateConversationRequest; + })(); + + v2beta1.ListConversationsRequest = (function() { - /** - * Creates a RbmSuggestedActionShareLocation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation} RbmSuggestedActionShareLocation - */ - RbmSuggestedActionShareLocation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation) - return object; - return new $root.google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation(); - }; + /** + * Properties of a ListConversationsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListConversationsRequest + * @property {string|null} [parent] ListConversationsRequest parent + * @property {number|null} [pageSize] ListConversationsRequest pageSize + * @property {string|null} [pageToken] ListConversationsRequest pageToken + * @property {string|null} [filter] ListConversationsRequest filter + */ - /** - * Creates a plain object from a RbmSuggestedActionShareLocation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation} message RbmSuggestedActionShareLocation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RbmSuggestedActionShareLocation.toObject = function toObject() { - return {}; - }; + /** + * Constructs a new ListConversationsRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListConversationsRequest. + * @implements IListConversationsRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListConversationsRequest=} [properties] Properties to set + */ + function ListConversationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Converts this RbmSuggestedActionShareLocation to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.RbmSuggestedAction.RbmSuggestedActionShareLocation - * @instance - * @returns {Object.} JSON object - */ - RbmSuggestedActionShareLocation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * ListConversationsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.parent = ""; - return RbmSuggestedActionShareLocation; - })(); + /** + * ListConversationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.pageSize = 0; - return RbmSuggestedAction; - })(); + /** + * ListConversationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.pageToken = ""; - Message.MediaContent = (function() { + /** + * ListConversationsRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @instance + */ + ListConversationsRequest.prototype.filter = ""; - /** - * Properties of a MediaContent. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IMediaContent - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType|null} [mediaType] MediaContent mediaType - * @property {Array.|null} [mediaObjects] MediaContent mediaObjects - */ + /** + * Creates a new ListConversationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListConversationsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListConversationsRequest} ListConversationsRequest instance + */ + ListConversationsRequest.create = function create(properties) { + return new ListConversationsRequest(properties); + }; - /** - * Constructs a new MediaContent. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a MediaContent. - * @implements IMediaContent - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent=} [properties] Properties to set - */ - function MediaContent(properties) { - this.mediaObjects = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Encodes the specified ListConversationsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListConversationsRequest} message ListConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; - /** - * MediaContent mediaType. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType} mediaType - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @instance - */ - MediaContent.prototype.mediaType = 0; + /** + * Encodes the specified ListConversationsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListConversationsRequest} message ListConversationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * MediaContent mediaObjects. - * @member {Array.} mediaObjects - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @instance - */ - MediaContent.prototype.mediaObjects = $util.emptyArray; + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListConversationsRequest} ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListConversationsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a new MediaContent instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent} MediaContent instance - */ - MediaContent.create = function create(properties) { - return new MediaContent(properties); - }; + /** + * Decodes a ListConversationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListConversationsRequest} ListConversationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified MediaContent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent} message MediaContent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MediaContent.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.mediaType != null && Object.hasOwnProperty.call(message, "mediaType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.mediaType); - if (message.mediaObjects != null && message.mediaObjects.length) - for (var i = 0; i < message.mediaObjects.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.encode(message.mediaObjects[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * Verifies a ListConversationsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConversationsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; - /** - * Encodes the specified MediaContent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IMediaContent} message MediaContent message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MediaContent.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a ListConversationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListConversationsRequest} ListConversationsRequest + */ + ListConversationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListConversationsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListConversationsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; - /** - * Decodes a MediaContent message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent} MediaContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MediaContent.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.mediaType = reader.int32(); - break; - case 2: - if (!(message.mediaObjects && message.mediaObjects.length)) - message.mediaObjects = []; - message.mediaObjects.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a plain object from a ListConversationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ListConversationsRequest} message ListConversationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConversationsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; - /** - * Decodes a MediaContent message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent} MediaContent - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MediaContent.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Converts this ListConversationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListConversationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Verifies a MediaContent message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MediaContent.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.mediaType != null && message.hasOwnProperty("mediaType")) - switch (message.mediaType) { - default: - return "mediaType: enum value expected"; - case 0: - case 1: - break; - } - if (message.mediaObjects != null && message.hasOwnProperty("mediaObjects")) { - if (!Array.isArray(message.mediaObjects)) - return "mediaObjects: array expected"; - for (var i = 0; i < message.mediaObjects.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.verify(message.mediaObjects[i]); - if (error) - return "mediaObjects." + error; - } - } - return null; - }; + return ListConversationsRequest; + })(); - /** - * Creates a MediaContent message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent} MediaContent - */ - MediaContent.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent(); - switch (object.mediaType) { - case "RESPONSE_MEDIA_TYPE_UNSPECIFIED": - case 0: - message.mediaType = 0; - break; - case "AUDIO": - case 1: - message.mediaType = 1; - break; - } - if (object.mediaObjects) { - if (!Array.isArray(object.mediaObjects)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.mediaObjects: array expected"); - message.mediaObjects = []; - for (var i = 0; i < object.mediaObjects.length; ++i) { - if (typeof object.mediaObjects[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.mediaObjects: object expected"); - message.mediaObjects[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.fromObject(object.mediaObjects[i]); - } - } - return message; - }; + v2beta1.ListConversationsResponse = (function() { - /** - * Creates a plain object from a MediaContent message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent} message MediaContent - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MediaContent.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.mediaObjects = []; - if (options.defaults) - object.mediaType = options.enums === String ? "RESPONSE_MEDIA_TYPE_UNSPECIFIED" : 0; - if (message.mediaType != null && message.hasOwnProperty("mediaType")) - object.mediaType = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType[message.mediaType] : message.mediaType; - if (message.mediaObjects && message.mediaObjects.length) { - object.mediaObjects = []; - for (var j = 0; j < message.mediaObjects.length; ++j) - object.mediaObjects[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.toObject(message.mediaObjects[j], options); - } - return object; - }; + /** + * Properties of a ListConversationsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListConversationsResponse + * @property {Array.|null} [conversations] ListConversationsResponse conversations + * @property {string|null} [nextPageToken] ListConversationsResponse nextPageToken + */ - /** - * Converts this MediaContent to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @instance - * @returns {Object.} JSON object - */ - MediaContent.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Constructs a new ListConversationsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListConversationsResponse. + * @implements IListConversationsResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListConversationsResponse=} [properties] Properties to set + */ + function ListConversationsResponse(properties) { + this.conversations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - MediaContent.ResponseMediaObject = (function() { + /** + * ListConversationsResponse conversations. + * @member {Array.} conversations + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsResponse + * @instance + */ + ListConversationsResponse.prototype.conversations = $util.emptyArray; - /** - * Properties of a ResponseMediaObject. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @interface IResponseMediaObject - * @property {string|null} [name] ResponseMediaObject name - * @property {string|null} [description] ResponseMediaObject description - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [largeImage] ResponseMediaObject largeImage - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [icon] ResponseMediaObject icon - * @property {string|null} [contentUrl] ResponseMediaObject contentUrl - */ + /** + * ListConversationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsResponse + * @instance + */ + ListConversationsResponse.prototype.nextPageToken = ""; - /** - * Constructs a new ResponseMediaObject. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent - * @classdesc Represents a ResponseMediaObject. - * @implements IResponseMediaObject - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject=} [properties] Properties to set - */ - function ResponseMediaObject(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Creates a new ListConversationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListConversationsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListConversationsResponse} ListConversationsResponse instance + */ + ListConversationsResponse.create = function create(properties) { + return new ListConversationsResponse(properties); + }; - /** - * ResponseMediaObject name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @instance - */ - ResponseMediaObject.prototype.name = ""; + /** + * Encodes the specified ListConversationsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListConversationsResponse} message ListConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.conversations != null && message.conversations.length) + for (var i = 0; i < message.conversations.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Conversation.encode(message.conversations[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; + + /** + * Encodes the specified ListConversationsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListConversationsResponse} message ListConversationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListConversationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * ResponseMediaObject description. - * @member {string} description - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @instance - */ - ResponseMediaObject.prototype.description = ""; + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListConversationsResponse} ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListConversationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.conversations && message.conversations.length)) + message.conversations = []; + message.conversations.push($root.google.cloud.dialogflow.v2beta1.Conversation.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * ResponseMediaObject largeImage. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} largeImage - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @instance - */ - ResponseMediaObject.prototype.largeImage = null; + /** + * Decodes a ListConversationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListConversationsResponse} ListConversationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListConversationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ResponseMediaObject icon. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} icon - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @instance - */ - ResponseMediaObject.prototype.icon = null; + /** + * Verifies a ListConversationsResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListConversationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.conversations != null && message.hasOwnProperty("conversations")) { + if (!Array.isArray(message.conversations)) + return "conversations: array expected"; + for (var i = 0; i < message.conversations.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Conversation.verify(message.conversations[i]); + if (error) + return "conversations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * ResponseMediaObject contentUrl. - * @member {string} contentUrl - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @instance - */ - ResponseMediaObject.prototype.contentUrl = ""; + /** + * Creates a ListConversationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListConversationsResponse} ListConversationsResponse + */ + ListConversationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListConversationsResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListConversationsResponse(); + if (object.conversations) { + if (!Array.isArray(object.conversations)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListConversationsResponse.conversations: array expected"); + message.conversations = []; + for (var i = 0; i < object.conversations.length; ++i) { + if (typeof object.conversations[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListConversationsResponse.conversations: object expected"); + message.conversations[i] = $root.google.cloud.dialogflow.v2beta1.Conversation.fromObject(object.conversations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * Creates a plain object from a ListConversationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ListConversationsResponse} message ListConversationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListConversationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.conversations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.conversations && message.conversations.length) { + object.conversations = []; + for (var j = 0; j < message.conversations.length; ++j) + object.conversations[j] = $root.google.cloud.dialogflow.v2beta1.Conversation.toObject(message.conversations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * ResponseMediaObject image. - * @member {"largeImage"|"icon"|undefined} image - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @instance - */ - Object.defineProperty(ResponseMediaObject.prototype, "image", { - get: $util.oneOfGetter($oneOfFields = ["largeImage", "icon"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Converts this ListConversationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListConversationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListConversationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a new ResponseMediaObject instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject instance - */ - ResponseMediaObject.create = function create(properties) { - return new ResponseMediaObject(properties); - }; + return ListConversationsResponse; + })(); - /** - * Encodes the specified ResponseMediaObject message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject} message ResponseMediaObject message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseMediaObject.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.largeImage != null && Object.hasOwnProperty.call(message, "largeImage")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.largeImage, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.icon != null && Object.hasOwnProperty.call(message, "icon")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.icon, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.contentUrl != null && Object.hasOwnProperty.call(message, "contentUrl")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.contentUrl); - return writer; - }; + v2beta1.GetConversationRequest = (function() { - /** - * Encodes the specified ResponseMediaObject message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.IResponseMediaObject} message ResponseMediaObject message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResponseMediaObject.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a GetConversationRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IGetConversationRequest + * @property {string|null} [name] GetConversationRequest name + */ - /** - * Decodes a ResponseMediaObject message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseMediaObject.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.description = reader.string(); - break; - case 3: - message.largeImage = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); - break; - case 4: - message.icon = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); - break; - case 5: - message.contentUrl = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Constructs a new GetConversationRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a GetConversationRequest. + * @implements IGetConversationRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IGetConversationRequest=} [properties] Properties to set + */ + function GetConversationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a ResponseMediaObject message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResponseMediaObject.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * GetConversationRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.GetConversationRequest + * @instance + */ + GetConversationRequest.prototype.name = ""; - /** - * Verifies a ResponseMediaObject message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResponseMediaObject.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.largeImage != null && message.hasOwnProperty("largeImage")) { - properties.image = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.largeImage); - if (error) - return "largeImage." + error; - } - } - if (message.icon != null && message.hasOwnProperty("icon")) { - if (properties.image === 1) - return "image: multiple values"; - properties.image = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.icon); - if (error) - return "icon." + error; - } - } - if (message.contentUrl != null && message.hasOwnProperty("contentUrl")) - if (!$util.isString(message.contentUrl)) - return "contentUrl: string expected"; - return null; - }; + /** + * Creates a new GetConversationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.GetConversationRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetConversationRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GetConversationRequest} GetConversationRequest instance + */ + GetConversationRequest.create = function create(properties) { + return new GetConversationRequest(properties); + }; - /** - * Creates a ResponseMediaObject message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject} ResponseMediaObject - */ - ResponseMediaObject.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.largeImage != null) { - if (typeof object.largeImage !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.largeImage: object expected"); - message.largeImage = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.largeImage); - } - if (object.icon != null) { - if (typeof object.icon !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject.icon: object expected"); - message.icon = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.icon); - } - if (object.contentUrl != null) - message.contentUrl = String(object.contentUrl); - return message; - }; + /** + * Encodes the specified GetConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetConversationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.GetConversationRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetConversationRequest} message GetConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConversationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * Creates a plain object from a ResponseMediaObject message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject} message ResponseMediaObject - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResponseMediaObject.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.contentUrl = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.largeImage != null && message.hasOwnProperty("largeImage")) { - object.largeImage = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.largeImage, options); - if (options.oneofs) - object.image = "largeImage"; - } - if (message.icon != null && message.hasOwnProperty("icon")) { - object.icon = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.icon, options); - if (options.oneofs) - object.image = "icon"; - } - if (message.contentUrl != null && message.hasOwnProperty("contentUrl")) - object.contentUrl = message.contentUrl; - return object; - }; + /** + * Encodes the specified GetConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetConversationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetConversationRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IGetConversationRequest} message GetConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Converts this ResponseMediaObject to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaObject - * @instance - * @returns {Object.} JSON object - */ - ResponseMediaObject.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a GetConversationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.GetConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.GetConversationRequest} GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConversationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetConversationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - return ResponseMediaObject; - })(); + /** + * Decodes a GetConversationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.GetConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.GetConversationRequest} GetConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConversationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ResponseMediaType enum. - * @name google.cloud.dialogflow.v2beta1.Intent.Message.MediaContent.ResponseMediaType - * @enum {number} - * @property {number} RESPONSE_MEDIA_TYPE_UNSPECIFIED=0 RESPONSE_MEDIA_TYPE_UNSPECIFIED value - * @property {number} AUDIO=1 AUDIO value - */ - MediaContent.ResponseMediaType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESPONSE_MEDIA_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "AUDIO"] = 1; - return values; - })(); + /** + * Verifies a GetConversationRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.GetConversationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConversationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - return MediaContent; - })(); + /** + * Creates a GetConversationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.GetConversationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.GetConversationRequest} GetConversationRequest + */ + GetConversationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetConversationRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.GetConversationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - Message.BrowseCarouselCard = (function() { + /** + * Creates a plain object from a GetConversationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.GetConversationRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.GetConversationRequest} message GetConversationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConversationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Properties of a BrowseCarouselCard. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IBrowseCarouselCard - * @property {Array.|null} [items] BrowseCarouselCard items - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions|null} [imageDisplayOptions] BrowseCarouselCard imageDisplayOptions - */ + /** + * Converts this GetConversationRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.GetConversationRequest + * @instance + * @returns {Object.} JSON object + */ + GetConversationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new BrowseCarouselCard. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a BrowseCarouselCard. - * @implements IBrowseCarouselCard - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard=} [properties] Properties to set - */ - function BrowseCarouselCard(properties) { - this.items = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return GetConversationRequest; + })(); - /** - * BrowseCarouselCard items. - * @member {Array.} items - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @instance - */ - BrowseCarouselCard.prototype.items = $util.emptyArray; + v2beta1.CompleteConversationRequest = (function() { - /** - * BrowseCarouselCard imageDisplayOptions. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions} imageDisplayOptions - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @instance - */ - BrowseCarouselCard.prototype.imageDisplayOptions = 0; + /** + * Properties of a CompleteConversationRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ICompleteConversationRequest + * @property {string|null} [name] CompleteConversationRequest name + */ - /** - * Creates a new BrowseCarouselCard instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard} BrowseCarouselCard instance - */ - BrowseCarouselCard.create = function create(properties) { - return new BrowseCarouselCard(properties); - }; + /** + * Constructs a new CompleteConversationRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a CompleteConversationRequest. + * @implements ICompleteConversationRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ICompleteConversationRequest=} [properties] Properties to set + */ + function CompleteConversationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified BrowseCarouselCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard} message BrowseCarouselCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BrowseCarouselCard.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.items != null && message.items.length) - for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.imageDisplayOptions != null && Object.hasOwnProperty.call(message, "imageDisplayOptions")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.imageDisplayOptions); - return writer; - }; + /** + * CompleteConversationRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.CompleteConversationRequest + * @instance + */ + CompleteConversationRequest.prototype.name = ""; - /** - * Encodes the specified BrowseCarouselCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IBrowseCarouselCard} message BrowseCarouselCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BrowseCarouselCard.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new CompleteConversationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CompleteConversationRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICompleteConversationRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CompleteConversationRequest} CompleteConversationRequest instance + */ + CompleteConversationRequest.create = function create(properties) { + return new CompleteConversationRequest(properties); + }; - /** - * Decodes a BrowseCarouselCard message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard} BrowseCarouselCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BrowseCarouselCard.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.items && message.items.length)) - message.items = []; - message.items.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.decode(reader, reader.uint32())); - break; - case 2: - message.imageDisplayOptions = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified CompleteConversationRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CompleteConversationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CompleteConversationRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICompleteConversationRequest} message CompleteConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteConversationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; - /** - * Decodes a BrowseCarouselCard message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard} BrowseCarouselCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BrowseCarouselCard.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified CompleteConversationRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CompleteConversationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CompleteConversationRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICompleteConversationRequest} message CompleteConversationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CompleteConversationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a BrowseCarouselCard message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BrowseCarouselCard.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!Array.isArray(message.items)) - return "items: array expected"; - for (var i = 0; i < message.items.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify(message.items[i]); - if (error) - return "items." + error; - } - } - if (message.imageDisplayOptions != null && message.hasOwnProperty("imageDisplayOptions")) - switch (message.imageDisplayOptions) { - default: - return "imageDisplayOptions: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; + /** + * Decodes a CompleteConversationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CompleteConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CompleteConversationRequest} CompleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteConversationRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CompleteConversationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a BrowseCarouselCard message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard} BrowseCarouselCard - */ - BrowseCarouselCard.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard(); - if (object.items) { - if (!Array.isArray(object.items)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.items: array expected"); - message.items = []; - for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.items: object expected"); - message.items[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.fromObject(object.items[i]); - } - } - switch (object.imageDisplayOptions) { - case "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED": - case 0: - message.imageDisplayOptions = 0; - break; - case "GRAY": - case 1: - message.imageDisplayOptions = 1; - break; - case "WHITE": - case 2: - message.imageDisplayOptions = 2; - break; - case "CROPPED": - case 3: - message.imageDisplayOptions = 3; - break; - case "BLURRED_BACKGROUND": - case 4: - message.imageDisplayOptions = 4; - break; - } - return message; - }; + /** + * Decodes a CompleteConversationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CompleteConversationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CompleteConversationRequest} CompleteConversationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CompleteConversationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a BrowseCarouselCard message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard} message BrowseCarouselCard - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BrowseCarouselCard.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.items = []; - if (options.defaults) - object.imageDisplayOptions = options.enums === String ? "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED" : 0; - if (message.items && message.items.length) { - object.items = []; - for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.toObject(message.items[j], options); - } - if (message.imageDisplayOptions != null && message.hasOwnProperty("imageDisplayOptions")) - object.imageDisplayOptions = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions[message.imageDisplayOptions] : message.imageDisplayOptions; - return object; - }; + /** + * Verifies a CompleteConversationRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CompleteConversationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CompleteConversationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Converts this BrowseCarouselCard to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @instance - * @returns {Object.} JSON object - */ - BrowseCarouselCard.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a CompleteConversationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CompleteConversationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CompleteConversationRequest} CompleteConversationRequest + */ + CompleteConversationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CompleteConversationRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CompleteConversationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - BrowseCarouselCard.BrowseCarouselCardItem = (function() { + /** + * Creates a plain object from a CompleteConversationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CompleteConversationRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.CompleteConversationRequest} message CompleteConversationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CompleteConversationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Properties of a BrowseCarouselCardItem. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @interface IBrowseCarouselCardItem - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null} [openUriAction] BrowseCarouselCardItem openUriAction - * @property {string|null} [title] BrowseCarouselCardItem title - * @property {string|null} [description] BrowseCarouselCardItem description - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [image] BrowseCarouselCardItem image - * @property {string|null} [footer] BrowseCarouselCardItem footer - */ + /** + * Converts this CompleteConversationRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CompleteConversationRequest + * @instance + * @returns {Object.} JSON object + */ + CompleteConversationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Constructs a new BrowseCarouselCardItem. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard - * @classdesc Represents a BrowseCarouselCardItem. - * @implements IBrowseCarouselCardItem - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem=} [properties] Properties to set - */ - function BrowseCarouselCardItem(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + return CompleteConversationRequest; + })(); - /** - * BrowseCarouselCardItem openUriAction. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction|null|undefined} openUriAction - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @instance - */ - BrowseCarouselCardItem.prototype.openUriAction = null; + v2beta1.CreateCallMatcherRequest = (function() { - /** - * BrowseCarouselCardItem title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @instance - */ - BrowseCarouselCardItem.prototype.title = ""; + /** + * Properties of a CreateCallMatcherRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ICreateCallMatcherRequest + * @property {string|null} [parent] CreateCallMatcherRequest parent + * @property {google.cloud.dialogflow.v2beta1.ICallMatcher|null} [callMatcher] CreateCallMatcherRequest callMatcher + */ - /** - * BrowseCarouselCardItem description. - * @member {string} description - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @instance - */ - BrowseCarouselCardItem.prototype.description = ""; + /** + * Constructs a new CreateCallMatcherRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a CreateCallMatcherRequest. + * @implements ICreateCallMatcherRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest=} [properties] Properties to set + */ + function CreateCallMatcherRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * BrowseCarouselCardItem image. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} image - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @instance - */ - BrowseCarouselCardItem.prototype.image = null; + /** + * CreateCallMatcherRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest + * @instance + */ + CreateCallMatcherRequest.prototype.parent = ""; - /** - * BrowseCarouselCardItem footer. - * @member {string} footer - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @instance - */ - BrowseCarouselCardItem.prototype.footer = ""; + /** + * CreateCallMatcherRequest callMatcher. + * @member {google.cloud.dialogflow.v2beta1.ICallMatcher|null|undefined} callMatcher + * @memberof google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest + * @instance + */ + CreateCallMatcherRequest.prototype.callMatcher = null; - /** - * Creates a new BrowseCarouselCardItem instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem instance - */ - BrowseCarouselCardItem.create = function create(properties) { - return new BrowseCarouselCardItem(properties); - }; + /** + * Creates a new CreateCallMatcherRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest} CreateCallMatcherRequest instance + */ + CreateCallMatcherRequest.create = function create(properties) { + return new CreateCallMatcherRequest(properties); + }; - /** - * Encodes the specified BrowseCarouselCardItem message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem} message BrowseCarouselCardItem message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BrowseCarouselCardItem.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.openUriAction != null && Object.hasOwnProperty.call(message, "openUriAction")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.encode(message.openUriAction, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.title); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.description); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.image, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.footer != null && Object.hasOwnProperty.call(message, "footer")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.footer); - return writer; - }; + /** + * Encodes the specified CreateCallMatcherRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest} message CreateCallMatcherRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCallMatcherRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.callMatcher != null && Object.hasOwnProperty.call(message, "callMatcher")) + $root.google.cloud.dialogflow.v2beta1.CallMatcher.encode(message.callMatcher, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateCallMatcherRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest} message CreateCallMatcherRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateCallMatcherRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateCallMatcherRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest} CreateCallMatcherRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCallMatcherRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.callMatcher = $root.google.cloud.dialogflow.v2beta1.CallMatcher.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateCallMatcherRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest} CreateCallMatcherRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateCallMatcherRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Encodes the specified BrowseCarouselCardItem message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.IBrowseCarouselCardItem} message BrowseCarouselCardItem message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BrowseCarouselCardItem.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Verifies a CreateCallMatcherRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateCallMatcherRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.callMatcher != null && message.hasOwnProperty("callMatcher")) { + var error = $root.google.cloud.dialogflow.v2beta1.CallMatcher.verify(message.callMatcher); + if (error) + return "callMatcher." + error; + } + return null; + }; - /** - * Decodes a BrowseCarouselCardItem message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BrowseCarouselCardItem.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.openUriAction = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.decode(reader, reader.uint32()); - break; - case 2: - message.title = reader.string(); - break; - case 3: - message.description = reader.string(); - break; - case 4: - message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); - break; - case 5: - message.footer = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Creates a CreateCallMatcherRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest} CreateCallMatcherRequest + */ + CreateCallMatcherRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.callMatcher != null) { + if (typeof object.callMatcher !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest.callMatcher: object expected"); + message.callMatcher = $root.google.cloud.dialogflow.v2beta1.CallMatcher.fromObject(object.callMatcher); + } + return message; + }; - /** - * Decodes a BrowseCarouselCardItem message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BrowseCarouselCardItem.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a plain object from a CreateCallMatcherRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest} message CreateCallMatcherRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateCallMatcherRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.callMatcher = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.callMatcher != null && message.hasOwnProperty("callMatcher")) + object.callMatcher = $root.google.cloud.dialogflow.v2beta1.CallMatcher.toObject(message.callMatcher, options); + return object; + }; - /** - * Verifies a BrowseCarouselCardItem message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BrowseCarouselCardItem.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify(message.openUriAction); - if (error) - return "openUriAction." + error; - } - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.image != null && message.hasOwnProperty("image")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.image); - if (error) - return "image." + error; - } - if (message.footer != null && message.hasOwnProperty("footer")) - if (!$util.isString(message.footer)) - return "footer: string expected"; - return null; - }; + /** + * Converts this CreateCallMatcherRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest + * @instance + * @returns {Object.} JSON object + */ + CreateCallMatcherRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a BrowseCarouselCardItem message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} BrowseCarouselCardItem - */ - BrowseCarouselCardItem.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem(); - if (object.openUriAction != null) { - if (typeof object.openUriAction !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.openUriAction: object expected"); - message.openUriAction = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.fromObject(object.openUriAction); - } - if (object.title != null) - message.title = String(object.title); - if (object.description != null) - message.description = String(object.description); - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.image: object expected"); - message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.image); - } - if (object.footer != null) - message.footer = String(object.footer); - return message; - }; + return CreateCallMatcherRequest; + })(); - /** - * Creates a plain object from a BrowseCarouselCardItem message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem} message BrowseCarouselCardItem - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BrowseCarouselCardItem.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.openUriAction = null; - object.title = ""; - object.description = ""; - object.image = null; - object.footer = ""; - } - if (message.openUriAction != null && message.hasOwnProperty("openUriAction")) - object.openUriAction = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.toObject(message.openUriAction, options); - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.image != null && message.hasOwnProperty("image")) - object.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.image, options); - if (message.footer != null && message.hasOwnProperty("footer")) - object.footer = message.footer; - return object; - }; + v2beta1.ListCallMatchersRequest = (function() { - /** - * Converts this BrowseCarouselCardItem to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @instance - * @returns {Object.} JSON object - */ - BrowseCarouselCardItem.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Properties of a ListCallMatchersRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListCallMatchersRequest + * @property {string|null} [parent] ListCallMatchersRequest parent + * @property {number|null} [pageSize] ListCallMatchersRequest pageSize + * @property {string|null} [pageToken] ListCallMatchersRequest pageToken + */ - BrowseCarouselCardItem.OpenUrlAction = (function() { + /** + * Constructs a new ListCallMatchersRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListCallMatchersRequest. + * @implements IListCallMatchersRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListCallMatchersRequest=} [properties] Properties to set + */ + function ListCallMatchersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of an OpenUrlAction. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @interface IOpenUrlAction - * @property {string|null} [url] OpenUrlAction url - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint|null} [urlTypeHint] OpenUrlAction urlTypeHint - */ + /** + * ListCallMatchersRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersRequest + * @instance + */ + ListCallMatchersRequest.prototype.parent = ""; - /** - * Constructs a new OpenUrlAction. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem - * @classdesc Represents an OpenUrlAction. - * @implements IOpenUrlAction - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction=} [properties] Properties to set - */ - function OpenUrlAction(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * ListCallMatchersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersRequest + * @instance + */ + ListCallMatchersRequest.prototype.pageSize = 0; - /** - * OpenUrlAction url. - * @member {string} url - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @instance - */ - OpenUrlAction.prototype.url = ""; + /** + * ListCallMatchersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersRequest + * @instance + */ + ListCallMatchersRequest.prototype.pageToken = ""; - /** - * OpenUrlAction urlTypeHint. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint} urlTypeHint - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @instance - */ - OpenUrlAction.prototype.urlTypeHint = 0; + /** + * Creates a new ListCallMatchersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListCallMatchersRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListCallMatchersRequest} ListCallMatchersRequest instance + */ + ListCallMatchersRequest.create = function create(properties) { + return new ListCallMatchersRequest(properties); + }; - /** - * Creates a new OpenUrlAction instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction instance - */ - OpenUrlAction.create = function create(properties) { - return new OpenUrlAction(properties); - }; + /** + * Encodes the specified ListCallMatchersRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListCallMatchersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListCallMatchersRequest} message ListCallMatchersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCallMatchersRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + return writer; + }; - /** - * Encodes the specified OpenUrlAction message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction} message OpenUrlAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenUrlAction.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.url != null && Object.hasOwnProperty.call(message, "url")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.url); - if (message.urlTypeHint != null && Object.hasOwnProperty.call(message, "urlTypeHint")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.urlTypeHint); - return writer; - }; + /** + * Encodes the specified ListCallMatchersRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListCallMatchersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListCallMatchersRequest} message ListCallMatchersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCallMatchersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified OpenUrlAction message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.IOpenUrlAction} message OpenUrlAction message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OpenUrlAction.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a ListCallMatchersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListCallMatchersRequest} ListCallMatchersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCallMatchersRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListCallMatchersRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes an OpenUrlAction message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenUrlAction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.url = reader.string(); - break; - case 3: - message.urlTypeHint = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a ListCallMatchersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListCallMatchersRequest} ListCallMatchersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCallMatchersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes an OpenUrlAction message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OpenUrlAction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a ListCallMatchersRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCallMatchersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; - /** - * Verifies an OpenUrlAction message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OpenUrlAction.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.url != null && message.hasOwnProperty("url")) - if (!$util.isString(message.url)) - return "url: string expected"; - if (message.urlTypeHint != null && message.hasOwnProperty("urlTypeHint")) - switch (message.urlTypeHint) { - default: - return "urlTypeHint: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; + /** + * Creates a ListCallMatchersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListCallMatchersRequest} ListCallMatchersRequest + */ + ListCallMatchersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListCallMatchersRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListCallMatchersRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; + + /** + * Creates a plain object from a ListCallMatchersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ListCallMatchersRequest} message ListCallMatchersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCallMatchersRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + return object; + }; - /** - * Creates an OpenUrlAction message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} OpenUrlAction - */ - OpenUrlAction.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction(); - if (object.url != null) - message.url = String(object.url); - switch (object.urlTypeHint) { - case "URL_TYPE_HINT_UNSPECIFIED": - case 0: - message.urlTypeHint = 0; - break; - case "AMP_ACTION": - case 1: - message.urlTypeHint = 1; - break; - case "AMP_CONTENT": - case 2: - message.urlTypeHint = 2; - break; - } - return message; - }; + /** + * Converts this ListCallMatchersRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersRequest + * @instance + * @returns {Object.} JSON object + */ + ListCallMatchersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from an OpenUrlAction message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction} message OpenUrlAction - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OpenUrlAction.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.url = ""; - object.urlTypeHint = options.enums === String ? "URL_TYPE_HINT_UNSPECIFIED" : 0; - } - if (message.url != null && message.hasOwnProperty("url")) - object.url = message.url; - if (message.urlTypeHint != null && message.hasOwnProperty("urlTypeHint")) - object.urlTypeHint = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint[message.urlTypeHint] : message.urlTypeHint; - return object; - }; + return ListCallMatchersRequest; + })(); - /** - * Converts this OpenUrlAction to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction - * @instance - * @returns {Object.} JSON object - */ - OpenUrlAction.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + v2beta1.ListCallMatchersResponse = (function() { - /** - * UrlTypeHint enum. - * @name google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.BrowseCarouselCardItem.OpenUrlAction.UrlTypeHint - * @enum {number} - * @property {number} URL_TYPE_HINT_UNSPECIFIED=0 URL_TYPE_HINT_UNSPECIFIED value - * @property {number} AMP_ACTION=1 AMP_ACTION value - * @property {number} AMP_CONTENT=2 AMP_CONTENT value - */ - OpenUrlAction.UrlTypeHint = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "URL_TYPE_HINT_UNSPECIFIED"] = 0; - values[valuesById[1] = "AMP_ACTION"] = 1; - values[valuesById[2] = "AMP_CONTENT"] = 2; - return values; - })(); + /** + * Properties of a ListCallMatchersResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListCallMatchersResponse + * @property {Array.|null} [callMatchers] ListCallMatchersResponse callMatchers + * @property {string|null} [nextPageToken] ListCallMatchersResponse nextPageToken + */ - return OpenUrlAction; - })(); + /** + * Constructs a new ListCallMatchersResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListCallMatchersResponse. + * @implements IListCallMatchersResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListCallMatchersResponse=} [properties] Properties to set + */ + function ListCallMatchersResponse(properties) { + this.callMatchers = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return BrowseCarouselCardItem; - })(); + /** + * ListCallMatchersResponse callMatchers. + * @member {Array.} callMatchers + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersResponse + * @instance + */ + ListCallMatchersResponse.prototype.callMatchers = $util.emptyArray; - /** - * ImageDisplayOptions enum. - * @name google.cloud.dialogflow.v2beta1.Intent.Message.BrowseCarouselCard.ImageDisplayOptions - * @enum {number} - * @property {number} IMAGE_DISPLAY_OPTIONS_UNSPECIFIED=0 IMAGE_DISPLAY_OPTIONS_UNSPECIFIED value - * @property {number} GRAY=1 GRAY value - * @property {number} WHITE=2 WHITE value - * @property {number} CROPPED=3 CROPPED value - * @property {number} BLURRED_BACKGROUND=4 BLURRED_BACKGROUND value - */ - BrowseCarouselCard.ImageDisplayOptions = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED"] = 0; - values[valuesById[1] = "GRAY"] = 1; - values[valuesById[2] = "WHITE"] = 2; - values[valuesById[3] = "CROPPED"] = 3; - values[valuesById[4] = "BLURRED_BACKGROUND"] = 4; - return values; - })(); + /** + * ListCallMatchersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersResponse + * @instance + */ + ListCallMatchersResponse.prototype.nextPageToken = ""; - return BrowseCarouselCard; - })(); + /** + * Creates a new ListCallMatchersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListCallMatchersResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListCallMatchersResponse} ListCallMatchersResponse instance + */ + ListCallMatchersResponse.create = function create(properties) { + return new ListCallMatchersResponse(properties); + }; - Message.TableCard = (function() { + /** + * Encodes the specified ListCallMatchersResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListCallMatchersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListCallMatchersResponse} message ListCallMatchersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCallMatchersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.callMatchers != null && message.callMatchers.length) + for (var i = 0; i < message.callMatchers.length; ++i) + $root.google.cloud.dialogflow.v2beta1.CallMatcher.encode(message.callMatchers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; - /** - * Properties of a TableCard. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ITableCard - * @property {string|null} [title] TableCard title - * @property {string|null} [subtitle] TableCard subtitle - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null} [image] TableCard image - * @property {Array.|null} [columnProperties] TableCard columnProperties - * @property {Array.|null} [rows] TableCard rows - * @property {Array.|null} [buttons] TableCard buttons - */ + /** + * Encodes the specified ListCallMatchersResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListCallMatchersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListCallMatchersResponse} message ListCallMatchersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListCallMatchersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Constructs a new TableCard. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a TableCard. - * @implements ITableCard - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard=} [properties] Properties to set - */ - function TableCard(properties) { - this.columnProperties = []; - this.rows = []; - this.buttons = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Decodes a ListCallMatchersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListCallMatchersResponse} ListCallMatchersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCallMatchersResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListCallMatchersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.callMatchers && message.callMatchers.length)) + message.callMatchers = []; + message.callMatchers.push($root.google.cloud.dialogflow.v2beta1.CallMatcher.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * TableCard title. - * @member {string} title - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @instance - */ - TableCard.prototype.title = ""; + /** + * Decodes a ListCallMatchersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListCallMatchersResponse} ListCallMatchersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListCallMatchersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * TableCard subtitle. - * @member {string} subtitle - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @instance - */ - TableCard.prototype.subtitle = ""; + /** + * Verifies a ListCallMatchersResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListCallMatchersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.callMatchers != null && message.hasOwnProperty("callMatchers")) { + if (!Array.isArray(message.callMatchers)) + return "callMatchers: array expected"; + for (var i = 0; i < message.callMatchers.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.CallMatcher.verify(message.callMatchers[i]); + if (error) + return "callMatchers." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * TableCard image. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.IImage|null|undefined} image - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @instance - */ - TableCard.prototype.image = null; + /** + * Creates a ListCallMatchersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListCallMatchersResponse} ListCallMatchersResponse + */ + ListCallMatchersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListCallMatchersResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListCallMatchersResponse(); + if (object.callMatchers) { + if (!Array.isArray(object.callMatchers)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListCallMatchersResponse.callMatchers: array expected"); + message.callMatchers = []; + for (var i = 0; i < object.callMatchers.length; ++i) { + if (typeof object.callMatchers[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListCallMatchersResponse.callMatchers: object expected"); + message.callMatchers[i] = $root.google.cloud.dialogflow.v2beta1.CallMatcher.fromObject(object.callMatchers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - /** - * TableCard columnProperties. - * @member {Array.} columnProperties - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @instance - */ - TableCard.prototype.columnProperties = $util.emptyArray; + /** + * Creates a plain object from a ListCallMatchersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ListCallMatchersResponse} message ListCallMatchersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListCallMatchersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.callMatchers = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.callMatchers && message.callMatchers.length) { + object.callMatchers = []; + for (var j = 0; j < message.callMatchers.length; ++j) + object.callMatchers[j] = $root.google.cloud.dialogflow.v2beta1.CallMatcher.toObject(message.callMatchers[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; - /** - * TableCard rows. - * @member {Array.} rows - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @instance - */ - TableCard.prototype.rows = $util.emptyArray; + /** + * Converts this ListCallMatchersResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListCallMatchersResponse + * @instance + * @returns {Object.} JSON object + */ + ListCallMatchersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * TableCard buttons. - * @member {Array.} buttons - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @instance - */ - TableCard.prototype.buttons = $util.emptyArray; + return ListCallMatchersResponse; + })(); - /** - * Creates a new TableCard instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCard} TableCard instance - */ - TableCard.create = function create(properties) { - return new TableCard(properties); - }; + v2beta1.DeleteCallMatcherRequest = (function() { - /** - * Encodes the specified TableCard message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard} message TableCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCard.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.title != null && Object.hasOwnProperty.call(message, "title")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.title); - if (message.subtitle != null && Object.hasOwnProperty.call(message, "subtitle")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subtitle); - if (message.image != null && Object.hasOwnProperty.call(message, "image")) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.encode(message.image, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.columnProperties != null && message.columnProperties.length) - for (var i = 0; i < message.columnProperties.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.encode(message.columnProperties[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.rows != null && message.rows.length) - for (var i = 0; i < message.rows.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.encode(message.rows[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.buttons != null && message.buttons.length) - for (var i = 0; i < message.buttons.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.encode(message.buttons[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; + /** + * Properties of a DeleteCallMatcherRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IDeleteCallMatcherRequest + * @property {string|null} [name] DeleteCallMatcherRequest name + */ - /** - * Encodes the specified TableCard message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCard} message TableCard message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCard.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Constructs a new DeleteCallMatcherRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a DeleteCallMatcherRequest. + * @implements IDeleteCallMatcherRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest=} [properties] Properties to set + */ + function DeleteCallMatcherRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Decodes a TableCard message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCard} TableCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCard.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.title = reader.string(); - break; - case 2: - message.subtitle = reader.string(); - break; - case 3: - message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.columnProperties && message.columnProperties.length)) - message.columnProperties = []; - message.columnProperties.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.rows && message.rows.length)) - message.rows = []; - message.rows.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.buttons && message.buttons.length)) - message.buttons = []; - message.buttons.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * DeleteCallMatcherRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest + * @instance + */ + DeleteCallMatcherRequest.prototype.name = ""; + + /** + * Creates a new DeleteCallMatcherRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest} DeleteCallMatcherRequest instance + */ + DeleteCallMatcherRequest.create = function create(properties) { + return new DeleteCallMatcherRequest(properties); + }; + + /** + * Encodes the specified DeleteCallMatcherRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest} message DeleteCallMatcherRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCallMatcherRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteCallMatcherRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest} message DeleteCallMatcherRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteCallMatcherRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteCallMatcherRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest} DeleteCallMatcherRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCallMatcherRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteCallMatcherRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest} DeleteCallMatcherRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteCallMatcherRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteCallMatcherRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteCallMatcherRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; - /** - * Decodes a TableCard message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCard} TableCard - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCard.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a DeleteCallMatcherRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest} DeleteCallMatcherRequest + */ + DeleteCallMatcherRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; - /** - * Verifies a TableCard message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TableCard.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.title != null && message.hasOwnProperty("title")) - if (!$util.isString(message.title)) - return "title: string expected"; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - if (!$util.isString(message.subtitle)) - return "subtitle: string expected"; - if (message.image != null && message.hasOwnProperty("image")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.verify(message.image); - if (error) - return "image." + error; - } - if (message.columnProperties != null && message.hasOwnProperty("columnProperties")) { - if (!Array.isArray(message.columnProperties)) - return "columnProperties: array expected"; - for (var i = 0; i < message.columnProperties.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.verify(message.columnProperties[i]); - if (error) - return "columnProperties." + error; - } - } - if (message.rows != null && message.hasOwnProperty("rows")) { - if (!Array.isArray(message.rows)) - return "rows: array expected"; - for (var i = 0; i < message.rows.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.verify(message.rows[i]); - if (error) - return "rows." + error; - } - } - if (message.buttons != null && message.hasOwnProperty("buttons")) { - if (!Array.isArray(message.buttons)) - return "buttons: array expected"; - for (var i = 0; i < message.buttons.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.verify(message.buttons[i]); - if (error) - return "buttons." + error; - } - } - return null; - }; + /** + * Creates a plain object from a DeleteCallMatcherRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest} message DeleteCallMatcherRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteCallMatcherRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; - /** - * Creates a TableCard message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCard} TableCard - */ - TableCard.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCard(); - if (object.title != null) - message.title = String(object.title); - if (object.subtitle != null) - message.subtitle = String(object.subtitle); - if (object.image != null) { - if (typeof object.image !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.image: object expected"); - message.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.fromObject(object.image); - } - if (object.columnProperties) { - if (!Array.isArray(object.columnProperties)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.columnProperties: array expected"); - message.columnProperties = []; - for (var i = 0; i < object.columnProperties.length; ++i) { - if (typeof object.columnProperties[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.columnProperties: object expected"); - message.columnProperties[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.fromObject(object.columnProperties[i]); - } - } - if (object.rows) { - if (!Array.isArray(object.rows)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.rows: array expected"); - message.rows = []; - for (var i = 0; i < object.rows.length; ++i) { - if (typeof object.rows[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.rows: object expected"); - message.rows[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.fromObject(object.rows[i]); - } - } - if (object.buttons) { - if (!Array.isArray(object.buttons)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.buttons: array expected"); - message.buttons = []; - for (var i = 0; i < object.buttons.length; ++i) { - if (typeof object.buttons[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCard.buttons: object expected"); - message.buttons[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.fromObject(object.buttons[i]); - } - } - return message; - }; + /** + * Converts this DeleteCallMatcherRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteCallMatcherRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Creates a plain object from a TableCard message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.TableCard} message TableCard - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TableCard.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.columnProperties = []; - object.rows = []; - object.buttons = []; - } - if (options.defaults) { - object.title = ""; - object.subtitle = ""; - object.image = null; - } - if (message.title != null && message.hasOwnProperty("title")) - object.title = message.title; - if (message.subtitle != null && message.hasOwnProperty("subtitle")) - object.subtitle = message.subtitle; - if (message.image != null && message.hasOwnProperty("image")) - object.image = $root.google.cloud.dialogflow.v2beta1.Intent.Message.Image.toObject(message.image, options); - if (message.columnProperties && message.columnProperties.length) { - object.columnProperties = []; - for (var j = 0; j < message.columnProperties.length; ++j) - object.columnProperties[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.toObject(message.columnProperties[j], options); - } - if (message.rows && message.rows.length) { - object.rows = []; - for (var j = 0; j < message.rows.length; ++j) - object.rows[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.toObject(message.rows[j], options); - } - if (message.buttons && message.buttons.length) { - object.buttons = []; - for (var j = 0; j < message.buttons.length; ++j) - object.buttons[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.BasicCard.Button.toObject(message.buttons[j], options); - } - return object; - }; + return DeleteCallMatcherRequest; + })(); - /** - * Converts this TableCard to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCard - * @instance - * @returns {Object.} JSON object - */ - TableCard.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + v2beta1.CreateMessageRequest = (function() { - return TableCard; - })(); + /** + * Properties of a CreateMessageRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface ICreateMessageRequest + * @property {string|null} [parent] CreateMessageRequest parent + * @property {google.cloud.dialogflow.v2beta1.IMessage|null} [message] CreateMessageRequest message + */ - Message.ColumnProperties = (function() { + /** + * Constructs a new CreateMessageRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a CreateMessageRequest. + * @implements ICreateMessageRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.ICreateMessageRequest=} [properties] Properties to set + */ + function CreateMessageRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Properties of a ColumnProperties. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface IColumnProperties - * @property {string|null} [header] ColumnProperties header - * @property {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment|null} [horizontalAlignment] ColumnProperties horizontalAlignment - */ + /** + * CreateMessageRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.parent = ""; - /** - * Constructs a new ColumnProperties. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a ColumnProperties. - * @implements IColumnProperties - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties=} [properties] Properties to set - */ - function ColumnProperties(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * CreateMessageRequest message. + * @member {google.cloud.dialogflow.v2beta1.IMessage|null|undefined} message + * @memberof google.cloud.dialogflow.v2beta1.CreateMessageRequest + * @instance + */ + CreateMessageRequest.prototype.message = null; + + /** + * Creates a new CreateMessageRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.CreateMessageRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateMessageRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CreateMessageRequest} CreateMessageRequest instance + */ + CreateMessageRequest.create = function create(properties) { + return new CreateMessageRequest(properties); + }; + + /** + * Encodes the specified CreateMessageRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateMessageRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.CreateMessageRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateMessageRequest} message CreateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMessageRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.message != null && Object.hasOwnProperty.call(message, "message")) + $root.google.cloud.dialogflow.v2beta1.Message.encode(message.message, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CreateMessageRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateMessageRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateMessageRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ICreateMessageRequest} message CreateMessageRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateMessageRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateMessageRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.CreateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.CreateMessageRequest} CreateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMessageRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateMessageRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.message = $root.google.cloud.dialogflow.v2beta1.Message.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; } + } + return message; + }; - /** - * ColumnProperties header. - * @member {string} header - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties - * @instance - */ - ColumnProperties.prototype.header = ""; + /** + * Decodes a CreateMessageRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.CreateMessageRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.CreateMessageRequest} CreateMessageRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateMessageRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * ColumnProperties horizontalAlignment. - * @member {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment} horizontalAlignment - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties - * @instance - */ - ColumnProperties.prototype.horizontalAlignment = 0; + /** + * Verifies a CreateMessageRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.CreateMessageRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateMessageRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.message != null && message.hasOwnProperty("message")) { + var error = $root.google.cloud.dialogflow.v2beta1.Message.verify(message.message); + if (error) + return "message." + error; + } + return null; + }; - /** - * Creates a new ColumnProperties instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties} ColumnProperties instance - */ - ColumnProperties.create = function create(properties) { - return new ColumnProperties(properties); - }; + /** + * Creates a CreateMessageRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.CreateMessageRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.CreateMessageRequest} CreateMessageRequest + */ + CreateMessageRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateMessageRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CreateMessageRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.message != null) { + if (typeof object.message !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CreateMessageRequest.message: object expected"); + message.message = $root.google.cloud.dialogflow.v2beta1.Message.fromObject(object.message); + } + return message; + }; - /** - * Encodes the specified ColumnProperties message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties} message ColumnProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ColumnProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.header != null && Object.hasOwnProperty.call(message, "header")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.header); - if (message.horizontalAlignment != null && Object.hasOwnProperty.call(message, "horizontalAlignment")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.horizontalAlignment); - return writer; - }; + /** + * Creates a plain object from a CreateMessageRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CreateMessageRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.CreateMessageRequest} message CreateMessageRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateMessageRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.message = null; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.message != null && message.hasOwnProperty("message")) + object.message = $root.google.cloud.dialogflow.v2beta1.Message.toObject(message.message, options); + return object; + }; - /** - * Encodes the specified ColumnProperties message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.IColumnProperties} message ColumnProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ColumnProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Converts this CreateMessageRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CreateMessageRequest + * @instance + * @returns {Object.} JSON object + */ + CreateMessageRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Decodes a ColumnProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties} ColumnProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ColumnProperties.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.header = reader.string(); - break; - case 2: - message.horizontalAlignment = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return CreateMessageRequest; + })(); - /** - * Decodes a ColumnProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties} ColumnProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ColumnProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + v2beta1.BatchCreateMessagesRequest = (function() { - /** - * Verifies a ColumnProperties message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ColumnProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.header != null && message.hasOwnProperty("header")) - if (!$util.isString(message.header)) - return "header: string expected"; - if (message.horizontalAlignment != null && message.hasOwnProperty("horizontalAlignment")) - switch (message.horizontalAlignment) { - default: - return "horizontalAlignment: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - return null; - }; + /** + * Properties of a BatchCreateMessagesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IBatchCreateMessagesRequest + * @property {string|null} [parent] BatchCreateMessagesRequest parent + * @property {Array.|null} [requests] BatchCreateMessagesRequest requests + */ + + /** + * Constructs a new BatchCreateMessagesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a BatchCreateMessagesRequest. + * @implements IBatchCreateMessagesRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest=} [properties] Properties to set + */ + function BatchCreateMessagesRequest(properties) { + this.requests = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a ColumnProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties} ColumnProperties - */ - ColumnProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties(); - if (object.header != null) - message.header = String(object.header); - switch (object.horizontalAlignment) { - case "HORIZONTAL_ALIGNMENT_UNSPECIFIED": - case 0: - message.horizontalAlignment = 0; - break; - case "LEADING": - case 1: - message.horizontalAlignment = 1; - break; - case "CENTER": - case 2: - message.horizontalAlignment = 2; - break; - case "TRAILING": - case 3: - message.horizontalAlignment = 3; - break; - } - return message; - }; + /** + * BatchCreateMessagesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest + * @instance + */ + BatchCreateMessagesRequest.prototype.parent = ""; - /** - * Creates a plain object from a ColumnProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties} message ColumnProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ColumnProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.header = ""; - object.horizontalAlignment = options.enums === String ? "HORIZONTAL_ALIGNMENT_UNSPECIFIED" : 0; - } - if (message.header != null && message.hasOwnProperty("header")) - object.header = message.header; - if (message.horizontalAlignment != null && message.hasOwnProperty("horizontalAlignment")) - object.horizontalAlignment = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment[message.horizontalAlignment] : message.horizontalAlignment; - return object; - }; + /** + * BatchCreateMessagesRequest requests. + * @member {Array.} requests + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest + * @instance + */ + BatchCreateMessagesRequest.prototype.requests = $util.emptyArray; - /** - * Converts this ColumnProperties to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties - * @instance - * @returns {Object.} JSON object - */ - ColumnProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a new BatchCreateMessagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest} BatchCreateMessagesRequest instance + */ + BatchCreateMessagesRequest.create = function create(properties) { + return new BatchCreateMessagesRequest(properties); + }; - /** - * HorizontalAlignment enum. - * @name google.cloud.dialogflow.v2beta1.Intent.Message.ColumnProperties.HorizontalAlignment - * @enum {number} - * @property {number} HORIZONTAL_ALIGNMENT_UNSPECIFIED=0 HORIZONTAL_ALIGNMENT_UNSPECIFIED value - * @property {number} LEADING=1 LEADING value - * @property {number} CENTER=2 CENTER value - * @property {number} TRAILING=3 TRAILING value - */ - ColumnProperties.HorizontalAlignment = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "HORIZONTAL_ALIGNMENT_UNSPECIFIED"] = 0; - values[valuesById[1] = "LEADING"] = 1; - values[valuesById[2] = "CENTER"] = 2; - values[valuesById[3] = "TRAILING"] = 3; - return values; - })(); + /** + * Encodes the specified BatchCreateMessagesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest} message BatchCreateMessagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateMessagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.requests != null && message.requests.length) + for (var i = 0; i < message.requests.length; ++i) + $root.google.cloud.dialogflow.v2beta1.CreateMessageRequest.encode(message.requests[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; - return ColumnProperties; - })(); + /** + * Encodes the specified BatchCreateMessagesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest} message BatchCreateMessagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateMessagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - Message.TableCardRow = (function() { + /** + * Decodes a BatchCreateMessagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest} BatchCreateMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateMessagesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + if (!(message.requests && message.requests.length)) + message.requests = []; + message.requests.push($root.google.cloud.dialogflow.v2beta1.CreateMessageRequest.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Properties of a TableCardRow. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ITableCardRow - * @property {Array.|null} [cells] TableCardRow cells - * @property {boolean|null} [dividerAfter] TableCardRow dividerAfter - */ + /** + * Decodes a BatchCreateMessagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest} BatchCreateMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateMessagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Constructs a new TableCardRow. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a TableCardRow. - * @implements ITableCardRow - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow=} [properties] Properties to set - */ - function TableCardRow(properties) { - this.cells = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; + /** + * Verifies a BatchCreateMessagesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateMessagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.requests != null && message.hasOwnProperty("requests")) { + if (!Array.isArray(message.requests)) + return "requests: array expected"; + for (var i = 0; i < message.requests.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.CreateMessageRequest.verify(message.requests[i]); + if (error) + return "requests." + error; } + } + return null; + }; - /** - * TableCardRow cells. - * @member {Array.} cells - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow - * @instance - */ - TableCardRow.prototype.cells = $util.emptyArray; + /** + * Creates a BatchCreateMessagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest} BatchCreateMessagesRequest + */ + BatchCreateMessagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.requests) { + if (!Array.isArray(object.requests)) + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest.requests: array expected"); + message.requests = []; + for (var i = 0; i < object.requests.length; ++i) { + if (typeof object.requests[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest.requests: object expected"); + message.requests[i] = $root.google.cloud.dialogflow.v2beta1.CreateMessageRequest.fromObject(object.requests[i]); + } + } + return message; + }; - /** - * TableCardRow dividerAfter. - * @member {boolean} dividerAfter - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow - * @instance - */ - TableCardRow.prototype.dividerAfter = false; + /** + * Creates a plain object from a BatchCreateMessagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest} message BatchCreateMessagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateMessagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.requests = []; + if (options.defaults) + object.parent = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.requests && message.requests.length) { + object.requests = []; + for (var j = 0; j < message.requests.length; ++j) + object.requests[j] = $root.google.cloud.dialogflow.v2beta1.CreateMessageRequest.toObject(message.requests[j], options); + } + return object; + }; - /** - * Creates a new TableCardRow instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow} TableCardRow instance - */ - TableCardRow.create = function create(properties) { - return new TableCardRow(properties); - }; + /** + * Converts this BatchCreateMessagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest + * @instance + * @returns {Object.} JSON object + */ + BatchCreateMessagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified TableCardRow message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow} message TableCardRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCardRow.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.cells != null && message.cells.length) - for (var i = 0; i < message.cells.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.encode(message.cells[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.dividerAfter != null && Object.hasOwnProperty.call(message, "dividerAfter")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.dividerAfter); - return writer; - }; + return BatchCreateMessagesRequest; + })(); - /** - * Encodes the specified TableCardRow message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardRow} message TableCardRow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCardRow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + v2beta1.BatchCreateMessagesResponse = (function() { - /** - * Decodes a TableCardRow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow} TableCardRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCardRow.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.cells && message.cells.length)) - message.cells = []; - message.cells.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.decode(reader, reader.uint32())); - break; - case 2: - message.dividerAfter = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Properties of a BatchCreateMessagesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IBatchCreateMessagesResponse + * @property {Array.|null} [messages] BatchCreateMessagesResponse messages + */ - /** - * Decodes a TableCardRow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow} TableCardRow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCardRow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Constructs a new BatchCreateMessagesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a BatchCreateMessagesResponse. + * @implements IBatchCreateMessagesResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse=} [properties] Properties to set + */ + function BatchCreateMessagesResponse(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Verifies a TableCardRow message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TableCardRow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.cells != null && message.hasOwnProperty("cells")) { - if (!Array.isArray(message.cells)) - return "cells: array expected"; - for (var i = 0; i < message.cells.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.verify(message.cells[i]); - if (error) - return "cells." + error; - } - } - if (message.dividerAfter != null && message.hasOwnProperty("dividerAfter")) - if (typeof message.dividerAfter !== "boolean") - return "dividerAfter: boolean expected"; - return null; - }; + /** + * BatchCreateMessagesResponse messages. + * @member {Array.} messages + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse + * @instance + */ + BatchCreateMessagesResponse.prototype.messages = $util.emptyArray; - /** - * Creates a TableCardRow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow} TableCardRow - */ - TableCardRow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow(); - if (object.cells) { - if (!Array.isArray(object.cells)) - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.cells: array expected"); - message.cells = []; - for (var i = 0; i < object.cells.length; ++i) { - if (typeof object.cells[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow.cells: object expected"); - message.cells[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.fromObject(object.cells[i]); - } - } - if (object.dividerAfter != null) - message.dividerAfter = Boolean(object.dividerAfter); - return message; - }; + /** + * Creates a new BatchCreateMessagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse} BatchCreateMessagesResponse instance + */ + BatchCreateMessagesResponse.create = function create(properties) { + return new BatchCreateMessagesResponse(properties); + }; - /** - * Creates a plain object from a TableCardRow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow} message TableCardRow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TableCardRow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.cells = []; - if (options.defaults) - object.dividerAfter = false; - if (message.cells && message.cells.length) { - object.cells = []; - for (var j = 0; j < message.cells.length; ++j) - object.cells[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.toObject(message.cells[j], options); - } - if (message.dividerAfter != null && message.hasOwnProperty("dividerAfter")) - object.dividerAfter = message.dividerAfter; - return object; - }; + /** + * Encodes the specified BatchCreateMessagesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse} message BatchCreateMessagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateMessagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BatchCreateMessagesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse} message BatchCreateMessagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BatchCreateMessagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BatchCreateMessagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse} BatchCreateMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateMessagesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.dialogflow.v2beta1.Message.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BatchCreateMessagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse} BatchCreateMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BatchCreateMessagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BatchCreateMessagesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BatchCreateMessagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Message.verify(message.messages[i]); + if (error) + return "messages." + error; + } + } + return null; + }; + + /** + * Creates a BatchCreateMessagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse} BatchCreateMessagesResponse + */ + BatchCreateMessagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse.messages: object expected"); + message.messages[i] = $root.google.cloud.dialogflow.v2beta1.Message.fromObject(object.messages[i]); + } + } + return message; + }; - /** - * Converts this TableCardRow to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardRow - * @instance - * @returns {Object.} JSON object - */ - TableCardRow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a plain object from a BatchCreateMessagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse} message BatchCreateMessagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BatchCreateMessagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.dialogflow.v2beta1.Message.toObject(message.messages[j], options); + } + return object; + }; - return TableCardRow; - })(); + /** + * Converts this BatchCreateMessagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse + * @instance + * @returns {Object.} JSON object + */ + BatchCreateMessagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - Message.TableCardCell = (function() { + return BatchCreateMessagesResponse; + })(); - /** - * Properties of a TableCardCell. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @interface ITableCardCell - * @property {string|null} [text] TableCardCell text - */ + v2beta1.ListMessagesRequest = (function() { - /** - * Constructs a new TableCardCell. - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message - * @classdesc Represents a TableCardCell. - * @implements ITableCardCell - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell=} [properties] Properties to set - */ - function TableCardCell(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Properties of a ListMessagesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListMessagesRequest + * @property {string|null} [parent] ListMessagesRequest parent + * @property {string|null} [filter] ListMessagesRequest filter + * @property {number|null} [pageSize] ListMessagesRequest pageSize + * @property {string|null} [pageToken] ListMessagesRequest pageToken + */ - /** - * TableCardCell text. - * @member {string} text - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell - * @instance - */ - TableCardCell.prototype.text = ""; + /** + * Constructs a new ListMessagesRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListMessagesRequest. + * @implements IListMessagesRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListMessagesRequest=} [properties] Properties to set + */ + function ListMessagesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new TableCardCell instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell} TableCardCell instance - */ - TableCardCell.create = function create(properties) { - return new TableCardCell(properties); - }; + /** + * ListMessagesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.parent = ""; - /** - * Encodes the specified TableCardCell message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell} message TableCardCell message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCardCell.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - return writer; - }; + /** + * ListMessagesRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.filter = ""; - /** - * Encodes the specified TableCardCell message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.ITableCardCell} message TableCardCell message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TableCardCell.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ListMessagesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.pageSize = 0; - /** - * Decodes a TableCardCell message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell} TableCardCell - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCardCell.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.text = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ListMessagesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @instance + */ + ListMessagesRequest.prototype.pageToken = ""; - /** - * Decodes a TableCardCell message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell} TableCardCell - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TableCardCell.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new ListMessagesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListMessagesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListMessagesRequest} ListMessagesRequest instance + */ + ListMessagesRequest.create = function create(properties) { + return new ListMessagesRequest(properties); + }; - /** - * Verifies a TableCardCell message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TableCardCell.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - return null; - }; + /** + * Encodes the specified ListMessagesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListMessagesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListMessagesRequest} message ListMessagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMessagesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; - /** - * Creates a TableCardCell message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell} TableCardCell - */ - TableCardCell.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell(); - if (object.text != null) - message.text = String(object.text); - return message; - }; + /** + * Encodes the specified ListMessagesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListMessagesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListMessagesRequest} message ListMessagesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMessagesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a TableCardCell message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell} message TableCardCell - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TableCardCell.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.text = ""; - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - return object; - }; + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListMessagesRequest} ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMessagesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListMessagesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this TableCardCell to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.Message.TableCardCell - * @instance - * @returns {Object.} JSON object - */ - TableCardCell.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a ListMessagesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListMessagesRequest} ListMessagesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMessagesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return TableCardCell; - })(); + /** + * Verifies a ListMessagesRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMessagesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + return null; + }; - /** - * Platform enum. - * @name google.cloud.dialogflow.v2beta1.Intent.Message.Platform - * @enum {number} - * @property {number} PLATFORM_UNSPECIFIED=0 PLATFORM_UNSPECIFIED value - * @property {number} FACEBOOK=1 FACEBOOK value - * @property {number} SLACK=2 SLACK value - * @property {number} TELEGRAM=3 TELEGRAM value - * @property {number} KIK=4 KIK value - * @property {number} SKYPE=5 SKYPE value - * @property {number} LINE=6 LINE value - * @property {number} VIBER=7 VIBER value - * @property {number} ACTIONS_ON_GOOGLE=8 ACTIONS_ON_GOOGLE value - * @property {number} TELEPHONY=10 TELEPHONY value - * @property {number} GOOGLE_HANGOUTS=11 GOOGLE_HANGOUTS value - */ - Message.Platform = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PLATFORM_UNSPECIFIED"] = 0; - values[valuesById[1] = "FACEBOOK"] = 1; - values[valuesById[2] = "SLACK"] = 2; - values[valuesById[3] = "TELEGRAM"] = 3; - values[valuesById[4] = "KIK"] = 4; - values[valuesById[5] = "SKYPE"] = 5; - values[valuesById[6] = "LINE"] = 6; - values[valuesById[7] = "VIBER"] = 7; - values[valuesById[8] = "ACTIONS_ON_GOOGLE"] = 8; - values[valuesById[10] = "TELEPHONY"] = 10; - values[valuesById[11] = "GOOGLE_HANGOUTS"] = 11; - return values; - })(); + /** + * Creates a ListMessagesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListMessagesRequest} ListMessagesRequest + */ + ListMessagesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListMessagesRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListMessagesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.filter != null) + message.filter = String(object.filter); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + return message; + }; - return Message; - })(); + /** + * Creates a plain object from a ListMessagesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ListMessagesRequest} message ListMessagesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMessagesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; - Intent.FollowupIntentInfo = (function() { + /** + * Converts this ListMessagesRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesRequest + * @instance + * @returns {Object.} JSON object + */ + ListMessagesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a FollowupIntentInfo. - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @interface IFollowupIntentInfo - * @property {string|null} [followupIntentName] FollowupIntentInfo followupIntentName - * @property {string|null} [parentFollowupIntentName] FollowupIntentInfo parentFollowupIntentName - */ + return ListMessagesRequest; + })(); - /** - * Constructs a new FollowupIntentInfo. - * @memberof google.cloud.dialogflow.v2beta1.Intent - * @classdesc Represents a FollowupIntentInfo. - * @implements IFollowupIntentInfo - * @constructor - * @param {google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo=} [properties] Properties to set - */ - function FollowupIntentInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + v2beta1.ListMessagesResponse = (function() { - /** - * FollowupIntentInfo followupIntentName. - * @member {string} followupIntentName - * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo - * @instance - */ - FollowupIntentInfo.prototype.followupIntentName = ""; + /** + * Properties of a ListMessagesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListMessagesResponse + * @property {Array.|null} [messages] ListMessagesResponse messages + * @property {string|null} [nextPageToken] ListMessagesResponse nextPageToken + */ - /** - * FollowupIntentInfo parentFollowupIntentName. - * @member {string} parentFollowupIntentName - * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo - * @instance - */ - FollowupIntentInfo.prototype.parentFollowupIntentName = ""; + /** + * Constructs a new ListMessagesResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListMessagesResponse. + * @implements IListMessagesResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListMessagesResponse=} [properties] Properties to set + */ + function ListMessagesResponse(properties) { + this.messages = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new FollowupIntentInfo instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo} FollowupIntentInfo instance - */ - FollowupIntentInfo.create = function create(properties) { - return new FollowupIntentInfo(properties); - }; + /** + * ListMessagesResponse messages. + * @member {Array.} messages + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesResponse + * @instance + */ + ListMessagesResponse.prototype.messages = $util.emptyArray; - /** - * Encodes the specified FollowupIntentInfo message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo} message FollowupIntentInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FollowupIntentInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.followupIntentName != null && Object.hasOwnProperty.call(message, "followupIntentName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.followupIntentName); - if (message.parentFollowupIntentName != null && Object.hasOwnProperty.call(message, "parentFollowupIntentName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.parentFollowupIntentName); - return writer; - }; + /** + * ListMessagesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesResponse + * @instance + */ + ListMessagesResponse.prototype.nextPageToken = ""; - /** - * Encodes the specified FollowupIntentInfo message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.IFollowupIntentInfo} message FollowupIntentInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FollowupIntentInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new ListMessagesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListMessagesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListMessagesResponse} ListMessagesResponse instance + */ + ListMessagesResponse.create = function create(properties) { + return new ListMessagesResponse(properties); + }; - /** - * Decodes a FollowupIntentInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo} FollowupIntentInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FollowupIntentInfo.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.followupIntentName = reader.string(); - break; - case 2: - message.parentFollowupIntentName = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified ListMessagesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListMessagesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListMessagesResponse} message ListMessagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMessagesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messages != null && message.messages.length) + for (var i = 0; i < message.messages.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Message.encode(message.messages[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + return writer; + }; - /** - * Decodes a FollowupIntentInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo} FollowupIntentInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FollowupIntentInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified ListMessagesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListMessagesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.IListMessagesResponse} message ListMessagesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListMessagesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a FollowupIntentInfo message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FollowupIntentInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.followupIntentName != null && message.hasOwnProperty("followupIntentName")) - if (!$util.isString(message.followupIntentName)) - return "followupIntentName: string expected"; - if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) - if (!$util.isString(message.parentFollowupIntentName)) - return "parentFollowupIntentName: string expected"; - return null; - }; + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListMessagesResponse} ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMessagesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListMessagesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.messages && message.messages.length)) + message.messages = []; + message.messages.push($root.google.cloud.dialogflow.v2beta1.Message.decode(reader, reader.uint32())); + break; + case 2: + message.nextPageToken = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Creates a FollowupIntentInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo} FollowupIntentInfo - */ - FollowupIntentInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo(); - if (object.followupIntentName != null) - message.followupIntentName = String(object.followupIntentName); - if (object.parentFollowupIntentName != null) - message.parentFollowupIntentName = String(object.parentFollowupIntentName); - return message; - }; + /** + * Decodes a ListMessagesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListMessagesResponse} ListMessagesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListMessagesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a FollowupIntentInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo - * @static - * @param {google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo} message FollowupIntentInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FollowupIntentInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.followupIntentName = ""; - object.parentFollowupIntentName = ""; + /** + * Verifies a ListMessagesResponse message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListMessagesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messages != null && message.hasOwnProperty("messages")) { + if (!Array.isArray(message.messages)) + return "messages: array expected"; + for (var i = 0; i < message.messages.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Message.verify(message.messages[i]); + if (error) + return "messages." + error; } - if (message.followupIntentName != null && message.hasOwnProperty("followupIntentName")) - object.followupIntentName = message.followupIntentName; - if (message.parentFollowupIntentName != null && message.hasOwnProperty("parentFollowupIntentName")) - object.parentFollowupIntentName = message.parentFollowupIntentName; - return object; - }; + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; - /** - * Converts this FollowupIntentInfo to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Intent.FollowupIntentInfo - * @instance - * @returns {Object.} JSON object - */ - FollowupIntentInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a ListMessagesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListMessagesResponse} ListMessagesResponse + */ + ListMessagesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListMessagesResponse) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListMessagesResponse(); + if (object.messages) { + if (!Array.isArray(object.messages)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListMessagesResponse.messages: array expected"); + message.messages = []; + for (var i = 0; i < object.messages.length; ++i) { + if (typeof object.messages[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListMessagesResponse.messages: object expected"); + message.messages[i] = $root.google.cloud.dialogflow.v2beta1.Message.fromObject(object.messages[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; - return FollowupIntentInfo; - })(); + /** + * Creates a plain object from a ListMessagesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesResponse + * @static + * @param {google.cloud.dialogflow.v2beta1.ListMessagesResponse} message ListMessagesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListMessagesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.messages = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.messages && message.messages.length) { + object.messages = []; + for (var j = 0; j < message.messages.length; ++j) + object.messages[j] = $root.google.cloud.dialogflow.v2beta1.Message.toObject(message.messages[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; /** - * WebhookState enum. - * @name google.cloud.dialogflow.v2beta1.Intent.WebhookState - * @enum {number} - * @property {number} WEBHOOK_STATE_UNSPECIFIED=0 WEBHOOK_STATE_UNSPECIFIED value - * @property {number} WEBHOOK_STATE_ENABLED=1 WEBHOOK_STATE_ENABLED value - * @property {number} WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING=2 WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING value + * Converts this ListMessagesResponse to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListMessagesResponse + * @instance + * @returns {Object.} JSON object */ - Intent.WebhookState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "WEBHOOK_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "WEBHOOK_STATE_ENABLED"] = 1; - values[valuesById[2] = "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING"] = 2; - return values; - })(); + ListMessagesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return Intent; + return ListMessagesResponse; })(); - v2beta1.ListIntentsRequest = (function() { + v2beta1.ConversationEvent = (function() { /** - * Properties of a ListIntentsRequest. + * Properties of a ConversationEvent. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListIntentsRequest - * @property {string|null} [parent] ListIntentsRequest parent - * @property {string|null} [languageCode] ListIntentsRequest languageCode - * @property {google.cloud.dialogflow.v2beta1.IntentView|null} [intentView] ListIntentsRequest intentView - * @property {number|null} [pageSize] ListIntentsRequest pageSize - * @property {string|null} [pageToken] ListIntentsRequest pageToken + * @interface IConversationEvent + * @property {string|null} [conversation] ConversationEvent conversation + * @property {google.cloud.dialogflow.v2beta1.ConversationEvent.Type|null} [type] ConversationEvent type + * @property {google.rpc.IStatus|null} [errorStatus] ConversationEvent errorStatus + * @property {google.cloud.dialogflow.v2beta1.IMessage|null} [newMessagePayload] ConversationEvent newMessagePayload */ /** - * Constructs a new ListIntentsRequest. + * Constructs a new ConversationEvent. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListIntentsRequest. - * @implements IListIntentsRequest + * @classdesc Represents a ConversationEvent. + * @implements IConversationEvent * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListIntentsRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IConversationEvent=} [properties] Properties to set */ - function ListIntentsRequest(properties) { + function ConversationEvent(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -60324,127 +110372,128 @@ } /** - * ListIntentsRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * ConversationEvent conversation. + * @member {string} conversation + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent * @instance */ - ListIntentsRequest.prototype.parent = ""; + ConversationEvent.prototype.conversation = ""; /** - * ListIntentsRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * ConversationEvent type. + * @member {google.cloud.dialogflow.v2beta1.ConversationEvent.Type} type + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent * @instance */ - ListIntentsRequest.prototype.languageCode = ""; + ConversationEvent.prototype.type = 0; /** - * ListIntentsRequest intentView. - * @member {google.cloud.dialogflow.v2beta1.IntentView} intentView - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * ConversationEvent errorStatus. + * @member {google.rpc.IStatus|null|undefined} errorStatus + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent * @instance */ - ListIntentsRequest.prototype.intentView = 0; + ConversationEvent.prototype.errorStatus = null; /** - * ListIntentsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * ConversationEvent newMessagePayload. + * @member {google.cloud.dialogflow.v2beta1.IMessage|null|undefined} newMessagePayload + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent * @instance */ - ListIntentsRequest.prototype.pageSize = 0; + ConversationEvent.prototype.newMessagePayload = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * ListIntentsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * ConversationEvent payload. + * @member {"newMessagePayload"|undefined} payload + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent * @instance */ - ListIntentsRequest.prototype.pageToken = ""; + Object.defineProperty(ConversationEvent.prototype, "payload", { + get: $util.oneOfGetter($oneOfFields = ["newMessagePayload"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new ListIntentsRequest instance using the specified properties. + * Creates a new ConversationEvent instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent * @static - * @param {google.cloud.dialogflow.v2beta1.IListIntentsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListIntentsRequest} ListIntentsRequest instance + * @param {google.cloud.dialogflow.v2beta1.IConversationEvent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ConversationEvent} ConversationEvent instance */ - ListIntentsRequest.create = function create(properties) { - return new ListIntentsRequest(properties); + ConversationEvent.create = function create(properties) { + return new ConversationEvent(properties); }; /** - * Encodes the specified ListIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsRequest.verify|verify} messages. + * Encodes the specified ConversationEvent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ConversationEvent.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent * @static - * @param {google.cloud.dialogflow.v2beta1.IListIntentsRequest} message ListIntentsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IConversationEvent} message ConversationEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListIntentsRequest.encode = function encode(message, writer) { + ConversationEvent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); - if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.intentView); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.pageToken); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.type); + if (message.errorStatus != null && Object.hasOwnProperty.call(message, "errorStatus")) + $root.google.rpc.Status.encode(message.errorStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.newMessagePayload != null && Object.hasOwnProperty.call(message, "newMessagePayload")) + $root.google.cloud.dialogflow.v2beta1.Message.encode(message.newMessagePayload, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsRequest.verify|verify} messages. + * Encodes the specified ConversationEvent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ConversationEvent.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent * @static - * @param {google.cloud.dialogflow.v2beta1.IListIntentsRequest} message ListIntentsRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IConversationEvent} message ConversationEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + ConversationEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListIntentsRequest message from the specified reader or buffer. + * Decodes a ConversationEvent message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListIntentsRequest} ListIntentsRequest + * @returns {google.cloud.dialogflow.v2beta1.ConversationEvent} ConversationEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListIntentsRequest.decode = function decode(reader, length) { + ConversationEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListIntentsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ConversationEvent(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.conversation = reader.string(); break; case 2: - message.languageCode = reader.string(); + message.type = reader.int32(); break; case 3: - message.intentView = reader.int32(); + message.errorStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); break; case 4: - message.pageSize = reader.int32(); - break; - case 5: - message.pageToken = reader.string(); + message.newMessagePayload = $root.google.cloud.dialogflow.v2beta1.Message.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -60455,155 +110504,407 @@ }; /** - * Decodes a ListIntentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListIntentsRequest} ListIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Decodes a ConversationEvent message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ConversationEvent} ConversationEvent + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationEvent.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConversationEvent message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationEvent.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 5: + case 4: + break; + } + if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) { + var error = $root.google.rpc.Status.verify(message.errorStatus); + if (error) + return "errorStatus." + error; + } + if (message.newMessagePayload != null && message.hasOwnProperty("newMessagePayload")) { + properties.payload = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.Message.verify(message.newMessagePayload); + if (error) + return "newMessagePayload." + error; + } + } + return null; + }; + + /** + * Creates a ConversationEvent message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ConversationEvent} ConversationEvent + */ + ConversationEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ConversationEvent) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ConversationEvent(); + if (object.conversation != null) + message.conversation = String(object.conversation); + switch (object.type) { + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "CONVERSATION_STARTED": + case 1: + message.type = 1; + break; + case "CONVERSATION_FINISHED": + case 2: + message.type = 2; + break; + case "NEW_MESSAGE": + case 5: + message.type = 5; + break; + case "UNRECOVERABLE_ERROR": + case 4: + message.type = 4; + break; + } + if (object.errorStatus != null) { + if (typeof object.errorStatus !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationEvent.errorStatus: object expected"); + message.errorStatus = $root.google.rpc.Status.fromObject(object.errorStatus); + } + if (object.newMessagePayload != null) { + if (typeof object.newMessagePayload !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationEvent.newMessagePayload: object expected"); + message.newMessagePayload = $root.google.cloud.dialogflow.v2beta1.Message.fromObject(object.newMessagePayload); + } + return message; + }; + + /** + * Creates a plain object from a ConversationEvent message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent + * @static + * @param {google.cloud.dialogflow.v2beta1.ConversationEvent} message ConversationEvent + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationEvent.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.conversation = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.errorStatus = null; + } + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.ConversationEvent.Type[message.type] : message.type; + if (message.errorStatus != null && message.hasOwnProperty("errorStatus")) + object.errorStatus = $root.google.rpc.Status.toObject(message.errorStatus, options); + if (message.newMessagePayload != null && message.hasOwnProperty("newMessagePayload")) { + object.newMessagePayload = $root.google.cloud.dialogflow.v2beta1.Message.toObject(message.newMessagePayload, options); + if (options.oneofs) + object.payload = "newMessagePayload"; + } + return object; + }; + + /** + * Converts this ConversationEvent to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ConversationEvent + * @instance + * @returns {Object.} JSON object + */ + ConversationEvent.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.cloud.dialogflow.v2beta1.ConversationEvent.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} CONVERSATION_STARTED=1 CONVERSATION_STARTED value + * @property {number} CONVERSATION_FINISHED=2 CONVERSATION_FINISHED value + * @property {number} NEW_MESSAGE=5 NEW_MESSAGE value + * @property {number} UNRECOVERABLE_ERROR=4 UNRECOVERABLE_ERROR value + */ + ConversationEvent.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CONVERSATION_STARTED"] = 1; + values[valuesById[2] = "CONVERSATION_FINISHED"] = 2; + values[valuesById[5] = "NEW_MESSAGE"] = 5; + values[valuesById[4] = "UNRECOVERABLE_ERROR"] = 4; + return values; + })(); + + return ConversationEvent; + })(); + + v2beta1.ConversationProfiles = (function() { + + /** + * Constructs a new ConversationProfiles service. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ConversationProfiles + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function ConversationProfiles(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (ConversationProfiles.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = ConversationProfiles; + + /** + * Creates new ConversationProfiles service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {ConversationProfiles} RPC service. Useful where requests and/or responses are streamed. + */ + ConversationProfiles.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.ConversationProfiles#listConversationProfiles}. + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @typedef ListConversationProfilesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse} [response] ListConversationProfilesResponse + */ + + /** + * Calls ListConversationProfiles. + * @function listConversationProfiles + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest} request ListConversationProfilesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.ConversationProfiles.ListConversationProfilesCallback} callback Node-style callback called with the error, if any, and ListConversationProfilesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConversationProfiles.prototype.listConversationProfiles = function listConversationProfiles(request, callback) { + return this.rpcCall(listConversationProfiles, $root.google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest, $root.google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse, request, callback); + }, "name", { value: "ListConversationProfiles" }); + + /** + * Calls ListConversationProfiles. + * @function listConversationProfiles + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @instance + * @param {google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest} request ListConversationProfilesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.ConversationProfiles#getConversationProfile}. + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @typedef GetConversationProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ConversationProfile} [response] ConversationProfile + */ + + /** + * Calls GetConversationProfile. + * @function getConversationProfile + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest} request GetConversationProfileRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.ConversationProfiles.GetConversationProfileCallback} callback Node-style callback called with the error, if any, and ConversationProfile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConversationProfiles.prototype.getConversationProfile = function getConversationProfile(request, callback) { + return this.rpcCall(getConversationProfile, $root.google.cloud.dialogflow.v2beta1.GetConversationProfileRequest, $root.google.cloud.dialogflow.v2beta1.ConversationProfile, request, callback); + }, "name", { value: "GetConversationProfile" }); + + /** + * Calls GetConversationProfile. + * @function getConversationProfile + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest} request GetConversationProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.ConversationProfiles#createConversationProfile}. + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @typedef CreateConversationProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ConversationProfile} [response] ConversationProfile + */ + + /** + * Calls CreateConversationProfile. + * @function createConversationProfile + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest} request CreateConversationProfileRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.ConversationProfiles.CreateConversationProfileCallback} callback Node-style callback called with the error, if any, and ConversationProfile + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(ConversationProfiles.prototype.createConversationProfile = function createConversationProfile(request, callback) { + return this.rpcCall(createConversationProfile, $root.google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest, $root.google.cloud.dialogflow.v2beta1.ConversationProfile, request, callback); + }, "name", { value: "CreateConversationProfile" }); + + /** + * Calls CreateConversationProfile. + * @function createConversationProfile + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest} request CreateConversationProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.ConversationProfiles#updateConversationProfile}. + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @typedef UpdateConversationProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ConversationProfile} [response] ConversationProfile + */ + + /** + * Calls UpdateConversationProfile. + * @function updateConversationProfile + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest} request UpdateConversationProfileRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.ConversationProfiles.UpdateConversationProfileCallback} callback Node-style callback called with the error, if any, and ConversationProfile + * @returns {undefined} + * @variation 1 */ - ListIntentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + Object.defineProperty(ConversationProfiles.prototype.updateConversationProfile = function updateConversationProfile(request, callback) { + return this.rpcCall(updateConversationProfile, $root.google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest, $root.google.cloud.dialogflow.v2beta1.ConversationProfile, request, callback); + }, "name", { value: "UpdateConversationProfile" }); /** - * Verifies a ListIntentsRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls UpdateConversationProfile. + * @function updateConversationProfile + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest} request UpdateConversationProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListIntentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.intentView != null && message.hasOwnProperty("intentView")) - switch (message.intentView) { - default: - return "intentView: enum value expected"; - case 0: - case 1: - break; - } - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - return null; - }; /** - * Creates a ListIntentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListIntentsRequest} ListIntentsRequest + * Callback as used by {@link google.cloud.dialogflow.v2beta1.ConversationProfiles#deleteConversationProfile}. + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @typedef DeleteConversationProfileCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.protobuf.Empty} [response] Empty */ - ListIntentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListIntentsRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListIntentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - switch (object.intentView) { - case "INTENT_VIEW_UNSPECIFIED": - case 0: - message.intentView = 0; - break; - case "INTENT_VIEW_FULL": - case 1: - message.intentView = 1; - break; - } - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - return message; - }; /** - * Creates a plain object from a ListIntentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.ListIntentsRequest} message ListIntentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Calls DeleteConversationProfile. + * @function deleteConversationProfile + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest} request DeleteConversationProfileRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.ConversationProfiles.DeleteConversationProfileCallback} callback Node-style callback called with the error, if any, and Empty + * @returns {undefined} + * @variation 1 */ - ListIntentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.languageCode = ""; - object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; - object.pageSize = 0; - object.pageToken = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.intentView != null && message.hasOwnProperty("intentView")) - object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.IntentView[message.intentView] : message.intentView; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - return object; - }; + Object.defineProperty(ConversationProfiles.prototype.deleteConversationProfile = function deleteConversationProfile(request, callback) { + return this.rpcCall(deleteConversationProfile, $root.google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteConversationProfile" }); /** - * Converts this ListIntentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsRequest + * Calls DeleteConversationProfile. + * @function deleteConversationProfile + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfiles * @instance - * @returns {Object.} JSON object + * @param {google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest} request DeleteConversationProfileRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - ListIntentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - return ListIntentsRequest; + return ConversationProfiles; })(); - v2beta1.ListIntentsResponse = (function() { + v2beta1.ConversationProfile = (function() { /** - * Properties of a ListIntentsResponse. + * Properties of a ConversationProfile. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListIntentsResponse - * @property {Array.|null} [intents] ListIntentsResponse intents - * @property {string|null} [nextPageToken] ListIntentsResponse nextPageToken - */ - - /** - * Constructs a new ListIntentsResponse. + * @interface IConversationProfile + * @property {string|null} [name] ConversationProfile name + * @property {string|null} [displayName] ConversationProfile displayName + * @property {google.protobuf.ITimestamp|null} [createTime] ConversationProfile createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ConversationProfile updateTime + * @property {google.cloud.dialogflow.v2beta1.IAutomatedAgentConfig|null} [automatedAgentConfig] ConversationProfile automatedAgentConfig + * @property {google.cloud.dialogflow.v2beta1.IHumanAgentAssistantConfig|null} [humanAgentAssistantConfig] ConversationProfile humanAgentAssistantConfig + * @property {google.cloud.dialogflow.v2beta1.IHumanAgentHandoffConfig|null} [humanAgentHandoffConfig] ConversationProfile humanAgentHandoffConfig + * @property {google.cloud.dialogflow.v2beta1.INotificationConfig|null} [notificationConfig] ConversationProfile notificationConfig + * @property {google.cloud.dialogflow.v2beta1.ILoggingConfig|null} [loggingConfig] ConversationProfile loggingConfig + * @property {google.cloud.dialogflow.v2beta1.INotificationConfig|null} [newMessageEventNotificationConfig] ConversationProfile newMessageEventNotificationConfig + * @property {google.cloud.dialogflow.v2beta1.ISpeechToTextConfig|null} [sttConfig] ConversationProfile sttConfig + * @property {string|null} [languageCode] ConversationProfile languageCode + */ + + /** + * Constructs a new ConversationProfile. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListIntentsResponse. - * @implements IListIntentsResponse + * @classdesc Represents a ConversationProfile. + * @implements IConversationProfile * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListIntentsResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IConversationProfile=} [properties] Properties to set */ - function ListIntentsResponse(properties) { - this.intents = []; + function ConversationProfile(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -60611,91 +110912,218 @@ } /** - * ListIntentsResponse intents. - * @member {Array.} intents - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * ConversationProfile name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile * @instance */ - ListIntentsResponse.prototype.intents = $util.emptyArray; + ConversationProfile.prototype.name = ""; /** - * ListIntentsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * ConversationProfile displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile * @instance */ - ListIntentsResponse.prototype.nextPageToken = ""; + ConversationProfile.prototype.displayName = ""; /** - * Creates a new ListIntentsResponse instance using the specified properties. + * ConversationProfile createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile + * @instance + */ + ConversationProfile.prototype.createTime = null; + + /** + * ConversationProfile updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile + * @instance + */ + ConversationProfile.prototype.updateTime = null; + + /** + * ConversationProfile automatedAgentConfig. + * @member {google.cloud.dialogflow.v2beta1.IAutomatedAgentConfig|null|undefined} automatedAgentConfig + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile + * @instance + */ + ConversationProfile.prototype.automatedAgentConfig = null; + + /** + * ConversationProfile humanAgentAssistantConfig. + * @member {google.cloud.dialogflow.v2beta1.IHumanAgentAssistantConfig|null|undefined} humanAgentAssistantConfig + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile + * @instance + */ + ConversationProfile.prototype.humanAgentAssistantConfig = null; + + /** + * ConversationProfile humanAgentHandoffConfig. + * @member {google.cloud.dialogflow.v2beta1.IHumanAgentHandoffConfig|null|undefined} humanAgentHandoffConfig + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile + * @instance + */ + ConversationProfile.prototype.humanAgentHandoffConfig = null; + + /** + * ConversationProfile notificationConfig. + * @member {google.cloud.dialogflow.v2beta1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile + * @instance + */ + ConversationProfile.prototype.notificationConfig = null; + + /** + * ConversationProfile loggingConfig. + * @member {google.cloud.dialogflow.v2beta1.ILoggingConfig|null|undefined} loggingConfig + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile + * @instance + */ + ConversationProfile.prototype.loggingConfig = null; + + /** + * ConversationProfile newMessageEventNotificationConfig. + * @member {google.cloud.dialogflow.v2beta1.INotificationConfig|null|undefined} newMessageEventNotificationConfig + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile + * @instance + */ + ConversationProfile.prototype.newMessageEventNotificationConfig = null; + + /** + * ConversationProfile sttConfig. + * @member {google.cloud.dialogflow.v2beta1.ISpeechToTextConfig|null|undefined} sttConfig + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile + * @instance + */ + ConversationProfile.prototype.sttConfig = null; + + /** + * ConversationProfile languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile + * @instance + */ + ConversationProfile.prototype.languageCode = ""; + + /** + * Creates a new ConversationProfile instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile * @static - * @param {google.cloud.dialogflow.v2beta1.IListIntentsResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListIntentsResponse} ListIntentsResponse instance + * @param {google.cloud.dialogflow.v2beta1.IConversationProfile=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ConversationProfile} ConversationProfile instance */ - ListIntentsResponse.create = function create(properties) { - return new ListIntentsResponse(properties); + ConversationProfile.create = function create(properties) { + return new ConversationProfile(properties); }; /** - * Encodes the specified ListIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsResponse.verify|verify} messages. + * Encodes the specified ConversationProfile message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ConversationProfile.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile * @static - * @param {google.cloud.dialogflow.v2beta1.IListIntentsResponse} message ListIntentsResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IConversationProfile} message ConversationProfile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListIntentsResponse.encode = function encode(message, writer) { + ConversationProfile.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.intents != null && message.intents.length) - for (var i = 0; i < message.intents.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.automatedAgentConfig != null && Object.hasOwnProperty.call(message, "automatedAgentConfig")) + $root.google.cloud.dialogflow.v2beta1.AutomatedAgentConfig.encode(message.automatedAgentConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.humanAgentAssistantConfig != null && Object.hasOwnProperty.call(message, "humanAgentAssistantConfig")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.encode(message.humanAgentAssistantConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.humanAgentHandoffConfig != null && Object.hasOwnProperty.call(message, "humanAgentHandoffConfig")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.encode(message.humanAgentHandoffConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.cloud.dialogflow.v2beta1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.loggingConfig != null && Object.hasOwnProperty.call(message, "loggingConfig")) + $root.google.cloud.dialogflow.v2beta1.LoggingConfig.encode(message.loggingConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.newMessageEventNotificationConfig != null && Object.hasOwnProperty.call(message, "newMessageEventNotificationConfig")) + $root.google.cloud.dialogflow.v2beta1.NotificationConfig.encode(message.newMessageEventNotificationConfig, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sttConfig != null && Object.hasOwnProperty.call(message, "sttConfig")) + $root.google.cloud.dialogflow.v2beta1.SpeechToTextConfig.encode(message.sttConfig, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.languageCode); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; /** - * Encodes the specified ListIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListIntentsResponse.verify|verify} messages. + * Encodes the specified ConversationProfile message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ConversationProfile.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile * @static - * @param {google.cloud.dialogflow.v2beta1.IListIntentsResponse} message ListIntentsResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IConversationProfile} message ConversationProfile message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + ConversationProfile.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListIntentsResponse message from the specified reader or buffer. + * Decodes a ConversationProfile message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListIntentsResponse} ListIntentsResponse + * @returns {google.cloud.dialogflow.v2beta1.ConversationProfile} ConversationProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListIntentsResponse.decode = function decode(reader, length) { + ConversationProfile.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListIntentsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ConversationProfile(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.intents && message.intents.length)) - message.intents = []; - message.intents.push($root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32())); + message.name = reader.string(); break; case 2: - message.nextPageToken = reader.string(); + message.displayName = reader.string(); + break; + case 11: + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 12: + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 3: + message.automatedAgentConfig = $root.google.cloud.dialogflow.v2beta1.AutomatedAgentConfig.decode(reader, reader.uint32()); + break; + case 4: + message.humanAgentAssistantConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.decode(reader, reader.uint32()); + break; + case 5: + message.humanAgentHandoffConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.decode(reader, reader.uint32()); + break; + case 6: + message.notificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.decode(reader, reader.uint32()); + break; + case 7: + message.loggingConfig = $root.google.cloud.dialogflow.v2beta1.LoggingConfig.decode(reader, reader.uint32()); + break; + case 8: + message.newMessageEventNotificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.decode(reader, reader.uint32()); + break; + case 9: + message.sttConfig = $root.google.cloud.dialogflow.v2beta1.SpeechToTextConfig.decode(reader, reader.uint32()); + break; + case 10: + message.languageCode = reader.string(); break; default: reader.skipType(tag & 7); @@ -60706,135 +111134,241 @@ }; /** - * Decodes a ListIntentsResponse message from the specified reader or buffer, length delimited. + * Decodes a ConversationProfile message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListIntentsResponse} ListIntentsResponse + * @returns {google.cloud.dialogflow.v2beta1.ConversationProfile} ConversationProfile * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListIntentsResponse.decodeDelimited = function decodeDelimited(reader) { + ConversationProfile.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListIntentsResponse message. + * Verifies a ConversationProfile message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListIntentsResponse.verify = function verify(message) { + ConversationProfile.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.intents != null && message.hasOwnProperty("intents")) { - if (!Array.isArray(message.intents)) - return "intents: array expected"; - for (var i = 0; i < message.intents.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intents[i]); - if (error) - return "intents." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.automatedAgentConfig != null && message.hasOwnProperty("automatedAgentConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.AutomatedAgentConfig.verify(message.automatedAgentConfig); + if (error) + return "automatedAgentConfig." + error; + } + if (message.humanAgentAssistantConfig != null && message.hasOwnProperty("humanAgentAssistantConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.verify(message.humanAgentAssistantConfig); + if (error) + return "humanAgentAssistantConfig." + error; + } + if (message.humanAgentHandoffConfig != null && message.hasOwnProperty("humanAgentHandoffConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.verify(message.humanAgentHandoffConfig); + if (error) + return "humanAgentHandoffConfig." + error; + } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.verify(message.notificationConfig); + if (error) + return "notificationConfig." + error; + } + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.LoggingConfig.verify(message.loggingConfig); + if (error) + return "loggingConfig." + error; + } + if (message.newMessageEventNotificationConfig != null && message.hasOwnProperty("newMessageEventNotificationConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.verify(message.newMessageEventNotificationConfig); + if (error) + return "newMessageEventNotificationConfig." + error; + } + if (message.sttConfig != null && message.hasOwnProperty("sttConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.SpeechToTextConfig.verify(message.sttConfig); + if (error) + return "sttConfig." + error; + } + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; return null; }; /** - * Creates a ListIntentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ConversationProfile message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListIntentsResponse} ListIntentsResponse + * @returns {google.cloud.dialogflow.v2beta1.ConversationProfile} ConversationProfile */ - ListIntentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListIntentsResponse) + ConversationProfile.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ConversationProfile) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListIntentsResponse(); - if (object.intents) { - if (!Array.isArray(object.intents)) - throw TypeError(".google.cloud.dialogflow.v2beta1.ListIntentsResponse.intents: array expected"); - message.intents = []; - for (var i = 0; i < object.intents.length; ++i) { - if (typeof object.intents[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.ListIntentsResponse.intents: object expected"); - message.intents[i] = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intents[i]); - } + var message = new $root.google.cloud.dialogflow.v2beta1.ConversationProfile(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationProfile.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + if (object.updateTime != null) { + if (typeof object.updateTime !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationProfile.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.automatedAgentConfig != null) { + if (typeof object.automatedAgentConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationProfile.automatedAgentConfig: object expected"); + message.automatedAgentConfig = $root.google.cloud.dialogflow.v2beta1.AutomatedAgentConfig.fromObject(object.automatedAgentConfig); + } + if (object.humanAgentAssistantConfig != null) { + if (typeof object.humanAgentAssistantConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationProfile.humanAgentAssistantConfig: object expected"); + message.humanAgentAssistantConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.fromObject(object.humanAgentAssistantConfig); + } + if (object.humanAgentHandoffConfig != null) { + if (typeof object.humanAgentHandoffConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationProfile.humanAgentHandoffConfig: object expected"); + message.humanAgentHandoffConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.fromObject(object.humanAgentHandoffConfig); + } + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationProfile.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.loggingConfig != null) { + if (typeof object.loggingConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationProfile.loggingConfig: object expected"); + message.loggingConfig = $root.google.cloud.dialogflow.v2beta1.LoggingConfig.fromObject(object.loggingConfig); + } + if (object.newMessageEventNotificationConfig != null) { + if (typeof object.newMessageEventNotificationConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationProfile.newMessageEventNotificationConfig: object expected"); + message.newMessageEventNotificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.fromObject(object.newMessageEventNotificationConfig); + } + if (object.sttConfig != null) { + if (typeof object.sttConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ConversationProfile.sttConfig: object expected"); + message.sttConfig = $root.google.cloud.dialogflow.v2beta1.SpeechToTextConfig.fromObject(object.sttConfig); + } + if (object.languageCode != null) + message.languageCode = String(object.languageCode); return message; }; /** - * Creates a plain object from a ListIntentsResponse message. Also converts values to other types if specified. + * Creates a plain object from a ConversationProfile message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile * @static - * @param {google.cloud.dialogflow.v2beta1.ListIntentsResponse} message ListIntentsResponse + * @param {google.cloud.dialogflow.v2beta1.ConversationProfile} message ConversationProfile * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListIntentsResponse.toObject = function toObject(message, options) { + ConversationProfile.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.intents = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.intents && message.intents.length) { - object.intents = []; - for (var j = 0; j < message.intents.length; ++j) - object.intents[j] = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intents[j], options); + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.automatedAgentConfig = null; + object.humanAgentAssistantConfig = null; + object.humanAgentHandoffConfig = null; + object.notificationConfig = null; + object.loggingConfig = null; + object.newMessageEventNotificationConfig = null; + object.sttConfig = null; + object.languageCode = ""; + object.createTime = null; + object.updateTime = null; } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.automatedAgentConfig != null && message.hasOwnProperty("automatedAgentConfig")) + object.automatedAgentConfig = $root.google.cloud.dialogflow.v2beta1.AutomatedAgentConfig.toObject(message.automatedAgentConfig, options); + if (message.humanAgentAssistantConfig != null && message.hasOwnProperty("humanAgentAssistantConfig")) + object.humanAgentAssistantConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.toObject(message.humanAgentAssistantConfig, options); + if (message.humanAgentHandoffConfig != null && message.hasOwnProperty("humanAgentHandoffConfig")) + object.humanAgentHandoffConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.toObject(message.humanAgentHandoffConfig, options); + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.toObject(message.notificationConfig, options); + if (message.loggingConfig != null && message.hasOwnProperty("loggingConfig")) + object.loggingConfig = $root.google.cloud.dialogflow.v2beta1.LoggingConfig.toObject(message.loggingConfig, options); + if (message.newMessageEventNotificationConfig != null && message.hasOwnProperty("newMessageEventNotificationConfig")) + object.newMessageEventNotificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.toObject(message.newMessageEventNotificationConfig, options); + if (message.sttConfig != null && message.hasOwnProperty("sttConfig")) + object.sttConfig = $root.google.cloud.dialogflow.v2beta1.SpeechToTextConfig.toObject(message.sttConfig, options); + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); return object; }; /** - * Converts this ListIntentsResponse to JSON. + * Converts this ConversationProfile to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListIntentsResponse + * @memberof google.cloud.dialogflow.v2beta1.ConversationProfile * @instance * @returns {Object.} JSON object */ - ListIntentsResponse.prototype.toJSON = function toJSON() { + ConversationProfile.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListIntentsResponse; + return ConversationProfile; })(); - v2beta1.GetIntentRequest = (function() { + v2beta1.AutomatedAgentConfig = (function() { /** - * Properties of a GetIntentRequest. + * Properties of an AutomatedAgentConfig. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IGetIntentRequest - * @property {string|null} [name] GetIntentRequest name - * @property {string|null} [languageCode] GetIntentRequest languageCode - * @property {google.cloud.dialogflow.v2beta1.IntentView|null} [intentView] GetIntentRequest intentView + * @interface IAutomatedAgentConfig + * @property {string|null} [agent] AutomatedAgentConfig agent */ /** - * Constructs a new GetIntentRequest. + * Constructs a new AutomatedAgentConfig. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a GetIntentRequest. - * @implements IGetIntentRequest + * @classdesc Represents an AutomatedAgentConfig. + * @implements IAutomatedAgentConfig * @constructor - * @param {google.cloud.dialogflow.v2beta1.IGetIntentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IAutomatedAgentConfig=} [properties] Properties to set */ - function GetIntentRequest(properties) { + function AutomatedAgentConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -60842,101 +111376,75 @@ } /** - * GetIntentRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest - * @instance - */ - GetIntentRequest.prototype.name = ""; - - /** - * GetIntentRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest - * @instance - */ - GetIntentRequest.prototype.languageCode = ""; - - /** - * GetIntentRequest intentView. - * @member {google.cloud.dialogflow.v2beta1.IntentView} intentView - * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * AutomatedAgentConfig agent. + * @member {string} agent + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentConfig * @instance */ - GetIntentRequest.prototype.intentView = 0; + AutomatedAgentConfig.prototype.agent = ""; /** - * Creates a new GetIntentRequest instance using the specified properties. + * Creates a new AutomatedAgentConfig instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IGetIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.GetIntentRequest} GetIntentRequest instance + * @param {google.cloud.dialogflow.v2beta1.IAutomatedAgentConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.AutomatedAgentConfig} AutomatedAgentConfig instance */ - GetIntentRequest.create = function create(properties) { - return new GetIntentRequest(properties); + AutomatedAgentConfig.create = function create(properties) { + return new AutomatedAgentConfig(properties); }; /** - * Encodes the specified GetIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetIntentRequest.verify|verify} messages. + * Encodes the specified AutomatedAgentConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AutomatedAgentConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IGetIntentRequest} message GetIntentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IAutomatedAgentConfig} message AutomatedAgentConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIntentRequest.encode = function encode(message, writer) { + AutomatedAgentConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); - if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.intentView); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); return writer; }; /** - * Encodes the specified GetIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetIntentRequest.verify|verify} messages. + * Encodes the specified AutomatedAgentConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.AutomatedAgentConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IGetIntentRequest} message GetIntentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IAutomatedAgentConfig} message AutomatedAgentConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + AutomatedAgentConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetIntentRequest message from the specified reader or buffer. + * Decodes an AutomatedAgentConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.GetIntentRequest} GetIntentRequest + * @returns {google.cloud.dialogflow.v2beta1.AutomatedAgentConfig} AutomatedAgentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetIntentRequest.decode = function decode(reader, length) { + AutomatedAgentConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetIntentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.AutomatedAgentConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); - break; - case 2: - message.languageCode = reader.string(); - break; - case 3: - message.intentView = reader.int32(); + message.agent = reader.string(); break; default: reader.skipType(tag & 7); @@ -60947,140 +111455,110 @@ }; /** - * Decodes a GetIntentRequest message from the specified reader or buffer, length delimited. + * Decodes an AutomatedAgentConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.GetIntentRequest} GetIntentRequest + * @returns {google.cloud.dialogflow.v2beta1.AutomatedAgentConfig} AutomatedAgentConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetIntentRequest.decodeDelimited = function decodeDelimited(reader) { + AutomatedAgentConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetIntentRequest message. + * Verifies an AutomatedAgentConfig message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetIntentRequest.verify = function verify(message) { + AutomatedAgentConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.intentView != null && message.hasOwnProperty("intentView")) - switch (message.intentView) { - default: - return "intentView: enum value expected"; - case 0: - case 1: - break; - } + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; return null; }; /** - * Creates a GetIntentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an AutomatedAgentConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.GetIntentRequest} GetIntentRequest + * @returns {google.cloud.dialogflow.v2beta1.AutomatedAgentConfig} AutomatedAgentConfig */ - GetIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetIntentRequest) + AutomatedAgentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.AutomatedAgentConfig) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.GetIntentRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - switch (object.intentView) { - case "INTENT_VIEW_UNSPECIFIED": - case 0: - message.intentView = 0; - break; - case "INTENT_VIEW_FULL": - case 1: - message.intentView = 1; - break; - } + var message = new $root.google.cloud.dialogflow.v2beta1.AutomatedAgentConfig(); + if (object.agent != null) + message.agent = String(object.agent); return message; }; /** - * Creates a plain object from a GetIntentRequest message. Also converts values to other types if specified. + * Creates a plain object from an AutomatedAgentConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentConfig * @static - * @param {google.cloud.dialogflow.v2beta1.GetIntentRequest} message GetIntentRequest + * @param {google.cloud.dialogflow.v2beta1.AutomatedAgentConfig} message AutomatedAgentConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetIntentRequest.toObject = function toObject(message, options) { + AutomatedAgentConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.name = ""; - object.languageCode = ""; - object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.intentView != null && message.hasOwnProperty("intentView")) - object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.IntentView[message.intentView] : message.intentView; + if (options.defaults) + object.agent = ""; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; return object; }; /** - * Converts this GetIntentRequest to JSON. + * Converts this AutomatedAgentConfig to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.GetIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.AutomatedAgentConfig * @instance * @returns {Object.} JSON object */ - GetIntentRequest.prototype.toJSON = function toJSON() { + AutomatedAgentConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetIntentRequest; + return AutomatedAgentConfig; })(); - v2beta1.CreateIntentRequest = (function() { + v2beta1.HumanAgentAssistantConfig = (function() { /** - * Properties of a CreateIntentRequest. + * Properties of a HumanAgentAssistantConfig. * @memberof google.cloud.dialogflow.v2beta1 - * @interface ICreateIntentRequest - * @property {string|null} [parent] CreateIntentRequest parent - * @property {google.cloud.dialogflow.v2beta1.IIntent|null} [intent] CreateIntentRequest intent - * @property {string|null} [languageCode] CreateIntentRequest languageCode - * @property {google.cloud.dialogflow.v2beta1.IntentView|null} [intentView] CreateIntentRequest intentView + * @interface IHumanAgentAssistantConfig + * @property {google.cloud.dialogflow.v2beta1.INotificationConfig|null} [notificationConfig] HumanAgentAssistantConfig notificationConfig + * @property {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig|null} [humanAgentSuggestionConfig] HumanAgentAssistantConfig humanAgentSuggestionConfig + * @property {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig|null} [endUserSuggestionConfig] HumanAgentAssistantConfig endUserSuggestionConfig + * @property {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IMessageAnalysisConfig|null} [messageAnalysisConfig] HumanAgentAssistantConfig messageAnalysisConfig */ /** - * Constructs a new CreateIntentRequest. + * Constructs a new HumanAgentAssistantConfig. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a CreateIntentRequest. - * @implements ICreateIntentRequest + * @classdesc Represents a HumanAgentAssistantConfig. + * @implements IHumanAgentAssistantConfig * @constructor - * @param {google.cloud.dialogflow.v2beta1.ICreateIntentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IHumanAgentAssistantConfig=} [properties] Properties to set */ - function CreateIntentRequest(properties) { + function HumanAgentAssistantConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -61088,114 +111566,114 @@ } /** - * CreateIntentRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * HumanAgentAssistantConfig notificationConfig. + * @member {google.cloud.dialogflow.v2beta1.INotificationConfig|null|undefined} notificationConfig + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig * @instance */ - CreateIntentRequest.prototype.parent = ""; + HumanAgentAssistantConfig.prototype.notificationConfig = null; /** - * CreateIntentRequest intent. - * @member {google.cloud.dialogflow.v2beta1.IIntent|null|undefined} intent - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * HumanAgentAssistantConfig humanAgentSuggestionConfig. + * @member {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig|null|undefined} humanAgentSuggestionConfig + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig * @instance */ - CreateIntentRequest.prototype.intent = null; + HumanAgentAssistantConfig.prototype.humanAgentSuggestionConfig = null; /** - * CreateIntentRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * HumanAgentAssistantConfig endUserSuggestionConfig. + * @member {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig|null|undefined} endUserSuggestionConfig + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig * @instance */ - CreateIntentRequest.prototype.languageCode = ""; + HumanAgentAssistantConfig.prototype.endUserSuggestionConfig = null; /** - * CreateIntentRequest intentView. - * @member {google.cloud.dialogflow.v2beta1.IntentView} intentView - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * HumanAgentAssistantConfig messageAnalysisConfig. + * @member {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IMessageAnalysisConfig|null|undefined} messageAnalysisConfig + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig * @instance */ - CreateIntentRequest.prototype.intentView = 0; + HumanAgentAssistantConfig.prototype.messageAnalysisConfig = null; /** - * Creates a new CreateIntentRequest instance using the specified properties. + * Creates a new HumanAgentAssistantConfig instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.CreateIntentRequest} CreateIntentRequest instance + * @param {google.cloud.dialogflow.v2beta1.IHumanAgentAssistantConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig} HumanAgentAssistantConfig instance */ - CreateIntentRequest.create = function create(properties) { - return new CreateIntentRequest(properties); + HumanAgentAssistantConfig.create = function create(properties) { + return new HumanAgentAssistantConfig(properties); }; /** - * Encodes the specified CreateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateIntentRequest.verify|verify} messages. + * Encodes the specified HumanAgentAssistantConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateIntentRequest} message CreateIntentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IHumanAgentAssistantConfig} message HumanAgentAssistantConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateIntentRequest.encode = function encode(message, writer) { + HumanAgentAssistantConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) - $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intent, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); - if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.intentView); + if (message.notificationConfig != null && Object.hasOwnProperty.call(message, "notificationConfig")) + $root.google.cloud.dialogflow.v2beta1.NotificationConfig.encode(message.notificationConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.humanAgentSuggestionConfig != null && Object.hasOwnProperty.call(message, "humanAgentSuggestionConfig")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.encode(message.humanAgentSuggestionConfig, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.endUserSuggestionConfig != null && Object.hasOwnProperty.call(message, "endUserSuggestionConfig")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.encode(message.endUserSuggestionConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.messageAnalysisConfig != null && Object.hasOwnProperty.call(message, "messageAnalysisConfig")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig.encode(message.messageAnalysisConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateIntentRequest.verify|verify} messages. + * Encodes the specified HumanAgentAssistantConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateIntentRequest} message CreateIntentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IHumanAgentAssistantConfig} message HumanAgentAssistantConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + HumanAgentAssistantConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateIntentRequest message from the specified reader or buffer. + * Decodes a HumanAgentAssistantConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.CreateIntentRequest} CreateIntentRequest + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig} HumanAgentAssistantConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateIntentRequest.decode = function decode(reader, length) { + HumanAgentAssistantConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateIntentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; case 2: - message.intent = $root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32()); + message.notificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.decode(reader, reader.uint32()); break; case 3: - message.languageCode = reader.string(); + message.humanAgentSuggestionConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.decode(reader, reader.uint32()); break; case 4: - message.intentView = reader.int32(); + message.endUserSuggestionConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.decode(reader, reader.uint32()); + break; + case 5: + message.messageAnalysisConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -61206,1401 +111684,2464 @@ }; /** - * Decodes a CreateIntentRequest message from the specified reader or buffer, length delimited. + * Decodes a HumanAgentAssistantConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.CreateIntentRequest} CreateIntentRequest + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig} HumanAgentAssistantConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateIntentRequest.decodeDelimited = function decodeDelimited(reader) { + HumanAgentAssistantConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateIntentRequest message. + * Verifies a HumanAgentAssistantConfig message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateIntentRequest.verify = function verify(message) { + HumanAgentAssistantConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.intent != null && message.hasOwnProperty("intent")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intent); + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.verify(message.notificationConfig); if (error) - return "intent." + error; + return "notificationConfig." + error; + } + if (message.humanAgentSuggestionConfig != null && message.hasOwnProperty("humanAgentSuggestionConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.verify(message.humanAgentSuggestionConfig); + if (error) + return "humanAgentSuggestionConfig." + error; + } + if (message.endUserSuggestionConfig != null && message.hasOwnProperty("endUserSuggestionConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.verify(message.endUserSuggestionConfig); + if (error) + return "endUserSuggestionConfig." + error; + } + if (message.messageAnalysisConfig != null && message.hasOwnProperty("messageAnalysisConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig.verify(message.messageAnalysisConfig); + if (error) + return "messageAnalysisConfig." + error; } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.intentView != null && message.hasOwnProperty("intentView")) - switch (message.intentView) { - default: - return "intentView: enum value expected"; - case 0: - case 1: - break; - } return null; }; /** - * Creates a CreateIntentRequest message from a plain object. Also converts values to their respective internal types. + * Creates a HumanAgentAssistantConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.CreateIntentRequest} CreateIntentRequest + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig} HumanAgentAssistantConfig */ - CreateIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateIntentRequest) + HumanAgentAssistantConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.CreateIntentRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.intent != null) { - if (typeof object.intent !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.CreateIntentRequest.intent: object expected"); - message.intent = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intent); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - switch (object.intentView) { - case "INTENT_VIEW_UNSPECIFIED": - case 0: - message.intentView = 0; - break; - case "INTENT_VIEW_FULL": - case 1: - message.intentView = 1; - break; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig(); + if (object.notificationConfig != null) { + if (typeof object.notificationConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.notificationConfig: object expected"); + message.notificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.fromObject(object.notificationConfig); + } + if (object.humanAgentSuggestionConfig != null) { + if (typeof object.humanAgentSuggestionConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.humanAgentSuggestionConfig: object expected"); + message.humanAgentSuggestionConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.fromObject(object.humanAgentSuggestionConfig); + } + if (object.endUserSuggestionConfig != null) { + if (typeof object.endUserSuggestionConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.endUserSuggestionConfig: object expected"); + message.endUserSuggestionConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.fromObject(object.endUserSuggestionConfig); + } + if (object.messageAnalysisConfig != null) { + if (typeof object.messageAnalysisConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.messageAnalysisConfig: object expected"); + message.messageAnalysisConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig.fromObject(object.messageAnalysisConfig); } return message; }; /** - * Creates a plain object from a CreateIntentRequest message. Also converts values to other types if specified. + * Creates a plain object from a HumanAgentAssistantConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig * @static - * @param {google.cloud.dialogflow.v2beta1.CreateIntentRequest} message CreateIntentRequest + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig} message HumanAgentAssistantConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateIntentRequest.toObject = function toObject(message, options) { + HumanAgentAssistantConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.intent = null; - object.languageCode = ""; - object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.intent != null && message.hasOwnProperty("intent")) - object.intent = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intent, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.intentView != null && message.hasOwnProperty("intentView")) - object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.IntentView[message.intentView] : message.intentView; + object.notificationConfig = null; + object.humanAgentSuggestionConfig = null; + object.endUserSuggestionConfig = null; + object.messageAnalysisConfig = null; + } + if (message.notificationConfig != null && message.hasOwnProperty("notificationConfig")) + object.notificationConfig = $root.google.cloud.dialogflow.v2beta1.NotificationConfig.toObject(message.notificationConfig, options); + if (message.humanAgentSuggestionConfig != null && message.hasOwnProperty("humanAgentSuggestionConfig")) + object.humanAgentSuggestionConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.toObject(message.humanAgentSuggestionConfig, options); + if (message.endUserSuggestionConfig != null && message.hasOwnProperty("endUserSuggestionConfig")) + object.endUserSuggestionConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.toObject(message.endUserSuggestionConfig, options); + if (message.messageAnalysisConfig != null && message.hasOwnProperty("messageAnalysisConfig")) + object.messageAnalysisConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig.toObject(message.messageAnalysisConfig, options); return object; }; - /** - * Converts this CreateIntentRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.CreateIntentRequest - * @instance - * @returns {Object.} JSON object - */ - CreateIntentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Converts this HumanAgentAssistantConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @instance + * @returns {Object.} JSON object + */ + HumanAgentAssistantConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + HumanAgentAssistantConfig.SuggestionTriggerSettings = (function() { + + /** + * Properties of a SuggestionTriggerSettings. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @interface ISuggestionTriggerSettings + * @property {boolean|null} [noSmallTalk] SuggestionTriggerSettings noSmallTalk + * @property {boolean|null} [onlyEndUser] SuggestionTriggerSettings onlyEndUser + */ + + /** + * Constructs a new SuggestionTriggerSettings. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @classdesc Represents a SuggestionTriggerSettings. + * @implements ISuggestionTriggerSettings + * @constructor + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionTriggerSettings=} [properties] Properties to set + */ + function SuggestionTriggerSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestionTriggerSettings noSmallTalk. + * @member {boolean} noSmallTalk + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @instance + */ + SuggestionTriggerSettings.prototype.noSmallTalk = false; + + /** + * SuggestionTriggerSettings onlyEndUser. + * @member {boolean} onlyEndUser + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @instance + */ + SuggestionTriggerSettings.prototype.onlyEndUser = false; + + /** + * Creates a new SuggestionTriggerSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionTriggerSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings} SuggestionTriggerSettings instance + */ + SuggestionTriggerSettings.create = function create(properties) { + return new SuggestionTriggerSettings(properties); + }; + + /** + * Encodes the specified SuggestionTriggerSettings message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionTriggerSettings} message SuggestionTriggerSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionTriggerSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.noSmallTalk != null && Object.hasOwnProperty.call(message, "noSmallTalk")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.noSmallTalk); + if (message.onlyEndUser != null && Object.hasOwnProperty.call(message, "onlyEndUser")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.onlyEndUser); + return writer; + }; + + /** + * Encodes the specified SuggestionTriggerSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionTriggerSettings} message SuggestionTriggerSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionTriggerSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestionTriggerSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings} SuggestionTriggerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionTriggerSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.noSmallTalk = reader.bool(); + break; + case 2: + message.onlyEndUser = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestionTriggerSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings} SuggestionTriggerSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionTriggerSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestionTriggerSettings message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionTriggerSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.noSmallTalk != null && message.hasOwnProperty("noSmallTalk")) + if (typeof message.noSmallTalk !== "boolean") + return "noSmallTalk: boolean expected"; + if (message.onlyEndUser != null && message.hasOwnProperty("onlyEndUser")) + if (typeof message.onlyEndUser !== "boolean") + return "onlyEndUser: boolean expected"; + return null; + }; + + /** + * Creates a SuggestionTriggerSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings} SuggestionTriggerSettings + */ + SuggestionTriggerSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings(); + if (object.noSmallTalk != null) + message.noSmallTalk = Boolean(object.noSmallTalk); + if (object.onlyEndUser != null) + message.onlyEndUser = Boolean(object.onlyEndUser); + return message; + }; + + /** + * Creates a plain object from a SuggestionTriggerSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings} message SuggestionTriggerSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionTriggerSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.noSmallTalk = false; + object.onlyEndUser = false; + } + if (message.noSmallTalk != null && message.hasOwnProperty("noSmallTalk")) + object.noSmallTalk = message.noSmallTalk; + if (message.onlyEndUser != null && message.hasOwnProperty("onlyEndUser")) + object.onlyEndUser = message.onlyEndUser; + return object; + }; + + /** + * Converts this SuggestionTriggerSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings + * @instance + * @returns {Object.} JSON object + */ + SuggestionTriggerSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SuggestionTriggerSettings; + })(); + + HumanAgentAssistantConfig.SuggestionFeatureConfig = (function() { + + /** + * Properties of a SuggestionFeatureConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @interface ISuggestionFeatureConfig + * @property {google.cloud.dialogflow.v2beta1.ISuggestionFeature|null} [suggestionFeature] SuggestionFeatureConfig suggestionFeature + * @property {boolean|null} [enableEventBasedSuggestion] SuggestionFeatureConfig enableEventBasedSuggestion + * @property {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionTriggerSettings|null} [suggestionTriggerSettings] SuggestionFeatureConfig suggestionTriggerSettings + * @property {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionQueryConfig|null} [queryConfig] SuggestionFeatureConfig queryConfig + * @property {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IConversationModelConfig|null} [conversationModelConfig] SuggestionFeatureConfig conversationModelConfig + */ + + /** + * Constructs a new SuggestionFeatureConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @classdesc Represents a SuggestionFeatureConfig. + * @implements ISuggestionFeatureConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionFeatureConfig=} [properties] Properties to set + */ + function SuggestionFeatureConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestionFeatureConfig suggestionFeature. + * @member {google.cloud.dialogflow.v2beta1.ISuggestionFeature|null|undefined} suggestionFeature + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @instance + */ + SuggestionFeatureConfig.prototype.suggestionFeature = null; + + /** + * SuggestionFeatureConfig enableEventBasedSuggestion. + * @member {boolean} enableEventBasedSuggestion + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @instance + */ + SuggestionFeatureConfig.prototype.enableEventBasedSuggestion = false; + + /** + * SuggestionFeatureConfig suggestionTriggerSettings. + * @member {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionTriggerSettings|null|undefined} suggestionTriggerSettings + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @instance + */ + SuggestionFeatureConfig.prototype.suggestionTriggerSettings = null; + + /** + * SuggestionFeatureConfig queryConfig. + * @member {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionQueryConfig|null|undefined} queryConfig + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @instance + */ + SuggestionFeatureConfig.prototype.queryConfig = null; + + /** + * SuggestionFeatureConfig conversationModelConfig. + * @member {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IConversationModelConfig|null|undefined} conversationModelConfig + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @instance + */ + SuggestionFeatureConfig.prototype.conversationModelConfig = null; + + /** + * Creates a new SuggestionFeatureConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionFeatureConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig} SuggestionFeatureConfig instance + */ + SuggestionFeatureConfig.create = function create(properties) { + return new SuggestionFeatureConfig(properties); + }; + + /** + * Encodes the specified SuggestionFeatureConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionFeatureConfig} message SuggestionFeatureConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionFeatureConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableEventBasedSuggestion != null && Object.hasOwnProperty.call(message, "enableEventBasedSuggestion")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableEventBasedSuggestion); + if (message.suggestionFeature != null && Object.hasOwnProperty.call(message, "suggestionFeature")) + $root.google.cloud.dialogflow.v2beta1.SuggestionFeature.encode(message.suggestionFeature, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.queryConfig != null && Object.hasOwnProperty.call(message, "queryConfig")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.encode(message.queryConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.conversationModelConfig != null && Object.hasOwnProperty.call(message, "conversationModelConfig")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig.encode(message.conversationModelConfig, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.suggestionTriggerSettings != null && Object.hasOwnProperty.call(message, "suggestionTriggerSettings")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings.encode(message.suggestionTriggerSettings, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SuggestionFeatureConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionFeatureConfig} message SuggestionFeatureConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionFeatureConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestionFeatureConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig} SuggestionFeatureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionFeatureConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 5: + message.suggestionFeature = $root.google.cloud.dialogflow.v2beta1.SuggestionFeature.decode(reader, reader.uint32()); + break; + case 3: + message.enableEventBasedSuggestion = reader.bool(); + break; + case 10: + message.suggestionTriggerSettings = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings.decode(reader, reader.uint32()); + break; + case 6: + message.queryConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.decode(reader, reader.uint32()); + break; + case 7: + message.conversationModelConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestionFeatureConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig} SuggestionFeatureConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionFeatureConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestionFeatureConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionFeatureConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.suggestionFeature != null && message.hasOwnProperty("suggestionFeature")) { + var error = $root.google.cloud.dialogflow.v2beta1.SuggestionFeature.verify(message.suggestionFeature); + if (error) + return "suggestionFeature." + error; + } + if (message.enableEventBasedSuggestion != null && message.hasOwnProperty("enableEventBasedSuggestion")) + if (typeof message.enableEventBasedSuggestion !== "boolean") + return "enableEventBasedSuggestion: boolean expected"; + if (message.suggestionTriggerSettings != null && message.hasOwnProperty("suggestionTriggerSettings")) { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings.verify(message.suggestionTriggerSettings); + if (error) + return "suggestionTriggerSettings." + error; + } + if (message.queryConfig != null && message.hasOwnProperty("queryConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.verify(message.queryConfig); + if (error) + return "queryConfig." + error; + } + if (message.conversationModelConfig != null && message.hasOwnProperty("conversationModelConfig")) { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig.verify(message.conversationModelConfig); + if (error) + return "conversationModelConfig." + error; + } + return null; + }; + + /** + * Creates a SuggestionFeatureConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig} SuggestionFeatureConfig + */ + SuggestionFeatureConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig(); + if (object.suggestionFeature != null) { + if (typeof object.suggestionFeature !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.suggestionFeature: object expected"); + message.suggestionFeature = $root.google.cloud.dialogflow.v2beta1.SuggestionFeature.fromObject(object.suggestionFeature); + } + if (object.enableEventBasedSuggestion != null) + message.enableEventBasedSuggestion = Boolean(object.enableEventBasedSuggestion); + if (object.suggestionTriggerSettings != null) { + if (typeof object.suggestionTriggerSettings !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.suggestionTriggerSettings: object expected"); + message.suggestionTriggerSettings = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings.fromObject(object.suggestionTriggerSettings); + } + if (object.queryConfig != null) { + if (typeof object.queryConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.queryConfig: object expected"); + message.queryConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.fromObject(object.queryConfig); + } + if (object.conversationModelConfig != null) { + if (typeof object.conversationModelConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.conversationModelConfig: object expected"); + message.conversationModelConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig.fromObject(object.conversationModelConfig); + } + return message; + }; + + /** + * Creates a plain object from a SuggestionFeatureConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig} message SuggestionFeatureConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionFeatureConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableEventBasedSuggestion = false; + object.suggestionFeature = null; + object.queryConfig = null; + object.conversationModelConfig = null; + object.suggestionTriggerSettings = null; + } + if (message.enableEventBasedSuggestion != null && message.hasOwnProperty("enableEventBasedSuggestion")) + object.enableEventBasedSuggestion = message.enableEventBasedSuggestion; + if (message.suggestionFeature != null && message.hasOwnProperty("suggestionFeature")) + object.suggestionFeature = $root.google.cloud.dialogflow.v2beta1.SuggestionFeature.toObject(message.suggestionFeature, options); + if (message.queryConfig != null && message.hasOwnProperty("queryConfig")) + object.queryConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.toObject(message.queryConfig, options); + if (message.conversationModelConfig != null && message.hasOwnProperty("conversationModelConfig")) + object.conversationModelConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig.toObject(message.conversationModelConfig, options); + if (message.suggestionTriggerSettings != null && message.hasOwnProperty("suggestionTriggerSettings")) + object.suggestionTriggerSettings = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionTriggerSettings.toObject(message.suggestionTriggerSettings, options); + return object; + }; + + /** + * Converts this SuggestionFeatureConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig + * @instance + * @returns {Object.} JSON object + */ + SuggestionFeatureConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return SuggestionFeatureConfig; + })(); + + HumanAgentAssistantConfig.SuggestionConfig = (function() { + + /** + * Properties of a SuggestionConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @interface ISuggestionConfig + * @property {Array.|null} [featureConfigs] SuggestionConfig featureConfigs + * @property {boolean|null} [groupSuggestionResponses] SuggestionConfig groupSuggestionResponses + */ + + /** + * Constructs a new SuggestionConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @classdesc Represents a SuggestionConfig. + * @implements ISuggestionConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig=} [properties] Properties to set + */ + function SuggestionConfig(properties) { + this.featureConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SuggestionConfig featureConfigs. + * @member {Array.} featureConfigs + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig + * @instance + */ + SuggestionConfig.prototype.featureConfigs = $util.emptyArray; + + /** + * SuggestionConfig groupSuggestionResponses. + * @member {boolean} groupSuggestionResponses + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig + * @instance + */ + SuggestionConfig.prototype.groupSuggestionResponses = false; + + /** + * Creates a new SuggestionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig} SuggestionConfig instance + */ + SuggestionConfig.create = function create(properties) { + return new SuggestionConfig(properties); + }; + + /** + * Encodes the specified SuggestionConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig} message SuggestionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.featureConfigs != null && message.featureConfigs.length) + for (var i = 0; i < message.featureConfigs.length; ++i) + $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.encode(message.featureConfigs[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.groupSuggestionResponses != null && Object.hasOwnProperty.call(message, "groupSuggestionResponses")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.groupSuggestionResponses); + return writer; + }; + + /** + * Encodes the specified SuggestionConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionConfig} message SuggestionConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestionConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig} SuggestionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.featureConfigs && message.featureConfigs.length)) + message.featureConfigs = []; + message.featureConfigs.push($root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.decode(reader, reader.uint32())); + break; + case 3: + message.groupSuggestionResponses = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SuggestionConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig} SuggestionConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SuggestionConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.featureConfigs != null && message.hasOwnProperty("featureConfigs")) { + if (!Array.isArray(message.featureConfigs)) + return "featureConfigs: array expected"; + for (var i = 0; i < message.featureConfigs.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.verify(message.featureConfigs[i]); + if (error) + return "featureConfigs." + error; + } + } + if (message.groupSuggestionResponses != null && message.hasOwnProperty("groupSuggestionResponses")) + if (typeof message.groupSuggestionResponses !== "boolean") + return "groupSuggestionResponses: boolean expected"; + return null; + }; + + /** + * Creates a SuggestionConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig} SuggestionConfig + */ + SuggestionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig(); + if (object.featureConfigs) { + if (!Array.isArray(object.featureConfigs)) + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.featureConfigs: array expected"); + message.featureConfigs = []; + for (var i = 0; i < object.featureConfigs.length; ++i) { + if (typeof object.featureConfigs[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig.featureConfigs: object expected"); + message.featureConfigs[i] = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.fromObject(object.featureConfigs[i]); + } + } + if (object.groupSuggestionResponses != null) + message.groupSuggestionResponses = Boolean(object.groupSuggestionResponses); + return message; + }; + + /** + * Creates a plain object from a SuggestionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig} message SuggestionConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.featureConfigs = []; + if (options.defaults) + object.groupSuggestionResponses = false; + if (message.featureConfigs && message.featureConfigs.length) { + object.featureConfigs = []; + for (var j = 0; j < message.featureConfigs.length; ++j) + object.featureConfigs[j] = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionFeatureConfig.toObject(message.featureConfigs[j], options); + } + if (message.groupSuggestionResponses != null && message.hasOwnProperty("groupSuggestionResponses")) + object.groupSuggestionResponses = message.groupSuggestionResponses; + return object; + }; + + /** + * Converts this SuggestionConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionConfig + * @instance + * @returns {Object.} JSON object + */ + SuggestionConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return CreateIntentRequest; - })(); + return SuggestionConfig; + })(); - v2beta1.UpdateIntentRequest = (function() { + HumanAgentAssistantConfig.SuggestionQueryConfig = (function() { - /** - * Properties of an UpdateIntentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IUpdateIntentRequest - * @property {google.cloud.dialogflow.v2beta1.IIntent|null} [intent] UpdateIntentRequest intent - * @property {string|null} [languageCode] UpdateIntentRequest languageCode - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateIntentRequest updateMask - * @property {google.cloud.dialogflow.v2beta1.IntentView|null} [intentView] UpdateIntentRequest intentView - */ + /** + * Properties of a SuggestionQueryConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @interface ISuggestionQueryConfig + * @property {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource|null} [knowledgeBaseQuerySource] SuggestionQueryConfig knowledgeBaseQuerySource + * @property {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource|null} [documentQuerySource] SuggestionQueryConfig documentQuerySource + * @property {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource|null} [dialogflowQuerySource] SuggestionQueryConfig dialogflowQuerySource + * @property {number|null} [maxResults] SuggestionQueryConfig maxResults + * @property {number|null} [confidenceThreshold] SuggestionQueryConfig confidenceThreshold + * @property {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings|null} [contextFilterSettings] SuggestionQueryConfig contextFilterSettings + */ - /** - * Constructs a new UpdateIntentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an UpdateIntentRequest. - * @implements IUpdateIntentRequest - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IUpdateIntentRequest=} [properties] Properties to set - */ - function UpdateIntentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Constructs a new SuggestionQueryConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @classdesc Represents a SuggestionQueryConfig. + * @implements ISuggestionQueryConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionQueryConfig=} [properties] Properties to set + */ + function SuggestionQueryConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * UpdateIntentRequest intent. - * @member {google.cloud.dialogflow.v2beta1.IIntent|null|undefined} intent - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @instance - */ - UpdateIntentRequest.prototype.intent = null; + /** + * SuggestionQueryConfig knowledgeBaseQuerySource. + * @member {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource|null|undefined} knowledgeBaseQuerySource + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + SuggestionQueryConfig.prototype.knowledgeBaseQuerySource = null; - /** - * UpdateIntentRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @instance - */ - UpdateIntentRequest.prototype.languageCode = ""; + /** + * SuggestionQueryConfig documentQuerySource. + * @member {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource|null|undefined} documentQuerySource + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + SuggestionQueryConfig.prototype.documentQuerySource = null; - /** - * UpdateIntentRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @instance - */ - UpdateIntentRequest.prototype.updateMask = null; + /** + * SuggestionQueryConfig dialogflowQuerySource. + * @member {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource|null|undefined} dialogflowQuerySource + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + SuggestionQueryConfig.prototype.dialogflowQuerySource = null; - /** - * UpdateIntentRequest intentView. - * @member {google.cloud.dialogflow.v2beta1.IntentView} intentView - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @instance - */ - UpdateIntentRequest.prototype.intentView = 0; + /** + * SuggestionQueryConfig maxResults. + * @member {number} maxResults + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + SuggestionQueryConfig.prototype.maxResults = 0; - /** - * Creates a new UpdateIntentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.UpdateIntentRequest} UpdateIntentRequest instance - */ - UpdateIntentRequest.create = function create(properties) { - return new UpdateIntentRequest(properties); - }; + /** + * SuggestionQueryConfig confidenceThreshold. + * @member {number} confidenceThreshold + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + SuggestionQueryConfig.prototype.confidenceThreshold = 0; - /** - * Encodes the specified UpdateIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateIntentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateIntentRequest} message UpdateIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateIntentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) - $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intent, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.intentView); - return writer; - }; + /** + * SuggestionQueryConfig contextFilterSettings. + * @member {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings|null|undefined} contextFilterSettings + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + SuggestionQueryConfig.prototype.contextFilterSettings = null; - /** - * Encodes the specified UpdateIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateIntentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateIntentRequest} message UpdateIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; - /** - * Decodes an UpdateIntentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.UpdateIntentRequest} UpdateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateIntentRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateIntentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.intent = $root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32()); - break; - case 2: - message.languageCode = reader.string(); - break; - case 3: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 4: - message.intentView = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * SuggestionQueryConfig querySource. + * @member {"knowledgeBaseQuerySource"|"documentQuerySource"|"dialogflowQuerySource"|undefined} querySource + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + */ + Object.defineProperty(SuggestionQueryConfig.prototype, "querySource", { + get: $util.oneOfGetter($oneOfFields = ["knowledgeBaseQuerySource", "documentQuerySource", "dialogflowQuerySource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SuggestionQueryConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionQueryConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig} SuggestionQueryConfig instance + */ + SuggestionQueryConfig.create = function create(properties) { + return new SuggestionQueryConfig(properties); + }; + + /** + * Encodes the specified SuggestionQueryConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionQueryConfig} message SuggestionQueryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionQueryConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.knowledgeBaseQuerySource != null && Object.hasOwnProperty.call(message, "knowledgeBaseQuerySource")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.encode(message.knowledgeBaseQuerySource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.documentQuerySource != null && Object.hasOwnProperty.call(message, "documentQuerySource")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.encode(message.documentQuerySource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.dialogflowQuerySource != null && Object.hasOwnProperty.call(message, "dialogflowQuerySource")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.encode(message.dialogflowQuerySource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.maxResults != null && Object.hasOwnProperty.call(message, "maxResults")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.maxResults); + if (message.confidenceThreshold != null && Object.hasOwnProperty.call(message, "confidenceThreshold")) + writer.uint32(/* id 5, wireType 5 =*/45).float(message.confidenceThreshold); + if (message.contextFilterSettings != null && Object.hasOwnProperty.call(message, "contextFilterSettings")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.encode(message.contextFilterSettings, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SuggestionQueryConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ISuggestionQueryConfig} message SuggestionQueryConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SuggestionQueryConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SuggestionQueryConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig} SuggestionQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionQueryConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.knowledgeBaseQuerySource = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.decode(reader, reader.uint32()); + break; + case 2: + message.documentQuerySource = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.decode(reader, reader.uint32()); + break; + case 3: + message.dialogflowQuerySource = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.decode(reader, reader.uint32()); + break; + case 4: + message.maxResults = reader.int32(); + break; + case 5: + message.confidenceThreshold = reader.float(); + break; + case 7: + message.contextFilterSettings = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes an UpdateIntentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.UpdateIntentRequest} UpdateIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateIntentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SuggestionQueryConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig} SuggestionQueryConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SuggestionQueryConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies an UpdateIntentRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateIntentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.intent != null && message.hasOwnProperty("intent")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intent); - if (error) - return "intent." + error; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.intentView != null && message.hasOwnProperty("intentView")) - switch (message.intentView) { - default: - return "intentView: enum value expected"; - case 0: - case 1: - break; + /** + * Verifies a SuggestionQueryConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SuggestionQueryConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.knowledgeBaseQuerySource != null && message.hasOwnProperty("knowledgeBaseQuerySource")) { + properties.querySource = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.verify(message.knowledgeBaseQuerySource); + if (error) + return "knowledgeBaseQuerySource." + error; + } } - return null; - }; + if (message.documentQuerySource != null && message.hasOwnProperty("documentQuerySource")) { + if (properties.querySource === 1) + return "querySource: multiple values"; + properties.querySource = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.verify(message.documentQuerySource); + if (error) + return "documentQuerySource." + error; + } + } + if (message.dialogflowQuerySource != null && message.hasOwnProperty("dialogflowQuerySource")) { + if (properties.querySource === 1) + return "querySource: multiple values"; + properties.querySource = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.verify(message.dialogflowQuerySource); + if (error) + return "dialogflowQuerySource." + error; + } + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + if (!$util.isInteger(message.maxResults)) + return "maxResults: integer expected"; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + if (typeof message.confidenceThreshold !== "number") + return "confidenceThreshold: number expected"; + if (message.contextFilterSettings != null && message.hasOwnProperty("contextFilterSettings")) { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.verify(message.contextFilterSettings); + if (error) + return "contextFilterSettings." + error; + } + return null; + }; - /** - * Creates an UpdateIntentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.UpdateIntentRequest} UpdateIntentRequest - */ - UpdateIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateIntentRequest) + /** + * Creates a SuggestionQueryConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig} SuggestionQueryConfig + */ + SuggestionQueryConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig(); + if (object.knowledgeBaseQuerySource != null) { + if (typeof object.knowledgeBaseQuerySource !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.knowledgeBaseQuerySource: object expected"); + message.knowledgeBaseQuerySource = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.fromObject(object.knowledgeBaseQuerySource); + } + if (object.documentQuerySource != null) { + if (typeof object.documentQuerySource !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.documentQuerySource: object expected"); + message.documentQuerySource = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.fromObject(object.documentQuerySource); + } + if (object.dialogflowQuerySource != null) { + if (typeof object.dialogflowQuerySource !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.dialogflowQuerySource: object expected"); + message.dialogflowQuerySource = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.fromObject(object.dialogflowQuerySource); + } + if (object.maxResults != null) + message.maxResults = object.maxResults | 0; + if (object.confidenceThreshold != null) + message.confidenceThreshold = Number(object.confidenceThreshold); + if (object.contextFilterSettings != null) { + if (typeof object.contextFilterSettings !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.contextFilterSettings: object expected"); + message.contextFilterSettings = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.fromObject(object.contextFilterSettings); + } + return message; + }; + + /** + * Creates a plain object from a SuggestionQueryConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig} message SuggestionQueryConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SuggestionQueryConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxResults = 0; + object.confidenceThreshold = 0; + object.contextFilterSettings = null; + } + if (message.knowledgeBaseQuerySource != null && message.hasOwnProperty("knowledgeBaseQuerySource")) { + object.knowledgeBaseQuerySource = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.toObject(message.knowledgeBaseQuerySource, options); + if (options.oneofs) + object.querySource = "knowledgeBaseQuerySource"; + } + if (message.documentQuerySource != null && message.hasOwnProperty("documentQuerySource")) { + object.documentQuerySource = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.toObject(message.documentQuerySource, options); + if (options.oneofs) + object.querySource = "documentQuerySource"; + } + if (message.dialogflowQuerySource != null && message.hasOwnProperty("dialogflowQuerySource")) { + object.dialogflowQuerySource = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.toObject(message.dialogflowQuerySource, options); + if (options.oneofs) + object.querySource = "dialogflowQuerySource"; + } + if (message.maxResults != null && message.hasOwnProperty("maxResults")) + object.maxResults = message.maxResults; + if (message.confidenceThreshold != null && message.hasOwnProperty("confidenceThreshold")) + object.confidenceThreshold = options.json && !isFinite(message.confidenceThreshold) ? String(message.confidenceThreshold) : message.confidenceThreshold; + if (message.contextFilterSettings != null && message.hasOwnProperty("contextFilterSettings")) + object.contextFilterSettings = $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.toObject(message.contextFilterSettings, options); return object; - var message = new $root.google.cloud.dialogflow.v2beta1.UpdateIntentRequest(); - if (object.intent != null) { - if (typeof object.intent !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateIntentRequest.intent: object expected"); - message.intent = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intent); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateIntentRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - switch (object.intentView) { - case "INTENT_VIEW_UNSPECIFIED": - case 0: - message.intentView = 0; - break; - case "INTENT_VIEW_FULL": - case 1: - message.intentView = 1; - break; - } - return message; - }; + }; + + /** + * Converts this SuggestionQueryConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @instance + * @returns {Object.} JSON object + */ + SuggestionQueryConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SuggestionQueryConfig.KnowledgeBaseQuerySource = (function() { + + /** + * Properties of a KnowledgeBaseQuerySource. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @interface IKnowledgeBaseQuerySource + * @property {Array.|null} [knowledgeBases] KnowledgeBaseQuerySource knowledgeBases + */ + + /** + * Constructs a new KnowledgeBaseQuerySource. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @classdesc Represents a KnowledgeBaseQuerySource. + * @implements IKnowledgeBaseQuerySource + * @constructor + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource=} [properties] Properties to set + */ + function KnowledgeBaseQuerySource(properties) { + this.knowledgeBases = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * KnowledgeBaseQuerySource knowledgeBases. + * @member {Array.} knowledgeBases + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @instance + */ + KnowledgeBaseQuerySource.prototype.knowledgeBases = $util.emptyArray; + + /** + * Creates a new KnowledgeBaseQuerySource instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource} KnowledgeBaseQuerySource instance + */ + KnowledgeBaseQuerySource.create = function create(properties) { + return new KnowledgeBaseQuerySource(properties); + }; + + /** + * Encodes the specified KnowledgeBaseQuerySource message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource} message KnowledgeBaseQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeBaseQuerySource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.knowledgeBases != null && message.knowledgeBases.length) + for (var i = 0; i < message.knowledgeBases.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.knowledgeBases[i]); + return writer; + }; + + /** + * Encodes the specified KnowledgeBaseQuerySource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IKnowledgeBaseQuerySource} message KnowledgeBaseQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + KnowledgeBaseQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a KnowledgeBaseQuerySource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource} KnowledgeBaseQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeBaseQuerySource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.knowledgeBases && message.knowledgeBases.length)) + message.knowledgeBases = []; + message.knowledgeBases.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a KnowledgeBaseQuerySource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource} KnowledgeBaseQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + KnowledgeBaseQuerySource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a KnowledgeBaseQuerySource message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + KnowledgeBaseQuerySource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.knowledgeBases != null && message.hasOwnProperty("knowledgeBases")) { + if (!Array.isArray(message.knowledgeBases)) + return "knowledgeBases: array expected"; + for (var i = 0; i < message.knowledgeBases.length; ++i) + if (!$util.isString(message.knowledgeBases[i])) + return "knowledgeBases: string[] expected"; + } + return null; + }; + + /** + * Creates a KnowledgeBaseQuerySource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource} KnowledgeBaseQuerySource + */ + KnowledgeBaseQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource(); + if (object.knowledgeBases) { + if (!Array.isArray(object.knowledgeBases)) + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource.knowledgeBases: array expected"); + message.knowledgeBases = []; + for (var i = 0; i < object.knowledgeBases.length; ++i) + message.knowledgeBases[i] = String(object.knowledgeBases[i]); + } + return message; + }; + + /** + * Creates a plain object from a KnowledgeBaseQuerySource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource} message KnowledgeBaseQuerySource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + KnowledgeBaseQuerySource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.knowledgeBases = []; + if (message.knowledgeBases && message.knowledgeBases.length) { + object.knowledgeBases = []; + for (var j = 0; j < message.knowledgeBases.length; ++j) + object.knowledgeBases[j] = message.knowledgeBases[j]; + } + return object; + }; - /** - * Creates a plain object from an UpdateIntentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.UpdateIntentRequest} message UpdateIntentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateIntentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.intent = null; - object.languageCode = ""; - object.updateMask = null; - object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; - } - if (message.intent != null && message.hasOwnProperty("intent")) - object.intent = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intent, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.intentView != null && message.hasOwnProperty("intentView")) - object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.IntentView[message.intentView] : message.intentView; - return object; - }; + /** + * Converts this KnowledgeBaseQuerySource to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.KnowledgeBaseQuerySource + * @instance + * @returns {Object.} JSON object + */ + KnowledgeBaseQuerySource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this UpdateIntentRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.UpdateIntentRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateIntentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return KnowledgeBaseQuerySource; + })(); - return UpdateIntentRequest; - })(); + SuggestionQueryConfig.DocumentQuerySource = (function() { - v2beta1.DeleteIntentRequest = (function() { + /** + * Properties of a DocumentQuerySource. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @interface IDocumentQuerySource + * @property {Array.|null} [documents] DocumentQuerySource documents + */ - /** - * Properties of a DeleteIntentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IDeleteIntentRequest - * @property {string|null} [name] DeleteIntentRequest name - */ + /** + * Constructs a new DocumentQuerySource. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @classdesc Represents a DocumentQuerySource. + * @implements IDocumentQuerySource + * @constructor + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource=} [properties] Properties to set + */ + function DocumentQuerySource(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new DeleteIntentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a DeleteIntentRequest. - * @implements IDeleteIntentRequest - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IDeleteIntentRequest=} [properties] Properties to set - */ - function DeleteIntentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * DocumentQuerySource documents. + * @member {Array.} documents + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @instance + */ + DocumentQuerySource.prototype.documents = $util.emptyArray; - /** - * DeleteIntentRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest - * @instance - */ - DeleteIntentRequest.prototype.name = ""; + /** + * Creates a new DocumentQuerySource instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource} DocumentQuerySource instance + */ + DocumentQuerySource.create = function create(properties) { + return new DocumentQuerySource(properties); + }; - /** - * Creates a new DeleteIntentRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.DeleteIntentRequest} DeleteIntentRequest instance - */ - DeleteIntentRequest.create = function create(properties) { - return new DeleteIntentRequest(properties); - }; + /** + * Encodes the specified DocumentQuerySource message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource} message DocumentQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentQuerySource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.documents[i]); + return writer; + }; - /** - * Encodes the specified DeleteIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteIntentRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteIntentRequest} message DeleteIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteIntentRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - return writer; - }; + /** + * Encodes the specified DocumentQuerySource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDocumentQuerySource} message DocumentQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Encodes the specified DeleteIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteIntentRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteIntentRequest} message DeleteIntentRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Decodes a DocumentQuerySource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource} DocumentQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentQuerySource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Decodes a DeleteIntentRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.DeleteIntentRequest} DeleteIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteIntentRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteIntentRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Decodes a DocumentQuerySource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource} DocumentQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentQuerySource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Decodes a DeleteIntentRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.DeleteIntentRequest} DeleteIntentRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteIntentRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Verifies a DocumentQuerySource message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentQuerySource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!$util.isString(message.documents[i])) + return "documents: string[] expected"; + } + return null; + }; - /** - * Verifies a DeleteIntentRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteIntentRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - return null; - }; + /** + * Creates a DocumentQuerySource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource} DocumentQuerySource + */ + DocumentQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + message.documents[i] = String(object.documents[i]); + } + return message; + }; - /** - * Creates a DeleteIntentRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.DeleteIntentRequest} DeleteIntentRequest - */ - DeleteIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteIntentRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.DeleteIntentRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; + /** + * Creates a plain object from a DocumentQuerySource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource} message DocumentQuerySource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DocumentQuerySource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = message.documents[j]; + } + return object; + }; - /** - * Creates a plain object from a DeleteIntentRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.DeleteIntentRequest} message DeleteIntentRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteIntentRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - return object; - }; + /** + * Converts this DocumentQuerySource to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DocumentQuerySource + * @instance + * @returns {Object.} JSON object + */ + DocumentQuerySource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this DeleteIntentRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.DeleteIntentRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteIntentRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return DocumentQuerySource; + })(); - return DeleteIntentRequest; - })(); + SuggestionQueryConfig.DialogflowQuerySource = (function() { - v2beta1.BatchUpdateIntentsRequest = (function() { + /** + * Properties of a DialogflowQuerySource. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @interface IDialogflowQuerySource + * @property {string|null} [agent] DialogflowQuerySource agent + */ - /** - * Properties of a BatchUpdateIntentsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IBatchUpdateIntentsRequest - * @property {string|null} [parent] BatchUpdateIntentsRequest parent - * @property {string|null} [intentBatchUri] BatchUpdateIntentsRequest intentBatchUri - * @property {google.cloud.dialogflow.v2beta1.IIntentBatch|null} [intentBatchInline] BatchUpdateIntentsRequest intentBatchInline - * @property {string|null} [languageCode] BatchUpdateIntentsRequest languageCode - * @property {google.protobuf.IFieldMask|null} [updateMask] BatchUpdateIntentsRequest updateMask - * @property {google.cloud.dialogflow.v2beta1.IntentView|null} [intentView] BatchUpdateIntentsRequest intentView - */ + /** + * Constructs a new DialogflowQuerySource. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @classdesc Represents a DialogflowQuerySource. + * @implements IDialogflowQuerySource + * @constructor + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource=} [properties] Properties to set + */ + function DialogflowQuerySource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new BatchUpdateIntentsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a BatchUpdateIntentsRequest. - * @implements IBatchUpdateIntentsRequest - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest=} [properties] Properties to set - */ - function BatchUpdateIntentsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * DialogflowQuerySource agent. + * @member {string} agent + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @instance + */ + DialogflowQuerySource.prototype.agent = ""; - /** - * BatchUpdateIntentsRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @instance - */ - BatchUpdateIntentsRequest.prototype.parent = ""; + /** + * Creates a new DialogflowQuerySource instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource} DialogflowQuerySource instance + */ + DialogflowQuerySource.create = function create(properties) { + return new DialogflowQuerySource(properties); + }; - /** - * BatchUpdateIntentsRequest intentBatchUri. - * @member {string} intentBatchUri - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @instance - */ - BatchUpdateIntentsRequest.prototype.intentBatchUri = ""; + /** + * Encodes the specified DialogflowQuerySource message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource} message DialogflowQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DialogflowQuerySource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.agent != null && Object.hasOwnProperty.call(message, "agent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.agent); + return writer; + }; - /** - * BatchUpdateIntentsRequest intentBatchInline. - * @member {google.cloud.dialogflow.v2beta1.IIntentBatch|null|undefined} intentBatchInline - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @instance - */ - BatchUpdateIntentsRequest.prototype.intentBatchInline = null; + /** + * Encodes the specified DialogflowQuerySource message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IDialogflowQuerySource} message DialogflowQuerySource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DialogflowQuerySource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * BatchUpdateIntentsRequest languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @instance - */ - BatchUpdateIntentsRequest.prototype.languageCode = ""; + /** + * Decodes a DialogflowQuerySource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource} DialogflowQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DialogflowQuerySource.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.agent = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * BatchUpdateIntentsRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @instance - */ - BatchUpdateIntentsRequest.prototype.updateMask = null; + /** + * Decodes a DialogflowQuerySource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource} DialogflowQuerySource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DialogflowQuerySource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DialogflowQuerySource message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DialogflowQuerySource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.agent != null && message.hasOwnProperty("agent")) + if (!$util.isString(message.agent)) + return "agent: string expected"; + return null; + }; + + /** + * Creates a DialogflowQuerySource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource} DialogflowQuerySource + */ + DialogflowQuerySource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource(); + if (object.agent != null) + message.agent = String(object.agent); + return message; + }; + + /** + * Creates a plain object from a DialogflowQuerySource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource} message DialogflowQuerySource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DialogflowQuerySource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.agent = ""; + if (message.agent != null && message.hasOwnProperty("agent")) + object.agent = message.agent; + return object; + }; + + /** + * Converts this DialogflowQuerySource to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.DialogflowQuerySource + * @instance + * @returns {Object.} JSON object + */ + DialogflowQuerySource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * BatchUpdateIntentsRequest intentView. - * @member {google.cloud.dialogflow.v2beta1.IntentView} intentView - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @instance - */ - BatchUpdateIntentsRequest.prototype.intentView = 0; + return DialogflowQuerySource; + })(); - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + SuggestionQueryConfig.ContextFilterSettings = (function() { - /** - * BatchUpdateIntentsRequest intentBatch. - * @member {"intentBatchUri"|"intentBatchInline"|undefined} intentBatch - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @instance - */ - Object.defineProperty(BatchUpdateIntentsRequest.prototype, "intentBatch", { - get: $util.oneOfGetter($oneOfFields = ["intentBatchUri", "intentBatchInline"]), - set: $util.oneOfSetter($oneOfFields) - }); + /** + * Properties of a ContextFilterSettings. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @interface IContextFilterSettings + * @property {boolean|null} [dropHandoffMessages] ContextFilterSettings dropHandoffMessages + * @property {boolean|null} [dropVirtualAgentMessages] ContextFilterSettings dropVirtualAgentMessages + * @property {boolean|null} [dropIvrMessages] ContextFilterSettings dropIvrMessages + */ - /** - * Creates a new BatchUpdateIntentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest instance - */ - BatchUpdateIntentsRequest.create = function create(properties) { - return new BatchUpdateIntentsRequest(properties); - }; + /** + * Constructs a new ContextFilterSettings. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig + * @classdesc Represents a ContextFilterSettings. + * @implements IContextFilterSettings + * @constructor + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings=} [properties] Properties to set + */ + function ContextFilterSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Encodes the specified BatchUpdateIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest} message BatchUpdateIntentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchUpdateIntentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.intentBatchUri != null && Object.hasOwnProperty.call(message, "intentBatchUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.intentBatchUri); - if (message.intentBatchInline != null && Object.hasOwnProperty.call(message, "intentBatchInline")) - $root.google.cloud.dialogflow.v2beta1.IntentBatch.encode(message.intentBatchInline, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.intentView != null && Object.hasOwnProperty.call(message, "intentView")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.intentView); - return writer; - }; + /** + * ContextFilterSettings dropHandoffMessages. + * @member {boolean} dropHandoffMessages + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @instance + */ + ContextFilterSettings.prototype.dropHandoffMessages = false; - /** - * Encodes the specified BatchUpdateIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsRequest} message BatchUpdateIntentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchUpdateIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * ContextFilterSettings dropVirtualAgentMessages. + * @member {boolean} dropVirtualAgentMessages + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @instance + */ + ContextFilterSettings.prototype.dropVirtualAgentMessages = false; - /** - * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchUpdateIntentsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - message.intentBatchUri = reader.string(); - break; - case 3: - message.intentBatchInline = $root.google.cloud.dialogflow.v2beta1.IntentBatch.decode(reader, reader.uint32()); - break; - case 4: - message.languageCode = reader.string(); - break; - case 5: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 6: - message.intentView = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * ContextFilterSettings dropIvrMessages. + * @member {boolean} dropIvrMessages + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @instance + */ + ContextFilterSettings.prototype.dropIvrMessages = false; - /** - * Decodes a BatchUpdateIntentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchUpdateIntentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Creates a new ContextFilterSettings instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings} ContextFilterSettings instance + */ + ContextFilterSettings.create = function create(properties) { + return new ContextFilterSettings(properties); + }; - /** - * Verifies a BatchUpdateIntentsRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchUpdateIntentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.intentBatchUri != null && message.hasOwnProperty("intentBatchUri")) { - properties.intentBatch = 1; - if (!$util.isString(message.intentBatchUri)) - return "intentBatchUri: string expected"; - } - if (message.intentBatchInline != null && message.hasOwnProperty("intentBatchInline")) { - if (properties.intentBatch === 1) - return "intentBatch: multiple values"; - properties.intentBatch = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.IntentBatch.verify(message.intentBatchInline); - if (error) - return "intentBatchInline." + error; - } - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.intentView != null && message.hasOwnProperty("intentView")) - switch (message.intentView) { - default: - return "intentView: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; + /** + * Encodes the specified ContextFilterSettings message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings} message ContextFilterSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextFilterSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dropHandoffMessages != null && Object.hasOwnProperty.call(message, "dropHandoffMessages")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.dropHandoffMessages); + if (message.dropVirtualAgentMessages != null && Object.hasOwnProperty.call(message, "dropVirtualAgentMessages")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.dropVirtualAgentMessages); + if (message.dropIvrMessages != null && Object.hasOwnProperty.call(message, "dropIvrMessages")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.dropIvrMessages); + return writer; + }; - /** - * Creates a BatchUpdateIntentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest} BatchUpdateIntentsRequest - */ - BatchUpdateIntentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.intentBatchUri != null) - message.intentBatchUri = String(object.intentBatchUri); - if (object.intentBatchInline != null) { - if (typeof object.intentBatchInline !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.intentBatchInline: object expected"); - message.intentBatchInline = $root.google.cloud.dialogflow.v2beta1.IntentBatch.fromObject(object.intentBatchInline); - } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - switch (object.intentView) { - case "INTENT_VIEW_UNSPECIFIED": - case 0: - message.intentView = 0; - break; - case "INTENT_VIEW_FULL": - case 1: - message.intentView = 1; - break; - } - return message; - }; + /** + * Encodes the specified ContextFilterSettings message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.IContextFilterSettings} message ContextFilterSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ContextFilterSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Creates a plain object from a BatchUpdateIntentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest} message BatchUpdateIntentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchUpdateIntentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.languageCode = ""; - object.updateMask = null; - object.intentView = options.enums === String ? "INTENT_VIEW_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.intentBatchUri != null && message.hasOwnProperty("intentBatchUri")) { - object.intentBatchUri = message.intentBatchUri; - if (options.oneofs) - object.intentBatch = "intentBatchUri"; - } - if (message.intentBatchInline != null && message.hasOwnProperty("intentBatchInline")) { - object.intentBatchInline = $root.google.cloud.dialogflow.v2beta1.IntentBatch.toObject(message.intentBatchInline, options); - if (options.oneofs) - object.intentBatch = "intentBatchInline"; - } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.intentView != null && message.hasOwnProperty("intentView")) - object.intentView = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.IntentView[message.intentView] : message.intentView; - return object; - }; + /** + * Decodes a ContextFilterSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings} ContextFilterSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextFilterSettings.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dropHandoffMessages = reader.bool(); + break; + case 2: + message.dropVirtualAgentMessages = reader.bool(); + break; + case 3: + message.dropIvrMessages = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Converts this BatchUpdateIntentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsRequest - * @instance - * @returns {Object.} JSON object - */ - BatchUpdateIntentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Decodes a ContextFilterSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings} ContextFilterSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ContextFilterSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - return BatchUpdateIntentsRequest; - })(); + /** + * Verifies a ContextFilterSettings message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ContextFilterSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dropHandoffMessages != null && message.hasOwnProperty("dropHandoffMessages")) + if (typeof message.dropHandoffMessages !== "boolean") + return "dropHandoffMessages: boolean expected"; + if (message.dropVirtualAgentMessages != null && message.hasOwnProperty("dropVirtualAgentMessages")) + if (typeof message.dropVirtualAgentMessages !== "boolean") + return "dropVirtualAgentMessages: boolean expected"; + if (message.dropIvrMessages != null && message.hasOwnProperty("dropIvrMessages")) + if (typeof message.dropIvrMessages !== "boolean") + return "dropIvrMessages: boolean expected"; + return null; + }; - v2beta1.BatchUpdateIntentsResponse = (function() { + /** + * Creates a ContextFilterSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings} ContextFilterSettings + */ + ContextFilterSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings(); + if (object.dropHandoffMessages != null) + message.dropHandoffMessages = Boolean(object.dropHandoffMessages); + if (object.dropVirtualAgentMessages != null) + message.dropVirtualAgentMessages = Boolean(object.dropVirtualAgentMessages); + if (object.dropIvrMessages != null) + message.dropIvrMessages = Boolean(object.dropIvrMessages); + return message; + }; - /** - * Properties of a BatchUpdateIntentsResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IBatchUpdateIntentsResponse - * @property {Array.|null} [intents] BatchUpdateIntentsResponse intents - */ + /** + * Creates a plain object from a ContextFilterSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings} message ContextFilterSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ContextFilterSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.dropHandoffMessages = false; + object.dropVirtualAgentMessages = false; + object.dropIvrMessages = false; + } + if (message.dropHandoffMessages != null && message.hasOwnProperty("dropHandoffMessages")) + object.dropHandoffMessages = message.dropHandoffMessages; + if (message.dropVirtualAgentMessages != null && message.hasOwnProperty("dropVirtualAgentMessages")) + object.dropVirtualAgentMessages = message.dropVirtualAgentMessages; + if (message.dropIvrMessages != null && message.hasOwnProperty("dropIvrMessages")) + object.dropIvrMessages = message.dropIvrMessages; + return object; + }; - /** - * Constructs a new BatchUpdateIntentsResponse. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a BatchUpdateIntentsResponse. - * @implements IBatchUpdateIntentsResponse - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse=} [properties] Properties to set - */ - function BatchUpdateIntentsResponse(properties) { - this.intents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * Converts this ContextFilterSettings to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.SuggestionQueryConfig.ContextFilterSettings + * @instance + * @returns {Object.} JSON object + */ + ContextFilterSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * BatchUpdateIntentsResponse intents. - * @member {Array.} intents - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse - * @instance - */ - BatchUpdateIntentsResponse.prototype.intents = $util.emptyArray; + return ContextFilterSettings; + })(); - /** - * Creates a new BatchUpdateIntentsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse instance - */ - BatchUpdateIntentsResponse.create = function create(properties) { - return new BatchUpdateIntentsResponse(properties); - }; + return SuggestionQueryConfig; + })(); - /** - * Encodes the specified BatchUpdateIntentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse} message BatchUpdateIntentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchUpdateIntentsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.intents != null && message.intents.length) - for (var i = 0; i < message.intents.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; + HumanAgentAssistantConfig.ConversationModelConfig = (function() { - /** - * Encodes the specified BatchUpdateIntentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchUpdateIntentsResponse} message BatchUpdateIntentsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchUpdateIntentsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Properties of a ConversationModelConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @interface IConversationModelConfig + * @property {string|null} [model] ConversationModelConfig model + */ - /** - * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchUpdateIntentsResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.intents && message.intents.length)) - message.intents = []; - message.intents.push($root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } + /** + * Constructs a new ConversationModelConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @classdesc Represents a ConversationModelConfig. + * @implements IConversationModelConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IConversationModelConfig=} [properties] Properties to set + */ + function ConversationModelConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - return message; - }; - /** - * Decodes a BatchUpdateIntentsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchUpdateIntentsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * ConversationModelConfig model. + * @member {string} model + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig + * @instance + */ + ConversationModelConfig.prototype.model = ""; + + /** + * Creates a new ConversationModelConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IConversationModelConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig} ConversationModelConfig instance + */ + ConversationModelConfig.create = function create(properties) { + return new ConversationModelConfig(properties); + }; + + /** + * Encodes the specified ConversationModelConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IConversationModelConfig} message ConversationModelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationModelConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.model != null && Object.hasOwnProperty.call(message, "model")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.model); + return writer; + }; + + /** + * Encodes the specified ConversationModelConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IConversationModelConfig} message ConversationModelConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConversationModelConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a BatchUpdateIntentsResponse message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchUpdateIntentsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.intents != null && message.hasOwnProperty("intents")) { - if (!Array.isArray(message.intents)) - return "intents: array expected"; - for (var i = 0; i < message.intents.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intents[i]); - if (error) - return "intents." + error; + /** + * Decodes a ConversationModelConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig} ConversationModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationModelConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.model = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return null; - }; + return message; + }; - /** - * Creates a BatchUpdateIntentsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse} BatchUpdateIntentsResponse - */ - BatchUpdateIntentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse(); - if (object.intents) { - if (!Array.isArray(object.intents)) - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.intents: array expected"); - message.intents = []; - for (var i = 0; i < object.intents.length; ++i) { - if (typeof object.intents[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse.intents: object expected"); - message.intents[i] = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intents[i]); - } - } - return message; - }; + /** + * Decodes a ConversationModelConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig} ConversationModelConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConversationModelConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Creates a plain object from a BatchUpdateIntentsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse} message BatchUpdateIntentsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchUpdateIntentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.intents = []; - if (message.intents && message.intents.length) { - object.intents = []; - for (var j = 0; j < message.intents.length; ++j) - object.intents[j] = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intents[j], options); - } - return object; - }; + /** + * Verifies a ConversationModelConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConversationModelConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.model != null && message.hasOwnProperty("model")) + if (!$util.isString(message.model)) + return "model: string expected"; + return null; + }; - /** - * Converts this BatchUpdateIntentsResponse to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse - * @instance - * @returns {Object.} JSON object - */ - BatchUpdateIntentsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + /** + * Creates a ConversationModelConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig} ConversationModelConfig + */ + ConversationModelConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig(); + if (object.model != null) + message.model = String(object.model); + return message; + }; - return BatchUpdateIntentsResponse; - })(); + /** + * Creates a plain object from a ConversationModelConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig} message ConversationModelConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConversationModelConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.model = ""; + if (message.model != null && message.hasOwnProperty("model")) + object.model = message.model; + return object; + }; - v2beta1.BatchDeleteIntentsRequest = (function() { + /** + * Converts this ConversationModelConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.ConversationModelConfig + * @instance + * @returns {Object.} JSON object + */ + ConversationModelConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Properties of a BatchDeleteIntentsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IBatchDeleteIntentsRequest - * @property {string|null} [parent] BatchDeleteIntentsRequest parent - * @property {Array.|null} [intents] BatchDeleteIntentsRequest intents - */ + return ConversationModelConfig; + })(); - /** - * Constructs a new BatchDeleteIntentsRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a BatchDeleteIntentsRequest. - * @implements IBatchDeleteIntentsRequest - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest=} [properties] Properties to set - */ - function BatchDeleteIntentsRequest(properties) { - this.intents = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + HumanAgentAssistantConfig.MessageAnalysisConfig = (function() { - /** - * BatchDeleteIntentsRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest - * @instance - */ - BatchDeleteIntentsRequest.prototype.parent = ""; + /** + * Properties of a MessageAnalysisConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @interface IMessageAnalysisConfig + * @property {boolean|null} [enableEntityExtraction] MessageAnalysisConfig enableEntityExtraction + * @property {boolean|null} [enableSentimentAnalysis] MessageAnalysisConfig enableSentimentAnalysis + */ - /** - * BatchDeleteIntentsRequest intents. - * @member {Array.} intents - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest - * @instance - */ - BatchDeleteIntentsRequest.prototype.intents = $util.emptyArray; + /** + * Constructs a new MessageAnalysisConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig + * @classdesc Represents a MessageAnalysisConfig. + * @implements IMessageAnalysisConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IMessageAnalysisConfig=} [properties] Properties to set + */ + function MessageAnalysisConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Creates a new BatchDeleteIntentsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest instance - */ - BatchDeleteIntentsRequest.create = function create(properties) { - return new BatchDeleteIntentsRequest(properties); - }; + /** + * MessageAnalysisConfig enableEntityExtraction. + * @member {boolean} enableEntityExtraction + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig + * @instance + */ + MessageAnalysisConfig.prototype.enableEntityExtraction = false; - /** - * Encodes the specified BatchDeleteIntentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest} message BatchDeleteIntentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteIntentsRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.intents != null && message.intents.length) - for (var i = 0; i < message.intents.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intents[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; + /** + * MessageAnalysisConfig enableSentimentAnalysis. + * @member {boolean} enableSentimentAnalysis + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig + * @instance + */ + MessageAnalysisConfig.prototype.enableSentimentAnalysis = false; - /** - * Encodes the specified BatchDeleteIntentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.IBatchDeleteIntentsRequest} message BatchDeleteIntentsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BatchDeleteIntentsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Creates a new MessageAnalysisConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IMessageAnalysisConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig} MessageAnalysisConfig instance + */ + MessageAnalysisConfig.create = function create(properties) { + return new MessageAnalysisConfig(properties); + }; - /** - * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteIntentsRequest.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.parent = reader.string(); - break; - case 2: - if (!(message.intents && message.intents.length)) - message.intents = []; - message.intents.push($root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + /** + * Encodes the specified MessageAnalysisConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IMessageAnalysisConfig} message MessageAnalysisConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageAnalysisConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableEntityExtraction != null && Object.hasOwnProperty.call(message, "enableEntityExtraction")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.enableEntityExtraction); + if (message.enableSentimentAnalysis != null && Object.hasOwnProperty.call(message, "enableSentimentAnalysis")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableSentimentAnalysis); + return writer; + }; - /** - * Decodes a BatchDeleteIntentsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BatchDeleteIntentsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Encodes the specified MessageAnalysisConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.IMessageAnalysisConfig} message MessageAnalysisConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageAnalysisConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Verifies a BatchDeleteIntentsRequest message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BatchDeleteIntentsRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.intents != null && message.hasOwnProperty("intents")) { - if (!Array.isArray(message.intents)) - return "intents: array expected"; - for (var i = 0; i < message.intents.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intents[i]); - if (error) - return "intents." + error; + /** + * Decodes a MessageAnalysisConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig} MessageAnalysisConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageAnalysisConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.enableEntityExtraction = reader.bool(); + break; + case 3: + message.enableSentimentAnalysis = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return null; - }; + return message; + }; - /** - * Creates a BatchDeleteIntentsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest} BatchDeleteIntentsRequest - */ - BatchDeleteIntentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.intents) { - if (!Array.isArray(object.intents)) - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.intents: array expected"); - message.intents = []; - for (var i = 0; i < object.intents.length; ++i) { - if (typeof object.intents[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest.intents: object expected"); - message.intents[i] = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intents[i]); + /** + * Decodes a MessageAnalysisConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig} MessageAnalysisConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageAnalysisConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageAnalysisConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageAnalysisConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.enableEntityExtraction != null && message.hasOwnProperty("enableEntityExtraction")) + if (typeof message.enableEntityExtraction !== "boolean") + return "enableEntityExtraction: boolean expected"; + if (message.enableSentimentAnalysis != null && message.hasOwnProperty("enableSentimentAnalysis")) + if (typeof message.enableSentimentAnalysis !== "boolean") + return "enableSentimentAnalysis: boolean expected"; + return null; + }; + + /** + * Creates a MessageAnalysisConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig} MessageAnalysisConfig + */ + MessageAnalysisConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig(); + if (object.enableEntityExtraction != null) + message.enableEntityExtraction = Boolean(object.enableEntityExtraction); + if (object.enableSentimentAnalysis != null) + message.enableSentimentAnalysis = Boolean(object.enableSentimentAnalysis); + return message; + }; + + /** + * Creates a plain object from a MessageAnalysisConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig} message MessageAnalysisConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageAnalysisConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.enableEntityExtraction = false; + object.enableSentimentAnalysis = false; } - } - return message; - }; + if (message.enableEntityExtraction != null && message.hasOwnProperty("enableEntityExtraction")) + object.enableEntityExtraction = message.enableEntityExtraction; + if (message.enableSentimentAnalysis != null && message.hasOwnProperty("enableSentimentAnalysis")) + object.enableSentimentAnalysis = message.enableSentimentAnalysis; + return object; + }; - /** - * Creates a plain object from a BatchDeleteIntentsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest - * @static - * @param {google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest} message BatchDeleteIntentsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BatchDeleteIntentsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.intents = []; - if (options.defaults) - object.parent = ""; - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.intents && message.intents.length) { - object.intents = []; - for (var j = 0; j < message.intents.length; ++j) - object.intents[j] = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intents[j], options); - } - return object; - }; + /** + * Converts this MessageAnalysisConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.MessageAnalysisConfig + * @instance + * @returns {Object.} JSON object + */ + MessageAnalysisConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this BatchDeleteIntentsRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.BatchDeleteIntentsRequest - * @instance - * @returns {Object.} JSON object - */ - BatchDeleteIntentsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return MessageAnalysisConfig; + })(); - return BatchDeleteIntentsRequest; + return HumanAgentAssistantConfig; })(); - v2beta1.IntentBatch = (function() { + v2beta1.HumanAgentHandoffConfig = (function() { /** - * Properties of an IntentBatch. + * Properties of a HumanAgentHandoffConfig. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IIntentBatch - * @property {Array.|null} [intents] IntentBatch intents + * @interface IHumanAgentHandoffConfig + * @property {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ILivePersonConfig|null} [livePersonConfig] HumanAgentHandoffConfig livePersonConfig + * @property {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig|null} [salesforceLiveAgentConfig] HumanAgentHandoffConfig salesforceLiveAgentConfig */ /** - * Constructs a new IntentBatch. + * Constructs a new HumanAgentHandoffConfig. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an IntentBatch. - * @implements IIntentBatch + * @classdesc Represents a HumanAgentHandoffConfig. + * @implements IHumanAgentHandoffConfig * @constructor - * @param {google.cloud.dialogflow.v2beta1.IIntentBatch=} [properties] Properties to set - */ - function IntentBatch(properties) { - this.intents = []; + * @param {google.cloud.dialogflow.v2beta1.IHumanAgentHandoffConfig=} [properties] Properties to set + */ + function HumanAgentHandoffConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -62608,78 +114149,102 @@ } /** - * IntentBatch intents. - * @member {Array.} intents - * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * HumanAgentHandoffConfig livePersonConfig. + * @member {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ILivePersonConfig|null|undefined} livePersonConfig + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig * @instance */ - IntentBatch.prototype.intents = $util.emptyArray; + HumanAgentHandoffConfig.prototype.livePersonConfig = null; /** - * Creates a new IntentBatch instance using the specified properties. + * HumanAgentHandoffConfig salesforceLiveAgentConfig. + * @member {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig|null|undefined} salesforceLiveAgentConfig + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig + * @instance + */ + HumanAgentHandoffConfig.prototype.salesforceLiveAgentConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * HumanAgentHandoffConfig agentService. + * @member {"livePersonConfig"|"salesforceLiveAgentConfig"|undefined} agentService + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig + * @instance + */ + Object.defineProperty(HumanAgentHandoffConfig.prototype, "agentService", { + get: $util.oneOfGetter($oneOfFields = ["livePersonConfig", "salesforceLiveAgentConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new HumanAgentHandoffConfig instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IIntentBatch=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.IntentBatch} IntentBatch instance + * @param {google.cloud.dialogflow.v2beta1.IHumanAgentHandoffConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig} HumanAgentHandoffConfig instance */ - IntentBatch.create = function create(properties) { - return new IntentBatch(properties); + HumanAgentHandoffConfig.create = function create(properties) { + return new HumanAgentHandoffConfig(properties); }; /** - * Encodes the specified IntentBatch message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.IntentBatch.verify|verify} messages. + * Encodes the specified HumanAgentHandoffConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IIntentBatch} message IntentBatch message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IHumanAgentHandoffConfig} message HumanAgentHandoffConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IntentBatch.encode = function encode(message, writer) { + HumanAgentHandoffConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.intents != null && message.intents.length) - for (var i = 0; i < message.intents.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.livePersonConfig != null && Object.hasOwnProperty.call(message, "livePersonConfig")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig.encode(message.livePersonConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.salesforceLiveAgentConfig != null && Object.hasOwnProperty.call(message, "salesforceLiveAgentConfig")) + $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.encode(message.salesforceLiveAgentConfig, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified IntentBatch message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.IntentBatch.verify|verify} messages. + * Encodes the specified HumanAgentHandoffConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IIntentBatch} message IntentBatch message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IHumanAgentHandoffConfig} message HumanAgentHandoffConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - IntentBatch.encodeDelimited = function encodeDelimited(message, writer) { + HumanAgentHandoffConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an IntentBatch message from the specified reader or buffer. + * Decodes a HumanAgentHandoffConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.IntentBatch} IntentBatch + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig} HumanAgentHandoffConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IntentBatch.decode = function decode(reader, length) { + HumanAgentHandoffConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.IntentBatch(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.intents && message.intents.length)) - message.intents = []; - message.intents.push($root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32())); + message.livePersonConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig.decode(reader, reader.uint32()); + break; + case 2: + message.salesforceLiveAgentConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -62690,573 +114255,579 @@ }; /** - * Decodes an IntentBatch message from the specified reader or buffer, length delimited. + * Decodes a HumanAgentHandoffConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.IntentBatch} IntentBatch + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig} HumanAgentHandoffConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - IntentBatch.decodeDelimited = function decodeDelimited(reader) { + HumanAgentHandoffConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an IntentBatch message. + * Verifies a HumanAgentHandoffConfig message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - IntentBatch.verify = function verify(message) { + HumanAgentHandoffConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.intents != null && message.hasOwnProperty("intents")) { - if (!Array.isArray(message.intents)) - return "intents: array expected"; - for (var i = 0; i < message.intents.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intents[i]); + var properties = {}; + if (message.livePersonConfig != null && message.hasOwnProperty("livePersonConfig")) { + properties.agentService = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig.verify(message.livePersonConfig); if (error) - return "intents." + error; + return "livePersonConfig." + error; + } + } + if (message.salesforceLiveAgentConfig != null && message.hasOwnProperty("salesforceLiveAgentConfig")) { + if (properties.agentService === 1) + return "agentService: multiple values"; + properties.agentService = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.verify(message.salesforceLiveAgentConfig); + if (error) + return "salesforceLiveAgentConfig." + error; } } return null; }; /** - * Creates an IntentBatch message from a plain object. Also converts values to their respective internal types. + * Creates a HumanAgentHandoffConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.IntentBatch} IntentBatch + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig} HumanAgentHandoffConfig */ - IntentBatch.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.IntentBatch) + HumanAgentHandoffConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.IntentBatch(); - if (object.intents) { - if (!Array.isArray(object.intents)) - throw TypeError(".google.cloud.dialogflow.v2beta1.IntentBatch.intents: array expected"); - message.intents = []; - for (var i = 0; i < object.intents.length; ++i) { - if (typeof object.intents[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.IntentBatch.intents: object expected"); - message.intents[i] = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intents[i]); - } + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig(); + if (object.livePersonConfig != null) { + if (typeof object.livePersonConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.livePersonConfig: object expected"); + message.livePersonConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig.fromObject(object.livePersonConfig); + } + if (object.salesforceLiveAgentConfig != null) { + if (typeof object.salesforceLiveAgentConfig !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.salesforceLiveAgentConfig: object expected"); + message.salesforceLiveAgentConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.fromObject(object.salesforceLiveAgentConfig); } return message; }; /** - * Creates a plain object from an IntentBatch message. Also converts values to other types if specified. + * Creates a plain object from a HumanAgentHandoffConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IntentBatch} message IntentBatch + * @param {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig} message HumanAgentHandoffConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - IntentBatch.toObject = function toObject(message, options) { + HumanAgentHandoffConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.intents = []; - if (message.intents && message.intents.length) { - object.intents = []; - for (var j = 0; j < message.intents.length; ++j) - object.intents[j] = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intents[j], options); + if (message.livePersonConfig != null && message.hasOwnProperty("livePersonConfig")) { + object.livePersonConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig.toObject(message.livePersonConfig, options); + if (options.oneofs) + object.agentService = "livePersonConfig"; + } + if (message.salesforceLiveAgentConfig != null && message.hasOwnProperty("salesforceLiveAgentConfig")) { + object.salesforceLiveAgentConfig = $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.toObject(message.salesforceLiveAgentConfig, options); + if (options.oneofs) + object.agentService = "salesforceLiveAgentConfig"; } return object; }; /** - * Converts this IntentBatch to JSON. + * Converts this HumanAgentHandoffConfig to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.IntentBatch + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig * @instance * @returns {Object.} JSON object */ - IntentBatch.prototype.toJSON = function toJSON() { + HumanAgentHandoffConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return IntentBatch; - })(); - - /** - * IntentView enum. - * @name google.cloud.dialogflow.v2beta1.IntentView - * @enum {number} - * @property {number} INTENT_VIEW_UNSPECIFIED=0 INTENT_VIEW_UNSPECIFIED value - * @property {number} INTENT_VIEW_FULL=1 INTENT_VIEW_FULL value - */ - v2beta1.IntentView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INTENT_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "INTENT_VIEW_FULL"] = 1; - return values; - })(); - - v2beta1.KnowledgeBases = (function() { - - /** - * Constructs a new KnowledgeBases service. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a KnowledgeBases - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function KnowledgeBases(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (KnowledgeBases.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = KnowledgeBases; - - /** - * Creates new KnowledgeBases service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {KnowledgeBases} RPC service. Useful where requests and/or responses are streamed. - */ - KnowledgeBases.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#listKnowledgeBases}. - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @typedef ListKnowledgeBasesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse} [response] ListKnowledgeBasesResponse - */ - - /** - * Calls ListKnowledgeBases. - * @function listKnowledgeBases - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @instance - * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest} request ListKnowledgeBasesRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBasesCallback} callback Node-style callback called with the error, if any, and ListKnowledgeBasesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KnowledgeBases.prototype.listKnowledgeBases = function listKnowledgeBases(request, callback) { - return this.rpcCall(listKnowledgeBases, $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest, $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse, request, callback); - }, "name", { value: "ListKnowledgeBases" }); + HumanAgentHandoffConfig.LivePersonConfig = (function() { - /** - * Calls ListKnowledgeBases. - * @function listKnowledgeBases - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @instance - * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest} request ListKnowledgeBasesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Properties of a LivePersonConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig + * @interface ILivePersonConfig + * @property {string|null} [accountNumber] LivePersonConfig accountNumber + */ - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#getKnowledgeBase}. - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @typedef GetKnowledgeBaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.KnowledgeBase} [response] KnowledgeBase - */ + /** + * Constructs a new LivePersonConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig + * @classdesc Represents a LivePersonConfig. + * @implements ILivePersonConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ILivePersonConfig=} [properties] Properties to set + */ + function LivePersonConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Calls GetKnowledgeBase. - * @function getKnowledgeBase - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest} request GetKnowledgeBaseRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.KnowledgeBases.GetKnowledgeBaseCallback} callback Node-style callback called with the error, if any, and KnowledgeBase - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KnowledgeBases.prototype.getKnowledgeBase = function getKnowledgeBase(request, callback) { - return this.rpcCall(getKnowledgeBase, $root.google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest, $root.google.cloud.dialogflow.v2beta1.KnowledgeBase, request, callback); - }, "name", { value: "GetKnowledgeBase" }); + /** + * LivePersonConfig accountNumber. + * @member {string} accountNumber + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig + * @instance + */ + LivePersonConfig.prototype.accountNumber = ""; - /** - * Calls GetKnowledgeBase. - * @function getKnowledgeBase - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest} request GetKnowledgeBaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a new LivePersonConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ILivePersonConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig} LivePersonConfig instance + */ + LivePersonConfig.create = function create(properties) { + return new LivePersonConfig(properties); + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#createKnowledgeBase}. - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @typedef CreateKnowledgeBaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.KnowledgeBase} [response] KnowledgeBase - */ + /** + * Encodes the specified LivePersonConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ILivePersonConfig} message LivePersonConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LivePersonConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.accountNumber != null && Object.hasOwnProperty.call(message, "accountNumber")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.accountNumber); + return writer; + }; - /** - * Calls CreateKnowledgeBase. - * @function createKnowledgeBase - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @instance - * @param {google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest} request CreateKnowledgeBaseRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.KnowledgeBases.CreateKnowledgeBaseCallback} callback Node-style callback called with the error, if any, and KnowledgeBase - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KnowledgeBases.prototype.createKnowledgeBase = function createKnowledgeBase(request, callback) { - return this.rpcCall(createKnowledgeBase, $root.google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest, $root.google.cloud.dialogflow.v2beta1.KnowledgeBase, request, callback); - }, "name", { value: "CreateKnowledgeBase" }); + /** + * Encodes the specified LivePersonConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ILivePersonConfig} message LivePersonConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + LivePersonConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Calls CreateKnowledgeBase. - * @function createKnowledgeBase - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @instance - * @param {google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest} request CreateKnowledgeBaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Decodes a LivePersonConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig} LivePersonConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LivePersonConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.accountNumber = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#deleteKnowledgeBase}. - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @typedef DeleteKnowledgeBaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty - */ + /** + * Decodes a LivePersonConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig} LivePersonConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + LivePersonConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Calls DeleteKnowledgeBase. - * @function deleteKnowledgeBase - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest} request DeleteKnowledgeBaseRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.KnowledgeBases.DeleteKnowledgeBaseCallback} callback Node-style callback called with the error, if any, and Empty - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KnowledgeBases.prototype.deleteKnowledgeBase = function deleteKnowledgeBase(request, callback) { - return this.rpcCall(deleteKnowledgeBase, $root.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteKnowledgeBase" }); + /** + * Verifies a LivePersonConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + LivePersonConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.accountNumber != null && message.hasOwnProperty("accountNumber")) + if (!$util.isString(message.accountNumber)) + return "accountNumber: string expected"; + return null; + }; - /** - * Calls DeleteKnowledgeBase. - * @function deleteKnowledgeBase - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest} request DeleteKnowledgeBaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + /** + * Creates a LivePersonConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig} LivePersonConfig + */ + LivePersonConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig(); + if (object.accountNumber != null) + message.accountNumber = String(object.accountNumber); + return message; + }; - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#updateKnowledgeBase}. - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @typedef UpdateKnowledgeBaseCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.KnowledgeBase} [response] KnowledgeBase - */ + /** + * Creates a plain object from a LivePersonConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig} message LivePersonConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + LivePersonConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.accountNumber = ""; + if (message.accountNumber != null && message.hasOwnProperty("accountNumber")) + object.accountNumber = message.accountNumber; + return object; + }; - /** - * Calls UpdateKnowledgeBase. - * @function updateKnowledgeBase - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @instance - * @param {google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest} request UpdateKnowledgeBaseRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.KnowledgeBases.UpdateKnowledgeBaseCallback} callback Node-style callback called with the error, if any, and KnowledgeBase - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(KnowledgeBases.prototype.updateKnowledgeBase = function updateKnowledgeBase(request, callback) { - return this.rpcCall(updateKnowledgeBase, $root.google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest, $root.google.cloud.dialogflow.v2beta1.KnowledgeBase, request, callback); - }, "name", { value: "UpdateKnowledgeBase" }); + /** + * Converts this LivePersonConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.LivePersonConfig + * @instance + * @returns {Object.} JSON object + */ + LivePersonConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Calls UpdateKnowledgeBase. - * @function updateKnowledgeBase - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases - * @instance - * @param {google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest} request UpdateKnowledgeBaseRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ + return LivePersonConfig; + })(); - return KnowledgeBases; - })(); + HumanAgentHandoffConfig.SalesforceLiveAgentConfig = (function() { - v2beta1.KnowledgeBase = (function() { + /** + * Properties of a SalesforceLiveAgentConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig + * @interface ISalesforceLiveAgentConfig + * @property {string|null} [organizationId] SalesforceLiveAgentConfig organizationId + * @property {string|null} [deploymentId] SalesforceLiveAgentConfig deploymentId + * @property {string|null} [buttonId] SalesforceLiveAgentConfig buttonId + * @property {string|null} [endpointDomain] SalesforceLiveAgentConfig endpointDomain + */ - /** - * Properties of a KnowledgeBase. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IKnowledgeBase - * @property {string|null} [name] KnowledgeBase name - * @property {string|null} [displayName] KnowledgeBase displayName - * @property {string|null} [languageCode] KnowledgeBase languageCode - */ + /** + * Constructs a new SalesforceLiveAgentConfig. + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig + * @classdesc Represents a SalesforceLiveAgentConfig. + * @implements ISalesforceLiveAgentConfig + * @constructor + * @param {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig=} [properties] Properties to set + */ + function SalesforceLiveAgentConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - /** - * Constructs a new KnowledgeBase. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a KnowledgeBase. - * @implements IKnowledgeBase - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IKnowledgeBase=} [properties] Properties to set - */ - function KnowledgeBase(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } + /** + * SalesforceLiveAgentConfig organizationId. + * @member {string} organizationId + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @instance + */ + SalesforceLiveAgentConfig.prototype.organizationId = ""; - /** - * KnowledgeBase name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase - * @instance - */ - KnowledgeBase.prototype.name = ""; + /** + * SalesforceLiveAgentConfig deploymentId. + * @member {string} deploymentId + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @instance + */ + SalesforceLiveAgentConfig.prototype.deploymentId = ""; - /** - * KnowledgeBase displayName. - * @member {string} displayName - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase - * @instance - */ - KnowledgeBase.prototype.displayName = ""; + /** + * SalesforceLiveAgentConfig buttonId. + * @member {string} buttonId + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @instance + */ + SalesforceLiveAgentConfig.prototype.buttonId = ""; - /** - * KnowledgeBase languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase - * @instance - */ - KnowledgeBase.prototype.languageCode = ""; + /** + * SalesforceLiveAgentConfig endpointDomain. + * @member {string} endpointDomain + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @instance + */ + SalesforceLiveAgentConfig.prototype.endpointDomain = ""; - /** - * Creates a new KnowledgeBase instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase - * @static - * @param {google.cloud.dialogflow.v2beta1.IKnowledgeBase=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeBase} KnowledgeBase instance - */ - KnowledgeBase.create = function create(properties) { - return new KnowledgeBase(properties); - }; + /** + * Creates a new SalesforceLiveAgentConfig instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig} SalesforceLiveAgentConfig instance + */ + SalesforceLiveAgentConfig.create = function create(properties) { + return new SalesforceLiveAgentConfig(properties); + }; - /** - * Encodes the specified KnowledgeBase message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeBase.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase - * @static - * @param {google.cloud.dialogflow.v2beta1.IKnowledgeBase} message KnowledgeBase message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KnowledgeBase.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); - return writer; - }; + /** + * Encodes the specified SalesforceLiveAgentConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig} message SalesforceLiveAgentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SalesforceLiveAgentConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.organizationId != null && Object.hasOwnProperty.call(message, "organizationId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.organizationId); + if (message.deploymentId != null && Object.hasOwnProperty.call(message, "deploymentId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.deploymentId); + if (message.buttonId != null && Object.hasOwnProperty.call(message, "buttonId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.buttonId); + if (message.endpointDomain != null && Object.hasOwnProperty.call(message, "endpointDomain")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.endpointDomain); + return writer; + }; - /** - * Encodes the specified KnowledgeBase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeBase.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase - * @static - * @param {google.cloud.dialogflow.v2beta1.IKnowledgeBase} message KnowledgeBase message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - KnowledgeBase.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + /** + * Encodes the specified SalesforceLiveAgentConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.ISalesforceLiveAgentConfig} message SalesforceLiveAgentConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SalesforceLiveAgentConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; - /** - * Decodes a KnowledgeBase message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeBase} KnowledgeBase - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KnowledgeBase.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeBase(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.displayName = reader.string(); - break; - case 4: - message.languageCode = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; + /** + * Decodes a SalesforceLiveAgentConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig} SalesforceLiveAgentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SalesforceLiveAgentConfig.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.organizationId = reader.string(); + break; + case 2: + message.deploymentId = reader.string(); + break; + case 3: + message.buttonId = reader.string(); + break; + case 4: + message.endpointDomain = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } } - } - return message; - }; + return message; + }; - /** - * Decodes a KnowledgeBase message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeBase} KnowledgeBase - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - KnowledgeBase.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; + /** + * Decodes a SalesforceLiveAgentConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig} SalesforceLiveAgentConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SalesforceLiveAgentConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; - /** - * Verifies a KnowledgeBase message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - KnowledgeBase.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.displayName != null && message.hasOwnProperty("displayName")) - if (!$util.isString(message.displayName)) - return "displayName: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - return null; - }; + /** + * Verifies a SalesforceLiveAgentConfig message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SalesforceLiveAgentConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.organizationId != null && message.hasOwnProperty("organizationId")) + if (!$util.isString(message.organizationId)) + return "organizationId: string expected"; + if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + if (!$util.isString(message.deploymentId)) + return "deploymentId: string expected"; + if (message.buttonId != null && message.hasOwnProperty("buttonId")) + if (!$util.isString(message.buttonId)) + return "buttonId: string expected"; + if (message.endpointDomain != null && message.hasOwnProperty("endpointDomain")) + if (!$util.isString(message.endpointDomain)) + return "endpointDomain: string expected"; + return null; + }; - /** - * Creates a KnowledgeBase message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeBase} KnowledgeBase - */ - KnowledgeBase.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.KnowledgeBase) + /** + * Creates a SalesforceLiveAgentConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig} SalesforceLiveAgentConfig + */ + SalesforceLiveAgentConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig(); + if (object.organizationId != null) + message.organizationId = String(object.organizationId); + if (object.deploymentId != null) + message.deploymentId = String(object.deploymentId); + if (object.buttonId != null) + message.buttonId = String(object.buttonId); + if (object.endpointDomain != null) + message.endpointDomain = String(object.endpointDomain); + return message; + }; + + /** + * Creates a plain object from a SalesforceLiveAgentConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @static + * @param {google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig} message SalesforceLiveAgentConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SalesforceLiveAgentConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.organizationId = ""; + object.deploymentId = ""; + object.buttonId = ""; + object.endpointDomain = ""; + } + if (message.organizationId != null && message.hasOwnProperty("organizationId")) + object.organizationId = message.organizationId; + if (message.deploymentId != null && message.hasOwnProperty("deploymentId")) + object.deploymentId = message.deploymentId; + if (message.buttonId != null && message.hasOwnProperty("buttonId")) + object.buttonId = message.buttonId; + if (message.endpointDomain != null && message.hasOwnProperty("endpointDomain")) + object.endpointDomain = message.endpointDomain; return object; - var message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeBase(); - if (object.name != null) - message.name = String(object.name); - if (object.displayName != null) - message.displayName = String(object.displayName); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - return message; - }; + }; - /** - * Creates a plain object from a KnowledgeBase message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase - * @static - * @param {google.cloud.dialogflow.v2beta1.KnowledgeBase} message KnowledgeBase - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KnowledgeBase.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.displayName = ""; - object.languageCode = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.displayName != null && message.hasOwnProperty("displayName")) - object.displayName = message.displayName; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - return object; - }; + /** + * Converts this SalesforceLiveAgentConfig to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentHandoffConfig.SalesforceLiveAgentConfig + * @instance + * @returns {Object.} JSON object + */ + SalesforceLiveAgentConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Converts this KnowledgeBase to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase - * @instance - * @returns {Object.} JSON object - */ - KnowledgeBase.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + return SalesforceLiveAgentConfig; + })(); - return KnowledgeBase; + return HumanAgentHandoffConfig; })(); - v2beta1.ListKnowledgeBasesRequest = (function() { + v2beta1.NotificationConfig = (function() { /** - * Properties of a ListKnowledgeBasesRequest. + * Properties of a NotificationConfig. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListKnowledgeBasesRequest - * @property {string|null} [parent] ListKnowledgeBasesRequest parent - * @property {number|null} [pageSize] ListKnowledgeBasesRequest pageSize - * @property {string|null} [pageToken] ListKnowledgeBasesRequest pageToken - * @property {string|null} [filter] ListKnowledgeBasesRequest filter + * @interface INotificationConfig + * @property {string|null} [topic] NotificationConfig topic + * @property {google.cloud.dialogflow.v2beta1.NotificationConfig.MessageFormat|null} [messageFormat] NotificationConfig messageFormat */ /** - * Constructs a new ListKnowledgeBasesRequest. + * Constructs a new NotificationConfig. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListKnowledgeBasesRequest. - * @implements IListKnowledgeBasesRequest + * @classdesc Represents a NotificationConfig. + * @implements INotificationConfig * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.INotificationConfig=} [properties] Properties to set */ - function ListKnowledgeBasesRequest(properties) { + function NotificationConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -63264,114 +114835,88 @@ } /** - * ListKnowledgeBasesRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest - * @instance - */ - ListKnowledgeBasesRequest.prototype.parent = ""; - - /** - * ListKnowledgeBasesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest - * @instance - */ - ListKnowledgeBasesRequest.prototype.pageSize = 0; - - /** - * ListKnowledgeBasesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest + * NotificationConfig topic. + * @member {string} topic + * @memberof google.cloud.dialogflow.v2beta1.NotificationConfig * @instance */ - ListKnowledgeBasesRequest.prototype.pageToken = ""; + NotificationConfig.prototype.topic = ""; /** - * ListKnowledgeBasesRequest filter. - * @member {string} filter - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest + * NotificationConfig messageFormat. + * @member {google.cloud.dialogflow.v2beta1.NotificationConfig.MessageFormat} messageFormat + * @memberof google.cloud.dialogflow.v2beta1.NotificationConfig * @instance */ - ListKnowledgeBasesRequest.prototype.filter = ""; + NotificationConfig.prototype.messageFormat = 0; /** - * Creates a new ListKnowledgeBasesRequest instance using the specified properties. + * Creates a new NotificationConfig instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest + * @memberof google.cloud.dialogflow.v2beta1.NotificationConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest} ListKnowledgeBasesRequest instance + * @param {google.cloud.dialogflow.v2beta1.INotificationConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.NotificationConfig} NotificationConfig instance */ - ListKnowledgeBasesRequest.create = function create(properties) { - return new ListKnowledgeBasesRequest(properties); + NotificationConfig.create = function create(properties) { + return new NotificationConfig(properties); }; /** - * Encodes the specified ListKnowledgeBasesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest.verify|verify} messages. + * Encodes the specified NotificationConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.NotificationConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest + * @memberof google.cloud.dialogflow.v2beta1.NotificationConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest} message ListKnowledgeBasesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.INotificationConfig} message NotificationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListKnowledgeBasesRequest.encode = function encode(message, writer) { + NotificationConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + if (message.topic != null && Object.hasOwnProperty.call(message, "topic")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.topic); + if (message.messageFormat != null && Object.hasOwnProperty.call(message, "messageFormat")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.messageFormat); return writer; }; /** - * Encodes the specified ListKnowledgeBasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest.verify|verify} messages. + * Encodes the specified NotificationConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.NotificationConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest + * @memberof google.cloud.dialogflow.v2beta1.NotificationConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest} message ListKnowledgeBasesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.INotificationConfig} message NotificationConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListKnowledgeBasesRequest.encodeDelimited = function encodeDelimited(message, writer) { + NotificationConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListKnowledgeBasesRequest message from the specified reader or buffer. + * Decodes a NotificationConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest + * @memberof google.cloud.dialogflow.v2beta1.NotificationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest} ListKnowledgeBasesRequest + * @returns {google.cloud.dialogflow.v2beta1.NotificationConfig} NotificationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListKnowledgeBasesRequest.decode = function decode(reader, length) { + NotificationConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.NotificationConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + message.topic = reader.string(); break; case 2: - message.pageSize = reader.int32(); - break; - case 3: - message.pageToken = reader.string(); - break; - case 4: - message.filter = reader.string(); + message.messageFormat = reader.int32(); break; default: reader.skipType(tag & 7); @@ -63382,134 +114927,150 @@ }; /** - * Decodes a ListKnowledgeBasesRequest message from the specified reader or buffer, length delimited. + * Decodes a NotificationConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest + * @memberof google.cloud.dialogflow.v2beta1.NotificationConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest} ListKnowledgeBasesRequest + * @returns {google.cloud.dialogflow.v2beta1.NotificationConfig} NotificationConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListKnowledgeBasesRequest.decodeDelimited = function decodeDelimited(reader) { + NotificationConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListKnowledgeBasesRequest message. + * Verifies a NotificationConfig message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest + * @memberof google.cloud.dialogflow.v2beta1.NotificationConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListKnowledgeBasesRequest.verify = function verify(message) { + NotificationConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - if (!$util.isInteger(message.pageSize)) - return "pageSize: integer expected"; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - if (!$util.isString(message.pageToken)) - return "pageToken: string expected"; - if (message.filter != null && message.hasOwnProperty("filter")) - if (!$util.isString(message.filter)) - return "filter: string expected"; + if (message.topic != null && message.hasOwnProperty("topic")) + if (!$util.isString(message.topic)) + return "topic: string expected"; + if (message.messageFormat != null && message.hasOwnProperty("messageFormat")) + switch (message.messageFormat) { + default: + return "messageFormat: enum value expected"; + case 0: + case 1: + case 2: + break; + } return null; }; /** - * Creates a ListKnowledgeBasesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a NotificationConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest + * @memberof google.cloud.dialogflow.v2beta1.NotificationConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest} ListKnowledgeBasesRequest + * @returns {google.cloud.dialogflow.v2beta1.NotificationConfig} NotificationConfig */ - ListKnowledgeBasesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest) + NotificationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.NotificationConfig) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.pageSize != null) - message.pageSize = object.pageSize | 0; - if (object.pageToken != null) - message.pageToken = String(object.pageToken); - if (object.filter != null) - message.filter = String(object.filter); + var message = new $root.google.cloud.dialogflow.v2beta1.NotificationConfig(); + if (object.topic != null) + message.topic = String(object.topic); + switch (object.messageFormat) { + case "MESSAGE_FORMAT_UNSPECIFIED": + case 0: + message.messageFormat = 0; + break; + case "PROTO": + case 1: + message.messageFormat = 1; + break; + case "JSON": + case 2: + message.messageFormat = 2; + break; + } return message; }; /** - * Creates a plain object from a ListKnowledgeBasesRequest message. Also converts values to other types if specified. + * Creates a plain object from a NotificationConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest + * @memberof google.cloud.dialogflow.v2beta1.NotificationConfig * @static - * @param {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest} message ListKnowledgeBasesRequest + * @param {google.cloud.dialogflow.v2beta1.NotificationConfig} message NotificationConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListKnowledgeBasesRequest.toObject = function toObject(message, options) { + NotificationConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; + object.topic = ""; + object.messageFormat = options.enums === String ? "MESSAGE_FORMAT_UNSPECIFIED" : 0; } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.pageSize != null && message.hasOwnProperty("pageSize")) - object.pageSize = message.pageSize; - if (message.pageToken != null && message.hasOwnProperty("pageToken")) - object.pageToken = message.pageToken; - if (message.filter != null && message.hasOwnProperty("filter")) - object.filter = message.filter; + if (message.topic != null && message.hasOwnProperty("topic")) + object.topic = message.topic; + if (message.messageFormat != null && message.hasOwnProperty("messageFormat")) + object.messageFormat = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.NotificationConfig.MessageFormat[message.messageFormat] : message.messageFormat; return object; }; /** - * Converts this ListKnowledgeBasesRequest to JSON. + * Converts this NotificationConfig to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest + * @memberof google.cloud.dialogflow.v2beta1.NotificationConfig * @instance * @returns {Object.} JSON object */ - ListKnowledgeBasesRequest.prototype.toJSON = function toJSON() { + NotificationConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListKnowledgeBasesRequest; + /** + * MessageFormat enum. + * @name google.cloud.dialogflow.v2beta1.NotificationConfig.MessageFormat + * @enum {number} + * @property {number} MESSAGE_FORMAT_UNSPECIFIED=0 MESSAGE_FORMAT_UNSPECIFIED value + * @property {number} PROTO=1 PROTO value + * @property {number} JSON=2 JSON value + */ + NotificationConfig.MessageFormat = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MESSAGE_FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "PROTO"] = 1; + values[valuesById[2] = "JSON"] = 2; + return values; + })(); + + return NotificationConfig; })(); - v2beta1.ListKnowledgeBasesResponse = (function() { + v2beta1.LoggingConfig = (function() { /** - * Properties of a ListKnowledgeBasesResponse. + * Properties of a LoggingConfig. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListKnowledgeBasesResponse - * @property {Array.|null} [knowledgeBases] ListKnowledgeBasesResponse knowledgeBases - * @property {string|null} [nextPageToken] ListKnowledgeBasesResponse nextPageToken + * @interface ILoggingConfig + * @property {boolean|null} [enableStackdriverLogging] LoggingConfig enableStackdriverLogging */ /** - * Constructs a new ListKnowledgeBasesResponse. + * Constructs a new LoggingConfig. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListKnowledgeBasesResponse. - * @implements IListKnowledgeBasesResponse + * @classdesc Represents a LoggingConfig. + * @implements ILoggingConfig * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.ILoggingConfig=} [properties] Properties to set */ - function ListKnowledgeBasesResponse(properties) { - this.knowledgeBases = []; + function LoggingConfig(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -63517,91 +115078,75 @@ } /** - * ListKnowledgeBasesResponse knowledgeBases. - * @member {Array.} knowledgeBases - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse - * @instance - */ - ListKnowledgeBasesResponse.prototype.knowledgeBases = $util.emptyArray; - - /** - * ListKnowledgeBasesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse + * LoggingConfig enableStackdriverLogging. + * @member {boolean} enableStackdriverLogging + * @memberof google.cloud.dialogflow.v2beta1.LoggingConfig * @instance */ - ListKnowledgeBasesResponse.prototype.nextPageToken = ""; + LoggingConfig.prototype.enableStackdriverLogging = false; /** - * Creates a new ListKnowledgeBasesResponse instance using the specified properties. + * Creates a new LoggingConfig instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse + * @memberof google.cloud.dialogflow.v2beta1.LoggingConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse} ListKnowledgeBasesResponse instance + * @param {google.cloud.dialogflow.v2beta1.ILoggingConfig=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.LoggingConfig} LoggingConfig instance */ - ListKnowledgeBasesResponse.create = function create(properties) { - return new ListKnowledgeBasesResponse(properties); + LoggingConfig.create = function create(properties) { + return new LoggingConfig(properties); }; /** - * Encodes the specified ListKnowledgeBasesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse.verify|verify} messages. + * Encodes the specified LoggingConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.LoggingConfig.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse + * @memberof google.cloud.dialogflow.v2beta1.LoggingConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse} message ListKnowledgeBasesResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.ILoggingConfig} message LoggingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListKnowledgeBasesResponse.encode = function encode(message, writer) { + LoggingConfig.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.knowledgeBases != null && message.knowledgeBases.length) - for (var i = 0; i < message.knowledgeBases.length; ++i) - $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.encode(message.knowledgeBases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); + if (message.enableStackdriverLogging != null && Object.hasOwnProperty.call(message, "enableStackdriverLogging")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.enableStackdriverLogging); return writer; }; /** - * Encodes the specified ListKnowledgeBasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse.verify|verify} messages. + * Encodes the specified LoggingConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.LoggingConfig.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse + * @memberof google.cloud.dialogflow.v2beta1.LoggingConfig * @static - * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse} message ListKnowledgeBasesResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.ILoggingConfig} message LoggingConfig message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListKnowledgeBasesResponse.encodeDelimited = function encodeDelimited(message, writer) { + LoggingConfig.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListKnowledgeBasesResponse message from the specified reader or buffer. + * Decodes a LoggingConfig message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse + * @memberof google.cloud.dialogflow.v2beta1.LoggingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse} ListKnowledgeBasesResponse + * @returns {google.cloud.dialogflow.v2beta1.LoggingConfig} LoggingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListKnowledgeBasesResponse.decode = function decode(reader, length) { + LoggingConfig.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.LoggingConfig(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.knowledgeBases && message.knowledgeBases.length)) - message.knowledgeBases = []; - message.knowledgeBases.push($root.google.cloud.dialogflow.v2beta1.KnowledgeBase.decode(reader, reader.uint32())); - break; - case 2: - message.nextPageToken = reader.string(); + case 3: + message.enableStackdriverLogging = reader.bool(); break; default: reader.skipType(tag & 7); @@ -63612,133 +115157,109 @@ }; /** - * Decodes a ListKnowledgeBasesResponse message from the specified reader or buffer, length delimited. + * Decodes a LoggingConfig message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse + * @memberof google.cloud.dialogflow.v2beta1.LoggingConfig * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse} ListKnowledgeBasesResponse + * @returns {google.cloud.dialogflow.v2beta1.LoggingConfig} LoggingConfig * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListKnowledgeBasesResponse.decodeDelimited = function decodeDelimited(reader) { + LoggingConfig.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListKnowledgeBasesResponse message. + * Verifies a LoggingConfig message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse + * @memberof google.cloud.dialogflow.v2beta1.LoggingConfig * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListKnowledgeBasesResponse.verify = function verify(message) { + LoggingConfig.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.knowledgeBases != null && message.hasOwnProperty("knowledgeBases")) { - if (!Array.isArray(message.knowledgeBases)) - return "knowledgeBases: array expected"; - for (var i = 0; i < message.knowledgeBases.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.verify(message.knowledgeBases[i]); - if (error) - return "knowledgeBases." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + if (typeof message.enableStackdriverLogging !== "boolean") + return "enableStackdriverLogging: boolean expected"; return null; }; /** - * Creates a ListKnowledgeBasesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a LoggingConfig message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse + * @memberof google.cloud.dialogflow.v2beta1.LoggingConfig * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse} ListKnowledgeBasesResponse + * @returns {google.cloud.dialogflow.v2beta1.LoggingConfig} LoggingConfig */ - ListKnowledgeBasesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse) + LoggingConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.LoggingConfig) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse(); - if (object.knowledgeBases) { - if (!Array.isArray(object.knowledgeBases)) - throw TypeError(".google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse.knowledgeBases: array expected"); - message.knowledgeBases = []; - for (var i = 0; i < object.knowledgeBases.length; ++i) { - if (typeof object.knowledgeBases[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse.knowledgeBases: object expected"); - message.knowledgeBases[i] = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.fromObject(object.knowledgeBases[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); + var message = new $root.google.cloud.dialogflow.v2beta1.LoggingConfig(); + if (object.enableStackdriverLogging != null) + message.enableStackdriverLogging = Boolean(object.enableStackdriverLogging); return message; }; /** - * Creates a plain object from a ListKnowledgeBasesResponse message. Also converts values to other types if specified. + * Creates a plain object from a LoggingConfig message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse + * @memberof google.cloud.dialogflow.v2beta1.LoggingConfig * @static - * @param {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse} message ListKnowledgeBasesResponse + * @param {google.cloud.dialogflow.v2beta1.LoggingConfig} message LoggingConfig * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListKnowledgeBasesResponse.toObject = function toObject(message, options) { + LoggingConfig.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.knowledgeBases = []; if (options.defaults) - object.nextPageToken = ""; - if (message.knowledgeBases && message.knowledgeBases.length) { - object.knowledgeBases = []; - for (var j = 0; j < message.knowledgeBases.length; ++j) - object.knowledgeBases[j] = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.toObject(message.knowledgeBases[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; + object.enableStackdriverLogging = false; + if (message.enableStackdriverLogging != null && message.hasOwnProperty("enableStackdriverLogging")) + object.enableStackdriverLogging = message.enableStackdriverLogging; return object; }; /** - * Converts this ListKnowledgeBasesResponse to JSON. + * Converts this LoggingConfig to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse + * @memberof google.cloud.dialogflow.v2beta1.LoggingConfig * @instance * @returns {Object.} JSON object */ - ListKnowledgeBasesResponse.prototype.toJSON = function toJSON() { + LoggingConfig.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListKnowledgeBasesResponse; + return LoggingConfig; })(); - v2beta1.GetKnowledgeBaseRequest = (function() { + v2beta1.ListConversationProfilesRequest = (function() { /** - * Properties of a GetKnowledgeBaseRequest. + * Properties of a ListConversationProfilesRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IGetKnowledgeBaseRequest - * @property {string|null} [name] GetKnowledgeBaseRequest name + * @interface IListConversationProfilesRequest + * @property {string|null} [parent] ListConversationProfilesRequest parent + * @property {number|null} [pageSize] ListConversationProfilesRequest pageSize + * @property {string|null} [pageToken] ListConversationProfilesRequest pageToken */ /** - * Constructs a new GetKnowledgeBaseRequest. + * Constructs a new ListConversationProfilesRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a GetKnowledgeBaseRequest. - * @implements IGetKnowledgeBaseRequest + * @classdesc Represents a ListConversationProfilesRequest. + * @implements IListConversationProfilesRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest=} [properties] Properties to set */ - function GetKnowledgeBaseRequest(properties) { + function ListConversationProfilesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -63746,75 +115267,101 @@ } /** - * GetKnowledgeBaseRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest + * ListConversationProfilesRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest * @instance */ - GetKnowledgeBaseRequest.prototype.name = ""; + ListConversationProfilesRequest.prototype.parent = ""; /** - * Creates a new GetKnowledgeBaseRequest instance using the specified properties. + * ListConversationProfilesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest + * @instance + */ + ListConversationProfilesRequest.prototype.pageSize = 0; + + /** + * ListConversationProfilesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest + * @instance + */ + ListConversationProfilesRequest.prototype.pageToken = ""; + + /** + * Creates a new ListConversationProfilesRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest} GetKnowledgeBaseRequest instance - */ - GetKnowledgeBaseRequest.create = function create(properties) { - return new GetKnowledgeBaseRequest(properties); + * @param {google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest} ListConversationProfilesRequest instance + */ + ListConversationProfilesRequest.create = function create(properties) { + return new ListConversationProfilesRequest(properties); }; /** - * Encodes the specified GetKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest.verify|verify} messages. + * Encodes the specified ListConversationProfilesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest} message GetKnowledgeBaseRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest} message ListConversationProfilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetKnowledgeBaseRequest.encode = function encode(message, writer) { + ListConversationProfilesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); return writer; }; /** - * Encodes the specified GetKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest.verify|verify} messages. + * Encodes the specified ListConversationProfilesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest} message GetKnowledgeBaseRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest} message ListConversationProfilesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetKnowledgeBaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListConversationProfilesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetKnowledgeBaseRequest message from the specified reader or buffer. + * Decodes a ListConversationProfilesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest} GetKnowledgeBaseRequest + * @returns {google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest} ListConversationProfilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetKnowledgeBaseRequest.decode = function decode(reader, length) { + ListConversationProfilesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -63825,108 +115372,126 @@ }; /** - * Decodes a GetKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * Decodes a ListConversationProfilesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest} GetKnowledgeBaseRequest + * @returns {google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest} ListConversationProfilesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetKnowledgeBaseRequest.decodeDelimited = function decodeDelimited(reader) { + ListConversationProfilesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetKnowledgeBaseRequest message. + * Verifies a ListConversationProfilesRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetKnowledgeBaseRequest.verify = function verify(message) { + ListConversationProfilesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; return null; }; /** - * Creates a GetKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListConversationProfilesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest} GetKnowledgeBaseRequest + * @returns {google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest} ListConversationProfilesRequest */ - GetKnowledgeBaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest) + ListConversationProfilesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); return message; }; /** - * Creates a plain object from a GetKnowledgeBaseRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListConversationProfilesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest} message GetKnowledgeBaseRequest + * @param {google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest} message ListConversationProfilesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetKnowledgeBaseRequest.toObject = function toObject(message, options) { + ListConversationProfilesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; return object; }; /** - * Converts this GetKnowledgeBaseRequest to JSON. + * Converts this ListConversationProfilesRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest * @instance * @returns {Object.} JSON object */ - GetKnowledgeBaseRequest.prototype.toJSON = function toJSON() { + ListConversationProfilesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetKnowledgeBaseRequest; + return ListConversationProfilesRequest; })(); - v2beta1.CreateKnowledgeBaseRequest = (function() { + v2beta1.ListConversationProfilesResponse = (function() { /** - * Properties of a CreateKnowledgeBaseRequest. + * Properties of a ListConversationProfilesResponse. * @memberof google.cloud.dialogflow.v2beta1 - * @interface ICreateKnowledgeBaseRequest - * @property {string|null} [parent] CreateKnowledgeBaseRequest parent - * @property {google.cloud.dialogflow.v2beta1.IKnowledgeBase|null} [knowledgeBase] CreateKnowledgeBaseRequest knowledgeBase + * @interface IListConversationProfilesResponse + * @property {Array.|null} [conversationProfiles] ListConversationProfilesResponse conversationProfiles + * @property {string|null} [nextPageToken] ListConversationProfilesResponse nextPageToken */ /** - * Constructs a new CreateKnowledgeBaseRequest. + * Constructs a new ListConversationProfilesResponse. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a CreateKnowledgeBaseRequest. - * @implements ICreateKnowledgeBaseRequest + * @classdesc Represents a ListConversationProfilesResponse. + * @implements IListConversationProfilesResponse * @constructor - * @param {google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse=} [properties] Properties to set */ - function CreateKnowledgeBaseRequest(properties) { + function ListConversationProfilesResponse(properties) { + this.conversationProfiles = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -63934,88 +115499,91 @@ } /** - * CreateKnowledgeBaseRequest parent. - * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest + * ListConversationProfilesResponse conversationProfiles. + * @member {Array.} conversationProfiles + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse * @instance */ - CreateKnowledgeBaseRequest.prototype.parent = ""; + ListConversationProfilesResponse.prototype.conversationProfiles = $util.emptyArray; /** - * CreateKnowledgeBaseRequest knowledgeBase. - * @member {google.cloud.dialogflow.v2beta1.IKnowledgeBase|null|undefined} knowledgeBase - * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest + * ListConversationProfilesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse * @instance */ - CreateKnowledgeBaseRequest.prototype.knowledgeBase = null; + ListConversationProfilesResponse.prototype.nextPageToken = ""; /** - * Creates a new CreateKnowledgeBaseRequest instance using the specified properties. + * Creates a new ListConversationProfilesResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest} CreateKnowledgeBaseRequest instance + * @param {google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse} ListConversationProfilesResponse instance */ - CreateKnowledgeBaseRequest.create = function create(properties) { - return new CreateKnowledgeBaseRequest(properties); + ListConversationProfilesResponse.create = function create(properties) { + return new ListConversationProfilesResponse(properties); }; /** - * Encodes the specified CreateKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest.verify|verify} messages. + * Encodes the specified ListConversationProfilesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest} message CreateKnowledgeBaseRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse} message ListConversationProfilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateKnowledgeBaseRequest.encode = function encode(message, writer) { + ListConversationProfilesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.knowledgeBase != null && Object.hasOwnProperty.call(message, "knowledgeBase")) - $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.encode(message.knowledgeBase, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.conversationProfiles != null && message.conversationProfiles.length) + for (var i = 0; i < message.conversationProfiles.length; ++i) + $root.google.cloud.dialogflow.v2beta1.ConversationProfile.encode(message.conversationProfiles[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified CreateKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest.verify|verify} messages. + * Encodes the specified ListConversationProfilesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest} message CreateKnowledgeBaseRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse} message ListConversationProfilesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateKnowledgeBaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListConversationProfilesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateKnowledgeBaseRequest message from the specified reader or buffer. + * Decodes a ListConversationProfilesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest} CreateKnowledgeBaseRequest + * @returns {google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse} ListConversationProfilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateKnowledgeBaseRequest.decode = function decode(reader, length) { + ListConversationProfilesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.parent = reader.string(); + if (!(message.conversationProfiles && message.conversationProfiles.length)) + message.conversationProfiles = []; + message.conversationProfiles.push($root.google.cloud.dialogflow.v2beta1.ConversationProfile.decode(reader, reader.uint32())); break; case 2: - message.knowledgeBase = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -64026,122 +115594,133 @@ }; /** - * Decodes a CreateKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * Decodes a ListConversationProfilesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest} CreateKnowledgeBaseRequest + * @returns {google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse} ListConversationProfilesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateKnowledgeBaseRequest.decodeDelimited = function decodeDelimited(reader) { + ListConversationProfilesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateKnowledgeBaseRequest message. + * Verifies a ListConversationProfilesResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateKnowledgeBaseRequest.verify = function verify(message) { + ListConversationProfilesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.knowledgeBase != null && message.hasOwnProperty("knowledgeBase")) { - var error = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.verify(message.knowledgeBase); - if (error) - return "knowledgeBase." + error; + if (message.conversationProfiles != null && message.hasOwnProperty("conversationProfiles")) { + if (!Array.isArray(message.conversationProfiles)) + return "conversationProfiles: array expected"; + for (var i = 0; i < message.conversationProfiles.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.ConversationProfile.verify(message.conversationProfiles[i]); + if (error) + return "conversationProfiles." + error; + } } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a CreateKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListConversationProfilesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest} CreateKnowledgeBaseRequest + * @returns {google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse} ListConversationProfilesResponse */ - CreateKnowledgeBaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest) + ListConversationProfilesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.knowledgeBase != null) { - if (typeof object.knowledgeBase !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest.knowledgeBase: object expected"); - message.knowledgeBase = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.fromObject(object.knowledgeBase); + var message = new $root.google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse(); + if (object.conversationProfiles) { + if (!Array.isArray(object.conversationProfiles)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse.conversationProfiles: array expected"); + message.conversationProfiles = []; + for (var i = 0; i < object.conversationProfiles.length; ++i) { + if (typeof object.conversationProfiles[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse.conversationProfiles: object expected"); + message.conversationProfiles[i] = $root.google.cloud.dialogflow.v2beta1.ConversationProfile.fromObject(object.conversationProfiles[i]); + } } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a CreateKnowledgeBaseRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListConversationProfilesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest} message CreateKnowledgeBaseRequest + * @param {google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse} message ListConversationProfilesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateKnowledgeBaseRequest.toObject = function toObject(message, options) { + ListConversationProfilesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.parent = ""; - object.knowledgeBase = null; + if (options.arrays || options.defaults) + object.conversationProfiles = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.conversationProfiles && message.conversationProfiles.length) { + object.conversationProfiles = []; + for (var j = 0; j < message.conversationProfiles.length; ++j) + object.conversationProfiles[j] = $root.google.cloud.dialogflow.v2beta1.ConversationProfile.toObject(message.conversationProfiles[j], options); } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.knowledgeBase != null && message.hasOwnProperty("knowledgeBase")) - object.knowledgeBase = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.toObject(message.knowledgeBase, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this CreateKnowledgeBaseRequest to JSON. + * Converts this ListConversationProfilesResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.ListConversationProfilesResponse * @instance * @returns {Object.} JSON object */ - CreateKnowledgeBaseRequest.prototype.toJSON = function toJSON() { + ListConversationProfilesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateKnowledgeBaseRequest; + return ListConversationProfilesResponse; })(); - v2beta1.DeleteKnowledgeBaseRequest = (function() { + v2beta1.GetConversationProfileRequest = (function() { /** - * Properties of a DeleteKnowledgeBaseRequest. + * Properties of a GetConversationProfileRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IDeleteKnowledgeBaseRequest - * @property {string|null} [name] DeleteKnowledgeBaseRequest name - * @property {boolean|null} [force] DeleteKnowledgeBaseRequest force + * @interface IGetConversationProfileRequest + * @property {string|null} [name] GetConversationProfileRequest name */ /** - * Constructs a new DeleteKnowledgeBaseRequest. + * Constructs a new GetConversationProfileRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a DeleteKnowledgeBaseRequest. - * @implements IDeleteKnowledgeBaseRequest + * @classdesc Represents a GetConversationProfileRequest. + * @implements IGetConversationProfileRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest=} [properties] Properties to set */ - function DeleteKnowledgeBaseRequest(properties) { + function GetConversationProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -64149,89 +115728,76 @@ } /** - * DeleteKnowledgeBaseRequest name. + * GetConversationProfileRequest name. * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest - * @instance - */ - DeleteKnowledgeBaseRequest.prototype.name = ""; - - /** - * DeleteKnowledgeBaseRequest force. - * @member {boolean} force - * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.GetConversationProfileRequest * @instance */ - DeleteKnowledgeBaseRequest.prototype.force = false; + GetConversationProfileRequest.prototype.name = ""; /** - * Creates a new DeleteKnowledgeBaseRequest instance using the specified properties. + * Creates a new GetConversationProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.GetConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest} DeleteKnowledgeBaseRequest instance + * @param {google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GetConversationProfileRequest} GetConversationProfileRequest instance */ - DeleteKnowledgeBaseRequest.create = function create(properties) { - return new DeleteKnowledgeBaseRequest(properties); + GetConversationProfileRequest.create = function create(properties) { + return new GetConversationProfileRequest(properties); }; /** - * Encodes the specified DeleteKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.verify|verify} messages. + * Encodes the specified GetConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetConversationProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.GetConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest} message DeleteKnowledgeBaseRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest} message GetConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteKnowledgeBaseRequest.encode = function encode(message, writer) { + GetConversationProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); return writer; }; /** - * Encodes the specified DeleteKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.verify|verify} messages. + * Encodes the specified GetConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetConversationProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.GetConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest} message DeleteKnowledgeBaseRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest} message GetConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteKnowledgeBaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetConversationProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteKnowledgeBaseRequest message from the specified reader or buffer. + * Decodes a GetConversationProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.GetConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest} DeleteKnowledgeBaseRequest + * @returns {google.cloud.dialogflow.v2beta1.GetConversationProfileRequest} GetConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteKnowledgeBaseRequest.decode = function decode(reader, length) { + GetConversationProfileRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetConversationProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: message.name = reader.string(); break; - case 2: - message.force = reader.bool(); - break; default: reader.skipType(tag & 7); break; @@ -64241,117 +115807,108 @@ }; /** - * Decodes a DeleteKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * Decodes a GetConversationProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.GetConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest} DeleteKnowledgeBaseRequest + * @returns {google.cloud.dialogflow.v2beta1.GetConversationProfileRequest} GetConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteKnowledgeBaseRequest.decodeDelimited = function decodeDelimited(reader) { + GetConversationProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteKnowledgeBaseRequest message. + * Verifies a GetConversationProfileRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.GetConversationProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteKnowledgeBaseRequest.verify = function verify(message) { + GetConversationProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; return null; }; /** - * Creates a DeleteKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetConversationProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.GetConversationProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest} DeleteKnowledgeBaseRequest + * @returns {google.cloud.dialogflow.v2beta1.GetConversationProfileRequest} GetConversationProfileRequest */ - DeleteKnowledgeBaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest) + GetConversationProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetConversationProfileRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest(); + var message = new $root.google.cloud.dialogflow.v2beta1.GetConversationProfileRequest(); if (object.name != null) message.name = String(object.name); - if (object.force != null) - message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from a DeleteKnowledgeBaseRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetConversationProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.GetConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest} message DeleteKnowledgeBaseRequest + * @param {google.cloud.dialogflow.v2beta1.GetConversationProfileRequest} message GetConversationProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteKnowledgeBaseRequest.toObject = function toObject(message, options) { + GetConversationProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { + if (options.defaults) object.name = ""; - object.force = false; - } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; return object; }; /** - * Converts this DeleteKnowledgeBaseRequest to JSON. + * Converts this GetConversationProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.GetConversationProfileRequest * @instance * @returns {Object.} JSON object */ - DeleteKnowledgeBaseRequest.prototype.toJSON = function toJSON() { + GetConversationProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteKnowledgeBaseRequest; + return GetConversationProfileRequest; })(); - v2beta1.UpdateKnowledgeBaseRequest = (function() { + v2beta1.CreateConversationProfileRequest = (function() { /** - * Properties of an UpdateKnowledgeBaseRequest. + * Properties of a CreateConversationProfileRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IUpdateKnowledgeBaseRequest - * @property {google.cloud.dialogflow.v2beta1.IKnowledgeBase|null} [knowledgeBase] UpdateKnowledgeBaseRequest knowledgeBase - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateKnowledgeBaseRequest updateMask + * @interface ICreateConversationProfileRequest + * @property {string|null} [parent] CreateConversationProfileRequest parent + * @property {google.cloud.dialogflow.v2beta1.IConversationProfile|null} [conversationProfile] CreateConversationProfileRequest conversationProfile */ /** - * Constructs a new UpdateKnowledgeBaseRequest. + * Constructs a new CreateConversationProfileRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an UpdateKnowledgeBaseRequest. - * @implements IUpdateKnowledgeBaseRequest + * @classdesc Represents a CreateConversationProfileRequest. + * @implements ICreateConversationProfileRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest=} [properties] Properties to set */ - function UpdateKnowledgeBaseRequest(properties) { + function CreateConversationProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -64359,88 +115916,88 @@ } /** - * UpdateKnowledgeBaseRequest knowledgeBase. - * @member {google.cloud.dialogflow.v2beta1.IKnowledgeBase|null|undefined} knowledgeBase - * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest + * CreateConversationProfileRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest * @instance */ - UpdateKnowledgeBaseRequest.prototype.knowledgeBase = null; + CreateConversationProfileRequest.prototype.parent = ""; /** - * UpdateKnowledgeBaseRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest + * CreateConversationProfileRequest conversationProfile. + * @member {google.cloud.dialogflow.v2beta1.IConversationProfile|null|undefined} conversationProfile + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest * @instance */ - UpdateKnowledgeBaseRequest.prototype.updateMask = null; + CreateConversationProfileRequest.prototype.conversationProfile = null; /** - * Creates a new UpdateKnowledgeBaseRequest instance using the specified properties. + * Creates a new CreateConversationProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest} UpdateKnowledgeBaseRequest instance + * @param {google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest} CreateConversationProfileRequest instance */ - UpdateKnowledgeBaseRequest.create = function create(properties) { - return new UpdateKnowledgeBaseRequest(properties); + CreateConversationProfileRequest.create = function create(properties) { + return new CreateConversationProfileRequest(properties); }; /** - * Encodes the specified UpdateKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest.verify|verify} messages. + * Encodes the specified CreateConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest} message UpdateKnowledgeBaseRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest} message CreateConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateKnowledgeBaseRequest.encode = function encode(message, writer) { + CreateConversationProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.knowledgeBase != null && Object.hasOwnProperty.call(message, "knowledgeBase")) - $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.encode(message.knowledgeBase, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.conversationProfile != null && Object.hasOwnProperty.call(message, "conversationProfile")) + $root.google.cloud.dialogflow.v2beta1.ConversationProfile.encode(message.conversationProfile, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified UpdateKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest.verify|verify} messages. + * Encodes the specified CreateConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest} message UpdateKnowledgeBaseRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest} message CreateConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateKnowledgeBaseRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateConversationProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateKnowledgeBaseRequest message from the specified reader or buffer. + * Decodes a CreateConversationProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest} UpdateKnowledgeBaseRequest + * @returns {google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest} CreateConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateKnowledgeBaseRequest.decode = function decode(reader, length) { + CreateConversationProfileRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.knowledgeBase = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.decode(reader, reader.uint32()); + message.parent = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.conversationProfile = $root.google.cloud.dialogflow.v2beta1.ConversationProfile.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -64451,373 +116008,211 @@ }; /** - * Decodes an UpdateKnowledgeBaseRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateConversationProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest} UpdateKnowledgeBaseRequest + * @returns {google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest} CreateConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateKnowledgeBaseRequest.decodeDelimited = function decodeDelimited(reader) { + CreateConversationProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateKnowledgeBaseRequest message. + * Verifies a CreateConversationProfileRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateKnowledgeBaseRequest.verify = function verify(message) { + CreateConversationProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.knowledgeBase != null && message.hasOwnProperty("knowledgeBase")) { - var error = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.verify(message.knowledgeBase); - if (error) - return "knowledgeBase." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) { + var error = $root.google.cloud.dialogflow.v2beta1.ConversationProfile.verify(message.conversationProfile); if (error) - return "updateMask." + error; + return "conversationProfile." + error; } return null; }; /** - * Creates an UpdateKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateConversationProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest} UpdateKnowledgeBaseRequest + * @returns {google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest} CreateConversationProfileRequest */ - UpdateKnowledgeBaseRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest) + CreateConversationProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest(); - if (object.knowledgeBase != null) { - if (typeof object.knowledgeBase !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest.knowledgeBase: object expected"); - message.knowledgeBase = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.fromObject(object.knowledgeBase); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + var message = new $root.google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.conversationProfile != null) { + if (typeof object.conversationProfile !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest.conversationProfile: object expected"); + message.conversationProfile = $root.google.cloud.dialogflow.v2beta1.ConversationProfile.fromObject(object.conversationProfile); } return message; }; /** - * Creates a plain object from an UpdateKnowledgeBaseRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateConversationProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest} message UpdateKnowledgeBaseRequest + * @param {google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest} message CreateConversationProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateKnowledgeBaseRequest.toObject = function toObject(message, options) { + CreateConversationProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.knowledgeBase = null; - object.updateMask = null; + object.parent = ""; + object.conversationProfile = null; } - if (message.knowledgeBase != null && message.hasOwnProperty("knowledgeBase")) - object.knowledgeBase = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.toObject(message.knowledgeBase, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - return object; - }; - - /** - * Converts this UpdateKnowledgeBaseRequest to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateKnowledgeBaseRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return UpdateKnowledgeBaseRequest; - })(); - - v2beta1.Sessions = (function() { - - /** - * Constructs a new Sessions service. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a Sessions - * @extends $protobuf.rpc.Service - * @constructor - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - */ - function Sessions(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (Sessions.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Sessions; - - /** - * Creates new Sessions service using the specified rpc implementation. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.Sessions - * @static - * @param {$protobuf.RPCImpl} rpcImpl RPC implementation - * @param {boolean} [requestDelimited=false] Whether requests are length-delimited - * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {Sessions} RPC service. Useful where requests and/or responses are streamed. - */ - Sessions.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Sessions#detectIntent}. - * @memberof google.cloud.dialogflow.v2beta1.Sessions - * @typedef DetectIntentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.DetectIntentResponse} [response] DetectIntentResponse - */ - - /** - * Calls DetectIntent. - * @function detectIntent - * @memberof google.cloud.dialogflow.v2beta1.Sessions - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDetectIntentRequest} request DetectIntentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Sessions.DetectIntentCallback} callback Node-style callback called with the error, if any, and DetectIntentResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Sessions.prototype.detectIntent = function detectIntent(request, callback) { - return this.rpcCall(detectIntent, $root.google.cloud.dialogflow.v2beta1.DetectIntentRequest, $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse, request, callback); - }, "name", { value: "DetectIntent" }); - - /** - * Calls DetectIntent. - * @function detectIntent - * @memberof google.cloud.dialogflow.v2beta1.Sessions - * @instance - * @param {google.cloud.dialogflow.v2beta1.IDetectIntentRequest} request DetectIntentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.Sessions#streamingDetectIntent}. - * @memberof google.cloud.dialogflow.v2beta1.Sessions - * @typedef StreamingDetectIntentCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse} [response] StreamingDetectIntentResponse - */ - - /** - * Calls StreamingDetectIntent. - * @function streamingDetectIntent - * @memberof google.cloud.dialogflow.v2beta1.Sessions - * @instance - * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest} request StreamingDetectIntentRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.Sessions.StreamingDetectIntentCallback} callback Node-style callback called with the error, if any, and StreamingDetectIntentResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(Sessions.prototype.streamingDetectIntent = function streamingDetectIntent(request, callback) { - return this.rpcCall(streamingDetectIntent, $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest, $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse, request, callback); - }, "name", { value: "StreamingDetectIntent" }); - - /** - * Calls StreamingDetectIntent. - * @function streamingDetectIntent - * @memberof google.cloud.dialogflow.v2beta1.Sessions - * @instance - * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest} request StreamingDetectIntentRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return Sessions; - })(); - - v2beta1.DetectIntentRequest = (function() { - - /** - * Properties of a DetectIntentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @interface IDetectIntentRequest - * @property {string|null} [session] DetectIntentRequest session - * @property {google.cloud.dialogflow.v2beta1.IQueryParameters|null} [queryParams] DetectIntentRequest queryParams - * @property {google.cloud.dialogflow.v2beta1.IQueryInput|null} [queryInput] DetectIntentRequest queryInput - * @property {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentRequest outputAudioConfig - * @property {google.protobuf.IFieldMask|null} [outputAudioConfigMask] DetectIntentRequest outputAudioConfigMask - * @property {Uint8Array|null} [inputAudio] DetectIntentRequest inputAudio - */ - - /** - * Constructs a new DetectIntentRequest. - * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a DetectIntentRequest. - * @implements IDetectIntentRequest - * @constructor - * @param {google.cloud.dialogflow.v2beta1.IDetectIntentRequest=} [properties] Properties to set - */ - function DetectIntentRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DetectIntentRequest session. - * @member {string} session - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest - * @instance - */ - DetectIntentRequest.prototype.session = ""; + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) + object.conversationProfile = $root.google.cloud.dialogflow.v2beta1.ConversationProfile.toObject(message.conversationProfile, options); + return object; + }; /** - * DetectIntentRequest queryParams. - * @member {google.cloud.dialogflow.v2beta1.IQueryParameters|null|undefined} queryParams - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * Converts this CreateConversationProfileRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest * @instance + * @returns {Object.} JSON object */ - DetectIntentRequest.prototype.queryParams = null; + CreateConversationProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return CreateConversationProfileRequest; + })(); + + v2beta1.UpdateConversationProfileRequest = (function() { /** - * DetectIntentRequest queryInput. - * @member {google.cloud.dialogflow.v2beta1.IQueryInput|null|undefined} queryInput - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest - * @instance + * Properties of an UpdateConversationProfileRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IUpdateConversationProfileRequest + * @property {google.cloud.dialogflow.v2beta1.IConversationProfile|null} [conversationProfile] UpdateConversationProfileRequest conversationProfile + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateConversationProfileRequest updateMask */ - DetectIntentRequest.prototype.queryInput = null; /** - * DetectIntentRequest outputAudioConfig. - * @member {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null|undefined} outputAudioConfig - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest - * @instance + * Constructs a new UpdateConversationProfileRequest. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents an UpdateConversationProfileRequest. + * @implements IUpdateConversationProfileRequest + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest=} [properties] Properties to set */ - DetectIntentRequest.prototype.outputAudioConfig = null; + function UpdateConversationProfileRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * DetectIntentRequest outputAudioConfigMask. - * @member {google.protobuf.IFieldMask|null|undefined} outputAudioConfigMask - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * UpdateConversationProfileRequest conversationProfile. + * @member {google.cloud.dialogflow.v2beta1.IConversationProfile|null|undefined} conversationProfile + * @memberof google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest * @instance */ - DetectIntentRequest.prototype.outputAudioConfigMask = null; + UpdateConversationProfileRequest.prototype.conversationProfile = null; /** - * DetectIntentRequest inputAudio. - * @member {Uint8Array} inputAudio - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * UpdateConversationProfileRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest * @instance */ - DetectIntentRequest.prototype.inputAudio = $util.newBuffer([]); + UpdateConversationProfileRequest.prototype.updateMask = null; /** - * Creates a new DetectIntentRequest instance using the specified properties. + * Creates a new UpdateConversationProfileRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDetectIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.DetectIntentRequest} DetectIntentRequest instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest} UpdateConversationProfileRequest instance */ - DetectIntentRequest.create = function create(properties) { - return new DetectIntentRequest(properties); + UpdateConversationProfileRequest.create = function create(properties) { + return new UpdateConversationProfileRequest(properties); }; /** - * Encodes the specified DetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentRequest.verify|verify} messages. + * Encodes the specified UpdateConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDetectIntentRequest} message DetectIntentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest} message UpdateConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DetectIntentRequest.encode = function encode(message, writer) { + UpdateConversationProfileRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) - $root.google.cloud.dialogflow.v2beta1.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) - $root.google.cloud.dialogflow.v2beta1.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) - $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.inputAudio != null && Object.hasOwnProperty.call(message, "inputAudio")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.inputAudio); - if (message.outputAudioConfigMask != null && Object.hasOwnProperty.call(message, "outputAudioConfigMask")) - $root.google.protobuf.FieldMask.encode(message.outputAudioConfigMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.conversationProfile != null && Object.hasOwnProperty.call(message, "conversationProfile")) + $root.google.cloud.dialogflow.v2beta1.ConversationProfile.encode(message.conversationProfile, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified DetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentRequest.verify|verify} messages. + * Encodes the specified UpdateConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDetectIntentRequest} message DetectIntentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest} message UpdateConversationProfileRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateConversationProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DetectIntentRequest message from the specified reader or buffer. + * Decodes an UpdateConversationProfileRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.DetectIntentRequest} DetectIntentRequest + * @returns {google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest} UpdateConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DetectIntentRequest.decode = function decode(reader, length) { + UpdateConversationProfileRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DetectIntentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.session = reader.string(); + message.conversationProfile = $root.google.cloud.dialogflow.v2beta1.ConversationProfile.decode(reader, reader.uint32()); break; case 2: - message.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.decode(reader, reader.uint32()); - break; - case 3: - message.queryInput = $root.google.cloud.dialogflow.v2beta1.QueryInput.decode(reader, reader.uint32()); - break; - case 4: - message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.decode(reader, reader.uint32()); - break; - case 7: - message.outputAudioConfigMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 5: - message.inputAudio = reader.bytes(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -64828,183 +116223,126 @@ }; /** - * Decodes a DetectIntentRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateConversationProfileRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.DetectIntentRequest} DetectIntentRequest + * @returns {google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest} UpdateConversationProfileRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateConversationProfileRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DetectIntentRequest message. + * Verifies an UpdateConversationProfileRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DetectIntentRequest.verify = function verify(message) { + UpdateConversationProfileRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.queryParams != null && message.hasOwnProperty("queryParams")) { - var error = $root.google.cloud.dialogflow.v2beta1.QueryParameters.verify(message.queryParams); - if (error) - return "queryParams." + error; - } - if (message.queryInput != null && message.hasOwnProperty("queryInput")) { - var error = $root.google.cloud.dialogflow.v2beta1.QueryInput.verify(message.queryInput); - if (error) - return "queryInput." + error; - } - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { - var error = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify(message.outputAudioConfig); + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) { + var error = $root.google.cloud.dialogflow.v2beta1.ConversationProfile.verify(message.conversationProfile); if (error) - return "outputAudioConfig." + error; + return "conversationProfile." + error; } - if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.outputAudioConfigMask); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); if (error) - return "outputAudioConfigMask." + error; + return "updateMask." + error; } - if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) - if (!(message.inputAudio && typeof message.inputAudio.length === "number" || $util.isString(message.inputAudio))) - return "inputAudio: buffer expected"; return null; }; /** - * Creates a DetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateConversationProfileRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.DetectIntentRequest} DetectIntentRequest + * @returns {google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest} UpdateConversationProfileRequest */ - DetectIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.DetectIntentRequest) + UpdateConversationProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.DetectIntentRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.queryParams != null) { - if (typeof object.queryParams !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentRequest.queryParams: object expected"); - message.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.fromObject(object.queryParams); - } - if (object.queryInput != null) { - if (typeof object.queryInput !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentRequest.queryInput: object expected"); - message.queryInput = $root.google.cloud.dialogflow.v2beta1.QueryInput.fromObject(object.queryInput); - } - if (object.outputAudioConfig != null) { - if (typeof object.outputAudioConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentRequest.outputAudioConfig: object expected"); - message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.fromObject(object.outputAudioConfig); + var message = new $root.google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest(); + if (object.conversationProfile != null) { + if (typeof object.conversationProfile !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest.conversationProfile: object expected"); + message.conversationProfile = $root.google.cloud.dialogflow.v2beta1.ConversationProfile.fromObject(object.conversationProfile); } - if (object.outputAudioConfigMask != null) { - if (typeof object.outputAudioConfigMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentRequest.outputAudioConfigMask: object expected"); - message.outputAudioConfigMask = $root.google.protobuf.FieldMask.fromObject(object.outputAudioConfigMask); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.inputAudio != null) - if (typeof object.inputAudio === "string") - $util.base64.decode(object.inputAudio, message.inputAudio = $util.newBuffer($util.base64.length(object.inputAudio)), 0); - else if (object.inputAudio.length) - message.inputAudio = object.inputAudio; return message; }; /** - * Creates a plain object from a DetectIntentRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateConversationProfileRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest * @static - * @param {google.cloud.dialogflow.v2beta1.DetectIntentRequest} message DetectIntentRequest + * @param {google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest} message UpdateConversationProfileRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DetectIntentRequest.toObject = function toObject(message, options) { + UpdateConversationProfileRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.session = ""; - object.queryParams = null; - object.queryInput = null; - object.outputAudioConfig = null; - if (options.bytes === String) - object.inputAudio = ""; - else { - object.inputAudio = []; - if (options.bytes !== Array) - object.inputAudio = $util.newBuffer(object.inputAudio); - } - object.outputAudioConfigMask = null; + object.conversationProfile = null; + object.updateMask = null; } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.queryParams != null && message.hasOwnProperty("queryParams")) - object.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.toObject(message.queryParams, options); - if (message.queryInput != null && message.hasOwnProperty("queryInput")) - object.queryInput = $root.google.cloud.dialogflow.v2beta1.QueryInput.toObject(message.queryInput, options); - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) - object.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); - if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) - object.inputAudio = options.bytes === String ? $util.base64.encode(message.inputAudio, 0, message.inputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputAudio) : message.inputAudio; - if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) - object.outputAudioConfigMask = $root.google.protobuf.FieldMask.toObject(message.outputAudioConfigMask, options); + if (message.conversationProfile != null && message.hasOwnProperty("conversationProfile")) + object.conversationProfile = $root.google.cloud.dialogflow.v2beta1.ConversationProfile.toObject(message.conversationProfile, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this DetectIntentRequest to JSON. + * Converts this UpdateConversationProfileRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest * @instance * @returns {Object.} JSON object */ - DetectIntentRequest.prototype.toJSON = function toJSON() { + UpdateConversationProfileRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DetectIntentRequest; + return UpdateConversationProfileRequest; })(); - v2beta1.DetectIntentResponse = (function() { + v2beta1.DeleteConversationProfileRequest = (function() { /** - * Properties of a DetectIntentResponse. + * Properties of a DeleteConversationProfileRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IDetectIntentResponse - * @property {string|null} [responseId] DetectIntentResponse responseId - * @property {google.cloud.dialogflow.v2beta1.IQueryResult|null} [queryResult] DetectIntentResponse queryResult - * @property {Array.|null} [alternativeQueryResults] DetectIntentResponse alternativeQueryResults - * @property {google.rpc.IStatus|null} [webhookStatus] DetectIntentResponse webhookStatus - * @property {Uint8Array|null} [outputAudio] DetectIntentResponse outputAudio - * @property {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null} [outputAudioConfig] DetectIntentResponse outputAudioConfig + * @interface IDeleteConversationProfileRequest + * @property {string|null} [name] DeleteConversationProfileRequest name */ /** - * Constructs a new DetectIntentResponse. + * Constructs a new DeleteConversationProfileRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a DetectIntentResponse. - * @implements IDetectIntentResponse + * @classdesc Represents a DeleteConversationProfileRequest. + * @implements IDeleteConversationProfileRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IDetectIntentResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest=} [properties] Properties to set */ - function DetectIntentResponse(properties) { - this.alternativeQueryResults = []; + function DeleteConversationProfileRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -65012,351 +116350,463 @@ } /** - * DetectIntentResponse responseId. - * @member {string} responseId - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * DeleteConversationProfileRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest * @instance */ - DetectIntentResponse.prototype.responseId = ""; + DeleteConversationProfileRequest.prototype.name = ""; /** - * DetectIntentResponse queryResult. - * @member {google.cloud.dialogflow.v2beta1.IQueryResult|null|undefined} queryResult - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * Creates a new DeleteConversationProfileRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest} DeleteConversationProfileRequest instance + */ + DeleteConversationProfileRequest.create = function create(properties) { + return new DeleteConversationProfileRequest(properties); + }; + + /** + * Encodes the specified DeleteConversationProfileRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest} message DeleteConversationProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConversationProfileRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + return writer; + }; + + /** + * Encodes the specified DeleteConversationProfileRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest} message DeleteConversationProfileRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteConversationProfileRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteConversationProfileRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest} DeleteConversationProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConversationProfileRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteConversationProfileRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest} DeleteConversationProfileRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteConversationProfileRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteConversationProfileRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteConversationProfileRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + return null; + }; + + /** + * Creates a DeleteConversationProfileRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest} DeleteConversationProfileRequest + */ + DeleteConversationProfileRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a DeleteConversationProfileRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest} message DeleteConversationProfileRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteConversationProfileRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + return object; + }; + + /** + * Converts this DeleteConversationProfileRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest * @instance + * @returns {Object.} JSON object */ - DetectIntentResponse.prototype.queryResult = null; + DeleteConversationProfileRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DeleteConversationProfileRequest; + })(); + + v2beta1.Documents = (function() { /** - * DetectIntentResponse alternativeQueryResults. - * @member {Array.} alternativeQueryResults - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * Constructs a new Documents service. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a Documents + * @extends $protobuf.rpc.Service + * @constructor + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + */ + function Documents(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (Documents.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = Documents; + + /** + * Creates new Documents service using the specified rpc implementation. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @static + * @param {$protobuf.RPCImpl} rpcImpl RPC implementation + * @param {boolean} [requestDelimited=false] Whether requests are length-delimited + * @param {boolean} [responseDelimited=false] Whether responses are length-delimited + * @returns {Documents} RPC service. Useful where requests and/or responses are streamed. + */ + Documents.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#listDocuments}. + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @typedef ListDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.ListDocumentsResponse} [response] ListDocumentsResponse + */ + + /** + * Calls ListDocuments. + * @function listDocuments + * @memberof google.cloud.dialogflow.v2beta1.Documents * @instance + * @param {google.cloud.dialogflow.v2beta1.IListDocumentsRequest} request ListDocumentsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Documents.ListDocumentsCallback} callback Node-style callback called with the error, if any, and ListDocumentsResponse + * @returns {undefined} + * @variation 1 */ - DetectIntentResponse.prototype.alternativeQueryResults = $util.emptyArray; + Object.defineProperty(Documents.prototype.listDocuments = function listDocuments(request, callback) { + return this.rpcCall(listDocuments, $root.google.cloud.dialogflow.v2beta1.ListDocumentsRequest, $root.google.cloud.dialogflow.v2beta1.ListDocumentsResponse, request, callback); + }, "name", { value: "ListDocuments" }); /** - * DetectIntentResponse webhookStatus. - * @member {google.rpc.IStatus|null|undefined} webhookStatus - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * Calls ListDocuments. + * @function listDocuments + * @memberof google.cloud.dialogflow.v2beta1.Documents * @instance + * @param {google.cloud.dialogflow.v2beta1.IListDocumentsRequest} request ListDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DetectIntentResponse.prototype.webhookStatus = null; /** - * DetectIntentResponse outputAudio. - * @member {Uint8Array} outputAudio - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#getDocument}. + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @typedef GetDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.dialogflow.v2beta1.Document} [response] Document + */ + + /** + * Calls GetDocument. + * @function getDocument + * @memberof google.cloud.dialogflow.v2beta1.Documents * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetDocumentRequest} request GetDocumentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Documents.GetDocumentCallback} callback Node-style callback called with the error, if any, and Document + * @returns {undefined} + * @variation 1 */ - DetectIntentResponse.prototype.outputAudio = $util.newBuffer([]); + Object.defineProperty(Documents.prototype.getDocument = function getDocument(request, callback) { + return this.rpcCall(getDocument, $root.google.cloud.dialogflow.v2beta1.GetDocumentRequest, $root.google.cloud.dialogflow.v2beta1.Document, request, callback); + }, "name", { value: "GetDocument" }); /** - * DetectIntentResponse outputAudioConfig. - * @member {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null|undefined} outputAudioConfig - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * Calls GetDocument. + * @function getDocument + * @memberof google.cloud.dialogflow.v2beta1.Documents * @instance + * @param {google.cloud.dialogflow.v2beta1.IGetDocumentRequest} request GetDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DetectIntentResponse.prototype.outputAudioConfig = null; /** - * Creates a new DetectIntentResponse instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.IDetectIntentResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.DetectIntentResponse} DetectIntentResponse instance + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#createDocument}. + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @typedef CreateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - DetectIntentResponse.create = function create(properties) { - return new DetectIntentResponse(properties); - }; /** - * Encodes the specified DetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.IDetectIntentResponse} message DetectIntentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls CreateDocument. + * @function createDocument + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateDocumentRequest} request CreateDocumentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Documents.CreateDocumentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Documents.prototype.createDocument = function createDocument(request, callback) { + return this.rpcCall(createDocument, $root.google.cloud.dialogflow.v2beta1.CreateDocumentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateDocument" }); + + /** + * Calls CreateDocument. + * @function createDocument + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @instance + * @param {google.cloud.dialogflow.v2beta1.ICreateDocumentRequest} request CreateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#importDocuments}. + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @typedef ImportDocumentsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls ImportDocuments. + * @function importDocuments + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentsRequest} request ImportDocumentsRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Documents.ImportDocumentsCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Documents.prototype.importDocuments = function importDocuments(request, callback) { + return this.rpcCall(importDocuments, $root.google.cloud.dialogflow.v2beta1.ImportDocumentsRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ImportDocuments" }); + + /** + * Calls ImportDocuments. + * @function importDocuments + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentsRequest} request ImportDocumentsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#deleteDocument}. + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @typedef DeleteDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - DetectIntentResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); - if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) - $root.google.cloud.dialogflow.v2beta1.QueryResult.encode(message.queryResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.webhookStatus != null && Object.hasOwnProperty.call(message, "webhookStatus")) - $root.google.rpc.Status.encode(message.webhookStatus, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.outputAudio != null && Object.hasOwnProperty.call(message, "outputAudio")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.outputAudio); - if (message.alternativeQueryResults != null && message.alternativeQueryResults.length) - for (var i = 0; i < message.alternativeQueryResults.length; ++i) - $root.google.cloud.dialogflow.v2beta1.QueryResult.encode(message.alternativeQueryResults[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) - $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - return writer; - }; /** - * Encodes the specified DetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DetectIntentResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.IDetectIntentResponse} message DetectIntentResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer + * Calls DeleteDocument. + * @function deleteDocument + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Documents.DeleteDocumentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - DetectIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + Object.defineProperty(Documents.prototype.deleteDocument = function deleteDocument(request, callback) { + return this.rpcCall(deleteDocument, $root.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteDocument" }); /** - * Decodes a DetectIntentResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.DetectIntentResponse} DetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Calls DeleteDocument. + * @function deleteDocument + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest} request DeleteDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DetectIntentResponse.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.responseId = reader.string(); - break; - case 2: - message.queryResult = $root.google.cloud.dialogflow.v2beta1.QueryResult.decode(reader, reader.uint32()); - break; - case 5: - if (!(message.alternativeQueryResults && message.alternativeQueryResults.length)) - message.alternativeQueryResults = []; - message.alternativeQueryResults.push($root.google.cloud.dialogflow.v2beta1.QueryResult.decode(reader, reader.uint32())); - break; - case 3: - message.webhookStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 4: - message.outputAudio = reader.bytes(); - break; - case 6: - message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; /** - * Decodes a DetectIntentResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.DetectIntentResponse} DetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#updateDocument}. + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @typedef UpdateDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - DetectIntentResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; /** - * Verifies a DetectIntentResponse message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not + * Calls UpdateDocument. + * @function updateDocument + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Documents.UpdateDocumentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - DetectIntentResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseId != null && message.hasOwnProperty("responseId")) - if (!$util.isString(message.responseId)) - return "responseId: string expected"; - if (message.queryResult != null && message.hasOwnProperty("queryResult")) { - var error = $root.google.cloud.dialogflow.v2beta1.QueryResult.verify(message.queryResult); - if (error) - return "queryResult." + error; - } - if (message.alternativeQueryResults != null && message.hasOwnProperty("alternativeQueryResults")) { - if (!Array.isArray(message.alternativeQueryResults)) - return "alternativeQueryResults: array expected"; - for (var i = 0; i < message.alternativeQueryResults.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.QueryResult.verify(message.alternativeQueryResults[i]); - if (error) - return "alternativeQueryResults." + error; - } - } - if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) { - var error = $root.google.rpc.Status.verify(message.webhookStatus); - if (error) - return "webhookStatus." + error; - } - if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) - if (!(message.outputAudio && typeof message.outputAudio.length === "number" || $util.isString(message.outputAudio))) - return "outputAudio: buffer expected"; - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { - var error = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify(message.outputAudioConfig); - if (error) - return "outputAudioConfig." + error; - } - return null; - }; + Object.defineProperty(Documents.prototype.updateDocument = function updateDocument(request, callback) { + return this.rpcCall(updateDocument, $root.google.cloud.dialogflow.v2beta1.UpdateDocumentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDocument" }); /** - * Creates a DetectIntentResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.DetectIntentResponse} DetectIntentResponse + * Calls UpdateDocument. + * @function updateDocument + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest} request UpdateDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 */ - DetectIntentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.DetectIntentResponse(); - if (object.responseId != null) - message.responseId = String(object.responseId); - if (object.queryResult != null) { - if (typeof object.queryResult !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentResponse.queryResult: object expected"); - message.queryResult = $root.google.cloud.dialogflow.v2beta1.QueryResult.fromObject(object.queryResult); - } - if (object.alternativeQueryResults) { - if (!Array.isArray(object.alternativeQueryResults)) - throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentResponse.alternativeQueryResults: array expected"); - message.alternativeQueryResults = []; - for (var i = 0; i < object.alternativeQueryResults.length; ++i) { - if (typeof object.alternativeQueryResults[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentResponse.alternativeQueryResults: object expected"); - message.alternativeQueryResults[i] = $root.google.cloud.dialogflow.v2beta1.QueryResult.fromObject(object.alternativeQueryResults[i]); - } - } - if (object.webhookStatus != null) { - if (typeof object.webhookStatus !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentResponse.webhookStatus: object expected"); - message.webhookStatus = $root.google.rpc.Status.fromObject(object.webhookStatus); - } - if (object.outputAudio != null) - if (typeof object.outputAudio === "string") - $util.base64.decode(object.outputAudio, message.outputAudio = $util.newBuffer($util.base64.length(object.outputAudio)), 0); - else if (object.outputAudio.length) - message.outputAudio = object.outputAudio; - if (object.outputAudioConfig != null) { - if (typeof object.outputAudioConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.DetectIntentResponse.outputAudioConfig: object expected"); - message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.fromObject(object.outputAudioConfig); - } - return message; - }; /** - * Creates a plain object from a DetectIntentResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse - * @static - * @param {google.cloud.dialogflow.v2beta1.DetectIntentResponse} message DetectIntentResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object + * Callback as used by {@link google.cloud.dialogflow.v2beta1.Documents#reloadDocument}. + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @typedef ReloadDocumentCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation */ - DetectIntentResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.alternativeQueryResults = []; - if (options.defaults) { - object.responseId = ""; - object.queryResult = null; - object.webhookStatus = null; - if (options.bytes === String) - object.outputAudio = ""; - else { - object.outputAudio = []; - if (options.bytes !== Array) - object.outputAudio = $util.newBuffer(object.outputAudio); - } - object.outputAudioConfig = null; - } - if (message.responseId != null && message.hasOwnProperty("responseId")) - object.responseId = message.responseId; - if (message.queryResult != null && message.hasOwnProperty("queryResult")) - object.queryResult = $root.google.cloud.dialogflow.v2beta1.QueryResult.toObject(message.queryResult, options); - if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) - object.webhookStatus = $root.google.rpc.Status.toObject(message.webhookStatus, options); - if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) - object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; - if (message.alternativeQueryResults && message.alternativeQueryResults.length) { - object.alternativeQueryResults = []; - for (var j = 0; j < message.alternativeQueryResults.length; ++j) - object.alternativeQueryResults[j] = $root.google.cloud.dialogflow.v2beta1.QueryResult.toObject(message.alternativeQueryResults[j], options); - } - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) - object.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); - return object; - }; /** - * Converts this DetectIntentResponse to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.DetectIntentResponse + * Calls ReloadDocument. + * @function reloadDocument + * @memberof google.cloud.dialogflow.v2beta1.Documents * @instance - * @returns {Object.} JSON object + * @param {google.cloud.dialogflow.v2beta1.IReloadDocumentRequest} request ReloadDocumentRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.Documents.ReloadDocumentCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 */ - DetectIntentResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Object.defineProperty(Documents.prototype.reloadDocument = function reloadDocument(request, callback) { + return this.rpcCall(reloadDocument, $root.google.cloud.dialogflow.v2beta1.ReloadDocumentRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "ReloadDocument" }); - return DetectIntentResponse; + /** + * Calls ReloadDocument. + * @function reloadDocument + * @memberof google.cloud.dialogflow.v2beta1.Documents + * @instance + * @param {google.cloud.dialogflow.v2beta1.IReloadDocumentRequest} request ReloadDocumentRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return Documents; })(); - v2beta1.QueryParameters = (function() { + v2beta1.Document = (function() { /** - * Properties of a QueryParameters. + * Properties of a Document. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IQueryParameters - * @property {string|null} [timeZone] QueryParameters timeZone - * @property {google.type.ILatLng|null} [geoLocation] QueryParameters geoLocation - * @property {Array.|null} [contexts] QueryParameters contexts - * @property {boolean|null} [resetContexts] QueryParameters resetContexts - * @property {Array.|null} [sessionEntityTypes] QueryParameters sessionEntityTypes - * @property {google.protobuf.IStruct|null} [payload] QueryParameters payload - * @property {Array.|null} [knowledgeBaseNames] QueryParameters knowledgeBaseNames - * @property {google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig|null} [sentimentAnalysisRequestConfig] QueryParameters sentimentAnalysisRequestConfig - * @property {Array.|null} [subAgents] QueryParameters subAgents - * @property {Object.|null} [webhookHeaders] QueryParameters webhookHeaders + * @interface IDocument + * @property {string|null} [name] Document name + * @property {string|null} [displayName] Document displayName + * @property {string|null} [mimeType] Document mimeType + * @property {Array.|null} [knowledgeTypes] Document knowledgeTypes + * @property {string|null} [contentUri] Document contentUri + * @property {string|null} [content] Document content + * @property {Uint8Array|null} [rawContent] Document rawContent + * @property {boolean|null} [enableAutoReload] Document enableAutoReload + * @property {google.cloud.dialogflow.v2beta1.Document.IReloadStatus|null} [latestReloadStatus] Document latestReloadStatus + * @property {Object.|null} [metadata] Document metadata */ /** - * Constructs a new QueryParameters. + * Constructs a new Document. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a QueryParameters. - * @implements IQueryParameters + * @classdesc Represents a Document. + * @implements IDocument * @constructor - * @param {google.cloud.dialogflow.v2beta1.IQueryParameters=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IDocument=} [properties] Properties to set */ - function QueryParameters(properties) { - this.contexts = []; - this.sessionEntityTypes = []; - this.knowledgeBaseNames = []; - this.subAgents = []; - this.webhookHeaders = {}; + function Document(properties) { + this.knowledgeTypes = []; + this.metadata = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -65364,206 +116814,219 @@ } /** - * QueryParameters timeZone. - * @member {string} timeZone - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * Document name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.Document * @instance */ - QueryParameters.prototype.timeZone = ""; + Document.prototype.name = ""; /** - * QueryParameters geoLocation. - * @member {google.type.ILatLng|null|undefined} geoLocation - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * Document displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2beta1.Document * @instance */ - QueryParameters.prototype.geoLocation = null; + Document.prototype.displayName = ""; /** - * QueryParameters contexts. - * @member {Array.} contexts - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * Document mimeType. + * @member {string} mimeType + * @memberof google.cloud.dialogflow.v2beta1.Document * @instance */ - QueryParameters.prototype.contexts = $util.emptyArray; + Document.prototype.mimeType = ""; /** - * QueryParameters resetContexts. - * @member {boolean} resetContexts - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * Document knowledgeTypes. + * @member {Array.} knowledgeTypes + * @memberof google.cloud.dialogflow.v2beta1.Document * @instance */ - QueryParameters.prototype.resetContexts = false; + Document.prototype.knowledgeTypes = $util.emptyArray; /** - * QueryParameters sessionEntityTypes. - * @member {Array.} sessionEntityTypes - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * Document contentUri. + * @member {string} contentUri + * @memberof google.cloud.dialogflow.v2beta1.Document * @instance */ - QueryParameters.prototype.sessionEntityTypes = $util.emptyArray; + Document.prototype.contentUri = ""; /** - * QueryParameters payload. - * @member {google.protobuf.IStruct|null|undefined} payload - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * Document content. + * @member {string} content + * @memberof google.cloud.dialogflow.v2beta1.Document * @instance */ - QueryParameters.prototype.payload = null; + Document.prototype.content = ""; /** - * QueryParameters knowledgeBaseNames. - * @member {Array.} knowledgeBaseNames - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * Document rawContent. + * @member {Uint8Array} rawContent + * @memberof google.cloud.dialogflow.v2beta1.Document * @instance */ - QueryParameters.prototype.knowledgeBaseNames = $util.emptyArray; + Document.prototype.rawContent = $util.newBuffer([]); /** - * QueryParameters sentimentAnalysisRequestConfig. - * @member {google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig|null|undefined} sentimentAnalysisRequestConfig - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * Document enableAutoReload. + * @member {boolean} enableAutoReload + * @memberof google.cloud.dialogflow.v2beta1.Document * @instance */ - QueryParameters.prototype.sentimentAnalysisRequestConfig = null; + Document.prototype.enableAutoReload = false; /** - * QueryParameters subAgents. - * @member {Array.} subAgents - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * Document latestReloadStatus. + * @member {google.cloud.dialogflow.v2beta1.Document.IReloadStatus|null|undefined} latestReloadStatus + * @memberof google.cloud.dialogflow.v2beta1.Document * @instance */ - QueryParameters.prototype.subAgents = $util.emptyArray; + Document.prototype.latestReloadStatus = null; /** - * QueryParameters webhookHeaders. - * @member {Object.} webhookHeaders - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * Document metadata. + * @member {Object.} metadata + * @memberof google.cloud.dialogflow.v2beta1.Document * @instance */ - QueryParameters.prototype.webhookHeaders = $util.emptyObject; + Document.prototype.metadata = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new QueryParameters instance using the specified properties. + * Document source. + * @member {"contentUri"|"content"|"rawContent"|undefined} source + * @memberof google.cloud.dialogflow.v2beta1.Document + * @instance + */ + Object.defineProperty(Document.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["contentUri", "content", "rawContent"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Document instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @memberof google.cloud.dialogflow.v2beta1.Document * @static - * @param {google.cloud.dialogflow.v2beta1.IQueryParameters=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.QueryParameters} QueryParameters instance + * @param {google.cloud.dialogflow.v2beta1.IDocument=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Document} Document instance */ - QueryParameters.create = function create(properties) { - return new QueryParameters(properties); + Document.create = function create(properties) { + return new Document(properties); }; /** - * Encodes the specified QueryParameters message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryParameters.verify|verify} messages. + * Encodes the specified Document message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @memberof google.cloud.dialogflow.v2beta1.Document * @static - * @param {google.cloud.dialogflow.v2beta1.IQueryParameters} message QueryParameters message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IDocument} message Document message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryParameters.encode = function encode(message, writer) { + Document.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.timeZone); - if (message.geoLocation != null && Object.hasOwnProperty.call(message, "geoLocation")) - $root.google.type.LatLng.encode(message.geoLocation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.contexts != null && message.contexts.length) - for (var i = 0; i < message.contexts.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Context.encode(message.contexts[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.resetContexts != null && Object.hasOwnProperty.call(message, "resetContexts")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.resetContexts); - if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) - for (var i = 0; i < message.sessionEntityTypes.length; ++i) - $root.google.cloud.dialogflow.v2beta1.SessionEntityType.encode(message.sessionEntityTypes[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.payload != null && Object.hasOwnProperty.call(message, "payload")) - $root.google.protobuf.Struct.encode(message.payload, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.sentimentAnalysisRequestConfig != null && Object.hasOwnProperty.call(message, "sentimentAnalysisRequestConfig")) - $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.encode(message.sentimentAnalysisRequestConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.knowledgeBaseNames != null && message.knowledgeBaseNames.length) - for (var i = 0; i < message.knowledgeBaseNames.length; ++i) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.knowledgeBaseNames[i]); - if (message.subAgents != null && message.subAgents.length) - for (var i = 0; i < message.subAgents.length; ++i) - $root.google.cloud.dialogflow.v2beta1.SubAgent.encode(message.subAgents[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim(); - if (message.webhookHeaders != null && Object.hasOwnProperty.call(message, "webhookHeaders")) - for (var keys = Object.keys(message.webhookHeaders), i = 0; i < keys.length; ++i) - writer.uint32(/* id 14, wireType 2 =*/114).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.webhookHeaders[keys[i]]).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.mimeType); + if (message.knowledgeTypes != null && message.knowledgeTypes.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.knowledgeTypes.length; ++i) + writer.int32(message.knowledgeTypes[i]); + writer.ldelim(); + } + if (message.contentUri != null && Object.hasOwnProperty.call(message, "contentUri")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.contentUri); + if (message.content != null && Object.hasOwnProperty.call(message, "content")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.content); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 7, wireType 2 =*/58).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); + if (message.rawContent != null && Object.hasOwnProperty.call(message, "rawContent")) + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.rawContent); + if (message.enableAutoReload != null && Object.hasOwnProperty.call(message, "enableAutoReload")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.enableAutoReload); + if (message.latestReloadStatus != null && Object.hasOwnProperty.call(message, "latestReloadStatus")) + $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.encode(message.latestReloadStatus, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); return writer; }; /** - * Encodes the specified QueryParameters message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryParameters.verify|verify} messages. + * Encodes the specified Document message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @memberof google.cloud.dialogflow.v2beta1.Document * @static - * @param {google.cloud.dialogflow.v2beta1.IQueryParameters} message QueryParameters message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IDocument} message Document message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryParameters.encodeDelimited = function encodeDelimited(message, writer) { + Document.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryParameters message from the specified reader or buffer. + * Decodes a Document message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @memberof google.cloud.dialogflow.v2beta1.Document * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.QueryParameters} QueryParameters + * @returns {google.cloud.dialogflow.v2beta1.Document} Document * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryParameters.decode = function decode(reader, length) { + Document.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.QueryParameters(), key, value; + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Document(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.timeZone = reader.string(); + message.name = reader.string(); break; case 2: - message.geoLocation = $root.google.type.LatLng.decode(reader, reader.uint32()); + message.displayName = reader.string(); break; case 3: - if (!(message.contexts && message.contexts.length)) - message.contexts = []; - message.contexts.push($root.google.cloud.dialogflow.v2beta1.Context.decode(reader, reader.uint32())); + message.mimeType = reader.string(); break; case 4: - message.resetContexts = reader.bool(); + if (!(message.knowledgeTypes && message.knowledgeTypes.length)) + message.knowledgeTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.knowledgeTypes.push(reader.int32()); + } else + message.knowledgeTypes.push(reader.int32()); break; case 5: - if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) - message.sessionEntityTypes = []; - message.sessionEntityTypes.push($root.google.cloud.dialogflow.v2beta1.SessionEntityType.decode(reader, reader.uint32())); + message.contentUri = reader.string(); break; case 6: - message.payload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + message.content = reader.string(); break; - case 12: - if (!(message.knowledgeBaseNames && message.knowledgeBaseNames.length)) - message.knowledgeBaseNames = []; - message.knowledgeBaseNames.push(reader.string()); + case 9: + message.rawContent = reader.bytes(); break; - case 10: - message.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.decode(reader, reader.uint32()); + case 11: + message.enableAutoReload = reader.bool(); break; - case 13: - if (!(message.subAgents && message.subAgents.length)) - message.subAgents = []; - message.subAgents.push($root.google.cloud.dialogflow.v2beta1.SubAgent.decode(reader, reader.uint32())); + case 12: + message.latestReloadStatus = $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.decode(reader, reader.uint32()); break; - case 14: - if (message.webhookHeaders === $util.emptyObject) - message.webhookHeaders = {}; + case 7: + if (message.metadata === $util.emptyObject) + message.metadata = {}; var end2 = reader.uint32() + reader.pos; key = ""; value = ""; @@ -65581,7 +117044,7 @@ break; } } - message.webhookHeaders[key] = value; + message.metadata[key] = value; break; default: reader.skipType(tag & 7); @@ -65592,277 +117055,503 @@ }; /** - * Decodes a QueryParameters message from the specified reader or buffer, length delimited. + * Decodes a Document message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @memberof google.cloud.dialogflow.v2beta1.Document * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.QueryParameters} QueryParameters + * @returns {google.cloud.dialogflow.v2beta1.Document} Document * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryParameters.decodeDelimited = function decodeDelimited(reader) { + Document.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryParameters message. + * Verifies a Document message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @memberof google.cloud.dialogflow.v2beta1.Document * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryParameters.verify = function verify(message) { + Document.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - if (message.geoLocation != null && message.hasOwnProperty("geoLocation")) { - var error = $root.google.type.LatLng.verify(message.geoLocation); - if (error) - return "geoLocation." + error; - } - if (message.contexts != null && message.hasOwnProperty("contexts")) { - if (!Array.isArray(message.contexts)) - return "contexts: array expected"; - for (var i = 0; i < message.contexts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Context.verify(message.contexts[i]); - if (error) - return "contexts." + error; - } + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.knowledgeTypes != null && message.hasOwnProperty("knowledgeTypes")) { + if (!Array.isArray(message.knowledgeTypes)) + return "knowledgeTypes: array expected"; + for (var i = 0; i < message.knowledgeTypes.length; ++i) + switch (message.knowledgeTypes[i]) { + default: + return "knowledgeTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } } - if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) - if (typeof message.resetContexts !== "boolean") - return "resetContexts: boolean expected"; - if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { - if (!Array.isArray(message.sessionEntityTypes)) - return "sessionEntityTypes: array expected"; - for (var i = 0; i < message.sessionEntityTypes.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.verify(message.sessionEntityTypes[i]); - if (error) - return "sessionEntityTypes." + error; - } + if (message.contentUri != null && message.hasOwnProperty("contentUri")) { + properties.source = 1; + if (!$util.isString(message.contentUri)) + return "contentUri: string expected"; } - if (message.payload != null && message.hasOwnProperty("payload")) { - var error = $root.google.protobuf.Struct.verify(message.payload); - if (error) - return "payload." + error; + if (message.content != null && message.hasOwnProperty("content")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!$util.isString(message.content)) + return "content: string expected"; } - if (message.knowledgeBaseNames != null && message.hasOwnProperty("knowledgeBaseNames")) { - if (!Array.isArray(message.knowledgeBaseNames)) - return "knowledgeBaseNames: array expected"; - for (var i = 0; i < message.knowledgeBaseNames.length; ++i) - if (!$util.isString(message.knowledgeBaseNames[i])) - return "knowledgeBaseNames: string[] expected"; + if (message.rawContent != null && message.hasOwnProperty("rawContent")) { + if (properties.source === 1) + return "source: multiple values"; + properties.source = 1; + if (!(message.rawContent && typeof message.rawContent.length === "number" || $util.isString(message.rawContent))) + return "rawContent: buffer expected"; } - if (message.sentimentAnalysisRequestConfig != null && message.hasOwnProperty("sentimentAnalysisRequestConfig")) { - var error = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.verify(message.sentimentAnalysisRequestConfig); + if (message.enableAutoReload != null && message.hasOwnProperty("enableAutoReload")) + if (typeof message.enableAutoReload !== "boolean") + return "enableAutoReload: boolean expected"; + if (message.latestReloadStatus != null && message.hasOwnProperty("latestReloadStatus")) { + var error = $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.verify(message.latestReloadStatus); if (error) - return "sentimentAnalysisRequestConfig." + error; - } - if (message.subAgents != null && message.hasOwnProperty("subAgents")) { - if (!Array.isArray(message.subAgents)) - return "subAgents: array expected"; - for (var i = 0; i < message.subAgents.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.SubAgent.verify(message.subAgents[i]); - if (error) - return "subAgents." + error; - } + return "latestReloadStatus." + error; } - if (message.webhookHeaders != null && message.hasOwnProperty("webhookHeaders")) { - if (!$util.isObject(message.webhookHeaders)) - return "webhookHeaders: object expected"; - var key = Object.keys(message.webhookHeaders); + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.webhookHeaders[key[i]])) - return "webhookHeaders: string{k:string} expected"; + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; } return null; }; /** - * Creates a QueryParameters message from a plain object. Also converts values to their respective internal types. + * Creates a Document message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters + * @memberof google.cloud.dialogflow.v2beta1.Document * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.QueryParameters} QueryParameters + * @returns {google.cloud.dialogflow.v2beta1.Document} Document */ - QueryParameters.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.QueryParameters) + Document.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Document) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.QueryParameters(); - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - if (object.geoLocation != null) { - if (typeof object.geoLocation !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.geoLocation: object expected"); - message.geoLocation = $root.google.type.LatLng.fromObject(object.geoLocation); + var message = new $root.google.cloud.dialogflow.v2beta1.Document(); + if (object.name != null) + message.name = String(object.name); + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.knowledgeTypes) { + if (!Array.isArray(object.knowledgeTypes)) + throw TypeError(".google.cloud.dialogflow.v2beta1.Document.knowledgeTypes: array expected"); + message.knowledgeTypes = []; + for (var i = 0; i < object.knowledgeTypes.length; ++i) + switch (object.knowledgeTypes[i]) { + default: + case "KNOWLEDGE_TYPE_UNSPECIFIED": + case 0: + message.knowledgeTypes[i] = 0; + break; + case "FAQ": + case 1: + message.knowledgeTypes[i] = 1; + break; + case "EXTRACTIVE_QA": + case 2: + message.knowledgeTypes[i] = 2; + break; + case "ARTICLE_SUGGESTION": + case 3: + message.knowledgeTypes[i] = 3; + break; + case "SMART_REPLY": + case 4: + message.knowledgeTypes[i] = 4; + break; + } } - if (object.contexts) { - if (!Array.isArray(object.contexts)) - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.contexts: array expected"); - message.contexts = []; - for (var i = 0; i < object.contexts.length; ++i) { - if (typeof object.contexts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.contexts: object expected"); - message.contexts[i] = $root.google.cloud.dialogflow.v2beta1.Context.fromObject(object.contexts[i]); - } + if (object.contentUri != null) + message.contentUri = String(object.contentUri); + if (object.content != null) + message.content = String(object.content); + if (object.rawContent != null) + if (typeof object.rawContent === "string") + $util.base64.decode(object.rawContent, message.rawContent = $util.newBuffer($util.base64.length(object.rawContent)), 0); + else if (object.rawContent.length) + message.rawContent = object.rawContent; + if (object.enableAutoReload != null) + message.enableAutoReload = Boolean(object.enableAutoReload); + if (object.latestReloadStatus != null) { + if (typeof object.latestReloadStatus !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Document.latestReloadStatus: object expected"); + message.latestReloadStatus = $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.fromObject(object.latestReloadStatus); } - if (object.resetContexts != null) - message.resetContexts = Boolean(object.resetContexts); - if (object.sessionEntityTypes) { - if (!Array.isArray(object.sessionEntityTypes)) - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.sessionEntityTypes: array expected"); - message.sessionEntityTypes = []; - for (var i = 0; i < object.sessionEntityTypes.length; ++i) { - if (typeof object.sessionEntityTypes[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.sessionEntityTypes: object expected"); - message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.fromObject(object.sessionEntityTypes[i]); - } + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Document.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); } - if (object.payload != null) { - if (typeof object.payload !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.payload: object expected"); - message.payload = $root.google.protobuf.Struct.fromObject(object.payload); + return message; + }; + + /** + * Creates a plain object from a Document message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Document + * @static + * @param {google.cloud.dialogflow.v2beta1.Document} message Document + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Document.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.knowledgeTypes = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) { + object.name = ""; + object.displayName = ""; + object.mimeType = ""; + object.enableAutoReload = false; + object.latestReloadStatus = null; } - if (object.knowledgeBaseNames) { - if (!Array.isArray(object.knowledgeBaseNames)) - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.knowledgeBaseNames: array expected"); - message.knowledgeBaseNames = []; - for (var i = 0; i < object.knowledgeBaseNames.length; ++i) - message.knowledgeBaseNames[i] = String(object.knowledgeBaseNames[i]); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.knowledgeTypes && message.knowledgeTypes.length) { + object.knowledgeTypes = []; + for (var j = 0; j < message.knowledgeTypes.length; ++j) + object.knowledgeTypes[j] = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Document.KnowledgeType[message.knowledgeTypes[j]] : message.knowledgeTypes[j]; } - if (object.sentimentAnalysisRequestConfig != null) { - if (typeof object.sentimentAnalysisRequestConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.sentimentAnalysisRequestConfig: object expected"); - message.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.fromObject(object.sentimentAnalysisRequestConfig); + if (message.contentUri != null && message.hasOwnProperty("contentUri")) { + object.contentUri = message.contentUri; + if (options.oneofs) + object.source = "contentUri"; } - if (object.subAgents) { - if (!Array.isArray(object.subAgents)) - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.subAgents: array expected"); - message.subAgents = []; - for (var i = 0; i < object.subAgents.length; ++i) { - if (typeof object.subAgents[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.subAgents: object expected"); - message.subAgents[i] = $root.google.cloud.dialogflow.v2beta1.SubAgent.fromObject(object.subAgents[i]); - } + if (message.content != null && message.hasOwnProperty("content")) { + object.content = message.content; + if (options.oneofs) + object.source = "content"; } - if (object.webhookHeaders) { - if (typeof object.webhookHeaders !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryParameters.webhookHeaders: object expected"); - message.webhookHeaders = {}; - for (var keys = Object.keys(object.webhookHeaders), i = 0; i < keys.length; ++i) - message.webhookHeaders[keys[i]] = String(object.webhookHeaders[keys[i]]); + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; } - return message; + if (message.rawContent != null && message.hasOwnProperty("rawContent")) { + object.rawContent = options.bytes === String ? $util.base64.encode(message.rawContent, 0, message.rawContent.length) : options.bytes === Array ? Array.prototype.slice.call(message.rawContent) : message.rawContent; + if (options.oneofs) + object.source = "rawContent"; + } + if (message.enableAutoReload != null && message.hasOwnProperty("enableAutoReload")) + object.enableAutoReload = message.enableAutoReload; + if (message.latestReloadStatus != null && message.hasOwnProperty("latestReloadStatus")) + object.latestReloadStatus = $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus.toObject(message.latestReloadStatus, options); + return object; }; - /** - * Creates a plain object from a QueryParameters message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters - * @static - * @param {google.cloud.dialogflow.v2beta1.QueryParameters} message QueryParameters - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QueryParameters.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.contexts = []; - object.sessionEntityTypes = []; - object.knowledgeBaseNames = []; - object.subAgents = []; - } - if (options.objects || options.defaults) - object.webhookHeaders = {}; - if (options.defaults) { - object.timeZone = ""; - object.geoLocation = null; - object.resetContexts = false; - object.payload = null; - object.sentimentAnalysisRequestConfig = null; - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - if (message.geoLocation != null && message.hasOwnProperty("geoLocation")) - object.geoLocation = $root.google.type.LatLng.toObject(message.geoLocation, options); - if (message.contexts && message.contexts.length) { - object.contexts = []; - for (var j = 0; j < message.contexts.length; ++j) - object.contexts[j] = $root.google.cloud.dialogflow.v2beta1.Context.toObject(message.contexts[j], options); - } - if (message.resetContexts != null && message.hasOwnProperty("resetContexts")) - object.resetContexts = message.resetContexts; - if (message.sessionEntityTypes && message.sessionEntityTypes.length) { - object.sessionEntityTypes = []; - for (var j = 0; j < message.sessionEntityTypes.length; ++j) - object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.toObject(message.sessionEntityTypes[j], options); - } - if (message.payload != null && message.hasOwnProperty("payload")) - object.payload = $root.google.protobuf.Struct.toObject(message.payload, options); - if (message.sentimentAnalysisRequestConfig != null && message.hasOwnProperty("sentimentAnalysisRequestConfig")) - object.sentimentAnalysisRequestConfig = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.toObject(message.sentimentAnalysisRequestConfig, options); - if (message.knowledgeBaseNames && message.knowledgeBaseNames.length) { - object.knowledgeBaseNames = []; - for (var j = 0; j < message.knowledgeBaseNames.length; ++j) - object.knowledgeBaseNames[j] = message.knowledgeBaseNames[j]; - } - if (message.subAgents && message.subAgents.length) { - object.subAgents = []; - for (var j = 0; j < message.subAgents.length; ++j) - object.subAgents[j] = $root.google.cloud.dialogflow.v2beta1.SubAgent.toObject(message.subAgents[j], options); - } - var keys2; - if (message.webhookHeaders && (keys2 = Object.keys(message.webhookHeaders)).length) { - object.webhookHeaders = {}; - for (var j = 0; j < keys2.length; ++j) - object.webhookHeaders[keys2[j]] = message.webhookHeaders[keys2[j]]; - } - return object; - }; + /** + * Converts this Document to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Document + * @instance + * @returns {Object.} JSON object + */ + Document.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + Document.ReloadStatus = (function() { + + /** + * Properties of a ReloadStatus. + * @memberof google.cloud.dialogflow.v2beta1.Document + * @interface IReloadStatus + * @property {google.protobuf.ITimestamp|null} [time] ReloadStatus time + * @property {google.rpc.IStatus|null} [status] ReloadStatus status + */ + + /** + * Constructs a new ReloadStatus. + * @memberof google.cloud.dialogflow.v2beta1.Document + * @classdesc Represents a ReloadStatus. + * @implements IReloadStatus + * @constructor + * @param {google.cloud.dialogflow.v2beta1.Document.IReloadStatus=} [properties] Properties to set + */ + function ReloadStatus(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ReloadStatus time. + * @member {google.protobuf.ITimestamp|null|undefined} time + * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus + * @instance + */ + ReloadStatus.prototype.time = null; + + /** + * ReloadStatus status. + * @member {google.rpc.IStatus|null|undefined} status + * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus + * @instance + */ + ReloadStatus.prototype.status = null; + + /** + * Creates a new ReloadStatus instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus + * @static + * @param {google.cloud.dialogflow.v2beta1.Document.IReloadStatus=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.Document.ReloadStatus} ReloadStatus instance + */ + ReloadStatus.create = function create(properties) { + return new ReloadStatus(properties); + }; + + /** + * Encodes the specified ReloadStatus message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.ReloadStatus.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus + * @static + * @param {google.cloud.dialogflow.v2beta1.Document.IReloadStatus} message ReloadStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReloadStatus.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + $root.google.protobuf.Timestamp.encode(message.time, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + $root.google.rpc.Status.encode(message.status, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ReloadStatus message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Document.ReloadStatus.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus + * @static + * @param {google.cloud.dialogflow.v2beta1.Document.IReloadStatus} message ReloadStatus message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReloadStatus.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReloadStatus message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.Document.ReloadStatus} ReloadStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReloadStatus.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.time = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + case 2: + message.status = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReloadStatus message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.Document.ReloadStatus} ReloadStatus + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReloadStatus.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReloadStatus message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReloadStatus.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.time != null && message.hasOwnProperty("time")) { + var error = $root.google.protobuf.Timestamp.verify(message.time); + if (error) + return "time." + error; + } + if (message.status != null && message.hasOwnProperty("status")) { + var error = $root.google.rpc.Status.verify(message.status); + if (error) + return "status." + error; + } + return null; + }; + + /** + * Creates a ReloadStatus message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.Document.ReloadStatus} ReloadStatus + */ + ReloadStatus.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.Document.ReloadStatus(); + if (object.time != null) { + if (typeof object.time !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Document.ReloadStatus.time: object expected"); + message.time = $root.google.protobuf.Timestamp.fromObject(object.time); + } + if (object.status != null) { + if (typeof object.status !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.Document.ReloadStatus.status: object expected"); + message.status = $root.google.rpc.Status.fromObject(object.status); + } + return message; + }; + + /** + * Creates a plain object from a ReloadStatus message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus + * @static + * @param {google.cloud.dialogflow.v2beta1.Document.ReloadStatus} message ReloadStatus + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReloadStatus.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.time = null; + object.status = null; + } + if (message.time != null && message.hasOwnProperty("time")) + object.time = $root.google.protobuf.Timestamp.toObject(message.time, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = $root.google.rpc.Status.toObject(message.status, options); + return object; + }; + + /** + * Converts this ReloadStatus to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.Document.ReloadStatus + * @instance + * @returns {Object.} JSON object + */ + ReloadStatus.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReloadStatus; + })(); /** - * Converts this QueryParameters to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.QueryParameters - * @instance - * @returns {Object.} JSON object + * KnowledgeType enum. + * @name google.cloud.dialogflow.v2beta1.Document.KnowledgeType + * @enum {number} + * @property {number} KNOWLEDGE_TYPE_UNSPECIFIED=0 KNOWLEDGE_TYPE_UNSPECIFIED value + * @property {number} FAQ=1 FAQ value + * @property {number} EXTRACTIVE_QA=2 EXTRACTIVE_QA value + * @property {number} ARTICLE_SUGGESTION=3 ARTICLE_SUGGESTION value + * @property {number} SMART_REPLY=4 SMART_REPLY value */ - QueryParameters.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + Document.KnowledgeType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KNOWLEDGE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FAQ"] = 1; + values[valuesById[2] = "EXTRACTIVE_QA"] = 2; + values[valuesById[3] = "ARTICLE_SUGGESTION"] = 3; + values[valuesById[4] = "SMART_REPLY"] = 4; + return values; + })(); - return QueryParameters; + return Document; })(); - v2beta1.QueryInput = (function() { + v2beta1.GetDocumentRequest = (function() { /** - * Properties of a QueryInput. + * Properties of a GetDocumentRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IQueryInput - * @property {google.cloud.dialogflow.v2beta1.IInputAudioConfig|null} [audioConfig] QueryInput audioConfig - * @property {google.cloud.dialogflow.v2beta1.ITextInput|null} [text] QueryInput text - * @property {google.cloud.dialogflow.v2beta1.IEventInput|null} [event] QueryInput event + * @interface IGetDocumentRequest + * @property {string|null} [name] GetDocumentRequest name */ /** - * Constructs a new QueryInput. + * Constructs a new GetDocumentRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a QueryInput. - * @implements IQueryInput + * @classdesc Represents a GetDocumentRequest. + * @implements IGetDocumentRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IQueryInput=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IGetDocumentRequest=} [properties] Properties to set */ - function QueryInput(properties) { + function GetDocumentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -65870,115 +117559,75 @@ } /** - * QueryInput audioConfig. - * @member {google.cloud.dialogflow.v2beta1.IInputAudioConfig|null|undefined} audioConfig - * @memberof google.cloud.dialogflow.v2beta1.QueryInput - * @instance - */ - QueryInput.prototype.audioConfig = null; - - /** - * QueryInput text. - * @member {google.cloud.dialogflow.v2beta1.ITextInput|null|undefined} text - * @memberof google.cloud.dialogflow.v2beta1.QueryInput - * @instance - */ - QueryInput.prototype.text = null; - - /** - * QueryInput event. - * @member {google.cloud.dialogflow.v2beta1.IEventInput|null|undefined} event - * @memberof google.cloud.dialogflow.v2beta1.QueryInput - * @instance - */ - QueryInput.prototype.event = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * QueryInput input. - * @member {"audioConfig"|"text"|"event"|undefined} input - * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * GetDocumentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest * @instance */ - Object.defineProperty(QueryInput.prototype, "input", { - get: $util.oneOfGetter($oneOfFields = ["audioConfig", "text", "event"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetDocumentRequest.prototype.name = ""; /** - * Creates a new QueryInput instance using the specified properties. + * Creates a new GetDocumentRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IQueryInput=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.QueryInput} QueryInput instance + * @param {google.cloud.dialogflow.v2beta1.IGetDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GetDocumentRequest} GetDocumentRequest instance */ - QueryInput.create = function create(properties) { - return new QueryInput(properties); + GetDocumentRequest.create = function create(properties) { + return new GetDocumentRequest(properties); }; /** - * Encodes the specified QueryInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryInput.verify|verify} messages. + * Encodes the specified GetDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetDocumentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IQueryInput} message QueryInput message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryInput.encode = function encode(message, writer) { + GetDocumentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.audioConfig != null && Object.hasOwnProperty.call(message, "audioConfig")) - $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.encode(message.audioConfig, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - $root.google.cloud.dialogflow.v2beta1.TextInput.encode(message.text, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.event != null && Object.hasOwnProperty.call(message, "event")) - $root.google.cloud.dialogflow.v2beta1.EventInput.encode(message.event, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified QueryInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryInput.verify|verify} messages. + * Encodes the specified GetDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetDocumentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IQueryInput} message QueryInput message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IGetDocumentRequest} message GetDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryInput.encodeDelimited = function encodeDelimited(message, writer) { + GetDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryInput message from the specified reader or buffer. + * Decodes a GetDocumentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.QueryInput} QueryInput + * @returns {google.cloud.dialogflow.v2beta1.GetDocumentRequest} GetDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryInput.decode = function decode(reader, length) { + GetDocumentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.QueryInput(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetDocumentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.audioConfig = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.decode(reader, reader.uint32()); - break; - case 2: - message.text = $root.google.cloud.dialogflow.v2beta1.TextInput.decode(reader, reader.uint32()); - break; - case 3: - message.event = $root.google.cloud.dialogflow.v2beta1.EventInput.decode(reader, reader.uint32()); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -65989,174 +117638,110 @@ }; /** - * Decodes a QueryInput message from the specified reader or buffer, length delimited. + * Decodes a GetDocumentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.QueryInput} QueryInput + * @returns {google.cloud.dialogflow.v2beta1.GetDocumentRequest} GetDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryInput.decodeDelimited = function decodeDelimited(reader) { + GetDocumentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryInput message. + * Verifies a GetDocumentRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryInput.verify = function verify(message) { + GetDocumentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { - properties.input = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.verify(message.audioConfig); - if (error) - return "audioConfig." + error; - } - } - if (message.text != null && message.hasOwnProperty("text")) { - if (properties.input === 1) - return "input: multiple values"; - properties.input = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.TextInput.verify(message.text); - if (error) - return "text." + error; - } - } - if (message.event != null && message.hasOwnProperty("event")) { - if (properties.input === 1) - return "input: multiple values"; - properties.input = 1; - { - var error = $root.google.cloud.dialogflow.v2beta1.EventInput.verify(message.event); - if (error) - return "event." + error; - } - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a QueryInput message from a plain object. Also converts values to their respective internal types. + * Creates a GetDocumentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.QueryInput} QueryInput + * @returns {google.cloud.dialogflow.v2beta1.GetDocumentRequest} GetDocumentRequest */ - QueryInput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.QueryInput) + GetDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetDocumentRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.QueryInput(); - if (object.audioConfig != null) { - if (typeof object.audioConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryInput.audioConfig: object expected"); - message.audioConfig = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.fromObject(object.audioConfig); - } - if (object.text != null) { - if (typeof object.text !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryInput.text: object expected"); - message.text = $root.google.cloud.dialogflow.v2beta1.TextInput.fromObject(object.text); - } - if (object.event != null) { - if (typeof object.event !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryInput.event: object expected"); - message.event = $root.google.cloud.dialogflow.v2beta1.EventInput.fromObject(object.event); - } + var message = new $root.google.cloud.dialogflow.v2beta1.GetDocumentRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a QueryInput message. Also converts values to other types if specified. + * Creates a plain object from a GetDocumentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.QueryInput} message QueryInput + * @param {google.cloud.dialogflow.v2beta1.GetDocumentRequest} message GetDocumentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryInput.toObject = function toObject(message, options) { + GetDocumentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (message.audioConfig != null && message.hasOwnProperty("audioConfig")) { - object.audioConfig = $root.google.cloud.dialogflow.v2beta1.InputAudioConfig.toObject(message.audioConfig, options); - if (options.oneofs) - object.input = "audioConfig"; - } - if (message.text != null && message.hasOwnProperty("text")) { - object.text = $root.google.cloud.dialogflow.v2beta1.TextInput.toObject(message.text, options); - if (options.oneofs) - object.input = "text"; - } - if (message.event != null && message.hasOwnProperty("event")) { - object.event = $root.google.cloud.dialogflow.v2beta1.EventInput.toObject(message.event, options); - if (options.oneofs) - object.input = "event"; - } + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this QueryInput to JSON. + * Converts this GetDocumentRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.QueryInput + * @memberof google.cloud.dialogflow.v2beta1.GetDocumentRequest * @instance * @returns {Object.} JSON object */ - QueryInput.prototype.toJSON = function toJSON() { + GetDocumentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return QueryInput; + return GetDocumentRequest; })(); - v2beta1.QueryResult = (function() { + v2beta1.ListDocumentsRequest = (function() { /** - * Properties of a QueryResult. + * Properties of a ListDocumentsRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IQueryResult - * @property {string|null} [queryText] QueryResult queryText - * @property {string|null} [languageCode] QueryResult languageCode - * @property {number|null} [speechRecognitionConfidence] QueryResult speechRecognitionConfidence - * @property {string|null} [action] QueryResult action - * @property {google.protobuf.IStruct|null} [parameters] QueryResult parameters - * @property {boolean|null} [allRequiredParamsPresent] QueryResult allRequiredParamsPresent - * @property {string|null} [fulfillmentText] QueryResult fulfillmentText - * @property {Array.|null} [fulfillmentMessages] QueryResult fulfillmentMessages - * @property {string|null} [webhookSource] QueryResult webhookSource - * @property {google.protobuf.IStruct|null} [webhookPayload] QueryResult webhookPayload - * @property {Array.|null} [outputContexts] QueryResult outputContexts - * @property {google.cloud.dialogflow.v2beta1.IIntent|null} [intent] QueryResult intent - * @property {number|null} [intentDetectionConfidence] QueryResult intentDetectionConfidence - * @property {google.protobuf.IStruct|null} [diagnosticInfo] QueryResult diagnosticInfo - * @property {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult|null} [sentimentAnalysisResult] QueryResult sentimentAnalysisResult - * @property {google.cloud.dialogflow.v2beta1.IKnowledgeAnswers|null} [knowledgeAnswers] QueryResult knowledgeAnswers + * @interface IListDocumentsRequest + * @property {string|null} [parent] ListDocumentsRequest parent + * @property {number|null} [pageSize] ListDocumentsRequest pageSize + * @property {string|null} [pageToken] ListDocumentsRequest pageToken + * @property {string|null} [filter] ListDocumentsRequest filter */ /** - * Constructs a new QueryResult. + * Constructs a new ListDocumentsRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a QueryResult. - * @implements IQueryResult + * @classdesc Represents a ListDocumentsRequest. + * @implements IListDocumentsRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IQueryResult=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IListDocumentsRequest=} [properties] Properties to set */ - function QueryResult(properties) { - this.fulfillmentMessages = []; - this.outputContexts = []; + function ListDocumentsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -66164,276 +117749,344 @@ } /** - * QueryResult queryText. - * @member {string} queryText - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * ListDocumentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest * @instance */ - QueryResult.prototype.queryText = ""; + ListDocumentsRequest.prototype.parent = ""; /** - * QueryResult languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * ListDocumentsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest * @instance */ - QueryResult.prototype.languageCode = ""; + ListDocumentsRequest.prototype.pageSize = 0; /** - * QueryResult speechRecognitionConfidence. - * @member {number} speechRecognitionConfidence - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * ListDocumentsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest * @instance */ - QueryResult.prototype.speechRecognitionConfidence = 0; + ListDocumentsRequest.prototype.pageToken = ""; /** - * QueryResult action. - * @member {string} action - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * ListDocumentsRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest * @instance */ - QueryResult.prototype.action = ""; + ListDocumentsRequest.prototype.filter = ""; /** - * QueryResult parameters. - * @member {google.protobuf.IStruct|null|undefined} parameters - * @memberof google.cloud.dialogflow.v2beta1.QueryResult - * @instance + * Creates a new ListDocumentsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListDocumentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsRequest} ListDocumentsRequest instance */ - QueryResult.prototype.parameters = null; + ListDocumentsRequest.create = function create(properties) { + return new ListDocumentsRequest(properties); + }; /** - * QueryResult allRequiredParamsPresent. - * @member {boolean} allRequiredParamsPresent - * @memberof google.cloud.dialogflow.v2beta1.QueryResult - * @instance + * Encodes the specified ListDocumentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - QueryResult.prototype.allRequiredParamsPresent = false; + ListDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); + return writer; + }; /** - * QueryResult fulfillmentText. - * @member {string} fulfillmentText - * @memberof google.cloud.dialogflow.v2beta1.QueryResult - * @instance + * Encodes the specified ListDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.IListDocumentsRequest} message ListDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer */ - QueryResult.prototype.fulfillmentText = ""; + ListDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; /** - * QueryResult fulfillmentMessages. - * @member {Array.} fulfillmentMessages - * @memberof google.cloud.dialogflow.v2beta1.QueryResult - * @instance + * Decodes a ListDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsRequest} ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryResult.prototype.fulfillmentMessages = $util.emptyArray; + ListDocumentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.parent = reader.string(); + break; + case 2: + message.pageSize = reader.int32(); + break; + case 3: + message.pageToken = reader.string(); + break; + case 4: + message.filter = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsRequest} ListDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; /** - * QueryResult webhookSource. - * @member {string} webhookSource - * @memberof google.cloud.dialogflow.v2beta1.QueryResult - * @instance + * Verifies a ListDocumentsRequest message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryResult.prototype.webhookSource = ""; + ListDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + if (!$util.isInteger(message.pageSize)) + return "pageSize: integer expected"; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + if (!$util.isString(message.pageToken)) + return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; + return null; + }; /** - * QueryResult webhookPayload. - * @member {google.protobuf.IStruct|null|undefined} webhookPayload - * @memberof google.cloud.dialogflow.v2beta1.QueryResult - * @instance + * Creates a ListDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsRequest} ListDocumentsRequest */ - QueryResult.prototype.webhookPayload = null; + ListDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListDocumentsRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.ListDocumentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.pageSize != null) + message.pageSize = object.pageSize | 0; + if (object.pageToken != null) + message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); + return message; + }; /** - * QueryResult outputContexts. - * @member {Array.} outputContexts - * @memberof google.cloud.dialogflow.v2beta1.QueryResult - * @instance + * Creates a plain object from a ListDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.ListDocumentsRequest} message ListDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object */ - QueryResult.prototype.outputContexts = $util.emptyArray; + ListDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.pageSize != null && message.hasOwnProperty("pageSize")) + object.pageSize = message.pageSize; + if (message.pageToken != null && message.hasOwnProperty("pageToken")) + object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; + return object; + }; /** - * QueryResult intent. - * @member {google.cloud.dialogflow.v2beta1.IIntent|null|undefined} intent - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * Converts this ListDocumentsRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsRequest * @instance + * @returns {Object.} JSON object */ - QueryResult.prototype.intent = null; + ListDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListDocumentsRequest; + })(); + + v2beta1.ListDocumentsResponse = (function() { /** - * QueryResult intentDetectionConfidence. - * @member {number} intentDetectionConfidence - * @memberof google.cloud.dialogflow.v2beta1.QueryResult - * @instance + * Properties of a ListDocumentsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @interface IListDocumentsResponse + * @property {Array.|null} [documents] ListDocumentsResponse documents + * @property {string|null} [nextPageToken] ListDocumentsResponse nextPageToken */ - QueryResult.prototype.intentDetectionConfidence = 0; /** - * QueryResult diagnosticInfo. - * @member {google.protobuf.IStruct|null|undefined} diagnosticInfo - * @memberof google.cloud.dialogflow.v2beta1.QueryResult - * @instance + * Constructs a new ListDocumentsResponse. + * @memberof google.cloud.dialogflow.v2beta1 + * @classdesc Represents a ListDocumentsResponse. + * @implements IListDocumentsResponse + * @constructor + * @param {google.cloud.dialogflow.v2beta1.IListDocumentsResponse=} [properties] Properties to set */ - QueryResult.prototype.diagnosticInfo = null; + function ListDocumentsResponse(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } /** - * QueryResult sentimentAnalysisResult. - * @member {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult|null|undefined} sentimentAnalysisResult - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * ListDocumentsResponse documents. + * @member {Array.} documents + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse * @instance */ - QueryResult.prototype.sentimentAnalysisResult = null; + ListDocumentsResponse.prototype.documents = $util.emptyArray; /** - * QueryResult knowledgeAnswers. - * @member {google.cloud.dialogflow.v2beta1.IKnowledgeAnswers|null|undefined} knowledgeAnswers - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * ListDocumentsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse * @instance */ - QueryResult.prototype.knowledgeAnswers = null; + ListDocumentsResponse.prototype.nextPageToken = ""; /** - * Creates a new QueryResult instance using the specified properties. + * Creates a new ListDocumentsResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IQueryResult=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.QueryResult} QueryResult instance + * @param {google.cloud.dialogflow.v2beta1.IListDocumentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsResponse} ListDocumentsResponse instance */ - QueryResult.create = function create(properties) { - return new QueryResult(properties); + ListDocumentsResponse.create = function create(properties) { + return new ListDocumentsResponse(properties); }; /** - * Encodes the specified QueryResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryResult.verify|verify} messages. + * Encodes the specified ListDocumentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IQueryResult} message QueryResult message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryResult.encode = function encode(message, writer) { + ListDocumentsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.queryText != null && Object.hasOwnProperty.call(message, "queryText")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.queryText); - if (message.speechRecognitionConfidence != null && Object.hasOwnProperty.call(message, "speechRecognitionConfidence")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.speechRecognitionConfidence); - if (message.action != null && Object.hasOwnProperty.call(message, "action")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.action); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.allRequiredParamsPresent != null && Object.hasOwnProperty.call(message, "allRequiredParamsPresent")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.allRequiredParamsPresent); - if (message.fulfillmentText != null && Object.hasOwnProperty.call(message, "fulfillmentText")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.fulfillmentText); - if (message.fulfillmentMessages != null && message.fulfillmentMessages.length) - for (var i = 0; i < message.fulfillmentMessages.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Intent.Message.encode(message.fulfillmentMessages[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.webhookSource != null && Object.hasOwnProperty.call(message, "webhookSource")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.webhookSource); - if (message.webhookPayload != null && Object.hasOwnProperty.call(message, "webhookPayload")) - $root.google.protobuf.Struct.encode(message.webhookPayload, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.outputContexts != null && message.outputContexts.length) - for (var i = 0; i < message.outputContexts.length; ++i) - $root.google.cloud.dialogflow.v2beta1.Context.encode(message.outputContexts[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.intent != null && Object.hasOwnProperty.call(message, "intent")) - $root.google.cloud.dialogflow.v2beta1.Intent.encode(message.intent, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.intentDetectionConfidence != null && Object.hasOwnProperty.call(message, "intentDetectionConfidence")) - writer.uint32(/* id 12, wireType 5 =*/101).float(message.intentDetectionConfidence); - if (message.diagnosticInfo != null && Object.hasOwnProperty.call(message, "diagnosticInfo")) - $root.google.protobuf.Struct.encode(message.diagnosticInfo, writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.languageCode); - if (message.sentimentAnalysisResult != null && Object.hasOwnProperty.call(message, "sentimentAnalysisResult")) - $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.encode(message.sentimentAnalysisResult, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.knowledgeAnswers != null && Object.hasOwnProperty.call(message, "knowledgeAnswers")) - $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.encode(message.knowledgeAnswers, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + $root.google.cloud.dialogflow.v2beta1.Document.encode(message.documents[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified QueryResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.QueryResult.verify|verify} messages. + * Encodes the specified ListDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListDocumentsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IQueryResult} message QueryResult message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IListDocumentsResponse} message ListDocumentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - QueryResult.encodeDelimited = function encodeDelimited(message, writer) { + ListDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a QueryResult message from the specified reader or buffer. + * Decodes a ListDocumentsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.QueryResult} QueryResult + * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsResponse} ListDocumentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryResult.decode = function decode(reader, length) { + ListDocumentsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.QueryResult(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListDocumentsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.queryText = reader.string(); - break; - case 15: - message.languageCode = reader.string(); + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push($root.google.cloud.dialogflow.v2beta1.Document.decode(reader, reader.uint32())); break; case 2: - message.speechRecognitionConfidence = reader.float(); - break; - case 3: - message.action = reader.string(); - break; - case 4: - message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 5: - message.allRequiredParamsPresent = reader.bool(); - break; - case 6: - message.fulfillmentText = reader.string(); - break; - case 7: - if (!(message.fulfillmentMessages && message.fulfillmentMessages.length)) - message.fulfillmentMessages = []; - message.fulfillmentMessages.push($root.google.cloud.dialogflow.v2beta1.Intent.Message.decode(reader, reader.uint32())); - break; - case 8: - message.webhookSource = reader.string(); - break; - case 9: - message.webhookPayload = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 10: - if (!(message.outputContexts && message.outputContexts.length)) - message.outputContexts = []; - message.outputContexts.push($root.google.cloud.dialogflow.v2beta1.Context.decode(reader, reader.uint32())); - break; - case 11: - message.intent = $root.google.cloud.dialogflow.v2beta1.Intent.decode(reader, reader.uint32()); - break; - case 12: - message.intentDetectionConfidence = reader.float(); - break; - case 14: - message.diagnosticInfo = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 17: - message.sentimentAnalysisResult = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.decode(reader, reader.uint32()); - break; - case 18: - message.knowledgeAnswers = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.decode(reader, reader.uint32()); + message.nextPageToken = reader.string(); break; default: reader.skipType(tag & 7); @@ -66444,295 +118097,135 @@ }; /** - * Decodes a QueryResult message from the specified reader or buffer, length delimited. + * Decodes a ListDocumentsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.QueryResult} QueryResult + * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsResponse} ListDocumentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - QueryResult.decodeDelimited = function decodeDelimited(reader) { + ListDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a QueryResult message. + * Verifies a ListDocumentsResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - QueryResult.verify = function verify(message) { + ListDocumentsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.queryText != null && message.hasOwnProperty("queryText")) - if (!$util.isString(message.queryText)) - return "queryText: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; - if (message.speechRecognitionConfidence != null && message.hasOwnProperty("speechRecognitionConfidence")) - if (typeof message.speechRecognitionConfidence !== "number") - return "speechRecognitionConfidence: number expected"; - if (message.action != null && message.hasOwnProperty("action")) - if (!$util.isString(message.action)) - return "action: string expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - var error = $root.google.protobuf.Struct.verify(message.parameters); - if (error) - return "parameters." + error; - } - if (message.allRequiredParamsPresent != null && message.hasOwnProperty("allRequiredParamsPresent")) - if (typeof message.allRequiredParamsPresent !== "boolean") - return "allRequiredParamsPresent: boolean expected"; - if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) - if (!$util.isString(message.fulfillmentText)) - return "fulfillmentText: string expected"; - if (message.fulfillmentMessages != null && message.hasOwnProperty("fulfillmentMessages")) { - if (!Array.isArray(message.fulfillmentMessages)) - return "fulfillmentMessages: array expected"; - for (var i = 0; i < message.fulfillmentMessages.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.Message.verify(message.fulfillmentMessages[i]); - if (error) - return "fulfillmentMessages." + error; - } - } - if (message.webhookSource != null && message.hasOwnProperty("webhookSource")) - if (!$util.isString(message.webhookSource)) - return "webhookSource: string expected"; - if (message.webhookPayload != null && message.hasOwnProperty("webhookPayload")) { - var error = $root.google.protobuf.Struct.verify(message.webhookPayload); - if (error) - return "webhookPayload." + error; - } - if (message.outputContexts != null && message.hasOwnProperty("outputContexts")) { - if (!Array.isArray(message.outputContexts)) - return "outputContexts: array expected"; - for (var i = 0; i < message.outputContexts.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.Context.verify(message.outputContexts[i]); + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.Document.verify(message.documents[i]); if (error) - return "outputContexts." + error; + return "documents." + error; } } - if (message.intent != null && message.hasOwnProperty("intent")) { - var error = $root.google.cloud.dialogflow.v2beta1.Intent.verify(message.intent); - if (error) - return "intent." + error; - } - if (message.intentDetectionConfidence != null && message.hasOwnProperty("intentDetectionConfidence")) - if (typeof message.intentDetectionConfidence !== "number") - return "intentDetectionConfidence: number expected"; - if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) { - var error = $root.google.protobuf.Struct.verify(message.diagnosticInfo); - if (error) - return "diagnosticInfo." + error; - } - if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) { - var error = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.verify(message.sentimentAnalysisResult); - if (error) - return "sentimentAnalysisResult." + error; - } - if (message.knowledgeAnswers != null && message.hasOwnProperty("knowledgeAnswers")) { - var error = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.verify(message.knowledgeAnswers); - if (error) - return "knowledgeAnswers." + error; - } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; return null; }; /** - * Creates a QueryResult message from a plain object. Also converts values to their respective internal types. + * Creates a ListDocumentsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.QueryResult} QueryResult + * @returns {google.cloud.dialogflow.v2beta1.ListDocumentsResponse} ListDocumentsResponse */ - QueryResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.QueryResult) + ListDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListDocumentsResponse) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.QueryResult(); - if (object.queryText != null) - message.queryText = String(object.queryText); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); - if (object.speechRecognitionConfidence != null) - message.speechRecognitionConfidence = Number(object.speechRecognitionConfidence); - if (object.action != null) - message.action = String(object.action); - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.parameters: object expected"); - message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters); - } - if (object.allRequiredParamsPresent != null) - message.allRequiredParamsPresent = Boolean(object.allRequiredParamsPresent); - if (object.fulfillmentText != null) - message.fulfillmentText = String(object.fulfillmentText); - if (object.fulfillmentMessages) { - if (!Array.isArray(object.fulfillmentMessages)) - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.fulfillmentMessages: array expected"); - message.fulfillmentMessages = []; - for (var i = 0; i < object.fulfillmentMessages.length; ++i) { - if (typeof object.fulfillmentMessages[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.fulfillmentMessages: object expected"); - message.fulfillmentMessages[i] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.fromObject(object.fulfillmentMessages[i]); - } - } - if (object.webhookSource != null) - message.webhookSource = String(object.webhookSource); - if (object.webhookPayload != null) { - if (typeof object.webhookPayload !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.webhookPayload: object expected"); - message.webhookPayload = $root.google.protobuf.Struct.fromObject(object.webhookPayload); - } - if (object.outputContexts) { - if (!Array.isArray(object.outputContexts)) - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.outputContexts: array expected"); - message.outputContexts = []; - for (var i = 0; i < object.outputContexts.length; ++i) { - if (typeof object.outputContexts[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.outputContexts: object expected"); - message.outputContexts[i] = $root.google.cloud.dialogflow.v2beta1.Context.fromObject(object.outputContexts[i]); + var message = new $root.google.cloud.dialogflow.v2beta1.ListDocumentsResponse(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListDocumentsResponse.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) { + if (typeof object.documents[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListDocumentsResponse.documents: object expected"); + message.documents[i] = $root.google.cloud.dialogflow.v2beta1.Document.fromObject(object.documents[i]); } } - if (object.intent != null) { - if (typeof object.intent !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.intent: object expected"); - message.intent = $root.google.cloud.dialogflow.v2beta1.Intent.fromObject(object.intent); - } - if (object.intentDetectionConfidence != null) - message.intentDetectionConfidence = Number(object.intentDetectionConfidence); - if (object.diagnosticInfo != null) { - if (typeof object.diagnosticInfo !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.diagnosticInfo: object expected"); - message.diagnosticInfo = $root.google.protobuf.Struct.fromObject(object.diagnosticInfo); - } - if (object.sentimentAnalysisResult != null) { - if (typeof object.sentimentAnalysisResult !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.sentimentAnalysisResult: object expected"); - message.sentimentAnalysisResult = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.fromObject(object.sentimentAnalysisResult); - } - if (object.knowledgeAnswers != null) { - if (typeof object.knowledgeAnswers !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.QueryResult.knowledgeAnswers: object expected"); - message.knowledgeAnswers = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.fromObject(object.knowledgeAnswers); - } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); return message; }; /** - * Creates a plain object from a QueryResult message. Also converts values to other types if specified. + * Creates a plain object from a ListDocumentsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse * @static - * @param {google.cloud.dialogflow.v2beta1.QueryResult} message QueryResult + * @param {google.cloud.dialogflow.v2beta1.ListDocumentsResponse} message ListDocumentsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - QueryResult.toObject = function toObject(message, options) { + ListDocumentsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) { - object.fulfillmentMessages = []; - object.outputContexts = []; - } - if (options.defaults) { - object.queryText = ""; - object.speechRecognitionConfidence = 0; - object.action = ""; - object.parameters = null; - object.allRequiredParamsPresent = false; - object.fulfillmentText = ""; - object.webhookSource = ""; - object.webhookPayload = null; - object.intent = null; - object.intentDetectionConfidence = 0; - object.diagnosticInfo = null; - object.languageCode = ""; - object.sentimentAnalysisResult = null; - object.knowledgeAnswers = null; - } - if (message.queryText != null && message.hasOwnProperty("queryText")) - object.queryText = message.queryText; - if (message.speechRecognitionConfidence != null && message.hasOwnProperty("speechRecognitionConfidence")) - object.speechRecognitionConfidence = options.json && !isFinite(message.speechRecognitionConfidence) ? String(message.speechRecognitionConfidence) : message.speechRecognitionConfidence; - if (message.action != null && message.hasOwnProperty("action")) - object.action = message.action; - if (message.parameters != null && message.hasOwnProperty("parameters")) - object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); - if (message.allRequiredParamsPresent != null && message.hasOwnProperty("allRequiredParamsPresent")) - object.allRequiredParamsPresent = message.allRequiredParamsPresent; - if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) - object.fulfillmentText = message.fulfillmentText; - if (message.fulfillmentMessages && message.fulfillmentMessages.length) { - object.fulfillmentMessages = []; - for (var j = 0; j < message.fulfillmentMessages.length; ++j) - object.fulfillmentMessages[j] = $root.google.cloud.dialogflow.v2beta1.Intent.Message.toObject(message.fulfillmentMessages[j], options); - } - if (message.webhookSource != null && message.hasOwnProperty("webhookSource")) - object.webhookSource = message.webhookSource; - if (message.webhookPayload != null && message.hasOwnProperty("webhookPayload")) - object.webhookPayload = $root.google.protobuf.Struct.toObject(message.webhookPayload, options); - if (message.outputContexts && message.outputContexts.length) { - object.outputContexts = []; - for (var j = 0; j < message.outputContexts.length; ++j) - object.outputContexts[j] = $root.google.cloud.dialogflow.v2beta1.Context.toObject(message.outputContexts[j], options); + if (options.arrays || options.defaults) + object.documents = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = $root.google.cloud.dialogflow.v2beta1.Document.toObject(message.documents[j], options); } - if (message.intent != null && message.hasOwnProperty("intent")) - object.intent = $root.google.cloud.dialogflow.v2beta1.Intent.toObject(message.intent, options); - if (message.intentDetectionConfidence != null && message.hasOwnProperty("intentDetectionConfidence")) - object.intentDetectionConfidence = options.json && !isFinite(message.intentDetectionConfidence) ? String(message.intentDetectionConfidence) : message.intentDetectionConfidence; - if (message.diagnosticInfo != null && message.hasOwnProperty("diagnosticInfo")) - object.diagnosticInfo = $root.google.protobuf.Struct.toObject(message.diagnosticInfo, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; - if (message.sentimentAnalysisResult != null && message.hasOwnProperty("sentimentAnalysisResult")) - object.sentimentAnalysisResult = $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.toObject(message.sentimentAnalysisResult, options); - if (message.knowledgeAnswers != null && message.hasOwnProperty("knowledgeAnswers")) - object.knowledgeAnswers = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.toObject(message.knowledgeAnswers, options); + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; return object; }; /** - * Converts this QueryResult to JSON. + * Converts this ListDocumentsResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.QueryResult + * @memberof google.cloud.dialogflow.v2beta1.ListDocumentsResponse * @instance * @returns {Object.} JSON object */ - QueryResult.prototype.toJSON = function toJSON() { + ListDocumentsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return QueryResult; + return ListDocumentsResponse; })(); - v2beta1.KnowledgeAnswers = (function() { + v2beta1.CreateDocumentRequest = (function() { /** - * Properties of a KnowledgeAnswers. + * Properties of a CreateDocumentRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IKnowledgeAnswers - * @property {Array.|null} [answers] KnowledgeAnswers answers + * @interface ICreateDocumentRequest + * @property {string|null} [parent] CreateDocumentRequest parent + * @property {google.cloud.dialogflow.v2beta1.IDocument|null} [document] CreateDocumentRequest document + * @property {boolean|null} [importGcsCustomMetadata] CreateDocumentRequest importGcsCustomMetadata */ /** - * Constructs a new KnowledgeAnswers. + * Constructs a new CreateDocumentRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a KnowledgeAnswers. - * @implements IKnowledgeAnswers + * @classdesc Represents a CreateDocumentRequest. + * @implements ICreateDocumentRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IKnowledgeAnswers=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.ICreateDocumentRequest=} [properties] Properties to set */ - function KnowledgeAnswers(properties) { - this.answers = []; + function CreateDocumentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -66740,78 +118233,101 @@ } /** - * KnowledgeAnswers answers. - * @member {Array.} answers - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * CreateDocumentRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest * @instance */ - KnowledgeAnswers.prototype.answers = $util.emptyArray; + CreateDocumentRequest.prototype.parent = ""; /** - * Creates a new KnowledgeAnswers instance using the specified properties. + * CreateDocumentRequest document. + * @member {google.cloud.dialogflow.v2beta1.IDocument|null|undefined} document + * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.document = null; + + /** + * CreateDocumentRequest importGcsCustomMetadata. + * @member {boolean} importGcsCustomMetadata + * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @instance + */ + CreateDocumentRequest.prototype.importGcsCustomMetadata = false; + + /** + * Creates a new CreateDocumentRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IKnowledgeAnswers=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers} KnowledgeAnswers instance + * @param {google.cloud.dialogflow.v2beta1.ICreateDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CreateDocumentRequest} CreateDocumentRequest instance */ - KnowledgeAnswers.create = function create(properties) { - return new KnowledgeAnswers(properties); + CreateDocumentRequest.create = function create(properties) { + return new CreateDocumentRequest(properties); }; /** - * Encodes the specified KnowledgeAnswers message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.verify|verify} messages. + * Encodes the specified CreateDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateDocumentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IKnowledgeAnswers} message KnowledgeAnswers message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KnowledgeAnswers.encode = function encode(message, writer) { + CreateDocumentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.answers != null && message.answers.length) - for (var i = 0; i < message.answers.length; ++i) - $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.encode(message.answers[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.dialogflow.v2beta1.Document.encode(message.document, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.importGcsCustomMetadata != null && Object.hasOwnProperty.call(message, "importGcsCustomMetadata")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.importGcsCustomMetadata); return writer; }; /** - * Encodes the specified KnowledgeAnswers message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.verify|verify} messages. + * Encodes the specified CreateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateDocumentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IKnowledgeAnswers} message KnowledgeAnswers message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.ICreateDocumentRequest} message CreateDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - KnowledgeAnswers.encodeDelimited = function encodeDelimited(message, writer) { + CreateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a KnowledgeAnswers message from the specified reader or buffer. + * Decodes a CreateDocumentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers} KnowledgeAnswers + * @returns {google.cloud.dialogflow.v2beta1.CreateDocumentRequest} CreateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - KnowledgeAnswers.decode = function decode(reader, length) { + CreateDocumentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateDocumentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.answers && message.answers.length)) - message.answers = []; - message.answers.push($root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.decode(reader, reader.uint32())); + message.parent = reader.string(); + break; + case 2: + message.document = $root.google.cloud.dialogflow.v2beta1.Document.decode(reader, reader.uint32()); + break; + case 3: + message.importGcsCustomMetadata = reader.bool(); break; default: reader.skipType(tag & 7); @@ -66822,447 +118338,132 @@ }; /** - * Decodes a KnowledgeAnswers message from the specified reader or buffer, length delimited. + * Decodes a CreateDocumentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers} KnowledgeAnswers + * @returns {google.cloud.dialogflow.v2beta1.CreateDocumentRequest} CreateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - KnowledgeAnswers.decodeDelimited = function decodeDelimited(reader) { + CreateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a KnowledgeAnswers message. + * Verifies a CreateDocumentRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - KnowledgeAnswers.verify = function verify(message) { + CreateDocumentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.answers != null && message.hasOwnProperty("answers")) { - if (!Array.isArray(message.answers)) - return "answers: array expected"; - for (var i = 0; i < message.answers.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.verify(message.answers[i]); - if (error) - return "answers." + error; - } + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.dialogflow.v2beta1.Document.verify(message.document); + if (error) + return "document." + error; } + if (message.importGcsCustomMetadata != null && message.hasOwnProperty("importGcsCustomMetadata")) + if (typeof message.importGcsCustomMetadata !== "boolean") + return "importGcsCustomMetadata: boolean expected"; return null; }; /** - * Creates a KnowledgeAnswers message from a plain object. Also converts values to their respective internal types. + * Creates a CreateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers + * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers} KnowledgeAnswers - */ - KnowledgeAnswers.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers(); - if (object.answers) { - if (!Array.isArray(object.answers)) - throw TypeError(".google.cloud.dialogflow.v2beta1.KnowledgeAnswers.answers: array expected"); - message.answers = []; - for (var i = 0; i < object.answers.length; ++i) { - if (typeof object.answers[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.KnowledgeAnswers.answers: object expected"); - message.answers[i] = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.fromObject(object.answers[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a KnowledgeAnswers message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers - * @static - * @param {google.cloud.dialogflow.v2beta1.KnowledgeAnswers} message KnowledgeAnswers - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - KnowledgeAnswers.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.answers = []; - if (message.answers && message.answers.length) { - object.answers = []; - for (var j = 0; j < message.answers.length; ++j) - object.answers[j] = $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.toObject(message.answers[j], options); - } - return object; - }; - - /** - * Converts this KnowledgeAnswers to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers - * @instance - * @returns {Object.} JSON object + * @returns {google.cloud.dialogflow.v2beta1.CreateDocumentRequest} CreateDocumentRequest */ - KnowledgeAnswers.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - KnowledgeAnswers.Answer = (function() { - - /** - * Properties of an Answer. - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers - * @interface IAnswer - * @property {string|null} [source] Answer source - * @property {string|null} [faqQuestion] Answer faqQuestion - * @property {string|null} [answer] Answer answer - * @property {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel|null} [matchConfidenceLevel] Answer matchConfidenceLevel - * @property {number|null} [matchConfidence] Answer matchConfidence - */ - - /** - * Constructs a new Answer. - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers - * @classdesc Represents an Answer. - * @implements IAnswer - * @constructor - * @param {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer=} [properties] Properties to set - */ - function Answer(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Answer source. - * @member {string} source - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @instance - */ - Answer.prototype.source = ""; - - /** - * Answer faqQuestion. - * @member {string} faqQuestion - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @instance - */ - Answer.prototype.faqQuestion = ""; - - /** - * Answer answer. - * @member {string} answer - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @instance - */ - Answer.prototype.answer = ""; - - /** - * Answer matchConfidenceLevel. - * @member {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel} matchConfidenceLevel - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @instance - */ - Answer.prototype.matchConfidenceLevel = 0; - - /** - * Answer matchConfidence. - * @member {number} matchConfidence - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @instance - */ - Answer.prototype.matchConfidence = 0; - - /** - * Creates a new Answer instance using the specified properties. - * @function create - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @static - * @param {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer} Answer instance - */ - Answer.create = function create(properties) { - return new Answer(properties); - }; - - /** - * Encodes the specified Answer message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.verify|verify} messages. - * @function encode - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @static - * @param {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer} message Answer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Answer.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.source); - if (message.faqQuestion != null && Object.hasOwnProperty.call(message, "faqQuestion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.faqQuestion); - if (message.answer != null && Object.hasOwnProperty.call(message, "answer")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.answer); - if (message.matchConfidenceLevel != null && Object.hasOwnProperty.call(message, "matchConfidenceLevel")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.matchConfidenceLevel); - if (message.matchConfidence != null && Object.hasOwnProperty.call(message, "matchConfidence")) - writer.uint32(/* id 5, wireType 5 =*/45).float(message.matchConfidence); - return writer; - }; - - /** - * Encodes the specified Answer message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @static - * @param {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.IAnswer} message Answer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Answer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Answer message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer} Answer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Answer.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.source = reader.string(); - break; - case 2: - message.faqQuestion = reader.string(); - break; - case 3: - message.answer = reader.string(); - break; - case 4: - message.matchConfidenceLevel = reader.int32(); - break; - case 5: - message.matchConfidence = reader.float(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Answer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer} Answer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Answer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Answer message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Answer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.source != null && message.hasOwnProperty("source")) - if (!$util.isString(message.source)) - return "source: string expected"; - if (message.faqQuestion != null && message.hasOwnProperty("faqQuestion")) - if (!$util.isString(message.faqQuestion)) - return "faqQuestion: string expected"; - if (message.answer != null && message.hasOwnProperty("answer")) - if (!$util.isString(message.answer)) - return "answer: string expected"; - if (message.matchConfidenceLevel != null && message.hasOwnProperty("matchConfidenceLevel")) - switch (message.matchConfidenceLevel) { - default: - return "matchConfidenceLevel: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.matchConfidence != null && message.hasOwnProperty("matchConfidence")) - if (typeof message.matchConfidence !== "number") - return "matchConfidence: number expected"; - return null; - }; - - /** - * Creates an Answer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer} Answer - */ - Answer.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer) - return object; - var message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer(); - if (object.source != null) - message.source = String(object.source); - if (object.faqQuestion != null) - message.faqQuestion = String(object.faqQuestion); - if (object.answer != null) - message.answer = String(object.answer); - switch (object.matchConfidenceLevel) { - case "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED": - case 0: - message.matchConfidenceLevel = 0; - break; - case "LOW": - case 1: - message.matchConfidenceLevel = 1; - break; - case "MEDIUM": - case 2: - message.matchConfidenceLevel = 2; - break; - case "HIGH": - case 3: - message.matchConfidenceLevel = 3; - break; - } - if (object.matchConfidence != null) - message.matchConfidence = Number(object.matchConfidence); - return message; - }; - - /** - * Creates a plain object from an Answer message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @static - * @param {google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer} message Answer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Answer.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.source = ""; - object.faqQuestion = ""; - object.answer = ""; - object.matchConfidenceLevel = options.enums === String ? "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED" : 0; - object.matchConfidence = 0; - } - if (message.source != null && message.hasOwnProperty("source")) - object.source = message.source; - if (message.faqQuestion != null && message.hasOwnProperty("faqQuestion")) - object.faqQuestion = message.faqQuestion; - if (message.answer != null && message.hasOwnProperty("answer")) - object.answer = message.answer; - if (message.matchConfidenceLevel != null && message.hasOwnProperty("matchConfidenceLevel")) - object.matchConfidenceLevel = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel[message.matchConfidenceLevel] : message.matchConfidenceLevel; - if (message.matchConfidence != null && message.hasOwnProperty("matchConfidence")) - object.matchConfidence = options.json && !isFinite(message.matchConfidence) ? String(message.matchConfidence) : message.matchConfidence; - return object; - }; - - /** - * Converts this Answer to JSON. - * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer - * @instance - * @returns {Object.} JSON object - */ - Answer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + CreateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateDocumentRequest) + return object; + var message = new $root.google.cloud.dialogflow.v2beta1.CreateDocumentRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CreateDocumentRequest.document: object expected"); + message.document = $root.google.cloud.dialogflow.v2beta1.Document.fromObject(object.document); + } + if (object.importGcsCustomMetadata != null) + message.importGcsCustomMetadata = Boolean(object.importGcsCustomMetadata); + return message; + }; - /** - * MatchConfidenceLevel enum. - * @name google.cloud.dialogflow.v2beta1.KnowledgeAnswers.Answer.MatchConfidenceLevel - * @enum {number} - * @property {number} MATCH_CONFIDENCE_LEVEL_UNSPECIFIED=0 MATCH_CONFIDENCE_LEVEL_UNSPECIFIED value - * @property {number} LOW=1 LOW value - * @property {number} MEDIUM=2 MEDIUM value - * @property {number} HIGH=3 HIGH value - */ - Answer.MatchConfidenceLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "LOW"] = 1; - values[valuesById[2] = "MEDIUM"] = 2; - values[valuesById[3] = "HIGH"] = 3; - return values; - })(); + /** + * Creates a plain object from a CreateDocumentRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @static + * @param {google.cloud.dialogflow.v2beta1.CreateDocumentRequest} message CreateDocumentRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateDocumentRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.document = null; + object.importGcsCustomMetadata = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.dialogflow.v2beta1.Document.toObject(message.document, options); + if (message.importGcsCustomMetadata != null && message.hasOwnProperty("importGcsCustomMetadata")) + object.importGcsCustomMetadata = message.importGcsCustomMetadata; + return object; + }; - return Answer; - })(); + /** + * Converts this CreateDocumentRequest to JSON. + * @function toJSON + * @memberof google.cloud.dialogflow.v2beta1.CreateDocumentRequest + * @instance + * @returns {Object.} JSON object + */ + CreateDocumentRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - return KnowledgeAnswers; + return CreateDocumentRequest; })(); - v2beta1.StreamingDetectIntentRequest = (function() { + v2beta1.ImportDocumentsRequest = (function() { /** - * Properties of a StreamingDetectIntentRequest. + * Properties of an ImportDocumentsRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IStreamingDetectIntentRequest - * @property {string|null} [session] StreamingDetectIntentRequest session - * @property {google.cloud.dialogflow.v2beta1.IQueryParameters|null} [queryParams] StreamingDetectIntentRequest queryParams - * @property {google.cloud.dialogflow.v2beta1.IQueryInput|null} [queryInput] StreamingDetectIntentRequest queryInput - * @property {boolean|null} [singleUtterance] StreamingDetectIntentRequest singleUtterance - * @property {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null} [outputAudioConfig] StreamingDetectIntentRequest outputAudioConfig - * @property {google.protobuf.IFieldMask|null} [outputAudioConfigMask] StreamingDetectIntentRequest outputAudioConfigMask - * @property {Uint8Array|null} [inputAudio] StreamingDetectIntentRequest inputAudio + * @interface IImportDocumentsRequest + * @property {string|null} [parent] ImportDocumentsRequest parent + * @property {google.cloud.dialogflow.v2beta1.IGcsSources|null} [gcsSource] ImportDocumentsRequest gcsSource + * @property {google.cloud.dialogflow.v2beta1.IImportDocumentTemplate|null} [documentTemplate] ImportDocumentsRequest documentTemplate + * @property {boolean|null} [importGcsCustomMetadata] ImportDocumentsRequest importGcsCustomMetadata */ /** - * Constructs a new StreamingDetectIntentRequest. + * Constructs a new ImportDocumentsRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a StreamingDetectIntentRequest. - * @implements IStreamingDetectIntentRequest + * @classdesc Represents an ImportDocumentsRequest. + * @implements IImportDocumentsRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentsRequest=} [properties] Properties to set */ - function StreamingDetectIntentRequest(properties) { + function ImportDocumentsRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67270,153 +118471,128 @@ } /** - * StreamingDetectIntentRequest session. - * @member {string} session - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest - * @instance - */ - StreamingDetectIntentRequest.prototype.session = ""; - - /** - * StreamingDetectIntentRequest queryParams. - * @member {google.cloud.dialogflow.v2beta1.IQueryParameters|null|undefined} queryParams - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * ImportDocumentsRequest parent. + * @member {string} parent + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @instance */ - StreamingDetectIntentRequest.prototype.queryParams = null; + ImportDocumentsRequest.prototype.parent = ""; /** - * StreamingDetectIntentRequest queryInput. - * @member {google.cloud.dialogflow.v2beta1.IQueryInput|null|undefined} queryInput - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * ImportDocumentsRequest gcsSource. + * @member {google.cloud.dialogflow.v2beta1.IGcsSources|null|undefined} gcsSource + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @instance */ - StreamingDetectIntentRequest.prototype.queryInput = null; + ImportDocumentsRequest.prototype.gcsSource = null; /** - * StreamingDetectIntentRequest singleUtterance. - * @member {boolean} singleUtterance - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * ImportDocumentsRequest documentTemplate. + * @member {google.cloud.dialogflow.v2beta1.IImportDocumentTemplate|null|undefined} documentTemplate + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @instance */ - StreamingDetectIntentRequest.prototype.singleUtterance = false; + ImportDocumentsRequest.prototype.documentTemplate = null; /** - * StreamingDetectIntentRequest outputAudioConfig. - * @member {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null|undefined} outputAudioConfig - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * ImportDocumentsRequest importGcsCustomMetadata. + * @member {boolean} importGcsCustomMetadata + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @instance */ - StreamingDetectIntentRequest.prototype.outputAudioConfig = null; + ImportDocumentsRequest.prototype.importGcsCustomMetadata = false; - /** - * StreamingDetectIntentRequest outputAudioConfigMask. - * @member {google.protobuf.IFieldMask|null|undefined} outputAudioConfigMask - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest - * @instance - */ - StreamingDetectIntentRequest.prototype.outputAudioConfigMask = null; + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * StreamingDetectIntentRequest inputAudio. - * @member {Uint8Array} inputAudio - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * ImportDocumentsRequest source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @instance */ - StreamingDetectIntentRequest.prototype.inputAudio = $util.newBuffer([]); + Object.defineProperty(ImportDocumentsRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); /** - * Creates a new StreamingDetectIntentRequest instance using the specified properties. + * Creates a new ImportDocumentsRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest} StreamingDetectIntentRequest instance + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentsRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ImportDocumentsRequest} ImportDocumentsRequest instance */ - StreamingDetectIntentRequest.create = function create(properties) { - return new StreamingDetectIntentRequest(properties); + ImportDocumentsRequest.create = function create(properties) { + return new ImportDocumentsRequest(properties); }; /** - * Encodes the specified StreamingDetectIntentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.verify|verify} messages. + * Encodes the specified ImportDocumentsRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportDocumentsRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest} message StreamingDetectIntentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentsRequest} message ImportDocumentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StreamingDetectIntentRequest.encode = function encode(message, writer) { + ImportDocumentsRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.session != null && Object.hasOwnProperty.call(message, "session")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.session); - if (message.queryParams != null && Object.hasOwnProperty.call(message, "queryParams")) - $root.google.cloud.dialogflow.v2beta1.QueryParameters.encode(message.queryParams, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.queryInput != null && Object.hasOwnProperty.call(message, "queryInput")) - $root.google.cloud.dialogflow.v2beta1.QueryInput.encode(message.queryInput, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.singleUtterance != null && Object.hasOwnProperty.call(message, "singleUtterance")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.singleUtterance); - if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) - $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.inputAudio != null && Object.hasOwnProperty.call(message, "inputAudio")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.inputAudio); - if (message.outputAudioConfigMask != null && Object.hasOwnProperty.call(message, "outputAudioConfigMask")) - $root.google.protobuf.FieldMask.encode(message.outputAudioConfigMask, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.dialogflow.v2beta1.GcsSources.encode(message.gcsSource, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.documentTemplate != null && Object.hasOwnProperty.call(message, "documentTemplate")) + $root.google.cloud.dialogflow.v2beta1.ImportDocumentTemplate.encode(message.documentTemplate, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.importGcsCustomMetadata != null && Object.hasOwnProperty.call(message, "importGcsCustomMetadata")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.importGcsCustomMetadata); return writer; }; /** - * Encodes the specified StreamingDetectIntentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.verify|verify} messages. + * Encodes the specified ImportDocumentsRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportDocumentsRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentRequest} message StreamingDetectIntentRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentsRequest} message ImportDocumentsRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StreamingDetectIntentRequest.encodeDelimited = function encodeDelimited(message, writer) { + ImportDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer. + * Decodes an ImportDocumentsRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest} StreamingDetectIntentRequest + * @returns {google.cloud.dialogflow.v2beta1.ImportDocumentsRequest} ImportDocumentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StreamingDetectIntentRequest.decode = function decode(reader, length) { + ImportDocumentsRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ImportDocumentsRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.session = reader.string(); + message.parent = reader.string(); break; case 2: - message.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.decode(reader, reader.uint32()); + message.gcsSource = $root.google.cloud.dialogflow.v2beta1.GcsSources.decode(reader, reader.uint32()); break; case 3: - message.queryInput = $root.google.cloud.dialogflow.v2beta1.QueryInput.decode(reader, reader.uint32()); + message.documentTemplate = $root.google.cloud.dialogflow.v2beta1.ImportDocumentTemplate.decode(reader, reader.uint32()); break; case 4: - message.singleUtterance = reader.bool(); - break; - case 5: - message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.decode(reader, reader.uint32()); - break; - case 7: - message.outputAudioConfigMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - case 6: - message.inputAudio = reader.bytes(); + message.importGcsCustomMetadata = reader.bool(); break; default: reader.skipType(tag & 7); @@ -67427,192 +118603,152 @@ }; /** - * Decodes a StreamingDetectIntentRequest message from the specified reader or buffer, length delimited. + * Decodes an ImportDocumentsRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest} StreamingDetectIntentRequest + * @returns {google.cloud.dialogflow.v2beta1.ImportDocumentsRequest} ImportDocumentsRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StreamingDetectIntentRequest.decodeDelimited = function decodeDelimited(reader) { + ImportDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StreamingDetectIntentRequest message. + * Verifies an ImportDocumentsRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StreamingDetectIntentRequest.verify = function verify(message) { + ImportDocumentsRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.session != null && message.hasOwnProperty("session")) - if (!$util.isString(message.session)) - return "session: string expected"; - if (message.queryParams != null && message.hasOwnProperty("queryParams")) { - var error = $root.google.cloud.dialogflow.v2beta1.QueryParameters.verify(message.queryParams); - if (error) - return "queryParams." + error; - } - if (message.queryInput != null && message.hasOwnProperty("queryInput")) { - var error = $root.google.cloud.dialogflow.v2beta1.QueryInput.verify(message.queryInput); - if (error) - return "queryInput." + error; - } - if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) - if (typeof message.singleUtterance !== "boolean") - return "singleUtterance: boolean expected"; - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { - var error = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify(message.outputAudioConfig); - if (error) - return "outputAudioConfig." + error; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.GcsSources.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } } - if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.outputAudioConfigMask); + if (message.documentTemplate != null && message.hasOwnProperty("documentTemplate")) { + var error = $root.google.cloud.dialogflow.v2beta1.ImportDocumentTemplate.verify(message.documentTemplate); if (error) - return "outputAudioConfigMask." + error; + return "documentTemplate." + error; } - if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) - if (!(message.inputAudio && typeof message.inputAudio.length === "number" || $util.isString(message.inputAudio))) - return "inputAudio: buffer expected"; + if (message.importGcsCustomMetadata != null && message.hasOwnProperty("importGcsCustomMetadata")) + if (typeof message.importGcsCustomMetadata !== "boolean") + return "importGcsCustomMetadata: boolean expected"; return null; }; /** - * Creates a StreamingDetectIntentRequest message from a plain object. Also converts values to their respective internal types. + * Creates an ImportDocumentsRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest} StreamingDetectIntentRequest + * @returns {google.cloud.dialogflow.v2beta1.ImportDocumentsRequest} ImportDocumentsRequest */ - StreamingDetectIntentRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest) + ImportDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ImportDocumentsRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest(); - if (object.session != null) - message.session = String(object.session); - if (object.queryParams != null) { - if (typeof object.queryParams !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.queryParams: object expected"); - message.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.fromObject(object.queryParams); - } - if (object.queryInput != null) { - if (typeof object.queryInput !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.queryInput: object expected"); - message.queryInput = $root.google.cloud.dialogflow.v2beta1.QueryInput.fromObject(object.queryInput); - } - if (object.singleUtterance != null) - message.singleUtterance = Boolean(object.singleUtterance); - if (object.outputAudioConfig != null) { - if (typeof object.outputAudioConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.outputAudioConfig: object expected"); - message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.fromObject(object.outputAudioConfig); + var message = new $root.google.cloud.dialogflow.v2beta1.ImportDocumentsRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ImportDocumentsRequest.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.dialogflow.v2beta1.GcsSources.fromObject(object.gcsSource); } - if (object.outputAudioConfigMask != null) { - if (typeof object.outputAudioConfigMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest.outputAudioConfigMask: object expected"); - message.outputAudioConfigMask = $root.google.protobuf.FieldMask.fromObject(object.outputAudioConfigMask); + if (object.documentTemplate != null) { + if (typeof object.documentTemplate !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ImportDocumentsRequest.documentTemplate: object expected"); + message.documentTemplate = $root.google.cloud.dialogflow.v2beta1.ImportDocumentTemplate.fromObject(object.documentTemplate); } - if (object.inputAudio != null) - if (typeof object.inputAudio === "string") - $util.base64.decode(object.inputAudio, message.inputAudio = $util.newBuffer($util.base64.length(object.inputAudio)), 0); - else if (object.inputAudio.length) - message.inputAudio = object.inputAudio; + if (object.importGcsCustomMetadata != null) + message.importGcsCustomMetadata = Boolean(object.importGcsCustomMetadata); return message; }; /** - * Creates a plain object from a StreamingDetectIntentRequest message. Also converts values to other types if specified. + * Creates a plain object from an ImportDocumentsRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @static - * @param {google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest} message StreamingDetectIntentRequest + * @param {google.cloud.dialogflow.v2beta1.ImportDocumentsRequest} message ImportDocumentsRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StreamingDetectIntentRequest.toObject = function toObject(message, options) { + ImportDocumentsRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.session = ""; - object.queryParams = null; - object.queryInput = null; - object.singleUtterance = false; - object.outputAudioConfig = null; - if (options.bytes === String) - object.inputAudio = ""; - else { - object.inputAudio = []; - if (options.bytes !== Array) - object.inputAudio = $util.newBuffer(object.inputAudio); - } - object.outputAudioConfigMask = null; + object.parent = ""; + object.documentTemplate = null; + object.importGcsCustomMetadata = false; } - if (message.session != null && message.hasOwnProperty("session")) - object.session = message.session; - if (message.queryParams != null && message.hasOwnProperty("queryParams")) - object.queryParams = $root.google.cloud.dialogflow.v2beta1.QueryParameters.toObject(message.queryParams, options); - if (message.queryInput != null && message.hasOwnProperty("queryInput")) - object.queryInput = $root.google.cloud.dialogflow.v2beta1.QueryInput.toObject(message.queryInput, options); - if (message.singleUtterance != null && message.hasOwnProperty("singleUtterance")) - object.singleUtterance = message.singleUtterance; - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) - object.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); - if (message.inputAudio != null && message.hasOwnProperty("inputAudio")) - object.inputAudio = options.bytes === String ? $util.base64.encode(message.inputAudio, 0, message.inputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.inputAudio) : message.inputAudio; - if (message.outputAudioConfigMask != null && message.hasOwnProperty("outputAudioConfigMask")) - object.outputAudioConfigMask = $root.google.protobuf.FieldMask.toObject(message.outputAudioConfigMask, options); + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.dialogflow.v2beta1.GcsSources.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.documentTemplate != null && message.hasOwnProperty("documentTemplate")) + object.documentTemplate = $root.google.cloud.dialogflow.v2beta1.ImportDocumentTemplate.toObject(message.documentTemplate, options); + if (message.importGcsCustomMetadata != null && message.hasOwnProperty("importGcsCustomMetadata")) + object.importGcsCustomMetadata = message.importGcsCustomMetadata; return object; }; /** - * Converts this StreamingDetectIntentRequest to JSON. + * Converts this ImportDocumentsRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentRequest + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsRequest * @instance * @returns {Object.} JSON object */ - StreamingDetectIntentRequest.prototype.toJSON = function toJSON() { + ImportDocumentsRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return StreamingDetectIntentRequest; + return ImportDocumentsRequest; })(); - v2beta1.StreamingDetectIntentResponse = (function() { + v2beta1.ImportDocumentTemplate = (function() { /** - * Properties of a StreamingDetectIntentResponse. + * Properties of an ImportDocumentTemplate. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IStreamingDetectIntentResponse - * @property {string|null} [responseId] StreamingDetectIntentResponse responseId - * @property {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null} [recognitionResult] StreamingDetectIntentResponse recognitionResult - * @property {google.cloud.dialogflow.v2beta1.IQueryResult|null} [queryResult] StreamingDetectIntentResponse queryResult - * @property {Array.|null} [alternativeQueryResults] StreamingDetectIntentResponse alternativeQueryResults - * @property {google.rpc.IStatus|null} [webhookStatus] StreamingDetectIntentResponse webhookStatus - * @property {Uint8Array|null} [outputAudio] StreamingDetectIntentResponse outputAudio - * @property {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null} [outputAudioConfig] StreamingDetectIntentResponse outputAudioConfig + * @interface IImportDocumentTemplate + * @property {string|null} [mimeType] ImportDocumentTemplate mimeType + * @property {Array.|null} [knowledgeTypes] ImportDocumentTemplate knowledgeTypes + * @property {Object.|null} [metadata] ImportDocumentTemplate metadata */ /** - * Constructs a new StreamingDetectIntentResponse. + * Constructs a new ImportDocumentTemplate. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a StreamingDetectIntentResponse. - * @implements IStreamingDetectIntentResponse + * @classdesc Represents an ImportDocumentTemplate. + * @implements IImportDocumentTemplate * @constructor - * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentTemplate=} [properties] Properties to set */ - function StreamingDetectIntentResponse(properties) { - this.alternativeQueryResults = []; + function ImportDocumentTemplate(properties) { + this.knowledgeTypes = []; + this.metadata = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67620,156 +118756,132 @@ } /** - * StreamingDetectIntentResponse responseId. - * @member {string} responseId - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse - * @instance - */ - StreamingDetectIntentResponse.prototype.responseId = ""; - - /** - * StreamingDetectIntentResponse recognitionResult. - * @member {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult|null|undefined} recognitionResult - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse - * @instance - */ - StreamingDetectIntentResponse.prototype.recognitionResult = null; - - /** - * StreamingDetectIntentResponse queryResult. - * @member {google.cloud.dialogflow.v2beta1.IQueryResult|null|undefined} queryResult - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse - * @instance - */ - StreamingDetectIntentResponse.prototype.queryResult = null; - - /** - * StreamingDetectIntentResponse alternativeQueryResults. - * @member {Array.} alternativeQueryResults - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse - * @instance - */ - StreamingDetectIntentResponse.prototype.alternativeQueryResults = $util.emptyArray; - - /** - * StreamingDetectIntentResponse webhookStatus. - * @member {google.rpc.IStatus|null|undefined} webhookStatus - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * ImportDocumentTemplate mimeType. + * @member {string} mimeType + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentTemplate * @instance */ - StreamingDetectIntentResponse.prototype.webhookStatus = null; + ImportDocumentTemplate.prototype.mimeType = ""; /** - * StreamingDetectIntentResponse outputAudio. - * @member {Uint8Array} outputAudio - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * ImportDocumentTemplate knowledgeTypes. + * @member {Array.} knowledgeTypes + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentTemplate * @instance */ - StreamingDetectIntentResponse.prototype.outputAudio = $util.newBuffer([]); + ImportDocumentTemplate.prototype.knowledgeTypes = $util.emptyArray; /** - * StreamingDetectIntentResponse outputAudioConfig. - * @member {google.cloud.dialogflow.v2beta1.IOutputAudioConfig|null|undefined} outputAudioConfig - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * ImportDocumentTemplate metadata. + * @member {Object.} metadata + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentTemplate * @instance */ - StreamingDetectIntentResponse.prototype.outputAudioConfig = null; + ImportDocumentTemplate.prototype.metadata = $util.emptyObject; /** - * Creates a new StreamingDetectIntentResponse instance using the specified properties. + * Creates a new ImportDocumentTemplate instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentTemplate * @static - * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse} StreamingDetectIntentResponse instance + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentTemplate=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ImportDocumentTemplate} ImportDocumentTemplate instance */ - StreamingDetectIntentResponse.create = function create(properties) { - return new StreamingDetectIntentResponse(properties); + ImportDocumentTemplate.create = function create(properties) { + return new ImportDocumentTemplate(properties); }; /** - * Encodes the specified StreamingDetectIntentResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.verify|verify} messages. + * Encodes the specified ImportDocumentTemplate message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportDocumentTemplate.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentTemplate * @static - * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse} message StreamingDetectIntentResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentTemplate} message ImportDocumentTemplate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StreamingDetectIntentResponse.encode = function encode(message, writer) { + ImportDocumentTemplate.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.responseId != null && Object.hasOwnProperty.call(message, "responseId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.responseId); - if (message.recognitionResult != null && Object.hasOwnProperty.call(message, "recognitionResult")) - $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.encode(message.recognitionResult, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.queryResult != null && Object.hasOwnProperty.call(message, "queryResult")) - $root.google.cloud.dialogflow.v2beta1.QueryResult.encode(message.queryResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.webhookStatus != null && Object.hasOwnProperty.call(message, "webhookStatus")) - $root.google.rpc.Status.encode(message.webhookStatus, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.outputAudio != null && Object.hasOwnProperty.call(message, "outputAudio")) - writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.outputAudio); - if (message.outputAudioConfig != null && Object.hasOwnProperty.call(message, "outputAudioConfig")) - $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.encode(message.outputAudioConfig, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.alternativeQueryResults != null && message.alternativeQueryResults.length) - for (var i = 0; i < message.alternativeQueryResults.length; ++i) - $root.google.cloud.dialogflow.v2beta1.QueryResult.encode(message.alternativeQueryResults[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.mimeType != null && Object.hasOwnProperty.call(message, "mimeType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.mimeType); + if (message.knowledgeTypes != null && message.knowledgeTypes.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.knowledgeTypes.length; ++i) + writer.int32(message.knowledgeTypes[i]); + writer.ldelim(); + } + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + for (var keys = Object.keys(message.metadata), i = 0; i < keys.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.metadata[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified StreamingDetectIntentResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.verify|verify} messages. + * Encodes the specified ImportDocumentTemplate message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportDocumentTemplate.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentTemplate * @static - * @param {google.cloud.dialogflow.v2beta1.IStreamingDetectIntentResponse} message StreamingDetectIntentResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentTemplate} message ImportDocumentTemplate message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StreamingDetectIntentResponse.encodeDelimited = function encodeDelimited(message, writer) { + ImportDocumentTemplate.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer. + * Decodes an ImportDocumentTemplate message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentTemplate * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse} StreamingDetectIntentResponse + * @returns {google.cloud.dialogflow.v2beta1.ImportDocumentTemplate} ImportDocumentTemplate * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StreamingDetectIntentResponse.decode = function decode(reader, length) { + ImportDocumentTemplate.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ImportDocumentTemplate(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.responseId = reader.string(); + message.mimeType = reader.string(); break; case 2: - message.recognitionResult = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.decode(reader, reader.uint32()); + if (!(message.knowledgeTypes && message.knowledgeTypes.length)) + message.knowledgeTypes = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.knowledgeTypes.push(reader.int32()); + } else + message.knowledgeTypes.push(reader.int32()); break; case 3: - message.queryResult = $root.google.cloud.dialogflow.v2beta1.QueryResult.decode(reader, reader.uint32()); - break; - case 7: - if (!(message.alternativeQueryResults && message.alternativeQueryResults.length)) - message.alternativeQueryResults = []; - message.alternativeQueryResults.push($root.google.cloud.dialogflow.v2beta1.QueryResult.decode(reader, reader.uint32())); - break; - case 4: - message.webhookStatus = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - case 5: - message.outputAudio = reader.bytes(); - break; - case 6: - message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.decode(reader, reader.uint32()); + if (message.metadata === $util.emptyObject) + message.metadata = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.metadata[key] = value; break; default: reader.skipType(tag & 7); @@ -67777,214 +118889,185 @@ } } return message; - }; - - /** - * Decodes a StreamingDetectIntentResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse} StreamingDetectIntentResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StreamingDetectIntentResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StreamingDetectIntentResponse message. - * @function verify - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StreamingDetectIntentResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.responseId != null && message.hasOwnProperty("responseId")) - if (!$util.isString(message.responseId)) - return "responseId: string expected"; - if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) { - var error = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.verify(message.recognitionResult); - if (error) - return "recognitionResult." + error; - } - if (message.queryResult != null && message.hasOwnProperty("queryResult")) { - var error = $root.google.cloud.dialogflow.v2beta1.QueryResult.verify(message.queryResult); - if (error) - return "queryResult." + error; - } - if (message.alternativeQueryResults != null && message.hasOwnProperty("alternativeQueryResults")) { - if (!Array.isArray(message.alternativeQueryResults)) - return "alternativeQueryResults: array expected"; - for (var i = 0; i < message.alternativeQueryResults.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.QueryResult.verify(message.alternativeQueryResults[i]); - if (error) - return "alternativeQueryResults." + error; - } - } - if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) { - var error = $root.google.rpc.Status.verify(message.webhookStatus); - if (error) - return "webhookStatus." + error; + }; + + /** + * Decodes an ImportDocumentTemplate message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentTemplate + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.dialogflow.v2beta1.ImportDocumentTemplate} ImportDocumentTemplate + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ImportDocumentTemplate.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ImportDocumentTemplate message. + * @function verify + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentTemplate + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ImportDocumentTemplate.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + if (!$util.isString(message.mimeType)) + return "mimeType: string expected"; + if (message.knowledgeTypes != null && message.hasOwnProperty("knowledgeTypes")) { + if (!Array.isArray(message.knowledgeTypes)) + return "knowledgeTypes: array expected"; + for (var i = 0; i < message.knowledgeTypes.length; ++i) + switch (message.knowledgeTypes[i]) { + default: + return "knowledgeTypes: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } } - if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) - if (!(message.outputAudio && typeof message.outputAudio.length === "number" || $util.isString(message.outputAudio))) - return "outputAudio: buffer expected"; - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) { - var error = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.verify(message.outputAudioConfig); - if (error) - return "outputAudioConfig." + error; + if (message.metadata != null && message.hasOwnProperty("metadata")) { + if (!$util.isObject(message.metadata)) + return "metadata: object expected"; + var key = Object.keys(message.metadata); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.metadata[key[i]])) + return "metadata: string{k:string} expected"; } return null; }; /** - * Creates a StreamingDetectIntentResponse message from a plain object. Also converts values to their respective internal types. + * Creates an ImportDocumentTemplate message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentTemplate * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse} StreamingDetectIntentResponse + * @returns {google.cloud.dialogflow.v2beta1.ImportDocumentTemplate} ImportDocumentTemplate */ - StreamingDetectIntentResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse) + ImportDocumentTemplate.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ImportDocumentTemplate) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse(); - if (object.responseId != null) - message.responseId = String(object.responseId); - if (object.recognitionResult != null) { - if (typeof object.recognitionResult !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.recognitionResult: object expected"); - message.recognitionResult = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.fromObject(object.recognitionResult); - } - if (object.queryResult != null) { - if (typeof object.queryResult !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.queryResult: object expected"); - message.queryResult = $root.google.cloud.dialogflow.v2beta1.QueryResult.fromObject(object.queryResult); - } - if (object.alternativeQueryResults) { - if (!Array.isArray(object.alternativeQueryResults)) - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.alternativeQueryResults: array expected"); - message.alternativeQueryResults = []; - for (var i = 0; i < object.alternativeQueryResults.length; ++i) { - if (typeof object.alternativeQueryResults[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.alternativeQueryResults: object expected"); - message.alternativeQueryResults[i] = $root.google.cloud.dialogflow.v2beta1.QueryResult.fromObject(object.alternativeQueryResults[i]); - } - } - if (object.webhookStatus != null) { - if (typeof object.webhookStatus !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.webhookStatus: object expected"); - message.webhookStatus = $root.google.rpc.Status.fromObject(object.webhookStatus); + var message = new $root.google.cloud.dialogflow.v2beta1.ImportDocumentTemplate(); + if (object.mimeType != null) + message.mimeType = String(object.mimeType); + if (object.knowledgeTypes) { + if (!Array.isArray(object.knowledgeTypes)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ImportDocumentTemplate.knowledgeTypes: array expected"); + message.knowledgeTypes = []; + for (var i = 0; i < object.knowledgeTypes.length; ++i) + switch (object.knowledgeTypes[i]) { + default: + case "KNOWLEDGE_TYPE_UNSPECIFIED": + case 0: + message.knowledgeTypes[i] = 0; + break; + case "FAQ": + case 1: + message.knowledgeTypes[i] = 1; + break; + case "EXTRACTIVE_QA": + case 2: + message.knowledgeTypes[i] = 2; + break; + case "ARTICLE_SUGGESTION": + case 3: + message.knowledgeTypes[i] = 3; + break; + case "SMART_REPLY": + case 4: + message.knowledgeTypes[i] = 4; + break; + } } - if (object.outputAudio != null) - if (typeof object.outputAudio === "string") - $util.base64.decode(object.outputAudio, message.outputAudio = $util.newBuffer($util.base64.length(object.outputAudio)), 0); - else if (object.outputAudio.length) - message.outputAudio = object.outputAudio; - if (object.outputAudioConfig != null) { - if (typeof object.outputAudioConfig !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse.outputAudioConfig: object expected"); - message.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.fromObject(object.outputAudioConfig); + if (object.metadata) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ImportDocumentTemplate.metadata: object expected"); + message.metadata = {}; + for (var keys = Object.keys(object.metadata), i = 0; i < keys.length; ++i) + message.metadata[keys[i]] = String(object.metadata[keys[i]]); } return message; }; /** - * Creates a plain object from a StreamingDetectIntentResponse message. Also converts values to other types if specified. + * Creates a plain object from an ImportDocumentTemplate message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentTemplate * @static - * @param {google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse} message StreamingDetectIntentResponse + * @param {google.cloud.dialogflow.v2beta1.ImportDocumentTemplate} message ImportDocumentTemplate * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StreamingDetectIntentResponse.toObject = function toObject(message, options) { + ImportDocumentTemplate.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.alternativeQueryResults = []; - if (options.defaults) { - object.responseId = ""; - object.recognitionResult = null; - object.queryResult = null; - object.webhookStatus = null; - if (options.bytes === String) - object.outputAudio = ""; - else { - object.outputAudio = []; - if (options.bytes !== Array) - object.outputAudio = $util.newBuffer(object.outputAudio); - } - object.outputAudioConfig = null; + object.knowledgeTypes = []; + if (options.objects || options.defaults) + object.metadata = {}; + if (options.defaults) + object.mimeType = ""; + if (message.mimeType != null && message.hasOwnProperty("mimeType")) + object.mimeType = message.mimeType; + if (message.knowledgeTypes && message.knowledgeTypes.length) { + object.knowledgeTypes = []; + for (var j = 0; j < message.knowledgeTypes.length; ++j) + object.knowledgeTypes[j] = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.Document.KnowledgeType[message.knowledgeTypes[j]] : message.knowledgeTypes[j]; } - if (message.responseId != null && message.hasOwnProperty("responseId")) - object.responseId = message.responseId; - if (message.recognitionResult != null && message.hasOwnProperty("recognitionResult")) - object.recognitionResult = $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.toObject(message.recognitionResult, options); - if (message.queryResult != null && message.hasOwnProperty("queryResult")) - object.queryResult = $root.google.cloud.dialogflow.v2beta1.QueryResult.toObject(message.queryResult, options); - if (message.webhookStatus != null && message.hasOwnProperty("webhookStatus")) - object.webhookStatus = $root.google.rpc.Status.toObject(message.webhookStatus, options); - if (message.outputAudio != null && message.hasOwnProperty("outputAudio")) - object.outputAudio = options.bytes === String ? $util.base64.encode(message.outputAudio, 0, message.outputAudio.length) : options.bytes === Array ? Array.prototype.slice.call(message.outputAudio) : message.outputAudio; - if (message.outputAudioConfig != null && message.hasOwnProperty("outputAudioConfig")) - object.outputAudioConfig = $root.google.cloud.dialogflow.v2beta1.OutputAudioConfig.toObject(message.outputAudioConfig, options); - if (message.alternativeQueryResults && message.alternativeQueryResults.length) { - object.alternativeQueryResults = []; - for (var j = 0; j < message.alternativeQueryResults.length; ++j) - object.alternativeQueryResults[j] = $root.google.cloud.dialogflow.v2beta1.QueryResult.toObject(message.alternativeQueryResults[j], options); + var keys2; + if (message.metadata && (keys2 = Object.keys(message.metadata)).length) { + object.metadata = {}; + for (var j = 0; j < keys2.length; ++j) + object.metadata[keys2[j]] = message.metadata[keys2[j]]; } return object; }; /** - * Converts this StreamingDetectIntentResponse to JSON. + * Converts this ImportDocumentTemplate to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.StreamingDetectIntentResponse + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentTemplate * @instance * @returns {Object.} JSON object */ - StreamingDetectIntentResponse.prototype.toJSON = function toJSON() { + ImportDocumentTemplate.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return StreamingDetectIntentResponse; + return ImportDocumentTemplate; })(); - v2beta1.StreamingRecognitionResult = (function() { + v2beta1.ImportDocumentsResponse = (function() { /** - * Properties of a StreamingRecognitionResult. + * Properties of an ImportDocumentsResponse. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IStreamingRecognitionResult - * @property {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType|null} [messageType] StreamingRecognitionResult messageType - * @property {string|null} [transcript] StreamingRecognitionResult transcript - * @property {boolean|null} [isFinal] StreamingRecognitionResult isFinal - * @property {number|null} [confidence] StreamingRecognitionResult confidence - * @property {number|null} [stability] StreamingRecognitionResult stability - * @property {Array.|null} [speechWordInfo] StreamingRecognitionResult speechWordInfo - * @property {google.protobuf.IDuration|null} [speechEndOffset] StreamingRecognitionResult speechEndOffset - * @property {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents|null} [dtmfDigits] StreamingRecognitionResult dtmfDigits + * @interface IImportDocumentsResponse + * @property {Array.|null} [warnings] ImportDocumentsResponse warnings */ /** - * Constructs a new StreamingRecognitionResult. + * Constructs a new ImportDocumentsResponse. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a StreamingRecognitionResult. - * @implements IStreamingRecognitionResult + * @classdesc Represents an ImportDocumentsResponse. + * @implements IImportDocumentsResponse * @constructor - * @param {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentsResponse=} [properties] Properties to set */ - function StreamingRecognitionResult(properties) { - this.speechWordInfo = []; + function ImportDocumentsResponse(properties) { + this.warnings = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -67992,169 +119075,78 @@ } /** - * StreamingRecognitionResult messageType. - * @member {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType} messageType - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.messageType = 0; - - /** - * StreamingRecognitionResult transcript. - * @member {string} transcript - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.transcript = ""; - - /** - * StreamingRecognitionResult isFinal. - * @member {boolean} isFinal - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.isFinal = false; - - /** - * StreamingRecognitionResult confidence. - * @member {number} confidence - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.confidence = 0; - - /** - * StreamingRecognitionResult stability. - * @member {number} stability - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.stability = 0; - - /** - * StreamingRecognitionResult speechWordInfo. - * @member {Array.} speechWordInfo - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.speechWordInfo = $util.emptyArray; - - /** - * StreamingRecognitionResult speechEndOffset. - * @member {google.protobuf.IDuration|null|undefined} speechEndOffset - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult - * @instance - */ - StreamingRecognitionResult.prototype.speechEndOffset = null; - - /** - * StreamingRecognitionResult dtmfDigits. - * @member {google.cloud.dialogflow.v2beta1.ITelephonyDtmfEvents|null|undefined} dtmfDigits - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * ImportDocumentsResponse warnings. + * @member {Array.} warnings + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsResponse * @instance */ - StreamingRecognitionResult.prototype.dtmfDigits = null; + ImportDocumentsResponse.prototype.warnings = $util.emptyArray; /** - * Creates a new StreamingRecognitionResult instance using the specified properties. + * Creates a new ImportDocumentsResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult} StreamingRecognitionResult instance + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentsResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ImportDocumentsResponse} ImportDocumentsResponse instance */ - StreamingRecognitionResult.create = function create(properties) { - return new StreamingRecognitionResult(properties); + ImportDocumentsResponse.create = function create(properties) { + return new ImportDocumentsResponse(properties); }; /** - * Encodes the specified StreamingRecognitionResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.verify|verify} messages. + * Encodes the specified ImportDocumentsResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportDocumentsResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentsResponse} message ImportDocumentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StreamingRecognitionResult.encode = function encode(message, writer) { + ImportDocumentsResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.messageType != null && Object.hasOwnProperty.call(message, "messageType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.messageType); - if (message.transcript != null && Object.hasOwnProperty.call(message, "transcript")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.transcript); - if (message.isFinal != null && Object.hasOwnProperty.call(message, "isFinal")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.isFinal); - if (message.confidence != null && Object.hasOwnProperty.call(message, "confidence")) - writer.uint32(/* id 4, wireType 5 =*/37).float(message.confidence); - if (message.dtmfDigits != null && Object.hasOwnProperty.call(message, "dtmfDigits")) - $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.encode(message.dtmfDigits, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.stability != null && Object.hasOwnProperty.call(message, "stability")) - writer.uint32(/* id 6, wireType 5 =*/53).float(message.stability); - if (message.speechWordInfo != null && message.speechWordInfo.length) - for (var i = 0; i < message.speechWordInfo.length; ++i) - $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo.encode(message.speechWordInfo[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.speechEndOffset != null && Object.hasOwnProperty.call(message, "speechEndOffset")) - $root.google.protobuf.Duration.encode(message.speechEndOffset, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.warnings != null && message.warnings.length) + for (var i = 0; i < message.warnings.length; ++i) + $root.google.rpc.Status.encode(message.warnings[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); return writer; }; /** - * Encodes the specified StreamingRecognitionResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.verify|verify} messages. + * Encodes the specified ImportDocumentsResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ImportDocumentsResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IStreamingRecognitionResult} message StreamingRecognitionResult message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IImportDocumentsResponse} message ImportDocumentsResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - StreamingRecognitionResult.encodeDelimited = function encodeDelimited(message, writer) { + ImportDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a StreamingRecognitionResult message from the specified reader or buffer. + * Decodes an ImportDocumentsResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult} StreamingRecognitionResult + * @returns {google.cloud.dialogflow.v2beta1.ImportDocumentsResponse} ImportDocumentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StreamingRecognitionResult.decode = function decode(reader, length) { + ImportDocumentsResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ImportDocumentsResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.messageType = reader.int32(); - break; - case 2: - message.transcript = reader.string(); - break; - case 3: - message.isFinal = reader.bool(); - break; - case 4: - message.confidence = reader.float(); - break; - case 6: - message.stability = reader.float(); - break; - case 7: - if (!(message.speechWordInfo && message.speechWordInfo.length)) - message.speechWordInfo = []; - message.speechWordInfo.push($root.google.cloud.dialogflow.v2beta1.SpeechWordInfo.decode(reader, reader.uint32())); - break; - case 8: - message.speechEndOffset = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - case 5: - message.dtmfDigits = $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.decode(reader, reader.uint32()); + if (!(message.warnings && message.warnings.length)) + message.warnings = []; + message.warnings.push($root.google.rpc.Status.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -68165,227 +119157,124 @@ }; /** - * Decodes a StreamingRecognitionResult message from the specified reader or buffer, length delimited. + * Decodes an ImportDocumentsResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult} StreamingRecognitionResult + * @returns {google.cloud.dialogflow.v2beta1.ImportDocumentsResponse} ImportDocumentsResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - StreamingRecognitionResult.decodeDelimited = function decodeDelimited(reader) { + ImportDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a StreamingRecognitionResult message. + * Verifies an ImportDocumentsResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - StreamingRecognitionResult.verify = function verify(message) { + ImportDocumentsResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.messageType != null && message.hasOwnProperty("messageType")) - switch (message.messageType) { - default: - return "messageType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.transcript != null && message.hasOwnProperty("transcript")) - if (!$util.isString(message.transcript)) - return "transcript: string expected"; - if (message.isFinal != null && message.hasOwnProperty("isFinal")) - if (typeof message.isFinal !== "boolean") - return "isFinal: boolean expected"; - if (message.confidence != null && message.hasOwnProperty("confidence")) - if (typeof message.confidence !== "number") - return "confidence: number expected"; - if (message.stability != null && message.hasOwnProperty("stability")) - if (typeof message.stability !== "number") - return "stability: number expected"; - if (message.speechWordInfo != null && message.hasOwnProperty("speechWordInfo")) { - if (!Array.isArray(message.speechWordInfo)) - return "speechWordInfo: array expected"; - for (var i = 0; i < message.speechWordInfo.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo.verify(message.speechWordInfo[i]); + if (message.warnings != null && message.hasOwnProperty("warnings")) { + if (!Array.isArray(message.warnings)) + return "warnings: array expected"; + for (var i = 0; i < message.warnings.length; ++i) { + var error = $root.google.rpc.Status.verify(message.warnings[i]); if (error) - return "speechWordInfo." + error; + return "warnings." + error; } } - if (message.speechEndOffset != null && message.hasOwnProperty("speechEndOffset")) { - var error = $root.google.protobuf.Duration.verify(message.speechEndOffset); - if (error) - return "speechEndOffset." + error; - } - if (message.dtmfDigits != null && message.hasOwnProperty("dtmfDigits")) { - var error = $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.verify(message.dtmfDigits); - if (error) - return "dtmfDigits." + error; - } return null; }; /** - * Creates a StreamingRecognitionResult message from a plain object. Also converts values to their respective internal types. + * Creates an ImportDocumentsResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult} StreamingRecognitionResult + * @returns {google.cloud.dialogflow.v2beta1.ImportDocumentsResponse} ImportDocumentsResponse */ - StreamingRecognitionResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult) + ImportDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ImportDocumentsResponse) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult(); - switch (object.messageType) { - case "MESSAGE_TYPE_UNSPECIFIED": - case 0: - message.messageType = 0; - break; - case "TRANSCRIPT": - case 1: - message.messageType = 1; - break; - case "END_OF_SINGLE_UTTERANCE": - case 2: - message.messageType = 2; - break; - } - if (object.transcript != null) - message.transcript = String(object.transcript); - if (object.isFinal != null) - message.isFinal = Boolean(object.isFinal); - if (object.confidence != null) - message.confidence = Number(object.confidence); - if (object.stability != null) - message.stability = Number(object.stability); - if (object.speechWordInfo) { - if (!Array.isArray(object.speechWordInfo)) - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.speechWordInfo: array expected"); - message.speechWordInfo = []; - for (var i = 0; i < object.speechWordInfo.length; ++i) { - if (typeof object.speechWordInfo[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.speechWordInfo: object expected"); - message.speechWordInfo[i] = $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo.fromObject(object.speechWordInfo[i]); + var message = new $root.google.cloud.dialogflow.v2beta1.ImportDocumentsResponse(); + if (object.warnings) { + if (!Array.isArray(object.warnings)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ImportDocumentsResponse.warnings: array expected"); + message.warnings = []; + for (var i = 0; i < object.warnings.length; ++i) { + if (typeof object.warnings[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ImportDocumentsResponse.warnings: object expected"); + message.warnings[i] = $root.google.rpc.Status.fromObject(object.warnings[i]); } } - if (object.speechEndOffset != null) { - if (typeof object.speechEndOffset !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.speechEndOffset: object expected"); - message.speechEndOffset = $root.google.protobuf.Duration.fromObject(object.speechEndOffset); - } - if (object.dtmfDigits != null) { - if (typeof object.dtmfDigits !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.dtmfDigits: object expected"); - message.dtmfDigits = $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.fromObject(object.dtmfDigits); - } return message; }; /** - * Creates a plain object from a StreamingRecognitionResult message. Also converts values to other types if specified. + * Creates a plain object from an ImportDocumentsResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsResponse * @static - * @param {google.cloud.dialogflow.v2beta1.StreamingRecognitionResult} message StreamingRecognitionResult + * @param {google.cloud.dialogflow.v2beta1.ImportDocumentsResponse} message ImportDocumentsResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - StreamingRecognitionResult.toObject = function toObject(message, options) { + ImportDocumentsResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.speechWordInfo = []; - if (options.defaults) { - object.messageType = options.enums === String ? "MESSAGE_TYPE_UNSPECIFIED" : 0; - object.transcript = ""; - object.isFinal = false; - object.confidence = 0; - object.dtmfDigits = null; - object.stability = 0; - object.speechEndOffset = null; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) - object.messageType = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType[message.messageType] : message.messageType; - if (message.transcript != null && message.hasOwnProperty("transcript")) - object.transcript = message.transcript; - if (message.isFinal != null && message.hasOwnProperty("isFinal")) - object.isFinal = message.isFinal; - if (message.confidence != null && message.hasOwnProperty("confidence")) - object.confidence = options.json && !isFinite(message.confidence) ? String(message.confidence) : message.confidence; - if (message.dtmfDigits != null && message.hasOwnProperty("dtmfDigits")) - object.dtmfDigits = $root.google.cloud.dialogflow.v2beta1.TelephonyDtmfEvents.toObject(message.dtmfDigits, options); - if (message.stability != null && message.hasOwnProperty("stability")) - object.stability = options.json && !isFinite(message.stability) ? String(message.stability) : message.stability; - if (message.speechWordInfo && message.speechWordInfo.length) { - object.speechWordInfo = []; - for (var j = 0; j < message.speechWordInfo.length; ++j) - object.speechWordInfo[j] = $root.google.cloud.dialogflow.v2beta1.SpeechWordInfo.toObject(message.speechWordInfo[j], options); + object.warnings = []; + if (message.warnings && message.warnings.length) { + object.warnings = []; + for (var j = 0; j < message.warnings.length; ++j) + object.warnings[j] = $root.google.rpc.Status.toObject(message.warnings[j], options); } - if (message.speechEndOffset != null && message.hasOwnProperty("speechEndOffset")) - object.speechEndOffset = $root.google.protobuf.Duration.toObject(message.speechEndOffset, options); return object; }; /** - * Converts this StreamingRecognitionResult to JSON. + * Converts this ImportDocumentsResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.StreamingRecognitionResult + * @memberof google.cloud.dialogflow.v2beta1.ImportDocumentsResponse * @instance * @returns {Object.} JSON object */ - StreamingRecognitionResult.prototype.toJSON = function toJSON() { + ImportDocumentsResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * MessageType enum. - * @name google.cloud.dialogflow.v2beta1.StreamingRecognitionResult.MessageType - * @enum {number} - * @property {number} MESSAGE_TYPE_UNSPECIFIED=0 MESSAGE_TYPE_UNSPECIFIED value - * @property {number} TRANSCRIPT=1 TRANSCRIPT value - * @property {number} END_OF_SINGLE_UTTERANCE=2 END_OF_SINGLE_UTTERANCE value - */ - StreamingRecognitionResult.MessageType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MESSAGE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TRANSCRIPT"] = 1; - values[valuesById[2] = "END_OF_SINGLE_UTTERANCE"] = 2; - return values; - })(); - - return StreamingRecognitionResult; + return ImportDocumentsResponse; })(); - v2beta1.TextInput = (function() { + v2beta1.DeleteDocumentRequest = (function() { /** - * Properties of a TextInput. + * Properties of a DeleteDocumentRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface ITextInput - * @property {string|null} [text] TextInput text - * @property {string|null} [languageCode] TextInput languageCode + * @interface IDeleteDocumentRequest + * @property {string|null} [name] DeleteDocumentRequest name */ /** - * Constructs a new TextInput. + * Constructs a new DeleteDocumentRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a TextInput. - * @implements ITextInput + * @classdesc Represents a DeleteDocumentRequest. + * @implements IDeleteDocumentRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.ITextInput=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest=} [properties] Properties to set */ - function TextInput(properties) { + function DeleteDocumentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -68393,88 +119282,75 @@ } /** - * TextInput text. - * @member {string} text - * @memberof google.cloud.dialogflow.v2beta1.TextInput - * @instance - */ - TextInput.prototype.text = ""; - - /** - * TextInput languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.TextInput + * DeleteDocumentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest * @instance */ - TextInput.prototype.languageCode = ""; + DeleteDocumentRequest.prototype.name = ""; /** - * Creates a new TextInput instance using the specified properties. + * Creates a new DeleteDocumentRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ITextInput=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.TextInput} TextInput instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DeleteDocumentRequest} DeleteDocumentRequest instance */ - TextInput.create = function create(properties) { - return new TextInput(properties); + DeleteDocumentRequest.create = function create(properties) { + return new DeleteDocumentRequest(properties); }; /** - * Encodes the specified TextInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TextInput.verify|verify} messages. + * Encodes the specified DeleteDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteDocumentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ITextInput} message TextInput message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TextInput.encode = function encode(message, writer) { + DeleteDocumentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.text != null && Object.hasOwnProperty.call(message, "text")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.text); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.languageCode); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); return writer; }; /** - * Encodes the specified TextInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.TextInput.verify|verify} messages. + * Encodes the specified DeleteDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteDocumentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ITextInput} message TextInput message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest} message DeleteDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - TextInput.encodeDelimited = function encodeDelimited(message, writer) { + DeleteDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a TextInput message from the specified reader or buffer. + * Decodes a DeleteDocumentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.TextInput} TextInput + * @returns {google.cloud.dialogflow.v2beta1.DeleteDocumentRequest} DeleteDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TextInput.decode = function decode(reader, length) { + DeleteDocumentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.TextInput(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.text = reader.string(); - break; - case 2: - message.languageCode = reader.string(); + message.name = reader.string(); break; default: reader.skipType(tag & 7); @@ -68485,118 +119361,108 @@ }; /** - * Decodes a TextInput message from the specified reader or buffer, length delimited. + * Decodes a DeleteDocumentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.TextInput} TextInput + * @returns {google.cloud.dialogflow.v2beta1.DeleteDocumentRequest} DeleteDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - TextInput.decodeDelimited = function decodeDelimited(reader) { + DeleteDocumentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a TextInput message. + * Verifies a DeleteDocumentRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - TextInput.verify = function verify(message) { + DeleteDocumentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.text != null && message.hasOwnProperty("text")) - if (!$util.isString(message.text)) - return "text: string expected"; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; return null; }; /** - * Creates a TextInput message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteDocumentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.TextInput} TextInput + * @returns {google.cloud.dialogflow.v2beta1.DeleteDocumentRequest} DeleteDocumentRequest */ - TextInput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.TextInput) + DeleteDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.TextInput(); - if (object.text != null) - message.text = String(object.text); - if (object.languageCode != null) - message.languageCode = String(object.languageCode); + var message = new $root.google.cloud.dialogflow.v2beta1.DeleteDocumentRequest(); + if (object.name != null) + message.name = String(object.name); return message; }; /** - * Creates a plain object from a TextInput message. Also converts values to other types if specified. + * Creates a plain object from a DeleteDocumentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.TextInput} message TextInput + * @param {google.cloud.dialogflow.v2beta1.DeleteDocumentRequest} message DeleteDocumentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - TextInput.toObject = function toObject(message, options) { + DeleteDocumentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.text = ""; - object.languageCode = ""; - } - if (message.text != null && message.hasOwnProperty("text")) - object.text = message.text; - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; + if (options.defaults) + object.name = ""; + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; return object; }; /** - * Converts this TextInput to JSON. + * Converts this DeleteDocumentRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.TextInput + * @memberof google.cloud.dialogflow.v2beta1.DeleteDocumentRequest * @instance * @returns {Object.} JSON object */ - TextInput.prototype.toJSON = function toJSON() { + DeleteDocumentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return TextInput; + return DeleteDocumentRequest; })(); - v2beta1.EventInput = (function() { + v2beta1.UpdateDocumentRequest = (function() { /** - * Properties of an EventInput. + * Properties of an UpdateDocumentRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IEventInput - * @property {string|null} [name] EventInput name - * @property {google.protobuf.IStruct|null} [parameters] EventInput parameters - * @property {string|null} [languageCode] EventInput languageCode + * @interface IUpdateDocumentRequest + * @property {google.cloud.dialogflow.v2beta1.IDocument|null} [document] UpdateDocumentRequest document + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDocumentRequest updateMask */ /** - * Constructs a new EventInput. + * Constructs a new UpdateDocumentRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an EventInput. - * @implements IEventInput + * @classdesc Represents an UpdateDocumentRequest. + * @implements IUpdateDocumentRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IEventInput=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest=} [properties] Properties to set */ - function EventInput(properties) { + function UpdateDocumentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -68604,101 +119470,88 @@ } /** - * EventInput name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.EventInput - * @instance - */ - EventInput.prototype.name = ""; - - /** - * EventInput parameters. - * @member {google.protobuf.IStruct|null|undefined} parameters - * @memberof google.cloud.dialogflow.v2beta1.EventInput + * UpdateDocumentRequest document. + * @member {google.cloud.dialogflow.v2beta1.IDocument|null|undefined} document + * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest * @instance */ - EventInput.prototype.parameters = null; + UpdateDocumentRequest.prototype.document = null; /** - * EventInput languageCode. - * @member {string} languageCode - * @memberof google.cloud.dialogflow.v2beta1.EventInput + * UpdateDocumentRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest * @instance */ - EventInput.prototype.languageCode = ""; + UpdateDocumentRequest.prototype.updateMask = null; /** - * Creates a new EventInput instance using the specified properties. + * Creates a new UpdateDocumentRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IEventInput=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.EventInput} EventInput instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.UpdateDocumentRequest} UpdateDocumentRequest instance */ - EventInput.create = function create(properties) { - return new EventInput(properties); + UpdateDocumentRequest.create = function create(properties) { + return new UpdateDocumentRequest(properties); }; /** - * Encodes the specified EventInput message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EventInput.verify|verify} messages. + * Encodes the specified UpdateDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateDocumentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IEventInput} message EventInput message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EventInput.encode = function encode(message, writer) { + UpdateDocumentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.parameters != null && Object.hasOwnProperty.call(message, "parameters")) - $root.google.protobuf.Struct.encode(message.parameters, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.languageCode); + if (message.document != null && Object.hasOwnProperty.call(message, "document")) + $root.google.cloud.dialogflow.v2beta1.Document.encode(message.document, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified EventInput message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.EventInput.verify|verify} messages. + * Encodes the specified UpdateDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateDocumentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IEventInput} message EventInput message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IUpdateDocumentRequest} message UpdateDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - EventInput.encodeDelimited = function encodeDelimited(message, writer) { + UpdateDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an EventInput message from the specified reader or buffer. + * Decodes an UpdateDocumentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.EventInput} EventInput + * @returns {google.cloud.dialogflow.v2beta1.UpdateDocumentRequest} UpdateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EventInput.decode = function decode(reader, length) { + UpdateDocumentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.EventInput(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateDocumentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.document = $root.google.cloud.dialogflow.v2beta1.Document.decode(reader, reader.uint32()); break; case 2: - message.parameters = $root.google.protobuf.Struct.decode(reader, reader.uint32()); - break; - case 3: - message.languageCode = reader.string(); + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -68709,129 +119562,126 @@ }; /** - * Decodes an EventInput message from the specified reader or buffer, length delimited. + * Decodes an UpdateDocumentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.EventInput} EventInput + * @returns {google.cloud.dialogflow.v2beta1.UpdateDocumentRequest} UpdateDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - EventInput.decodeDelimited = function decodeDelimited(reader) { + UpdateDocumentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an EventInput message. + * Verifies an UpdateDocumentRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - EventInput.verify = function verify(message) { + UpdateDocumentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.parameters != null && message.hasOwnProperty("parameters")) { - var error = $root.google.protobuf.Struct.verify(message.parameters); + if (message.document != null && message.hasOwnProperty("document")) { + var error = $root.google.cloud.dialogflow.v2beta1.Document.verify(message.document); if (error) - return "parameters." + error; + return "document." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; } - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - if (!$util.isString(message.languageCode)) - return "languageCode: string expected"; return null; }; /** - * Creates an EventInput message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateDocumentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.EventInput} EventInput + * @returns {google.cloud.dialogflow.v2beta1.UpdateDocumentRequest} UpdateDocumentRequest */ - EventInput.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.EventInput) + UpdateDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateDocumentRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.EventInput(); - if (object.name != null) - message.name = String(object.name); - if (object.parameters != null) { - if (typeof object.parameters !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.EventInput.parameters: object expected"); - message.parameters = $root.google.protobuf.Struct.fromObject(object.parameters); + var message = new $root.google.cloud.dialogflow.v2beta1.UpdateDocumentRequest(); + if (object.document != null) { + if (typeof object.document !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateDocumentRequest.document: object expected"); + message.document = $root.google.cloud.dialogflow.v2beta1.Document.fromObject(object.document); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateDocumentRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); } - if (object.languageCode != null) - message.languageCode = String(object.languageCode); return message; }; /** - * Creates a plain object from an EventInput message. Also converts values to other types if specified. + * Creates a plain object from an UpdateDocumentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.EventInput} message EventInput + * @param {google.cloud.dialogflow.v2beta1.UpdateDocumentRequest} message UpdateDocumentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - EventInput.toObject = function toObject(message, options) { + UpdateDocumentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.name = ""; - object.parameters = null; - object.languageCode = ""; + object.document = null; + object.updateMask = null; } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.parameters != null && message.hasOwnProperty("parameters")) - object.parameters = $root.google.protobuf.Struct.toObject(message.parameters, options); - if (message.languageCode != null && message.hasOwnProperty("languageCode")) - object.languageCode = message.languageCode; + if (message.document != null && message.hasOwnProperty("document")) + object.document = $root.google.cloud.dialogflow.v2beta1.Document.toObject(message.document, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this EventInput to JSON. + * Converts this UpdateDocumentRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.EventInput + * @memberof google.cloud.dialogflow.v2beta1.UpdateDocumentRequest * @instance * @returns {Object.} JSON object */ - EventInput.prototype.toJSON = function toJSON() { + UpdateDocumentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return EventInput; + return UpdateDocumentRequest; })(); - v2beta1.SentimentAnalysisRequestConfig = (function() { + v2beta1.KnowledgeOperationMetadata = (function() { /** - * Properties of a SentimentAnalysisRequestConfig. + * Properties of a KnowledgeOperationMetadata. * @memberof google.cloud.dialogflow.v2beta1 - * @interface ISentimentAnalysisRequestConfig - * @property {boolean|null} [analyzeQueryTextSentiment] SentimentAnalysisRequestConfig analyzeQueryTextSentiment + * @interface IKnowledgeOperationMetadata + * @property {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State|null} [state] KnowledgeOperationMetadata state */ /** - * Constructs a new SentimentAnalysisRequestConfig. + * Constructs a new KnowledgeOperationMetadata. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a SentimentAnalysisRequestConfig. - * @implements ISentimentAnalysisRequestConfig + * @classdesc Represents a KnowledgeOperationMetadata. + * @implements IKnowledgeOperationMetadata * @constructor - * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata=} [properties] Properties to set */ - function SentimentAnalysisRequestConfig(properties) { + function KnowledgeOperationMetadata(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -68839,75 +119689,75 @@ } /** - * SentimentAnalysisRequestConfig analyzeQueryTextSentiment. - * @member {boolean} analyzeQueryTextSentiment - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * KnowledgeOperationMetadata state. + * @member {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State} state + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata * @instance */ - SentimentAnalysisRequestConfig.prototype.analyzeQueryTextSentiment = false; + KnowledgeOperationMetadata.prototype.state = 0; /** - * Creates a new SentimentAnalysisRequestConfig instance using the specified properties. + * Creates a new KnowledgeOperationMetadata instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata * @static - * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig instance + * @param {google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata} KnowledgeOperationMetadata instance */ - SentimentAnalysisRequestConfig.create = function create(properties) { - return new SentimentAnalysisRequestConfig(properties); + KnowledgeOperationMetadata.create = function create(properties) { + return new KnowledgeOperationMetadata(properties); }; /** - * Encodes the specified SentimentAnalysisRequestConfig message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.verify|verify} messages. + * Encodes the specified KnowledgeOperationMetadata message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata * @static - * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig} message SentimentAnalysisRequestConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata} message KnowledgeOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SentimentAnalysisRequestConfig.encode = function encode(message, writer) { + KnowledgeOperationMetadata.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.analyzeQueryTextSentiment != null && Object.hasOwnProperty.call(message, "analyzeQueryTextSentiment")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.analyzeQueryTextSentiment); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.state); return writer; }; /** - * Encodes the specified SentimentAnalysisRequestConfig message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig.verify|verify} messages. + * Encodes the specified KnowledgeOperationMetadata message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata * @static - * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisRequestConfig} message SentimentAnalysisRequestConfig message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata} message KnowledgeOperationMetadata message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SentimentAnalysisRequestConfig.encodeDelimited = function encodeDelimited(message, writer) { + KnowledgeOperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer. + * Decodes a KnowledgeOperationMetadata message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata} KnowledgeOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SentimentAnalysisRequestConfig.decode = function decode(reader, length) { + KnowledgeOperationMetadata.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.analyzeQueryTextSentiment = reader.bool(); + message.state = reader.int32(); break; default: reader.skipType(tag & 7); @@ -68918,107 +119768,150 @@ }; /** - * Decodes a SentimentAnalysisRequestConfig message from the specified reader or buffer, length delimited. + * Decodes a KnowledgeOperationMetadata message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata} KnowledgeOperationMetadata * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SentimentAnalysisRequestConfig.decodeDelimited = function decodeDelimited(reader) { + KnowledgeOperationMetadata.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SentimentAnalysisRequestConfig message. + * Verifies a KnowledgeOperationMetadata message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SentimentAnalysisRequestConfig.verify = function verify(message) { + KnowledgeOperationMetadata.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.analyzeQueryTextSentiment != null && message.hasOwnProperty("analyzeQueryTextSentiment")) - if (typeof message.analyzeQueryTextSentiment !== "boolean") - return "analyzeQueryTextSentiment: boolean expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } return null; }; /** - * Creates a SentimentAnalysisRequestConfig message from a plain object. Also converts values to their respective internal types. + * Creates a KnowledgeOperationMetadata message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig} SentimentAnalysisRequestConfig + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata} KnowledgeOperationMetadata */ - SentimentAnalysisRequestConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig) + KnowledgeOperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig(); - if (object.analyzeQueryTextSentiment != null) - message.analyzeQueryTextSentiment = Boolean(object.analyzeQueryTextSentiment); + var message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata(); + switch (object.state) { + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "PENDING": + case 1: + message.state = 1; + break; + case "RUNNING": + case 2: + message.state = 2; + break; + case "DONE": + case 3: + message.state = 3; + break; + } return message; }; /** - * Creates a plain object from a SentimentAnalysisRequestConfig message. Also converts values to other types if specified. + * Creates a plain object from a KnowledgeOperationMetadata message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata * @static - * @param {google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig} message SentimentAnalysisRequestConfig + * @param {google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata} message KnowledgeOperationMetadata * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SentimentAnalysisRequestConfig.toObject = function toObject(message, options) { + KnowledgeOperationMetadata.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) - object.analyzeQueryTextSentiment = false; - if (message.analyzeQueryTextSentiment != null && message.hasOwnProperty("analyzeQueryTextSentiment")) - object.analyzeQueryTextSentiment = message.analyzeQueryTextSentiment; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State[message.state] : message.state; return object; }; /** - * Converts this SentimentAnalysisRequestConfig to JSON. + * Converts this KnowledgeOperationMetadata to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisRequestConfig + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata * @instance * @returns {Object.} JSON object */ - SentimentAnalysisRequestConfig.prototype.toJSON = function toJSON() { + KnowledgeOperationMetadata.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SentimentAnalysisRequestConfig; + /** + * State enum. + * @name google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} PENDING=1 PENDING value + * @property {number} RUNNING=2 RUNNING value + * @property {number} DONE=3 DONE value + */ + KnowledgeOperationMetadata.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PENDING"] = 1; + values[valuesById[2] = "RUNNING"] = 2; + values[valuesById[3] = "DONE"] = 3; + return values; + })(); + + return KnowledgeOperationMetadata; })(); - v2beta1.SentimentAnalysisResult = (function() { + v2beta1.ReloadDocumentRequest = (function() { /** - * Properties of a SentimentAnalysisResult. + * Properties of a ReloadDocumentRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface ISentimentAnalysisResult - * @property {google.cloud.dialogflow.v2beta1.ISentiment|null} [queryTextSentiment] SentimentAnalysisResult queryTextSentiment + * @interface IReloadDocumentRequest + * @property {string|null} [name] ReloadDocumentRequest name + * @property {google.cloud.dialogflow.v2beta1.IGcsSource|null} [gcsSource] ReloadDocumentRequest gcsSource + * @property {boolean|null} [importGcsCustomMetadata] ReloadDocumentRequest importGcsCustomMetadata */ /** - * Constructs a new SentimentAnalysisResult. + * Constructs a new ReloadDocumentRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a SentimentAnalysisResult. - * @implements ISentimentAnalysisResult + * @classdesc Represents a ReloadDocumentRequest. + * @implements IReloadDocumentRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IReloadDocumentRequest=} [properties] Properties to set */ - function SentimentAnalysisResult(properties) { + function ReloadDocumentRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -69026,75 +119919,115 @@ } /** - * SentimentAnalysisResult queryTextSentiment. - * @member {google.cloud.dialogflow.v2beta1.ISentiment|null|undefined} queryTextSentiment - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * ReloadDocumentRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest * @instance */ - SentimentAnalysisResult.prototype.queryTextSentiment = null; + ReloadDocumentRequest.prototype.name = ""; /** - * Creates a new SentimentAnalysisResult instance using the specified properties. + * ReloadDocumentRequest gcsSource. + * @member {google.cloud.dialogflow.v2beta1.IGcsSource|null|undefined} gcsSource + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * @instance + */ + ReloadDocumentRequest.prototype.gcsSource = null; + + /** + * ReloadDocumentRequest importGcsCustomMetadata. + * @member {boolean} importGcsCustomMetadata + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * @instance + */ + ReloadDocumentRequest.prototype.importGcsCustomMetadata = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * ReloadDocumentRequest source. + * @member {"gcsSource"|undefined} source + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest + * @instance + */ + Object.defineProperty(ReloadDocumentRequest.prototype, "source", { + get: $util.oneOfGetter($oneOfFields = ["gcsSource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ReloadDocumentRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisResult} SentimentAnalysisResult instance - */ - SentimentAnalysisResult.create = function create(properties) { - return new SentimentAnalysisResult(properties); + * @param {google.cloud.dialogflow.v2beta1.IReloadDocumentRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ReloadDocumentRequest} ReloadDocumentRequest instance + */ + ReloadDocumentRequest.create = function create(properties) { + return new ReloadDocumentRequest(properties); }; /** - * Encodes the specified SentimentAnalysisResult message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.verify|verify} messages. + * Encodes the specified ReloadDocumentRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ReloadDocumentRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IReloadDocumentRequest} message ReloadDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SentimentAnalysisResult.encode = function encode(message, writer) { + ReloadDocumentRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.queryTextSentiment != null && Object.hasOwnProperty.call(message, "queryTextSentiment")) - $root.google.cloud.dialogflow.v2beta1.Sentiment.encode(message.queryTextSentiment, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.gcsSource != null && Object.hasOwnProperty.call(message, "gcsSource")) + $root.google.cloud.dialogflow.v2beta1.GcsSource.encode(message.gcsSource, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.importGcsCustomMetadata != null && Object.hasOwnProperty.call(message, "importGcsCustomMetadata")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.importGcsCustomMetadata); return writer; }; /** - * Encodes the specified SentimentAnalysisResult message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.verify|verify} messages. + * Encodes the specified ReloadDocumentRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ReloadDocumentRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ISentimentAnalysisResult} message SentimentAnalysisResult message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IReloadDocumentRequest} message ReloadDocumentRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SentimentAnalysisResult.encodeDelimited = function encodeDelimited(message, writer) { + ReloadDocumentRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SentimentAnalysisResult message from the specified reader or buffer. + * Decodes a ReloadDocumentRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisResult} SentimentAnalysisResult + * @returns {google.cloud.dialogflow.v2beta1.ReloadDocumentRequest} ReloadDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SentimentAnalysisResult.decode = function decode(reader, length) { + ReloadDocumentRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ReloadDocumentRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.queryTextSentiment = $root.google.cloud.dialogflow.v2beta1.Sentiment.decode(reader, reader.uint32()); + message.name = reader.string(); + break; + case 3: + message.gcsSource = $root.google.cloud.dialogflow.v2beta1.GcsSource.decode(reader, reader.uint32()); + break; + case 4: + message.importGcsCustomMetadata = reader.bool(); break; default: reader.skipType(tag & 7); @@ -69105,113 +120038,138 @@ }; /** - * Decodes a SentimentAnalysisResult message from the specified reader or buffer, length delimited. + * Decodes a ReloadDocumentRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisResult} SentimentAnalysisResult + * @returns {google.cloud.dialogflow.v2beta1.ReloadDocumentRequest} ReloadDocumentRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SentimentAnalysisResult.decodeDelimited = function decodeDelimited(reader) { + ReloadDocumentRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SentimentAnalysisResult message. + * Verifies a ReloadDocumentRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SentimentAnalysisResult.verify = function verify(message) { + ReloadDocumentRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.queryTextSentiment != null && message.hasOwnProperty("queryTextSentiment")) { - var error = $root.google.cloud.dialogflow.v2beta1.Sentiment.verify(message.queryTextSentiment); - if (error) - return "queryTextSentiment." + error; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + properties.source = 1; + { + var error = $root.google.cloud.dialogflow.v2beta1.GcsSource.verify(message.gcsSource); + if (error) + return "gcsSource." + error; + } } + if (message.importGcsCustomMetadata != null && message.hasOwnProperty("importGcsCustomMetadata")) + if (typeof message.importGcsCustomMetadata !== "boolean") + return "importGcsCustomMetadata: boolean expected"; return null; }; /** - * Creates a SentimentAnalysisResult message from a plain object. Also converts values to their respective internal types. + * Creates a ReloadDocumentRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.SentimentAnalysisResult} SentimentAnalysisResult + * @returns {google.cloud.dialogflow.v2beta1.ReloadDocumentRequest} ReloadDocumentRequest */ - SentimentAnalysisResult.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult) + ReloadDocumentRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ReloadDocumentRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.SentimentAnalysisResult(); - if (object.queryTextSentiment != null) { - if (typeof object.queryTextSentiment !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.SentimentAnalysisResult.queryTextSentiment: object expected"); - message.queryTextSentiment = $root.google.cloud.dialogflow.v2beta1.Sentiment.fromObject(object.queryTextSentiment); + var message = new $root.google.cloud.dialogflow.v2beta1.ReloadDocumentRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.gcsSource != null) { + if (typeof object.gcsSource !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ReloadDocumentRequest.gcsSource: object expected"); + message.gcsSource = $root.google.cloud.dialogflow.v2beta1.GcsSource.fromObject(object.gcsSource); } + if (object.importGcsCustomMetadata != null) + message.importGcsCustomMetadata = Boolean(object.importGcsCustomMetadata); return message; }; /** - * Creates a plain object from a SentimentAnalysisResult message. Also converts values to other types if specified. + * Creates a plain object from a ReloadDocumentRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest * @static - * @param {google.cloud.dialogflow.v2beta1.SentimentAnalysisResult} message SentimentAnalysisResult + * @param {google.cloud.dialogflow.v2beta1.ReloadDocumentRequest} message ReloadDocumentRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SentimentAnalysisResult.toObject = function toObject(message, options) { + ReloadDocumentRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.queryTextSentiment = null; - if (message.queryTextSentiment != null && message.hasOwnProperty("queryTextSentiment")) - object.queryTextSentiment = $root.google.cloud.dialogflow.v2beta1.Sentiment.toObject(message.queryTextSentiment, options); + if (options.defaults) { + object.name = ""; + object.importGcsCustomMetadata = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.gcsSource != null && message.hasOwnProperty("gcsSource")) { + object.gcsSource = $root.google.cloud.dialogflow.v2beta1.GcsSource.toObject(message.gcsSource, options); + if (options.oneofs) + object.source = "gcsSource"; + } + if (message.importGcsCustomMetadata != null && message.hasOwnProperty("importGcsCustomMetadata")) + object.importGcsCustomMetadata = message.importGcsCustomMetadata; return object; }; /** - * Converts this SentimentAnalysisResult to JSON. + * Converts this ReloadDocumentRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.SentimentAnalysisResult + * @memberof google.cloud.dialogflow.v2beta1.ReloadDocumentRequest * @instance * @returns {Object.} JSON object */ - SentimentAnalysisResult.prototype.toJSON = function toJSON() { + ReloadDocumentRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return SentimentAnalysisResult; + return ReloadDocumentRequest; })(); - v2beta1.Sentiment = (function() { + v2beta1.HumanAgentAssistantEvent = (function() { /** - * Properties of a Sentiment. + * Properties of a HumanAgentAssistantEvent. * @memberof google.cloud.dialogflow.v2beta1 - * @interface ISentiment - * @property {number|null} [score] Sentiment score - * @property {number|null} [magnitude] Sentiment magnitude + * @interface IHumanAgentAssistantEvent + * @property {string|null} [conversation] HumanAgentAssistantEvent conversation + * @property {string|null} [participant] HumanAgentAssistantEvent participant + * @property {Array.|null} [suggestionResults] HumanAgentAssistantEvent suggestionResults */ /** - * Constructs a new Sentiment. + * Constructs a new HumanAgentAssistantEvent. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a Sentiment. - * @implements ISentiment + * @classdesc Represents a HumanAgentAssistantEvent. + * @implements IHumanAgentAssistantEvent * @constructor - * @param {google.cloud.dialogflow.v2beta1.ISentiment=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IHumanAgentAssistantEvent=} [properties] Properties to set */ - function Sentiment(properties) { + function HumanAgentAssistantEvent(properties) { + this.suggestionResults = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -69219,88 +120177,104 @@ } /** - * Sentiment score. - * @member {number} score - * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * HumanAgentAssistantEvent conversation. + * @member {string} conversation + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent * @instance */ - Sentiment.prototype.score = 0; + HumanAgentAssistantEvent.prototype.conversation = ""; /** - * Sentiment magnitude. - * @member {number} magnitude - * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * HumanAgentAssistantEvent participant. + * @member {string} participant + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent * @instance */ - Sentiment.prototype.magnitude = 0; + HumanAgentAssistantEvent.prototype.participant = ""; /** - * Creates a new Sentiment instance using the specified properties. + * HumanAgentAssistantEvent suggestionResults. + * @member {Array.} suggestionResults + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent + * @instance + */ + HumanAgentAssistantEvent.prototype.suggestionResults = $util.emptyArray; + + /** + * Creates a new HumanAgentAssistantEvent instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent * @static - * @param {google.cloud.dialogflow.v2beta1.ISentiment=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.Sentiment} Sentiment instance + * @param {google.cloud.dialogflow.v2beta1.IHumanAgentAssistantEvent=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent} HumanAgentAssistantEvent instance */ - Sentiment.create = function create(properties) { - return new Sentiment(properties); + HumanAgentAssistantEvent.create = function create(properties) { + return new HumanAgentAssistantEvent(properties); }; /** - * Encodes the specified Sentiment message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Sentiment.verify|verify} messages. + * Encodes the specified HumanAgentAssistantEvent message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent * @static - * @param {google.cloud.dialogflow.v2beta1.ISentiment} message Sentiment message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IHumanAgentAssistantEvent} message HumanAgentAssistantEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Sentiment.encode = function encode(message, writer) { + HumanAgentAssistantEvent.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.score != null && Object.hasOwnProperty.call(message, "score")) - writer.uint32(/* id 1, wireType 5 =*/13).float(message.score); - if (message.magnitude != null && Object.hasOwnProperty.call(message, "magnitude")) - writer.uint32(/* id 2, wireType 5 =*/21).float(message.magnitude); + if (message.conversation != null && Object.hasOwnProperty.call(message, "conversation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.conversation); + if (message.participant != null && Object.hasOwnProperty.call(message, "participant")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.participant); + if (message.suggestionResults != null && message.suggestionResults.length) + for (var i = 0; i < message.suggestionResults.length; ++i) + $root.google.cloud.dialogflow.v2beta1.SuggestionResult.encode(message.suggestionResults[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); return writer; }; /** - * Encodes the specified Sentiment message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.Sentiment.verify|verify} messages. + * Encodes the specified HumanAgentAssistantEvent message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent * @static - * @param {google.cloud.dialogflow.v2beta1.ISentiment} message Sentiment message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IHumanAgentAssistantEvent} message HumanAgentAssistantEvent message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Sentiment.encodeDelimited = function encodeDelimited(message, writer) { + HumanAgentAssistantEvent.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Sentiment message from the specified reader or buffer. + * Decodes a HumanAgentAssistantEvent message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.Sentiment} Sentiment + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent} HumanAgentAssistantEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Sentiment.decode = function decode(reader, length) { + HumanAgentAssistantEvent.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.Sentiment(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.score = reader.float(); + message.conversation = reader.string(); break; - case 2: - message.magnitude = reader.float(); + case 3: + message.participant = reader.string(); + break; + case 5: + if (!(message.suggestionResults && message.suggestionResults.length)) + message.suggestionResults = []; + message.suggestionResults.push($root.google.cloud.dialogflow.v2beta1.SuggestionResult.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -69311,319 +120285,344 @@ }; /** - * Decodes a Sentiment message from the specified reader or buffer, length delimited. + * Decodes a HumanAgentAssistantEvent message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.Sentiment} Sentiment + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent} HumanAgentAssistantEvent * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Sentiment.decodeDelimited = function decodeDelimited(reader) { + HumanAgentAssistantEvent.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Sentiment message. + * Verifies a HumanAgentAssistantEvent message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Sentiment.verify = function verify(message) { + HumanAgentAssistantEvent.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.score != null && message.hasOwnProperty("score")) - if (typeof message.score !== "number") - return "score: number expected"; - if (message.magnitude != null && message.hasOwnProperty("magnitude")) - if (typeof message.magnitude !== "number") - return "magnitude: number expected"; + if (message.conversation != null && message.hasOwnProperty("conversation")) + if (!$util.isString(message.conversation)) + return "conversation: string expected"; + if (message.participant != null && message.hasOwnProperty("participant")) + if (!$util.isString(message.participant)) + return "participant: string expected"; + if (message.suggestionResults != null && message.hasOwnProperty("suggestionResults")) { + if (!Array.isArray(message.suggestionResults)) + return "suggestionResults: array expected"; + for (var i = 0; i < message.suggestionResults.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.verify(message.suggestionResults[i]); + if (error) + return "suggestionResults." + error; + } + } return null; }; /** - * Creates a Sentiment message from a plain object. Also converts values to their respective internal types. + * Creates a HumanAgentAssistantEvent message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.Sentiment} Sentiment + * @returns {google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent} HumanAgentAssistantEvent */ - Sentiment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.Sentiment) + HumanAgentAssistantEvent.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.Sentiment(); - if (object.score != null) - message.score = Number(object.score); - if (object.magnitude != null) - message.magnitude = Number(object.magnitude); + var message = new $root.google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent(); + if (object.conversation != null) + message.conversation = String(object.conversation); + if (object.participant != null) + message.participant = String(object.participant); + if (object.suggestionResults) { + if (!Array.isArray(object.suggestionResults)) + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent.suggestionResults: array expected"); + message.suggestionResults = []; + for (var i = 0; i < object.suggestionResults.length; ++i) { + if (typeof object.suggestionResults[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent.suggestionResults: object expected"); + message.suggestionResults[i] = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.fromObject(object.suggestionResults[i]); + } + } return message; }; /** - * Creates a plain object from a Sentiment message. Also converts values to other types if specified. + * Creates a plain object from a HumanAgentAssistantEvent message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent * @static - * @param {google.cloud.dialogflow.v2beta1.Sentiment} message Sentiment + * @param {google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent} message HumanAgentAssistantEvent * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - Sentiment.toObject = function toObject(message, options) { + HumanAgentAssistantEvent.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.suggestionResults = []; if (options.defaults) { - object.score = 0; - object.magnitude = 0; + object.conversation = ""; + object.participant = ""; + } + if (message.conversation != null && message.hasOwnProperty("conversation")) + object.conversation = message.conversation; + if (message.participant != null && message.hasOwnProperty("participant")) + object.participant = message.participant; + if (message.suggestionResults && message.suggestionResults.length) { + object.suggestionResults = []; + for (var j = 0; j < message.suggestionResults.length; ++j) + object.suggestionResults[j] = $root.google.cloud.dialogflow.v2beta1.SuggestionResult.toObject(message.suggestionResults[j], options); } - if (message.score != null && message.hasOwnProperty("score")) - object.score = options.json && !isFinite(message.score) ? String(message.score) : message.score; - if (message.magnitude != null && message.hasOwnProperty("magnitude")) - object.magnitude = options.json && !isFinite(message.magnitude) ? String(message.magnitude) : message.magnitude; return object; }; /** - * Converts this Sentiment to JSON. + * Converts this HumanAgentAssistantEvent to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.Sentiment + * @memberof google.cloud.dialogflow.v2beta1.HumanAgentAssistantEvent * @instance * @returns {Object.} JSON object */ - Sentiment.prototype.toJSON = function toJSON() { + HumanAgentAssistantEvent.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return Sentiment; + return HumanAgentAssistantEvent; })(); - v2beta1.SessionEntityTypes = (function() { + v2beta1.KnowledgeBases = (function() { /** - * Constructs a new SessionEntityTypes service. + * Constructs a new KnowledgeBases service. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a SessionEntityTypes + * @classdesc Represents a KnowledgeBases * @extends $protobuf.rpc.Service * @constructor * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited */ - function SessionEntityTypes(rpcImpl, requestDelimited, responseDelimited) { + function KnowledgeBases(rpcImpl, requestDelimited, responseDelimited) { $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); } - (SessionEntityTypes.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = SessionEntityTypes; + (KnowledgeBases.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = KnowledgeBases; /** - * Creates new SessionEntityTypes service using the specified rpc implementation. + * Creates new KnowledgeBases service using the specified rpc implementation. * @function create - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases * @static * @param {$protobuf.RPCImpl} rpcImpl RPC implementation * @param {boolean} [requestDelimited=false] Whether requests are length-delimited * @param {boolean} [responseDelimited=false] Whether responses are length-delimited - * @returns {SessionEntityTypes} RPC service. Useful where requests and/or responses are streamed. + * @returns {KnowledgeBases} RPC service. Useful where requests and/or responses are streamed. */ - SessionEntityTypes.create = function create(rpcImpl, requestDelimited, responseDelimited) { + KnowledgeBases.create = function create(rpcImpl, requestDelimited, responseDelimited) { return new this(rpcImpl, requestDelimited, responseDelimited); }; /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#listSessionEntityTypes}. - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes - * @typedef ListSessionEntityTypesCallback + * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#listKnowledgeBases}. + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases + * @typedef ListKnowledgeBasesCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse} [response] ListSessionEntityTypesResponse + * @param {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse} [response] ListKnowledgeBasesResponse */ /** - * Calls ListSessionEntityTypes. - * @function listSessionEntityTypes - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * Calls ListKnowledgeBases. + * @function listKnowledgeBases + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases * @instance - * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest} request ListSessionEntityTypesRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.SessionEntityTypes.ListSessionEntityTypesCallback} callback Node-style callback called with the error, if any, and ListSessionEntityTypesResponse + * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest} request ListKnowledgeBasesRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.KnowledgeBases.ListKnowledgeBasesCallback} callback Node-style callback called with the error, if any, and ListKnowledgeBasesResponse * @returns {undefined} * @variation 1 */ - Object.defineProperty(SessionEntityTypes.prototype.listSessionEntityTypes = function listSessionEntityTypes(request, callback) { - return this.rpcCall(listSessionEntityTypes, $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest, $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse, request, callback); - }, "name", { value: "ListSessionEntityTypes" }); + Object.defineProperty(KnowledgeBases.prototype.listKnowledgeBases = function listKnowledgeBases(request, callback) { + return this.rpcCall(listKnowledgeBases, $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest, $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse, request, callback); + }, "name", { value: "ListKnowledgeBases" }); /** - * Calls ListSessionEntityTypes. - * @function listSessionEntityTypes - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * Calls ListKnowledgeBases. + * @function listKnowledgeBases + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases * @instance - * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest} request ListSessionEntityTypesRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest} request ListKnowledgeBasesRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#getSessionEntityType}. - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes - * @typedef GetSessionEntityTypeCallback + * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#getKnowledgeBase}. + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases + * @typedef GetKnowledgeBaseCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.SessionEntityType} [response] SessionEntityType + * @param {google.cloud.dialogflow.v2beta1.KnowledgeBase} [response] KnowledgeBase */ /** - * Calls GetSessionEntityType. - * @function getSessionEntityType - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * Calls GetKnowledgeBase. + * @function getKnowledgeBase + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest} request GetSessionEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.SessionEntityTypes.GetSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @param {google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest} request GetKnowledgeBaseRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.KnowledgeBases.GetKnowledgeBaseCallback} callback Node-style callback called with the error, if any, and KnowledgeBase * @returns {undefined} * @variation 1 */ - Object.defineProperty(SessionEntityTypes.prototype.getSessionEntityType = function getSessionEntityType(request, callback) { - return this.rpcCall(getSessionEntityType, $root.google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest, $root.google.cloud.dialogflow.v2beta1.SessionEntityType, request, callback); - }, "name", { value: "GetSessionEntityType" }); + Object.defineProperty(KnowledgeBases.prototype.getKnowledgeBase = function getKnowledgeBase(request, callback) { + return this.rpcCall(getKnowledgeBase, $root.google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest, $root.google.cloud.dialogflow.v2beta1.KnowledgeBase, request, callback); + }, "name", { value: "GetKnowledgeBase" }); /** - * Calls GetSessionEntityType. - * @function getSessionEntityType - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * Calls GetKnowledgeBase. + * @function getKnowledgeBase + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases * @instance - * @param {google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest} request GetSessionEntityTypeRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest} request GetKnowledgeBaseRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#createSessionEntityType}. - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes - * @typedef CreateSessionEntityTypeCallback + * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#createKnowledgeBase}. + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases + * @typedef CreateKnowledgeBaseCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.SessionEntityType} [response] SessionEntityType + * @param {google.cloud.dialogflow.v2beta1.KnowledgeBase} [response] KnowledgeBase */ /** - * Calls CreateSessionEntityType. - * @function createSessionEntityType - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * Calls CreateKnowledgeBase. + * @function createKnowledgeBase + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases * @instance - * @param {google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest} request CreateSessionEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.SessionEntityTypes.CreateSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @param {google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest} request CreateKnowledgeBaseRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.KnowledgeBases.CreateKnowledgeBaseCallback} callback Node-style callback called with the error, if any, and KnowledgeBase * @returns {undefined} * @variation 1 */ - Object.defineProperty(SessionEntityTypes.prototype.createSessionEntityType = function createSessionEntityType(request, callback) { - return this.rpcCall(createSessionEntityType, $root.google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest, $root.google.cloud.dialogflow.v2beta1.SessionEntityType, request, callback); - }, "name", { value: "CreateSessionEntityType" }); + Object.defineProperty(KnowledgeBases.prototype.createKnowledgeBase = function createKnowledgeBase(request, callback) { + return this.rpcCall(createKnowledgeBase, $root.google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest, $root.google.cloud.dialogflow.v2beta1.KnowledgeBase, request, callback); + }, "name", { value: "CreateKnowledgeBase" }); /** - * Calls CreateSessionEntityType. - * @function createSessionEntityType - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * Calls CreateKnowledgeBase. + * @function createKnowledgeBase + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases * @instance - * @param {google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest} request CreateSessionEntityTypeRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest} request CreateKnowledgeBaseRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#updateSessionEntityType}. - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes - * @typedef UpdateSessionEntityTypeCallback + * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#deleteKnowledgeBase}. + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases + * @typedef DeleteKnowledgeBaseCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.cloud.dialogflow.v2beta1.SessionEntityType} [response] SessionEntityType + * @param {google.protobuf.Empty} [response] Empty */ /** - * Calls UpdateSessionEntityType. - * @function updateSessionEntityType - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * Calls DeleteKnowledgeBase. + * @function deleteKnowledgeBase + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases * @instance - * @param {google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest} request UpdateSessionEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.SessionEntityTypes.UpdateSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and SessionEntityType + * @param {google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest} request DeleteKnowledgeBaseRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.KnowledgeBases.DeleteKnowledgeBaseCallback} callback Node-style callback called with the error, if any, and Empty * @returns {undefined} * @variation 1 */ - Object.defineProperty(SessionEntityTypes.prototype.updateSessionEntityType = function updateSessionEntityType(request, callback) { - return this.rpcCall(updateSessionEntityType, $root.google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest, $root.google.cloud.dialogflow.v2beta1.SessionEntityType, request, callback); - }, "name", { value: "UpdateSessionEntityType" }); + Object.defineProperty(KnowledgeBases.prototype.deleteKnowledgeBase = function deleteKnowledgeBase(request, callback) { + return this.rpcCall(deleteKnowledgeBase, $root.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest, $root.google.protobuf.Empty, request, callback); + }, "name", { value: "DeleteKnowledgeBase" }); /** - * Calls UpdateSessionEntityType. - * @function updateSessionEntityType - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * Calls DeleteKnowledgeBase. + * @function deleteKnowledgeBase + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases * @instance - * @param {google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest} request UpdateSessionEntityTypeRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest} request DeleteKnowledgeBaseRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ /** - * Callback as used by {@link google.cloud.dialogflow.v2beta1.SessionEntityTypes#deleteSessionEntityType}. - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes - * @typedef DeleteSessionEntityTypeCallback + * Callback as used by {@link google.cloud.dialogflow.v2beta1.KnowledgeBases#updateKnowledgeBase}. + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases + * @typedef UpdateKnowledgeBaseCallback * @type {function} * @param {Error|null} error Error, if any - * @param {google.protobuf.Empty} [response] Empty + * @param {google.cloud.dialogflow.v2beta1.KnowledgeBase} [response] KnowledgeBase */ /** - * Calls DeleteSessionEntityType. - * @function deleteSessionEntityType - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * Calls UpdateKnowledgeBase. + * @function updateKnowledgeBase + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest} request DeleteSessionEntityTypeRequest message or plain object - * @param {google.cloud.dialogflow.v2beta1.SessionEntityTypes.DeleteSessionEntityTypeCallback} callback Node-style callback called with the error, if any, and Empty + * @param {google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest} request UpdateKnowledgeBaseRequest message or plain object + * @param {google.cloud.dialogflow.v2beta1.KnowledgeBases.UpdateKnowledgeBaseCallback} callback Node-style callback called with the error, if any, and KnowledgeBase * @returns {undefined} * @variation 1 */ - Object.defineProperty(SessionEntityTypes.prototype.deleteSessionEntityType = function deleteSessionEntityType(request, callback) { - return this.rpcCall(deleteSessionEntityType, $root.google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest, $root.google.protobuf.Empty, request, callback); - }, "name", { value: "DeleteSessionEntityType" }); + Object.defineProperty(KnowledgeBases.prototype.updateKnowledgeBase = function updateKnowledgeBase(request, callback) { + return this.rpcCall(updateKnowledgeBase, $root.google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest, $root.google.cloud.dialogflow.v2beta1.KnowledgeBase, request, callback); + }, "name", { value: "UpdateKnowledgeBase" }); /** - * Calls DeleteSessionEntityType. - * @function deleteSessionEntityType - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityTypes + * Calls UpdateKnowledgeBase. + * @function updateKnowledgeBase + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBases * @instance - * @param {google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest} request DeleteSessionEntityTypeRequest message or plain object - * @returns {Promise} Promise + * @param {google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest} request UpdateKnowledgeBaseRequest message or plain object + * @returns {Promise} Promise * @variation 2 */ - return SessionEntityTypes; + return KnowledgeBases; })(); - v2beta1.SessionEntityType = (function() { + v2beta1.KnowledgeBase = (function() { /** - * Properties of a SessionEntityType. + * Properties of a KnowledgeBase. * @memberof google.cloud.dialogflow.v2beta1 - * @interface ISessionEntityType - * @property {string|null} [name] SessionEntityType name - * @property {google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode|null} [entityOverrideMode] SessionEntityType entityOverrideMode - * @property {Array.|null} [entities] SessionEntityType entities + * @interface IKnowledgeBase + * @property {string|null} [name] KnowledgeBase name + * @property {string|null} [displayName] KnowledgeBase displayName + * @property {string|null} [languageCode] KnowledgeBase languageCode */ /** - * Constructs a new SessionEntityType. + * Constructs a new KnowledgeBase. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a SessionEntityType. - * @implements ISessionEntityType + * @classdesc Represents a KnowledgeBase. + * @implements IKnowledgeBase * @constructor - * @param {google.cloud.dialogflow.v2beta1.ISessionEntityType=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IKnowledgeBase=} [properties] Properties to set */ - function SessionEntityType(properties) { - this.entities = []; + function KnowledgeBase(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -69631,91 +120630,90 @@ } /** - * SessionEntityType name. + * KnowledgeBase name. * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase * @instance */ - SessionEntityType.prototype.name = ""; + KnowledgeBase.prototype.name = ""; /** - * SessionEntityType entityOverrideMode. - * @member {google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode} entityOverrideMode - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * KnowledgeBase displayName. + * @member {string} displayName + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase * @instance */ - SessionEntityType.prototype.entityOverrideMode = 0; + KnowledgeBase.prototype.displayName = ""; /** - * SessionEntityType entities. - * @member {Array.} entities - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * KnowledgeBase languageCode. + * @member {string} languageCode + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase * @instance */ - SessionEntityType.prototype.entities = $util.emptyArray; + KnowledgeBase.prototype.languageCode = ""; /** - * Creates a new SessionEntityType instance using the specified properties. + * Creates a new KnowledgeBase instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase * @static - * @param {google.cloud.dialogflow.v2beta1.ISessionEntityType=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.SessionEntityType} SessionEntityType instance + * @param {google.cloud.dialogflow.v2beta1.IKnowledgeBase=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeBase} KnowledgeBase instance */ - SessionEntityType.create = function create(properties) { - return new SessionEntityType(properties); + KnowledgeBase.create = function create(properties) { + return new KnowledgeBase(properties); }; /** - * Encodes the specified SessionEntityType message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SessionEntityType.verify|verify} messages. + * Encodes the specified KnowledgeBase message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeBase.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase * @static - * @param {google.cloud.dialogflow.v2beta1.ISessionEntityType} message SessionEntityType message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IKnowledgeBase} message KnowledgeBase message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SessionEntityType.encode = function encode(message, writer) { + KnowledgeBase.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.entityOverrideMode != null && Object.hasOwnProperty.call(message, "entityOverrideMode")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.entityOverrideMode); - if (message.entities != null && message.entities.length) - for (var i = 0; i < message.entities.length; ++i) - $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.encode(message.entities[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.displayName != null && Object.hasOwnProperty.call(message, "displayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.displayName); + if (message.languageCode != null && Object.hasOwnProperty.call(message, "languageCode")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.languageCode); return writer; }; /** - * Encodes the specified SessionEntityType message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.SessionEntityType.verify|verify} messages. + * Encodes the specified KnowledgeBase message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.KnowledgeBase.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase * @static - * @param {google.cloud.dialogflow.v2beta1.ISessionEntityType} message SessionEntityType message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IKnowledgeBase} message KnowledgeBase message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - SessionEntityType.encodeDelimited = function encodeDelimited(message, writer) { + KnowledgeBase.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a SessionEntityType message from the specified reader or buffer. + * Decodes a KnowledgeBase message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.SessionEntityType} SessionEntityType + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeBase} KnowledgeBase * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SessionEntityType.decode = function decode(reader, length) { + KnowledgeBase.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.SessionEntityType(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeBase(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -69723,12 +120721,10 @@ message.name = reader.string(); break; case 2: - message.entityOverrideMode = reader.int32(); + message.displayName = reader.string(); break; - case 3: - if (!(message.entities && message.entities.length)) - message.entities = []; - message.entities.push($root.google.cloud.dialogflow.v2beta1.EntityType.Entity.decode(reader, reader.uint32())); + case 4: + message.languageCode = reader.string(); break; default: reader.skipType(tag & 7); @@ -69739,178 +120735,127 @@ }; /** - * Decodes a SessionEntityType message from the specified reader or buffer, length delimited. + * Decodes a KnowledgeBase message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.SessionEntityType} SessionEntityType + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeBase} KnowledgeBase * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - SessionEntityType.decodeDelimited = function decodeDelimited(reader) { + KnowledgeBase.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a SessionEntityType message. + * Verifies a KnowledgeBase message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - SessionEntityType.verify = function verify(message) { + KnowledgeBase.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) if (!$util.isString(message.name)) return "name: string expected"; - if (message.entityOverrideMode != null && message.hasOwnProperty("entityOverrideMode")) - switch (message.entityOverrideMode) { - default: - return "entityOverrideMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.entities != null && message.hasOwnProperty("entities")) { - if (!Array.isArray(message.entities)) - return "entities: array expected"; - for (var i = 0; i < message.entities.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.verify(message.entities[i]); - if (error) - return "entities." + error; - } - } + if (message.displayName != null && message.hasOwnProperty("displayName")) + if (!$util.isString(message.displayName)) + return "displayName: string expected"; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + if (!$util.isString(message.languageCode)) + return "languageCode: string expected"; return null; }; /** - * Creates a SessionEntityType message from a plain object. Also converts values to their respective internal types. + * Creates a KnowledgeBase message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.SessionEntityType} SessionEntityType + * @returns {google.cloud.dialogflow.v2beta1.KnowledgeBase} KnowledgeBase */ - SessionEntityType.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.SessionEntityType) + KnowledgeBase.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.KnowledgeBase) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.SessionEntityType(); + var message = new $root.google.cloud.dialogflow.v2beta1.KnowledgeBase(); if (object.name != null) message.name = String(object.name); - switch (object.entityOverrideMode) { - case "ENTITY_OVERRIDE_MODE_UNSPECIFIED": - case 0: - message.entityOverrideMode = 0; - break; - case "ENTITY_OVERRIDE_MODE_OVERRIDE": - case 1: - message.entityOverrideMode = 1; - break; - case "ENTITY_OVERRIDE_MODE_SUPPLEMENT": - case 2: - message.entityOverrideMode = 2; - break; - } - if (object.entities) { - if (!Array.isArray(object.entities)) - throw TypeError(".google.cloud.dialogflow.v2beta1.SessionEntityType.entities: array expected"); - message.entities = []; - for (var i = 0; i < object.entities.length; ++i) { - if (typeof object.entities[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.SessionEntityType.entities: object expected"); - message.entities[i] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.fromObject(object.entities[i]); - } - } + if (object.displayName != null) + message.displayName = String(object.displayName); + if (object.languageCode != null) + message.languageCode = String(object.languageCode); return message; }; /** - * Creates a plain object from a SessionEntityType message. Also converts values to other types if specified. + * Creates a plain object from a KnowledgeBase message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase * @static - * @param {google.cloud.dialogflow.v2beta1.SessionEntityType} message SessionEntityType + * @param {google.cloud.dialogflow.v2beta1.KnowledgeBase} message KnowledgeBase * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - SessionEntityType.toObject = function toObject(message, options) { + KnowledgeBase.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.entities = []; if (options.defaults) { object.name = ""; - object.entityOverrideMode = options.enums === String ? "ENTITY_OVERRIDE_MODE_UNSPECIFIED" : 0; + object.displayName = ""; + object.languageCode = ""; } if (message.name != null && message.hasOwnProperty("name")) object.name = message.name; - if (message.entityOverrideMode != null && message.hasOwnProperty("entityOverrideMode")) - object.entityOverrideMode = options.enums === String ? $root.google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode[message.entityOverrideMode] : message.entityOverrideMode; - if (message.entities && message.entities.length) { - object.entities = []; - for (var j = 0; j < message.entities.length; ++j) - object.entities[j] = $root.google.cloud.dialogflow.v2beta1.EntityType.Entity.toObject(message.entities[j], options); - } + if (message.displayName != null && message.hasOwnProperty("displayName")) + object.displayName = message.displayName; + if (message.languageCode != null && message.hasOwnProperty("languageCode")) + object.languageCode = message.languageCode; return object; }; /** - * Converts this SessionEntityType to JSON. + * Converts this KnowledgeBase to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.SessionEntityType + * @memberof google.cloud.dialogflow.v2beta1.KnowledgeBase * @instance * @returns {Object.} JSON object */ - SessionEntityType.prototype.toJSON = function toJSON() { + KnowledgeBase.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - /** - * EntityOverrideMode enum. - * @name google.cloud.dialogflow.v2beta1.SessionEntityType.EntityOverrideMode - * @enum {number} - * @property {number} ENTITY_OVERRIDE_MODE_UNSPECIFIED=0 ENTITY_OVERRIDE_MODE_UNSPECIFIED value - * @property {number} ENTITY_OVERRIDE_MODE_OVERRIDE=1 ENTITY_OVERRIDE_MODE_OVERRIDE value - * @property {number} ENTITY_OVERRIDE_MODE_SUPPLEMENT=2 ENTITY_OVERRIDE_MODE_SUPPLEMENT value - */ - SessionEntityType.EntityOverrideMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ENTITY_OVERRIDE_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENTITY_OVERRIDE_MODE_OVERRIDE"] = 1; - values[valuesById[2] = "ENTITY_OVERRIDE_MODE_SUPPLEMENT"] = 2; - return values; - })(); - - return SessionEntityType; + return KnowledgeBase; })(); - v2beta1.ListSessionEntityTypesRequest = (function() { + v2beta1.ListKnowledgeBasesRequest = (function() { /** - * Properties of a ListSessionEntityTypesRequest. + * Properties of a ListKnowledgeBasesRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListSessionEntityTypesRequest - * @property {string|null} [parent] ListSessionEntityTypesRequest parent - * @property {number|null} [pageSize] ListSessionEntityTypesRequest pageSize - * @property {string|null} [pageToken] ListSessionEntityTypesRequest pageToken + * @interface IListKnowledgeBasesRequest + * @property {string|null} [parent] ListKnowledgeBasesRequest parent + * @property {number|null} [pageSize] ListKnowledgeBasesRequest pageSize + * @property {string|null} [pageToken] ListKnowledgeBasesRequest pageToken + * @property {string|null} [filter] ListKnowledgeBasesRequest filter */ /** - * Constructs a new ListSessionEntityTypesRequest. + * Constructs a new ListKnowledgeBasesRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListSessionEntityTypesRequest. - * @implements IListSessionEntityTypesRequest + * @classdesc Represents a ListKnowledgeBasesRequest. + * @implements IListKnowledgeBasesRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest=} [properties] Properties to set */ - function ListSessionEntityTypesRequest(properties) { + function ListKnowledgeBasesRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -69918,51 +120863,59 @@ } /** - * ListSessionEntityTypesRequest parent. + * ListKnowledgeBasesRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest * @instance */ - ListSessionEntityTypesRequest.prototype.parent = ""; + ListKnowledgeBasesRequest.prototype.parent = ""; /** - * ListSessionEntityTypesRequest pageSize. + * ListKnowledgeBasesRequest pageSize. * @member {number} pageSize - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest * @instance */ - ListSessionEntityTypesRequest.prototype.pageSize = 0; + ListKnowledgeBasesRequest.prototype.pageSize = 0; /** - * ListSessionEntityTypesRequest pageToken. + * ListKnowledgeBasesRequest pageToken. * @member {string} pageToken - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest * @instance */ - ListSessionEntityTypesRequest.prototype.pageToken = ""; + ListKnowledgeBasesRequest.prototype.pageToken = ""; /** - * Creates a new ListSessionEntityTypesRequest instance using the specified properties. + * ListKnowledgeBasesRequest filter. + * @member {string} filter + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest + * @instance + */ + ListKnowledgeBasesRequest.prototype.filter = ""; + + /** + * Creates a new ListKnowledgeBasesRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest instance + * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest} ListKnowledgeBasesRequest instance */ - ListSessionEntityTypesRequest.create = function create(properties) { - return new ListSessionEntityTypesRequest(properties); + ListKnowledgeBasesRequest.create = function create(properties) { + return new ListKnowledgeBasesRequest(properties); }; /** - * Encodes the specified ListSessionEntityTypesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest.verify|verify} messages. + * Encodes the specified ListKnowledgeBasesRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest} message ListSessionEntityTypesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest} message ListKnowledgeBasesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSessionEntityTypesRequest.encode = function encode(message, writer) { + ListKnowledgeBasesRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) @@ -69971,37 +120924,39 @@ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.pageSize); if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) writer.uint32(/* id 3, wireType 2 =*/26).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.filter); return writer; }; /** - * Encodes the specified ListSessionEntityTypesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest.verify|verify} messages. + * Encodes the specified ListKnowledgeBasesRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesRequest} message ListSessionEntityTypesRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesRequest} message ListKnowledgeBasesRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSessionEntityTypesRequest.encodeDelimited = function encodeDelimited(message, writer) { + ListKnowledgeBasesRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer. + * Decodes a ListKnowledgeBasesRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest + * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest} ListKnowledgeBasesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSessionEntityTypesRequest.decode = function decode(reader, length) { + ListKnowledgeBasesRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -70014,6 +120969,9 @@ case 3: message.pageToken = reader.string(); break; + case 4: + message.filter = reader.string(); + break; default: reader.skipType(tag & 7); break; @@ -70023,30 +120981,30 @@ }; /** - * Decodes a ListSessionEntityTypesRequest message from the specified reader or buffer, length delimited. + * Decodes a ListKnowledgeBasesRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest + * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest} ListKnowledgeBasesRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSessionEntityTypesRequest.decodeDelimited = function decodeDelimited(reader) { + ListKnowledgeBasesRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSessionEntityTypesRequest message. + * Verifies a ListKnowledgeBasesRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSessionEntityTypesRequest.verify = function verify(message) { + ListKnowledgeBasesRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) @@ -70058,40 +121016,45 @@ if (message.pageToken != null && message.hasOwnProperty("pageToken")) if (!$util.isString(message.pageToken)) return "pageToken: string expected"; + if (message.filter != null && message.hasOwnProperty("filter")) + if (!$util.isString(message.filter)) + return "filter: string expected"; return null; }; /** - * Creates a ListSessionEntityTypesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a ListKnowledgeBasesRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest} ListSessionEntityTypesRequest + * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest} ListKnowledgeBasesRequest */ - ListSessionEntityTypesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest) + ListKnowledgeBasesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest(); + var message = new $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest(); if (object.parent != null) message.parent = String(object.parent); if (object.pageSize != null) message.pageSize = object.pageSize | 0; if (object.pageToken != null) message.pageToken = String(object.pageToken); + if (object.filter != null) + message.filter = String(object.filter); return message; }; /** - * Creates a plain object from a ListSessionEntityTypesRequest message. Also converts values to other types if specified. + * Creates a plain object from a ListKnowledgeBasesRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest} message ListSessionEntityTypesRequest + * @param {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest} message ListKnowledgeBasesRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSessionEntityTypesRequest.toObject = function toObject(message, options) { + ListKnowledgeBasesRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -70099,6 +121062,7 @@ object.parent = ""; object.pageSize = 0; object.pageToken = ""; + object.filter = ""; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; @@ -70106,43 +121070,45 @@ object.pageSize = message.pageSize; if (message.pageToken != null && message.hasOwnProperty("pageToken")) object.pageToken = message.pageToken; + if (message.filter != null && message.hasOwnProperty("filter")) + object.filter = message.filter; return object; }; /** - * Converts this ListSessionEntityTypesRequest to JSON. + * Converts this ListKnowledgeBasesRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesRequest + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesRequest * @instance * @returns {Object.} JSON object */ - ListSessionEntityTypesRequest.prototype.toJSON = function toJSON() { + ListKnowledgeBasesRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListSessionEntityTypesRequest; + return ListKnowledgeBasesRequest; })(); - v2beta1.ListSessionEntityTypesResponse = (function() { + v2beta1.ListKnowledgeBasesResponse = (function() { /** - * Properties of a ListSessionEntityTypesResponse. + * Properties of a ListKnowledgeBasesResponse. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IListSessionEntityTypesResponse - * @property {Array.|null} [sessionEntityTypes] ListSessionEntityTypesResponse sessionEntityTypes - * @property {string|null} [nextPageToken] ListSessionEntityTypesResponse nextPageToken + * @interface IListKnowledgeBasesResponse + * @property {Array.|null} [knowledgeBases] ListKnowledgeBasesResponse knowledgeBases + * @property {string|null} [nextPageToken] ListKnowledgeBasesResponse nextPageToken */ /** - * Constructs a new ListSessionEntityTypesResponse. + * Constructs a new ListKnowledgeBasesResponse. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a ListSessionEntityTypesResponse. - * @implements IListSessionEntityTypesResponse + * @classdesc Represents a ListKnowledgeBasesResponse. + * @implements IListKnowledgeBasesResponse * @constructor - * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse=} [properties] Properties to set */ - function ListSessionEntityTypesResponse(properties) { - this.sessionEntityTypes = []; + function ListKnowledgeBasesResponse(properties) { + this.knowledgeBases = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -70150,88 +121116,88 @@ } /** - * ListSessionEntityTypesResponse sessionEntityTypes. - * @member {Array.} sessionEntityTypes - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * ListKnowledgeBasesResponse knowledgeBases. + * @member {Array.} knowledgeBases + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse * @instance */ - ListSessionEntityTypesResponse.prototype.sessionEntityTypes = $util.emptyArray; + ListKnowledgeBasesResponse.prototype.knowledgeBases = $util.emptyArray; /** - * ListSessionEntityTypesResponse nextPageToken. + * ListKnowledgeBasesResponse nextPageToken. * @member {string} nextPageToken - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse * @instance */ - ListSessionEntityTypesResponse.prototype.nextPageToken = ""; + ListKnowledgeBasesResponse.prototype.nextPageToken = ""; /** - * Creates a new ListSessionEntityTypesResponse instance using the specified properties. + * Creates a new ListKnowledgeBasesResponse instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse instance + * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse} ListKnowledgeBasesResponse instance */ - ListSessionEntityTypesResponse.create = function create(properties) { - return new ListSessionEntityTypesResponse(properties); + ListKnowledgeBasesResponse.create = function create(properties) { + return new ListKnowledgeBasesResponse(properties); }; /** - * Encodes the specified ListSessionEntityTypesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse.verify|verify} messages. + * Encodes the specified ListKnowledgeBasesResponse message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse} message ListSessionEntityTypesResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse} message ListKnowledgeBasesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSessionEntityTypesResponse.encode = function encode(message, writer) { + ListKnowledgeBasesResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) - for (var i = 0; i < message.sessionEntityTypes.length; ++i) - $root.google.cloud.dialogflow.v2beta1.SessionEntityType.encode(message.sessionEntityTypes[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.knowledgeBases != null && message.knowledgeBases.length) + for (var i = 0; i < message.knowledgeBases.length; ++i) + $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.encode(message.knowledgeBases[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); if (message.nextPageToken != null && Object.hasOwnProperty.call(message, "nextPageToken")) writer.uint32(/* id 2, wireType 2 =*/18).string(message.nextPageToken); return writer; }; /** - * Encodes the specified ListSessionEntityTypesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse.verify|verify} messages. + * Encodes the specified ListKnowledgeBasesResponse message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.IListSessionEntityTypesResponse} message ListSessionEntityTypesResponse message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IListKnowledgeBasesResponse} message ListKnowledgeBasesResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ListSessionEntityTypesResponse.encodeDelimited = function encodeDelimited(message, writer) { + ListKnowledgeBasesResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer. + * Decodes a ListKnowledgeBasesResponse message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse + * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse} ListKnowledgeBasesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSessionEntityTypesResponse.decode = function decode(reader, length) { + ListKnowledgeBasesResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.sessionEntityTypes && message.sessionEntityTypes.length)) - message.sessionEntityTypes = []; - message.sessionEntityTypes.push($root.google.cloud.dialogflow.v2beta1.SessionEntityType.decode(reader, reader.uint32())); + if (!(message.knowledgeBases && message.knowledgeBases.length)) + message.knowledgeBases = []; + message.knowledgeBases.push($root.google.cloud.dialogflow.v2beta1.KnowledgeBase.decode(reader, reader.uint32())); break; case 2: message.nextPageToken = reader.string(); @@ -70245,39 +121211,39 @@ }; /** - * Decodes a ListSessionEntityTypesResponse message from the specified reader or buffer, length delimited. + * Decodes a ListKnowledgeBasesResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse + * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse} ListKnowledgeBasesResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ListSessionEntityTypesResponse.decodeDelimited = function decodeDelimited(reader) { + ListKnowledgeBasesResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ListSessionEntityTypesResponse message. + * Verifies a ListKnowledgeBasesResponse message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ListSessionEntityTypesResponse.verify = function verify(message) { + ListKnowledgeBasesResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sessionEntityTypes != null && message.hasOwnProperty("sessionEntityTypes")) { - if (!Array.isArray(message.sessionEntityTypes)) - return "sessionEntityTypes: array expected"; - for (var i = 0; i < message.sessionEntityTypes.length; ++i) { - var error = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.verify(message.sessionEntityTypes[i]); + if (message.knowledgeBases != null && message.hasOwnProperty("knowledgeBases")) { + if (!Array.isArray(message.knowledgeBases)) + return "knowledgeBases: array expected"; + for (var i = 0; i < message.knowledgeBases.length; ++i) { + var error = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.verify(message.knowledgeBases[i]); if (error) - return "sessionEntityTypes." + error; + return "knowledgeBases." + error; } } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) @@ -70287,25 +121253,25 @@ }; /** - * Creates a ListSessionEntityTypesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a ListKnowledgeBasesResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse} ListSessionEntityTypesResponse + * @returns {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse} ListKnowledgeBasesResponse */ - ListSessionEntityTypesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse) + ListKnowledgeBasesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse(); - if (object.sessionEntityTypes) { - if (!Array.isArray(object.sessionEntityTypes)) - throw TypeError(".google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse.sessionEntityTypes: array expected"); - message.sessionEntityTypes = []; - for (var i = 0; i < object.sessionEntityTypes.length; ++i) { - if (typeof object.sessionEntityTypes[i] !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse.sessionEntityTypes: object expected"); - message.sessionEntityTypes[i] = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.fromObject(object.sessionEntityTypes[i]); + var message = new $root.google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse(); + if (object.knowledgeBases) { + if (!Array.isArray(object.knowledgeBases)) + throw TypeError(".google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse.knowledgeBases: array expected"); + message.knowledgeBases = []; + for (var i = 0; i < object.knowledgeBases.length; ++i) { + if (typeof object.knowledgeBases[i] !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse.knowledgeBases: object expected"); + message.knowledgeBases[i] = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.fromObject(object.knowledgeBases[i]); } } if (object.nextPageToken != null) @@ -70314,26 +121280,26 @@ }; /** - * Creates a plain object from a ListSessionEntityTypesResponse message. Also converts values to other types if specified. + * Creates a plain object from a ListKnowledgeBasesResponse message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse * @static - * @param {google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse} message ListSessionEntityTypesResponse + * @param {google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse} message ListKnowledgeBasesResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ListSessionEntityTypesResponse.toObject = function toObject(message, options) { + ListKnowledgeBasesResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.sessionEntityTypes = []; + object.knowledgeBases = []; if (options.defaults) object.nextPageToken = ""; - if (message.sessionEntityTypes && message.sessionEntityTypes.length) { - object.sessionEntityTypes = []; - for (var j = 0; j < message.sessionEntityTypes.length; ++j) - object.sessionEntityTypes[j] = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.toObject(message.sessionEntityTypes[j], options); + if (message.knowledgeBases && message.knowledgeBases.length) { + object.knowledgeBases = []; + for (var j = 0; j < message.knowledgeBases.length; ++j) + object.knowledgeBases[j] = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.toObject(message.knowledgeBases[j], options); } if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) object.nextPageToken = message.nextPageToken; @@ -70341,37 +121307,37 @@ }; /** - * Converts this ListSessionEntityTypesResponse to JSON. + * Converts this ListKnowledgeBasesResponse to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.ListSessionEntityTypesResponse + * @memberof google.cloud.dialogflow.v2beta1.ListKnowledgeBasesResponse * @instance * @returns {Object.} JSON object */ - ListSessionEntityTypesResponse.prototype.toJSON = function toJSON() { + ListKnowledgeBasesResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ListSessionEntityTypesResponse; + return ListKnowledgeBasesResponse; })(); - v2beta1.GetSessionEntityTypeRequest = (function() { + v2beta1.GetKnowledgeBaseRequest = (function() { /** - * Properties of a GetSessionEntityTypeRequest. + * Properties of a GetKnowledgeBaseRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IGetSessionEntityTypeRequest - * @property {string|null} [name] GetSessionEntityTypeRequest name + * @interface IGetKnowledgeBaseRequest + * @property {string|null} [name] GetKnowledgeBaseRequest name */ /** - * Constructs a new GetSessionEntityTypeRequest. + * Constructs a new GetKnowledgeBaseRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a GetSessionEntityTypeRequest. - * @implements IGetSessionEntityTypeRequest + * @classdesc Represents a GetKnowledgeBaseRequest. + * @implements IGetKnowledgeBaseRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest=} [properties] Properties to set */ - function GetSessionEntityTypeRequest(properties) { + function GetKnowledgeBaseRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -70379,35 +121345,35 @@ } /** - * GetSessionEntityTypeRequest name. + * GetKnowledgeBaseRequest name. * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest * @instance */ - GetSessionEntityTypeRequest.prototype.name = ""; + GetKnowledgeBaseRequest.prototype.name = ""; /** - * Creates a new GetSessionEntityTypeRequest instance using the specified properties. + * Creates a new GetKnowledgeBaseRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest instance + * @param {google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest} GetKnowledgeBaseRequest instance */ - GetSessionEntityTypeRequest.create = function create(properties) { - return new GetSessionEntityTypeRequest(properties); + GetKnowledgeBaseRequest.create = function create(properties) { + return new GetKnowledgeBaseRequest(properties); }; /** - * Encodes the specified GetSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest.verify|verify} messages. + * Encodes the specified GetKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest} message GetSessionEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest} message GetKnowledgeBaseRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSessionEntityTypeRequest.encode = function encode(message, writer) { + GetKnowledgeBaseRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.name != null && Object.hasOwnProperty.call(message, "name")) @@ -70416,33 +121382,33 @@ }; /** - * Encodes the specified GetSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest.verify|verify} messages. + * Encodes the specified GetKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IGetSessionEntityTypeRequest} message GetSessionEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IGetKnowledgeBaseRequest} message GetKnowledgeBaseRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetKnowledgeBaseRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer. + * Decodes a GetKnowledgeBaseRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest + * @returns {google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest} GetKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSessionEntityTypeRequest.decode = function decode(reader, length) { + GetKnowledgeBaseRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -70458,30 +121424,30 @@ }; /** - * Decodes a GetSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a GetKnowledgeBaseRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest + * @returns {google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest} GetKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + GetKnowledgeBaseRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetSessionEntityTypeRequest message. + * Verifies a GetKnowledgeBaseRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetSessionEntityTypeRequest.verify = function verify(message) { + GetKnowledgeBaseRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.name != null && message.hasOwnProperty("name")) @@ -70491,32 +121457,32 @@ }; /** - * Creates a GetSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest} GetSessionEntityTypeRequest + * @returns {google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest} GetKnowledgeBaseRequest */ - GetSessionEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest) + GetKnowledgeBaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest(); + var message = new $root.google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest(); if (object.name != null) message.name = String(object.name); return message; }; /** - * Creates a plain object from a GetSessionEntityTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetKnowledgeBaseRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest} message GetSessionEntityTypeRequest + * @param {google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest} message GetKnowledgeBaseRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetSessionEntityTypeRequest.toObject = function toObject(message, options) { + GetKnowledgeBaseRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; @@ -70528,38 +121494,38 @@ }; /** - * Converts this GetSessionEntityTypeRequest to JSON. + * Converts this GetKnowledgeBaseRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.GetSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.GetKnowledgeBaseRequest * @instance * @returns {Object.} JSON object */ - GetSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + GetKnowledgeBaseRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetSessionEntityTypeRequest; + return GetKnowledgeBaseRequest; })(); - v2beta1.CreateSessionEntityTypeRequest = (function() { + v2beta1.CreateKnowledgeBaseRequest = (function() { /** - * Properties of a CreateSessionEntityTypeRequest. + * Properties of a CreateKnowledgeBaseRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface ICreateSessionEntityTypeRequest - * @property {string|null} [parent] CreateSessionEntityTypeRequest parent - * @property {google.cloud.dialogflow.v2beta1.ISessionEntityType|null} [sessionEntityType] CreateSessionEntityTypeRequest sessionEntityType + * @interface ICreateKnowledgeBaseRequest + * @property {string|null} [parent] CreateKnowledgeBaseRequest parent + * @property {google.cloud.dialogflow.v2beta1.IKnowledgeBase|null} [knowledgeBase] CreateKnowledgeBaseRequest knowledgeBase */ /** - * Constructs a new CreateSessionEntityTypeRequest. + * Constructs a new CreateKnowledgeBaseRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a CreateSessionEntityTypeRequest. - * @implements ICreateSessionEntityTypeRequest + * @classdesc Represents a CreateKnowledgeBaseRequest. + * @implements ICreateKnowledgeBaseRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest=} [properties] Properties to set */ - function CreateSessionEntityTypeRequest(properties) { + function CreateKnowledgeBaseRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -70567,80 +121533,80 @@ } /** - * CreateSessionEntityTypeRequest parent. + * CreateKnowledgeBaseRequest parent. * @member {string} parent - * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest * @instance */ - CreateSessionEntityTypeRequest.prototype.parent = ""; + CreateKnowledgeBaseRequest.prototype.parent = ""; /** - * CreateSessionEntityTypeRequest sessionEntityType. - * @member {google.cloud.dialogflow.v2beta1.ISessionEntityType|null|undefined} sessionEntityType - * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * CreateKnowledgeBaseRequest knowledgeBase. + * @member {google.cloud.dialogflow.v2beta1.IKnowledgeBase|null|undefined} knowledgeBase + * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest * @instance */ - CreateSessionEntityTypeRequest.prototype.sessionEntityType = null; + CreateKnowledgeBaseRequest.prototype.knowledgeBase = null; /** - * Creates a new CreateSessionEntityTypeRequest instance using the specified properties. + * Creates a new CreateKnowledgeBaseRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest instance + * @param {google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest} CreateKnowledgeBaseRequest instance */ - CreateSessionEntityTypeRequest.create = function create(properties) { - return new CreateSessionEntityTypeRequest(properties); + CreateKnowledgeBaseRequest.create = function create(properties) { + return new CreateKnowledgeBaseRequest(properties); }; /** - * Encodes the specified CreateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest.verify|verify} messages. + * Encodes the specified CreateKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest} message CreateKnowledgeBaseRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSessionEntityTypeRequest.encode = function encode(message, writer) { + CreateKnowledgeBaseRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); if (message.parent != null && Object.hasOwnProperty.call(message, "parent")) writer.uint32(/* id 1, wireType 2 =*/10).string(message.parent); - if (message.sessionEntityType != null && Object.hasOwnProperty.call(message, "sessionEntityType")) - $root.google.cloud.dialogflow.v2beta1.SessionEntityType.encode(message.sessionEntityType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.knowledgeBase != null && Object.hasOwnProperty.call(message, "knowledgeBase")) + $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.encode(message.knowledgeBase, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified CreateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest.verify|verify} messages. + * Encodes the specified CreateKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.ICreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.ICreateKnowledgeBaseRequest} message CreateKnowledgeBaseRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - CreateSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + CreateKnowledgeBaseRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer. + * Decodes a CreateKnowledgeBaseRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest + * @returns {google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest} CreateKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSessionEntityTypeRequest.decode = function decode(reader, length) { + CreateKnowledgeBaseRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { @@ -70648,7 +121614,7 @@ message.parent = reader.string(); break; case 2: - message.sessionEntityType = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.decode(reader, reader.uint32()); + message.knowledgeBase = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -70659,122 +121625,122 @@ }; /** - * Decodes a CreateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a CreateKnowledgeBaseRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest + * @returns {google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest} CreateKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - CreateSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + CreateKnowledgeBaseRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a CreateSessionEntityTypeRequest message. + * Verifies a CreateKnowledgeBaseRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - CreateSessionEntityTypeRequest.verify = function verify(message) { + CreateKnowledgeBaseRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; if (message.parent != null && message.hasOwnProperty("parent")) if (!$util.isString(message.parent)) return "parent: string expected"; - if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) { - var error = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.verify(message.sessionEntityType); + if (message.knowledgeBase != null && message.hasOwnProperty("knowledgeBase")) { + var error = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.verify(message.knowledgeBase); if (error) - return "sessionEntityType." + error; + return "knowledgeBase." + error; } return null; }; /** - * Creates a CreateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a CreateKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest} CreateSessionEntityTypeRequest + * @returns {google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest} CreateKnowledgeBaseRequest */ - CreateSessionEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest) + CreateKnowledgeBaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest(); + var message = new $root.google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest(); if (object.parent != null) message.parent = String(object.parent); - if (object.sessionEntityType != null) { - if (typeof object.sessionEntityType !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest.sessionEntityType: object expected"); - message.sessionEntityType = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.fromObject(object.sessionEntityType); + if (object.knowledgeBase != null) { + if (typeof object.knowledgeBase !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest.knowledgeBase: object expected"); + message.knowledgeBase = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.fromObject(object.knowledgeBase); } return message; }; /** - * Creates a plain object from a CreateSessionEntityTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from a CreateKnowledgeBaseRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest} message CreateSessionEntityTypeRequest + * @param {google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest} message CreateKnowledgeBaseRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - CreateSessionEntityTypeRequest.toObject = function toObject(message, options) { + CreateKnowledgeBaseRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { object.parent = ""; - object.sessionEntityType = null; + object.knowledgeBase = null; } if (message.parent != null && message.hasOwnProperty("parent")) object.parent = message.parent; - if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) - object.sessionEntityType = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.toObject(message.sessionEntityType, options); + if (message.knowledgeBase != null && message.hasOwnProperty("knowledgeBase")) + object.knowledgeBase = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.toObject(message.knowledgeBase, options); return object; }; /** - * Converts this CreateSessionEntityTypeRequest to JSON. + * Converts this CreateKnowledgeBaseRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.CreateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.CreateKnowledgeBaseRequest * @instance * @returns {Object.} JSON object */ - CreateSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + CreateKnowledgeBaseRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return CreateSessionEntityTypeRequest; + return CreateKnowledgeBaseRequest; })(); - v2beta1.UpdateSessionEntityTypeRequest = (function() { + v2beta1.DeleteKnowledgeBaseRequest = (function() { /** - * Properties of an UpdateSessionEntityTypeRequest. + * Properties of a DeleteKnowledgeBaseRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IUpdateSessionEntityTypeRequest - * @property {google.cloud.dialogflow.v2beta1.ISessionEntityType|null} [sessionEntityType] UpdateSessionEntityTypeRequest sessionEntityType - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateSessionEntityTypeRequest updateMask + * @interface IDeleteKnowledgeBaseRequest + * @property {string|null} [name] DeleteKnowledgeBaseRequest name + * @property {boolean|null} [force] DeleteKnowledgeBaseRequest force */ /** - * Constructs a new UpdateSessionEntityTypeRequest. + * Constructs a new DeleteKnowledgeBaseRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents an UpdateSessionEntityTypeRequest. - * @implements IUpdateSessionEntityTypeRequest + * @classdesc Represents a DeleteKnowledgeBaseRequest. + * @implements IDeleteKnowledgeBaseRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest=} [properties] Properties to set */ - function UpdateSessionEntityTypeRequest(properties) { + function DeleteKnowledgeBaseRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -70782,88 +121748,88 @@ } /** - * UpdateSessionEntityTypeRequest sessionEntityType. - * @member {google.cloud.dialogflow.v2beta1.ISessionEntityType|null|undefined} sessionEntityType - * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * DeleteKnowledgeBaseRequest name. + * @member {string} name + * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest * @instance */ - UpdateSessionEntityTypeRequest.prototype.sessionEntityType = null; + DeleteKnowledgeBaseRequest.prototype.name = ""; /** - * UpdateSessionEntityTypeRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * DeleteKnowledgeBaseRequest force. + * @member {boolean} force + * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest * @instance */ - UpdateSessionEntityTypeRequest.prototype.updateMask = null; + DeleteKnowledgeBaseRequest.prototype.force = false; /** - * Creates a new UpdateSessionEntityTypeRequest instance using the specified properties. + * Creates a new DeleteKnowledgeBaseRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest instance + * @param {google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest} DeleteKnowledgeBaseRequest instance */ - UpdateSessionEntityTypeRequest.create = function create(properties) { - return new UpdateSessionEntityTypeRequest(properties); + DeleteKnowledgeBaseRequest.create = function create(properties) { + return new DeleteKnowledgeBaseRequest(properties); }; /** - * Encodes the specified UpdateSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest.verify|verify} messages. + * Encodes the specified DeleteKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest} message DeleteKnowledgeBaseRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSessionEntityTypeRequest.encode = function encode(message, writer) { + DeleteKnowledgeBaseRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.sessionEntityType != null && Object.hasOwnProperty.call(message, "sessionEntityType")) - $root.google.cloud.dialogflow.v2beta1.SessionEntityType.encode(message.sessionEntityType, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.force); return writer; }; /** - * Encodes the specified UpdateSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest.verify|verify} messages. + * Encodes the specified DeleteKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IUpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IDeleteKnowledgeBaseRequest} message DeleteKnowledgeBaseRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - UpdateSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + DeleteKnowledgeBaseRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer. + * Decodes a DeleteKnowledgeBaseRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest + * @returns {google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest} DeleteKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSessionEntityTypeRequest.decode = function decode(reader, length) { + DeleteKnowledgeBaseRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.sessionEntityType = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.decode(reader, reader.uint32()); + message.name = reader.string(); break; case 2: - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + message.force = reader.bool(); break; default: reader.skipType(tag & 7); @@ -70874,126 +121840,117 @@ }; /** - * Decodes an UpdateSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes a DeleteKnowledgeBaseRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest + * @returns {google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest} DeleteKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - UpdateSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + DeleteKnowledgeBaseRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies an UpdateSessionEntityTypeRequest message. + * Verifies a DeleteKnowledgeBaseRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - UpdateSessionEntityTypeRequest.verify = function verify(message) { + DeleteKnowledgeBaseRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) { - var error = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.verify(message.sessionEntityType); - if (error) - return "sessionEntityType." + error; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; return null; }; /** - * Creates an UpdateSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates a DeleteKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest} UpdateSessionEntityTypeRequest + * @returns {google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest} DeleteKnowledgeBaseRequest */ - UpdateSessionEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest) + DeleteKnowledgeBaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest(); - if (object.sessionEntityType != null) { - if (typeof object.sessionEntityType !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest.sessionEntityType: object expected"); - message.sessionEntityType = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.fromObject(object.sessionEntityType); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } + var message = new $root.google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.force != null) + message.force = Boolean(object.force); return message; }; /** - * Creates a plain object from an UpdateSessionEntityTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from a DeleteKnowledgeBaseRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest} message UpdateSessionEntityTypeRequest + * @param {google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest} message DeleteKnowledgeBaseRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - UpdateSessionEntityTypeRequest.toObject = function toObject(message, options) { + DeleteKnowledgeBaseRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.sessionEntityType = null; - object.updateMask = null; + object.name = ""; + object.force = false; } - if (message.sessionEntityType != null && message.hasOwnProperty("sessionEntityType")) - object.sessionEntityType = $root.google.cloud.dialogflow.v2beta1.SessionEntityType.toObject(message.sessionEntityType, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; return object; }; /** - * Converts this UpdateSessionEntityTypeRequest to JSON. + * Converts this DeleteKnowledgeBaseRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.UpdateSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.DeleteKnowledgeBaseRequest * @instance * @returns {Object.} JSON object */ - UpdateSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + DeleteKnowledgeBaseRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return UpdateSessionEntityTypeRequest; + return DeleteKnowledgeBaseRequest; })(); - v2beta1.DeleteSessionEntityTypeRequest = (function() { + v2beta1.UpdateKnowledgeBaseRequest = (function() { /** - * Properties of a DeleteSessionEntityTypeRequest. + * Properties of an UpdateKnowledgeBaseRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @interface IDeleteSessionEntityTypeRequest - * @property {string|null} [name] DeleteSessionEntityTypeRequest name + * @interface IUpdateKnowledgeBaseRequest + * @property {google.cloud.dialogflow.v2beta1.IKnowledgeBase|null} [knowledgeBase] UpdateKnowledgeBaseRequest knowledgeBase + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateKnowledgeBaseRequest updateMask */ /** - * Constructs a new DeleteSessionEntityTypeRequest. + * Constructs a new UpdateKnowledgeBaseRequest. * @memberof google.cloud.dialogflow.v2beta1 - * @classdesc Represents a DeleteSessionEntityTypeRequest. - * @implements IDeleteSessionEntityTypeRequest + * @classdesc Represents an UpdateKnowledgeBaseRequest. + * @implements IUpdateKnowledgeBaseRequest * @constructor - * @param {google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest=} [properties] Properties to set + * @param {google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest=} [properties] Properties to set */ - function DeleteSessionEntityTypeRequest(properties) { + function UpdateKnowledgeBaseRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -71001,75 +121958,88 @@ } /** - * DeleteSessionEntityTypeRequest name. - * @member {string} name - * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * UpdateKnowledgeBaseRequest knowledgeBase. + * @member {google.cloud.dialogflow.v2beta1.IKnowledgeBase|null|undefined} knowledgeBase + * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest * @instance */ - DeleteSessionEntityTypeRequest.prototype.name = ""; + UpdateKnowledgeBaseRequest.prototype.knowledgeBase = null; /** - * Creates a new DeleteSessionEntityTypeRequest instance using the specified properties. + * UpdateKnowledgeBaseRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest + * @instance + */ + UpdateKnowledgeBaseRequest.prototype.updateMask = null; + + /** + * Creates a new UpdateKnowledgeBaseRequest instance using the specified properties. * @function create - * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest=} [properties] Properties to set - * @returns {google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest instance + * @param {google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest=} [properties] Properties to set + * @returns {google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest} UpdateKnowledgeBaseRequest instance */ - DeleteSessionEntityTypeRequest.create = function create(properties) { - return new DeleteSessionEntityTypeRequest(properties); + UpdateKnowledgeBaseRequest.create = function create(properties) { + return new UpdateKnowledgeBaseRequest(properties); }; /** - * Encodes the specified DeleteSessionEntityTypeRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest.verify|verify} messages. + * Encodes the specified UpdateKnowledgeBaseRequest message. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest.verify|verify} messages. * @function encode - * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest} message UpdateKnowledgeBaseRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSessionEntityTypeRequest.encode = function encode(message, writer) { + UpdateKnowledgeBaseRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.knowledgeBase != null && Object.hasOwnProperty.call(message, "knowledgeBase")) + $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.encode(message.knowledgeBase, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); return writer; }; /** - * Encodes the specified DeleteSessionEntityTypeRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest.verify|verify} messages. + * Encodes the specified UpdateKnowledgeBaseRequest message, length delimited. Does not implicitly {@link google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest.verify|verify} messages. * @function encodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.IDeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest message or plain object to encode + * @param {google.cloud.dialogflow.v2beta1.IUpdateKnowledgeBaseRequest} message UpdateKnowledgeBaseRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DeleteSessionEntityTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + UpdateKnowledgeBaseRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer. + * Decodes an UpdateKnowledgeBaseRequest message from the specified reader or buffer. * @function decode - * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest + * @returns {google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest} UpdateKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteSessionEntityTypeRequest.decode = function decode(reader, length) { + UpdateKnowledgeBaseRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.name = reader.string(); + message.knowledgeBase = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.decode(reader, reader.uint32()); + break; + case 2: + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -71080,87 +122050,106 @@ }; /** - * Decodes a DeleteSessionEntityTypeRequest message from the specified reader or buffer, length delimited. + * Decodes an UpdateKnowledgeBaseRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest + * @returns {google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest} UpdateKnowledgeBaseRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DeleteSessionEntityTypeRequest.decodeDelimited = function decodeDelimited(reader) { + UpdateKnowledgeBaseRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DeleteSessionEntityTypeRequest message. + * Verifies an UpdateKnowledgeBaseRequest message. * @function verify - * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DeleteSessionEntityTypeRequest.verify = function verify(message) { + UpdateKnowledgeBaseRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; + if (message.knowledgeBase != null && message.hasOwnProperty("knowledgeBase")) { + var error = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.verify(message.knowledgeBase); + if (error) + return "knowledgeBase." + error; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } return null; }; /** - * Creates a DeleteSessionEntityTypeRequest message from a plain object. Also converts values to their respective internal types. + * Creates an UpdateKnowledgeBaseRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest * @static * @param {Object.} object Plain object - * @returns {google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest} DeleteSessionEntityTypeRequest + * @returns {google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest} UpdateKnowledgeBaseRequest */ - DeleteSessionEntityTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest) + UpdateKnowledgeBaseRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest) return object; - var message = new $root.google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest(); - if (object.name != null) - message.name = String(object.name); + var message = new $root.google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest(); + if (object.knowledgeBase != null) { + if (typeof object.knowledgeBase !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest.knowledgeBase: object expected"); + message.knowledgeBase = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.fromObject(object.knowledgeBase); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } return message; }; /** - * Creates a plain object from a DeleteSessionEntityTypeRequest message. Also converts values to other types if specified. + * Creates a plain object from an UpdateKnowledgeBaseRequest message. Also converts values to other types if specified. * @function toObject - * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest * @static - * @param {google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest} message DeleteSessionEntityTypeRequest + * @param {google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest} message UpdateKnowledgeBaseRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DeleteSessionEntityTypeRequest.toObject = function toObject(message, options) { + UpdateKnowledgeBaseRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.name = ""; - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; + if (options.defaults) { + object.knowledgeBase = null; + object.updateMask = null; + } + if (message.knowledgeBase != null && message.hasOwnProperty("knowledgeBase")) + object.knowledgeBase = $root.google.cloud.dialogflow.v2beta1.KnowledgeBase.toObject(message.knowledgeBase, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); return object; }; /** - * Converts this DeleteSessionEntityTypeRequest to JSON. + * Converts this UpdateKnowledgeBaseRequest to JSON. * @function toJSON - * @memberof google.cloud.dialogflow.v2beta1.DeleteSessionEntityTypeRequest + * @memberof google.cloud.dialogflow.v2beta1.UpdateKnowledgeBaseRequest * @instance * @returns {Object.} JSON object */ - DeleteSessionEntityTypeRequest.prototype.toJSON = function toJSON() { + UpdateKnowledgeBaseRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DeleteSessionEntityTypeRequest; + return UpdateKnowledgeBaseRequest; })(); v2beta1.WebhookRequest = (function() { @@ -71483,6 +122472,7 @@ * @property {google.protobuf.IStruct|null} [payload] WebhookResponse payload * @property {Array.|null} [outputContexts] WebhookResponse outputContexts * @property {google.cloud.dialogflow.v2beta1.IEventInput|null} [followupEventInput] WebhookResponse followupEventInput + * @property {boolean|null} [liveAgentHandoff] WebhookResponse liveAgentHandoff * @property {boolean|null} [endInteraction] WebhookResponse endInteraction * @property {Array.|null} [sessionEntityTypes] WebhookResponse sessionEntityTypes */ @@ -71553,6 +122543,14 @@ */ WebhookResponse.prototype.followupEventInput = null; + /** + * WebhookResponse liveAgentHandoff. + * @member {boolean} liveAgentHandoff + * @memberof google.cloud.dialogflow.v2beta1.WebhookResponse + * @instance + */ + WebhookResponse.prototype.liveAgentHandoff = false; + /** * WebhookResponse endInteraction. * @member {boolean} endInteraction @@ -71607,6 +122605,8 @@ $root.google.cloud.dialogflow.v2beta1.Context.encode(message.outputContexts[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); if (message.followupEventInput != null && Object.hasOwnProperty.call(message, "followupEventInput")) $root.google.cloud.dialogflow.v2beta1.EventInput.encode(message.followupEventInput, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.liveAgentHandoff != null && Object.hasOwnProperty.call(message, "liveAgentHandoff")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.liveAgentHandoff); if (message.endInteraction != null && Object.hasOwnProperty.call(message, "endInteraction")) writer.uint32(/* id 8, wireType 0 =*/64).bool(message.endInteraction); if (message.sessionEntityTypes != null && message.sessionEntityTypes.length) @@ -71668,6 +122668,9 @@ case 6: message.followupEventInput = $root.google.cloud.dialogflow.v2beta1.EventInput.decode(reader, reader.uint32()); break; + case 7: + message.liveAgentHandoff = reader.bool(); + break; case 8: message.endInteraction = reader.bool(); break; @@ -71745,6 +122748,9 @@ if (error) return "followupEventInput." + error; } + if (message.liveAgentHandoff != null && message.hasOwnProperty("liveAgentHandoff")) + if (typeof message.liveAgentHandoff !== "boolean") + return "liveAgentHandoff: boolean expected"; if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) if (typeof message.endInteraction !== "boolean") return "endInteraction: boolean expected"; @@ -71806,6 +122812,8 @@ throw TypeError(".google.cloud.dialogflow.v2beta1.WebhookResponse.followupEventInput: object expected"); message.followupEventInput = $root.google.cloud.dialogflow.v2beta1.EventInput.fromObject(object.followupEventInput); } + if (object.liveAgentHandoff != null) + message.liveAgentHandoff = Boolean(object.liveAgentHandoff); if (object.endInteraction != null) message.endInteraction = Boolean(object.endInteraction); if (object.sessionEntityTypes) { @@ -71844,6 +122852,7 @@ object.source = ""; object.payload = null; object.followupEventInput = null; + object.liveAgentHandoff = false; object.endInteraction = false; } if (message.fulfillmentText != null && message.hasOwnProperty("fulfillmentText")) @@ -71864,6 +122873,8 @@ } if (message.followupEventInput != null && message.hasOwnProperty("followupEventInput")) object.followupEventInput = $root.google.cloud.dialogflow.v2beta1.EventInput.toObject(message.followupEventInput, options); + if (message.liveAgentHandoff != null && message.hasOwnProperty("liveAgentHandoff")) + object.liveAgentHandoff = message.liveAgentHandoff; if (message.endInteraction != null && message.hasOwnProperty("endInteraction")) object.endInteraction = message.endInteraction; if (message.sessionEntityTypes && message.sessionEntityTypes.length) { diff --git a/packages/google-cloud-dialogflow/protos/protos.json b/packages/google-cloud-dialogflow/protos/protos.json index a1ce94aeafb..83f464aa93b 100644 --- a/packages/google-cloud-dialogflow/protos/protos.json +++ b/packages/google-cloud-dialogflow/protos/protos.json @@ -580,218 +580,325 @@ } } }, - "AudioEncoding": { - "values": { - "AUDIO_ENCODING_UNSPECIFIED": 0, - "AUDIO_ENCODING_LINEAR_16": 1, - "AUDIO_ENCODING_FLAC": 2, - "AUDIO_ENCODING_MULAW": 3, - "AUDIO_ENCODING_AMR": 4, - "AUDIO_ENCODING_AMR_WB": 5, - "AUDIO_ENCODING_OGG_OPUS": 6, - "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": 7 - } - }, - "SpeechContext": { - "fields": { - "phrases": { - "rule": "repeated", - "type": "string", - "id": 1 + "AnswerRecords": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListAnswerRecords": { + "requestType": "ListAnswerRecordsRequest", + "responseType": "ListAnswerRecordsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/answerRecords", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/answerRecords", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/answerRecords", + "additional_bindings": { + "get": "/v2/{parent=projects/*/locations/*}/answerRecords" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, - "boost": { - "type": "float", - "id": 2 + "UpdateAnswerRecord": { + "requestType": "UpdateAnswerRecordRequest", + "responseType": "AnswerRecord", + "options": { + "(google.api.http).patch": "/v2/{answer_record.name=projects/*/answerRecords/*}", + "(google.api.http).body": "answer_record", + "(google.api.http).additional_bindings.patch": "/v2/{answer_record.name=projects/*/locations/*/answerRecords/*}", + "(google.api.http).additional_bindings.body": "answer_record", + "(google.api.method_signature)": "answer_record,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{answer_record.name=projects/*/answerRecords/*}", + "body": "answer_record", + "additional_bindings": { + "patch": "/v2/{answer_record.name=projects/*/locations/*/answerRecords/*}", + "body": "answer_record" + } + } + }, + { + "(google.api.method_signature)": "answer_record,update_mask" + } + ] } } }, - "SpeechWordInfo": { + "AnswerRecord": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/AnswerRecord", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/answerRecords/{answer_record}" + }, + "oneofs": { + "record": { + "oneof": [ + "agentAssistantRecord" + ] + } + }, "fields": { - "word": { + "name": { "type": "string", - "id": 3 - }, - "startOffset": { - "type": "google.protobuf.Duration", "id": 1 }, - "endOffset": { - "type": "google.protobuf.Duration", - "id": 2 + "answerFeedback": { + "type": "AnswerFeedback", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "confidence": { - "type": "float", - "id": 4 + "agentAssistantRecord": { + "type": "AgentAssistantRecord", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, - "SpeechModelVariant": { - "values": { - "SPEECH_MODEL_VARIANT_UNSPECIFIED": 0, - "USE_BEST_AVAILABLE": 1, - "USE_STANDARD": 2, - "USE_ENHANCED": 3 - } - }, - "InputAudioConfig": { + "ListAnswerRecordsRequest": { "fields": { - "audioEncoding": { - "type": "AudioEncoding", - "id": 1 - }, - "sampleRateHertz": { - "type": "int32", - "id": 2 + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/AnswerRecord" + } }, - "languageCode": { + "filter": { "type": "string", - "id": 3 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "enableWordInfo": { - "type": "bool", - "id": 13 + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "phraseHints": { - "rule": "repeated", + "pageToken": { "type": "string", "id": 4, "options": { - "deprecated": true + "(google.api.field_behavior)": "OPTIONAL" } - }, - "speechContexts": { + } + } + }, + "ListAnswerRecordsResponse": { + "fields": { + "answerRecords": { "rule": "repeated", - "type": "SpeechContext", - "id": 11 + "type": "AnswerRecord", + "id": 1 }, - "model": { + "nextPageToken": { "type": "string", - "id": 7 - }, - "modelVariant": { - "type": "SpeechModelVariant", - "id": 10 - }, - "singleUtterance": { - "type": "bool", - "id": 8 + "id": 2 } } }, - "VoiceSelectionParams": { + "UpdateAnswerRecordRequest": { "fields": { - "name": { - "type": "string", - "id": 1 + "answerRecord": { + "type": "AnswerRecord", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/AnswerRecord" + } }, - "ssmlGender": { - "type": "SsmlVoiceGender", - "id": 2 + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - "SynthesizeSpeechConfig": { + "AnswerFeedback": { + "oneofs": { + "detailFeedback": { + "oneof": [ + "agentAssistantDetailFeedback" + ] + } + }, "fields": { - "speakingRate": { - "type": "double", + "correctnessLevel": { + "type": "CorrectnessLevel", "id": 1 }, - "pitch": { - "type": "double", + "agentAssistantDetailFeedback": { + "type": "AgentAssistantFeedback", "id": 2 }, - "volumeGainDb": { - "type": "double", + "clicked": { + "type": "bool", "id": 3 }, - "effectsProfileId": { - "rule": "repeated", - "type": "string", + "clickTime": { + "type": "google.protobuf.Timestamp", "id": 5 }, - "voice": { - "type": "VoiceSelectionParams", + "displayed": { + "type": "bool", "id": 4 + }, + "displayTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + } + }, + "nested": { + "CorrectnessLevel": { + "values": { + "CORRECTNESS_LEVEL_UNSPECIFIED": 0, + "NOT_CORRECT": 1, + "PARTIALLY_CORRECT": 2, + "FULLY_CORRECT": 3 + } } } }, - "SsmlVoiceGender": { - "values": { - "SSML_VOICE_GENDER_UNSPECIFIED": 0, - "SSML_VOICE_GENDER_MALE": 1, - "SSML_VOICE_GENDER_FEMALE": 2, - "SSML_VOICE_GENDER_NEUTRAL": 3 - } - }, - "OutputAudioConfig": { + "AgentAssistantFeedback": { "fields": { - "audioEncoding": { - "type": "OutputAudioEncoding", + "answerRelevance": { + "type": "AnswerRelevance", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } }, - "sampleRateHertz": { - "type": "int32", - "id": 2 + "documentCorrectness": { + "type": "DocumentCorrectness", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "synthesizeSpeechConfig": { - "type": "SynthesizeSpeechConfig", - "id": 3 + "documentEfficiency": { + "type": "DocumentEfficiency", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AnswerRelevance": { + "values": { + "ANSWER_RELEVANCE_UNSPECIFIED": 0, + "IRRELEVANT": 1, + "RELEVANT": 2 + } + }, + "DocumentCorrectness": { + "values": { + "DOCUMENT_CORRECTNESS_UNSPECIFIED": 0, + "INCORRECT": 1, + "CORRECT": 2 + } + }, + "DocumentEfficiency": { + "values": { + "DOCUMENT_EFFICIENCY_UNSPECIFIED": 0, + "INEFFICIENT": 1, + "EFFICIENT": 2 + } } } }, - "OutputAudioEncoding": { - "values": { - "OUTPUT_AUDIO_ENCODING_UNSPECIFIED": 0, - "OUTPUT_AUDIO_ENCODING_LINEAR_16": 1, - "OUTPUT_AUDIO_ENCODING_MP3": 2, - "OUTPUT_AUDIO_ENCODING_OGG_OPUS": 3 + "AgentAssistantRecord": { + "oneofs": { + "answer": { + "oneof": [ + "articleSuggestionAnswer", + "faqAnswer" + ] + } + }, + "fields": { + "articleSuggestionAnswer": { + "type": "ArticleAnswer", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "faqAnswer": { + "type": "FaqAnswer", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } } }, - "Contexts": { + "Participants": { "options": { "(google.api.default_host)": "dialogflow.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" }, "methods": { - "ListContexts": { - "requestType": "ListContextsRequest", - "responseType": "ListContextsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/agent/sessions/*}/contexts", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts", - "(google.api.method_signature)": "parent" + "CreateParticipant": { + "requestType": "CreateParticipantRequest", + "responseType": "Participant", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/conversations/*}/participants", + "(google.api.http).body": "participant", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*/conversations/*}/participants", + "(google.api.http).additional_bindings.body": "participant", + "(google.api.method_signature)": "parent,participant" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2/{parent=projects/*/agent/sessions/*}/contexts", + "post": "/v2/{parent=projects/*/conversations/*}/participants", + "body": "participant", "additional_bindings": { - "get": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts" + "post": "/v2/{parent=projects/*/locations/*/conversations/*}/participants", + "body": "participant" } } }, { - "(google.api.method_signature)": "parent" + "(google.api.method_signature)": "parent,participant" } ] }, - "GetContext": { - "requestType": "GetContextRequest", - "responseType": "Context", + "GetParticipant": { + "requestType": "GetParticipantRequest", + "responseType": "Participant", "options": { - "(google.api.http).get": "/v2/{name=projects/*/agent/sessions/*/contexts/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}", + "(google.api.http).get": "/v2/{name=projects/*/conversations/*/participants/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/conversations/*/participants/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2/{name=projects/*/agent/sessions/*/contexts/*}", + "get": "/v2/{name=projects/*/conversations/*/participants/*}", "additional_bindings": { - "get": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}" + "get": "/v2/{name=projects/*/locations/*/conversations/*/participants/*}" } } }, @@ -800,94 +907,136 @@ } ] }, - "CreateContext": { - "requestType": "CreateContextRequest", - "responseType": "Context", + "ListParticipants": { + "requestType": "ListParticipantsRequest", + "responseType": "ListParticipantsResponse", "options": { - "(google.api.http).post": "/v2/{parent=projects/*/agent/sessions/*}/contexts", - "(google.api.http).body": "context", - "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts", - "(google.api.http).additional_bindings.body": "context", - "(google.api.method_signature)": "parent,context" + "(google.api.http).get": "/v2/{parent=projects/*/conversations/*}/participants", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*/conversations/*}/participants", + "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2/{parent=projects/*/agent/sessions/*}/contexts", - "body": "context", + "get": "/v2/{parent=projects/*/conversations/*}/participants", "additional_bindings": { - "post": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts", - "body": "context" + "get": "/v2/{parent=projects/*/locations/*/conversations/*}/participants" } } }, { - "(google.api.method_signature)": "parent,context" + "(google.api.method_signature)": "parent" } ] }, - "UpdateContext": { - "requestType": "UpdateContextRequest", - "responseType": "Context", + "UpdateParticipant": { + "requestType": "UpdateParticipantRequest", + "responseType": "Participant", "options": { - "(google.api.http).patch": "/v2/{context.name=projects/*/agent/sessions/*/contexts/*}", - "(google.api.http).body": "context", - "(google.api.http).additional_bindings.patch": "/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}", - "(google.api.http).additional_bindings.body": "context", - "(google.api.method_signature)": "context,update_mask" + "(google.api.http).patch": "/v2/{participant.name=projects/*/conversations/*/participants/*}", + "(google.api.http).body": "participant", + "(google.api.http).additional_bindings.patch": "/v2/{participant.name=projects/*/locations/*/conversations/*/participants/*}", + "(google.api.http).additional_bindings.body": "participant", + "(google.api.method_signature)": "participant,update_mask" }, "parsedOptions": [ { "(google.api.http)": { - "patch": "/v2/{context.name=projects/*/agent/sessions/*/contexts/*}", - "body": "context", + "patch": "/v2/{participant.name=projects/*/conversations/*/participants/*}", + "body": "participant", "additional_bindings": { - "patch": "/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}", - "body": "context" + "patch": "/v2/{participant.name=projects/*/locations/*/conversations/*/participants/*}", + "body": "participant" } } }, { - "(google.api.method_signature)": "context,update_mask" + "(google.api.method_signature)": "participant,update_mask" } ] }, - "DeleteContext": { - "requestType": "DeleteContextRequest", - "responseType": "google.protobuf.Empty", + "AnalyzeContent": { + "requestType": "AnalyzeContentRequest", + "responseType": "AnalyzeContentResponse", "options": { - "(google.api.http).delete": "/v2/{name=projects/*/agent/sessions/*/contexts/*}", - "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}", - "(google.api.method_signature)": "name" + "(google.api.http).post": "/v2/{participant=projects/*/conversations/*/participants/*}:analyzeContent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "participant,event_input" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v2/{name=projects/*/agent/sessions/*/contexts/*}", + "post": "/v2/{participant=projects/*/conversations/*/participants/*}:analyzeContent", + "body": "*", "additional_bindings": { - "delete": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}" + "post": "/v2/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent", + "body": "*" } } }, { - "(google.api.method_signature)": "name" + "(google.api.method_signature)": "participant,text_input" + }, + { + "(google.api.method_signature)": "participant,audio_input" + }, + { + "(google.api.method_signature)": "participant,event_input" } ] }, - "DeleteAllContexts": { - "requestType": "DeleteAllContextsRequest", - "responseType": "google.protobuf.Empty", + "StreamingAnalyzeContent": { + "requestType": "StreamingAnalyzeContentRequest", + "requestStream": true, + "responseType": "StreamingAnalyzeContentResponse", + "responseStream": true + }, + "SuggestArticles": { + "requestType": "SuggestArticlesRequest", + "responseType": "SuggestArticlesResponse", "options": { - "(google.api.http).delete": "/v2/{parent=projects/*/agent/sessions/*}/contexts", - "(google.api.http).additional_bindings.delete": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts", + "(google.api.http).post": "/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles", + "(google.api.http).additional_bindings.body": "*", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v2/{parent=projects/*/agent/sessions/*}/contexts", + "post": "/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles", + "body": "*", "additional_bindings": { - "delete": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts" + "post": "/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SuggestFaqAnswers": { + "requestType": "SuggestFaqAnswersRequest", + "responseType": "SuggestFaqAnswersResponse", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers", + "body": "*", + "additional_bindings": { + "post": "/v2/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers", + "body": "*" } } }, @@ -898,109 +1047,173 @@ } } }, - "Context": { + "Participant": { "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/Context", - "(google.api.resource).pattern": "projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}" + "(google.api.resource).type": "dialogflow.googleapis.com/Participant", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}" }, "fields": { "name": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } }, - "lifespanCount": { - "type": "int32", + "role": { + "type": "Role", "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "IMMUTABLE" } }, - "parameters": { - "type": "google.protobuf.Struct", - "id": 3, + "sipRecordingMediaLabel": { + "type": "string", + "id": 6, "options": { "(google.api.field_behavior)": "OPTIONAL" } } + }, + "nested": { + "Role": { + "values": { + "ROLE_UNSPECIFIED": 0, + "HUMAN_AGENT": 1, + "AUTOMATED_AGENT": 2, + "END_USER": 3 + } + } } }, - "ListContextsRequest": { + "Message": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Message", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}" + }, "fields": { - "parent": { + "name": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Context" - } + "id": 1 }, - "pageSize": { - "type": "int32", + "content": { + "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "pageToken": { + "languageCode": { "type": "string", "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } + }, + "participant": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "participantRole": { + "type": "Participant.Role", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "messageAnnotation": { + "type": "MessageAnnotation", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } } } }, - "ListContextsResponse": { + "CreateParticipantRequest": { "fields": { - "contexts": { - "rule": "repeated", - "type": "Context", - "id": 1 - }, - "nextPageToken": { + "parent": { "type": "string", - "id": 2 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Participant" + } + }, + "participant": { + "type": "Participant", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - "GetContextRequest": { + "GetParticipantRequest": { "fields": { "name": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Context" + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Participant" } } } }, - "CreateContextRequest": { + "ListParticipantsRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Context" + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Participant" } }, - "context": { - "type": "Context", + "pageSize": { + "type": "int32", "id": 2, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "UpdateContextRequest": { + "ListParticipantsResponse": { "fields": { - "context": { - "type": "Context", + "participants": { + "rule": "repeated", + "type": "Participant", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateParticipantRequest": { + "fields": { + "participant": { + "type": "Participant", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" @@ -1010,3359 +1223,8073 @@ "type": "google.protobuf.FieldMask", "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } } } }, - "DeleteContextRequest": { + "AnalyzeContentRequest": { + "oneofs": { + "input": { + "oneof": [ + "textInput", + "audioInput", + "eventInput" + ] + } + }, "fields": { - "name": { + "participant": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Context" + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Participant" } + }, + "textInput": { + "type": "TextInput", + "id": 6 + }, + "audioInput": { + "type": "AudioInput", + "id": 7 + }, + "eventInput": { + "type": "EventInput", + "id": 8 + }, + "replyAudioConfig": { + "type": "OutputAudioConfig", + "id": 5 + }, + "queryParams": { + "type": "QueryParameters", + "id": 9 + }, + "requestId": { + "type": "string", + "id": 11 } } }, - "DeleteAllContextsRequest": { + "DtmfParameters": { "fields": { - "parent": { + "acceptsDtmfInput": { + "type": "bool", + "id": 1 + } + } + }, + "AnalyzeContentResponse": { + "fields": { + "replyText": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Context" - } + "id": 1 + }, + "replyAudio": { + "type": "OutputAudio", + "id": 2 + }, + "automatedAgentReply": { + "type": "AutomatedAgentReply", + "id": 3 + }, + "message": { + "type": "Message", + "id": 5 + }, + "humanAgentSuggestionResults": { + "rule": "repeated", + "type": "SuggestionResult", + "id": 6 + }, + "endUserSuggestionResults": { + "rule": "repeated", + "type": "SuggestionResult", + "id": 7 + }, + "dtmfParameters": { + "type": "DtmfParameters", + "id": 9 } } }, - "EntityTypes": { - "options": { - "(google.api.default_host)": "dialogflow.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + "StreamingAnalyzeContentRequest": { + "oneofs": { + "config": { + "oneof": [ + "audioConfig", + "textConfig" + ] + }, + "input": { + "oneof": [ + "inputAudio", + "inputText", + "inputDtmf" + ] + } }, - "methods": { - "ListEntityTypes": { - "requestType": "ListEntityTypesRequest", - "responseType": "ListEntityTypesResponse", + "fields": { + "participant": { + "type": "string", + "id": 1, "options": { - "(google.api.http).get": "/v2/{parent=projects/*/agent}/entityTypes", - "(google.api.method_signature)": "parent,language_code" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/agent}/entityTypes" - } - }, - { - "(google.api.method_signature)": "parent" - }, - { - "(google.api.method_signature)": "parent,language_code" - } - ] + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Participant" + } }, - "GetEntityType": { - "requestType": "GetEntityTypeRequest", - "responseType": "EntityType", + "audioConfig": { + "type": "InputAudioConfig", + "id": 2 + }, + "textConfig": { + "type": "InputTextConfig", + "id": 3 + }, + "replyAudioConfig": { + "type": "OutputAudioConfig", + "id": 4 + }, + "inputAudio": { + "type": "bytes", + "id": 5 + }, + "inputText": { + "type": "string", + "id": 6 + }, + "inputDtmf": { + "type": "TelephonyDtmfEvents", + "id": 9 + }, + "queryParams": { + "type": "QueryParameters", + "id": 7 + } + } + }, + "StreamingAnalyzeContentResponse": { + "fields": { + "recognitionResult": { + "type": "StreamingRecognitionResult", + "id": 1 + }, + "replyText": { + "type": "string", + "id": 2 + }, + "replyAudio": { + "type": "OutputAudio", + "id": 3 + }, + "automatedAgentReply": { + "type": "AutomatedAgentReply", + "id": 4 + }, + "message": { + "type": "Message", + "id": 6 + }, + "humanAgentSuggestionResults": { + "rule": "repeated", + "type": "SuggestionResult", + "id": 7 + }, + "endUserSuggestionResults": { + "rule": "repeated", + "type": "SuggestionResult", + "id": 8 + }, + "dtmfParameters": { + "type": "DtmfParameters", + "id": 10 + } + } + }, + "SuggestArticlesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, "options": { - "(google.api.http).get": "/v2/{name=projects/*/agent/entityTypes/*}", - "(google.api.method_signature)": "name,language_code" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/agent/entityTypes/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.api.method_signature)": "name,language_code" - } - ] + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Participant" + } }, - "CreateEntityType": { - "requestType": "CreateEntityTypeRequest", - "responseType": "EntityType", + "latestMessage": { + "type": "string", + "id": 2, "options": { - "(google.api.http).post": "/v2/{parent=projects/*/agent}/entityTypes", - "(google.api.http).body": "entity_type", - "(google.api.method_signature)": "parent,entity_type,language_code" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/agent}/entityTypes", - "body": "entity_type" - } - }, - { - "(google.api.method_signature)": "parent,entity_type" - }, - { - "(google.api.method_signature)": "parent,entity_type,language_code" - } - ] + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Message" + } }, - "UpdateEntityType": { - "requestType": "UpdateEntityTypeRequest", - "responseType": "EntityType", + "contextSize": { + "type": "int32", + "id": 3 + } + } + }, + "SuggestArticlesResponse": { + "fields": { + "articleAnswers": { + "rule": "repeated", + "type": "ArticleAnswer", + "id": 1 + }, + "latestMessage": { + "type": "string", + "id": 2 + }, + "contextSize": { + "type": "int32", + "id": 3 + } + } + }, + "SuggestFaqAnswersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, "options": { - "(google.api.http).patch": "/v2/{entity_type.name=projects/*/agent/entityTypes/*}", - "(google.api.http).body": "entity_type", - "(google.api.method_signature)": "entity_type,language_code" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{entity_type.name=projects/*/agent/entityTypes/*}", - "body": "entity_type" - } - }, - { - "(google.api.method_signature)": "entity_type" - }, - { - "(google.api.method_signature)": "entity_type,language_code" - } - ] + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Participant" + } }, - "DeleteEntityType": { - "requestType": "DeleteEntityTypeRequest", - "responseType": "google.protobuf.Empty", + "latestMessage": { + "type": "string", + "id": 2, "options": { - "(google.api.http).delete": "/v2/{name=projects/*/agent/entityTypes/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/agent/entityTypes/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Message" + } }, - "BatchUpdateEntityTypes": { - "requestType": "BatchUpdateEntityTypesRequest", - "responseType": "google.longrunning.Operation", + "contextSize": { + "type": "int32", + "id": 3 + } + } + }, + "SuggestFaqAnswersResponse": { + "fields": { + "faqAnswers": { + "rule": "repeated", + "type": "FaqAnswer", + "id": 1 + }, + "latestMessage": { + "type": "string", + "id": 2 + }, + "contextSize": { + "type": "int32", + "id": 3 + } + } + }, + "AudioInput": { + "fields": { + "config": { + "type": "InputAudioConfig", + "id": 1, "options": { - "(google.api.http).post": "/v2/{parent=projects/*/agent}/entityTypes:batchUpdate", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/agent}/entityTypes:batchUpdate", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse", - "metadata_type": "google.protobuf.Struct" - } - } - ] + "(google.api.field_behavior)": "REQUIRED" + } }, - "BatchDeleteEntityTypes": { - "requestType": "BatchDeleteEntityTypesRequest", - "responseType": "google.longrunning.Operation", + "audio": { + "type": "bytes", + "id": 2, "options": { - "(google.api.http).post": "/v2/{parent=projects/*/agent}/entityTypes:batchDelete", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,entity_type_names", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/agent}/entityTypes:batchDelete", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,entity_type_names" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.protobuf.Struct" - } - } - ] - }, - "BatchCreateEntities": { - "requestType": "BatchCreateEntitiesRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,entities,language_code", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,entities" - }, - { - "(google.api.method_signature)": "parent,entities,language_code" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.protobuf.Struct" - } - } - ] - }, - "BatchUpdateEntities": { - "requestType": "BatchUpdateEntitiesRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,entities,language_code", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,entities" - }, - { - "(google.api.method_signature)": "parent,entities,language_code" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.protobuf.Struct" - } - } - ] + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "OutputAudio": { + "fields": { + "config": { + "type": "OutputAudioConfig", + "id": 1 }, - "BatchDeleteEntities": { - "requestType": "BatchDeleteEntitiesRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,entity_values,language_code", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,entity_values" - }, - { - "(google.api.method_signature)": "parent,entity_values,language_code" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.protobuf.Struct" - } - } - ] + "audio": { + "type": "bytes", + "id": 2 } } }, - "EntityType": { - "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/EntityType", - "(google.api.resource).pattern": "projects/{project}/agent/entityTypes/{entity_type}" - }, + "AutomatedAgentReply": { "fields": { - "name": { + "detectIntentResponse": { + "type": "DetectIntentResponse", + "id": 1 + } + } + }, + "ArticleAnswer": { + "fields": { + "title": { "type": "string", "id": 1 }, - "displayName": { + "uri": { "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "kind": { - "type": "Kind", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "autoExpansionMode": { - "type": "AutoExpansionMode", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 2 }, - "entities": { + "snippets": { "rule": "repeated", - "type": "Entity", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "type": "string", + "id": 3 }, - "enableFuzzyExtraction": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Entity": { - "fields": { - "value": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "synonyms": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } + "confidence": { + "type": "float", + "id": 4 }, - "Kind": { - "values": { - "KIND_UNSPECIFIED": 0, - "KIND_MAP": 1, - "KIND_LIST": 2, - "KIND_REGEXP": 3 - } + "metadata": { + "keyType": "string", + "type": "string", + "id": 5 }, - "AutoExpansionMode": { - "values": { - "AUTO_EXPANSION_MODE_UNSPECIFIED": 0, - "AUTO_EXPANSION_MODE_DEFAULT": 1 - } + "answerRecord": { + "type": "string", + "id": 6 } } }, - "ListEntityTypesRequest": { + "FaqAnswer": { "fields": { - "parent": { + "answer": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" - } + "id": 1 }, - "languageCode": { + "confidence": { + "type": "float", + "id": 2 + }, + "question": { "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 3 }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "source": { + "type": "string", + "id": 4 }, - "pageToken": { + "metadata": { + "keyType": "string", "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 5 + }, + "answerRecord": { + "type": "string", + "id": 6 } } }, - "ListEntityTypesResponse": { + "SuggestionResult": { + "oneofs": { + "suggestionResponse": { + "oneof": [ + "error", + "suggestArticlesResponse", + "suggestFaqAnswersResponse" + ] + } + }, "fields": { - "entityTypes": { - "rule": "repeated", - "type": "EntityType", + "error": { + "type": "google.rpc.Status", "id": 1 }, - "nextPageToken": { - "type": "string", + "suggestArticlesResponse": { + "type": "SuggestArticlesResponse", "id": 2 + }, + "suggestFaqAnswersResponse": { + "type": "SuggestFaqAnswersResponse", + "id": 3 } } }, - "GetEntityTypeRequest": { + "InputTextConfig": { "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" - } - }, "languageCode": { "type": "string", - "id": 2, + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } } } }, - "CreateEntityTypeRequest": { + "AnnotatedMessagePart": { "fields": { - "parent": { + "text": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" - } + "id": 1 }, "entityType": { - "type": "EntityType", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "languageCode": { "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 2 + }, + "formattedValue": { + "type": "google.protobuf.Value", + "id": 3 } } }, - "UpdateEntityTypeRequest": { + "MessageAnnotation": { "fields": { - "entityType": { - "type": "EntityType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "parts": { + "rule": "repeated", + "type": "AnnotatedMessagePart", + "id": 1 }, - "languageCode": { + "containEntities": { + "type": "bool", + "id": 2 + } + } + }, + "SpeechContext": { + "fields": { + "phrases": { + "rule": "repeated", "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 1 }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "boost": { + "type": "float", + "id": 2 } } }, - "DeleteEntityTypeRequest": { + "AudioEncoding": { + "values": { + "AUDIO_ENCODING_UNSPECIFIED": 0, + "AUDIO_ENCODING_LINEAR_16": 1, + "AUDIO_ENCODING_FLAC": 2, + "AUDIO_ENCODING_MULAW": 3, + "AUDIO_ENCODING_AMR": 4, + "AUDIO_ENCODING_AMR_WB": 5, + "AUDIO_ENCODING_OGG_OPUS": 6, + "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": 7 + } + }, + "SpeechWordInfo": { "fields": { - "name": { + "word": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" - } + "id": 3 + }, + "startOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "confidence": { + "type": "float", + "id": 4 } } }, - "BatchUpdateEntityTypesRequest": { - "oneofs": { - "entityTypeBatch": { - "oneof": [ - "entityTypeBatchUri", - "entityTypeBatchInline" - ] - } - }, + "SpeechModelVariant": { + "values": { + "SPEECH_MODEL_VARIANT_UNSPECIFIED": 0, + "USE_BEST_AVAILABLE": 1, + "USE_STANDARD": 2, + "USE_ENHANCED": 3 + } + }, + "InputAudioConfig": { "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" - } + "audioEncoding": { + "type": "AudioEncoding", + "id": 1 }, - "entityTypeBatchUri": { - "type": "string", + "sampleRateHertz": { + "type": "int32", "id": 2 }, - "entityTypeBatchInline": { - "type": "EntityTypeBatch", + "languageCode": { + "type": "string", "id": 3 }, - "languageCode": { + "enableWordInfo": { + "type": "bool", + "id": 13 + }, + "phraseHints": { + "rule": "repeated", "type": "string", "id": 4, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "deprecated": true } }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "speechContexts": { + "rule": "repeated", + "type": "SpeechContext", + "id": 11 + }, + "model": { + "type": "string", + "id": 7 + }, + "modelVariant": { + "type": "SpeechModelVariant", + "id": 10 + }, + "singleUtterance": { + "type": "bool", + "id": 8 + }, + "disableNoSpeechRecognizedEvent": { + "type": "bool", + "id": 14 } } }, - "BatchUpdateEntityTypesResponse": { + "VoiceSelectionParams": { "fields": { - "entityTypes": { - "rule": "repeated", - "type": "EntityType", + "name": { + "type": "string", "id": 1 + }, + "ssmlGender": { + "type": "SsmlVoiceGender", + "id": 2 } } }, - "BatchDeleteEntityTypesRequest": { + "SynthesizeSpeechConfig": { "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" - } + "speakingRate": { + "type": "double", + "id": 1 }, - "entityTypeNames": { + "pitch": { + "type": "double", + "id": 2 + }, + "volumeGainDb": { + "type": "double", + "id": 3 + }, + "effectsProfileId": { "rule": "repeated", "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 5 + }, + "voice": { + "type": "VoiceSelectionParams", + "id": 4 } } }, - "BatchCreateEntitiesRequest": { + "SsmlVoiceGender": { + "values": { + "SSML_VOICE_GENDER_UNSPECIFIED": 0, + "SSML_VOICE_GENDER_MALE": 1, + "SSML_VOICE_GENDER_FEMALE": 2, + "SSML_VOICE_GENDER_NEUTRAL": 3 + } + }, + "OutputAudioConfig": { "fields": { - "parent": { - "type": "string", + "audioEncoding": { + "type": "OutputAudioEncoding", "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" - } - }, - "entities": { - "rule": "repeated", - "type": "EntityType.Entity", - "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } }, - "languageCode": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "sampleRateHertz": { + "type": "int32", + "id": 2 + }, + "synthesizeSpeechConfig": { + "type": "SynthesizeSpeechConfig", + "id": 3 } } }, - "BatchUpdateEntitiesRequest": { + "TelephonyDtmfEvents": { "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" - } - }, - "entities": { + "dtmfEvents": { "rule": "repeated", - "type": "EntityType.Entity", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "languageCode": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "type": "TelephonyDtmf", + "id": 1 } } }, - "BatchDeleteEntitiesRequest": { + "OutputAudioEncoding": { + "values": { + "OUTPUT_AUDIO_ENCODING_UNSPECIFIED": 0, + "OUTPUT_AUDIO_ENCODING_LINEAR_16": 1, + "OUTPUT_AUDIO_ENCODING_MP3": 2, + "OUTPUT_AUDIO_ENCODING_OGG_OPUS": 3 + } + }, + "SpeechToTextConfig": { "fields": { - "parent": { - "type": "string", + "speechModelVariant": { + "type": "SpeechModelVariant", "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" - } - }, - "entityValues": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "languageCode": { - "type": "string", - "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } } } }, - "EntityTypeBatch": { - "fields": { - "entityTypes": { - "rule": "repeated", - "type": "EntityType", - "id": 1 - } + "TelephonyDtmf": { + "values": { + "TELEPHONY_DTMF_UNSPECIFIED": 0, + "DTMF_ONE": 1, + "DTMF_TWO": 2, + "DTMF_THREE": 3, + "DTMF_FOUR": 4, + "DTMF_FIVE": 5, + "DTMF_SIX": 6, + "DTMF_SEVEN": 7, + "DTMF_EIGHT": 8, + "DTMF_NINE": 9, + "DTMF_ZERO": 10, + "DTMF_A": 11, + "DTMF_B": 12, + "DTMF_C": 13, + "DTMF_D": 14, + "DTMF_STAR": 15, + "DTMF_POUND": 16 } }, - "Environments": { + "Sessions": { "options": { "(google.api.default_host)": "dialogflow.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" }, "methods": { - "ListEnvironments": { - "requestType": "ListEnvironmentsRequest", - "responseType": "ListEnvironmentsResponse", + "DetectIntent": { + "requestType": "DetectIntentRequest", + "responseType": "DetectIntentResponse", "options": { - "(google.api.http).get": "/v2/{parent=projects/*/agent}/environments" + "(google.api.http).post": "/v2/{session=projects/*/agent/sessions/*}:detectIntent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "session,query_input" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2/{parent=projects/*/agent}/environments" + "post": "/v2/{session=projects/*/agent/sessions/*}:detectIntent", + "body": "*", + "additional_bindings": { + "post": "/v2/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent", + "body": "*" + } } + }, + { + "(google.api.method_signature)": "session,query_input" } ] + }, + "StreamingDetectIntent": { + "requestType": "StreamingDetectIntentRequest", + "requestStream": true, + "responseType": "StreamingDetectIntentResponse", + "responseStream": true } } }, - "Environment": { - "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/Environment", - "(google.api.resource).pattern": "projects/{project}/agent/environments/{environment}" - }, + "DetectIntentRequest": { "fields": { - "name": { + "session": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" } }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "queryParams": { + "type": "QueryParameters", + "id": 2 }, - "agentVersion": { - "type": "string", + "queryInput": { + "type": "QueryInput", "id": 3, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "state": { - "type": "State", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 4 }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "STOPPED": 1, - "LOADING": 2, - "RUNNING": 3 - } + "outputAudioConfigMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "inputAudio": { + "type": "bytes", + "id": 5 } } }, - "ListEnvironmentsRequest": { + "DetectIntentResponse": { "fields": { - "parent": { + "responseId": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Environment" - } + "id": 1 }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "queryResult": { + "type": "QueryResult", + "id": 2 }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "webhookStatus": { + "type": "google.rpc.Status", + "id": 3 + }, + "outputAudio": { + "type": "bytes", + "id": 4 + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 6 } } }, - "ListEnvironmentsResponse": { + "QueryParameters": { "fields": { - "environments": { - "rule": "repeated", - "type": "Environment", + "timeZone": { + "type": "string", "id": 1 }, - "nextPageToken": { - "type": "string", + "geoLocation": { + "type": "google.type.LatLng", "id": 2 + }, + "contexts": { + "rule": "repeated", + "type": "Context", + "id": 3 + }, + "resetContexts": { + "type": "bool", + "id": 4 + }, + "sessionEntityTypes": { + "rule": "repeated", + "type": "SessionEntityType", + "id": 5 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 6 + }, + "sentimentAnalysisRequestConfig": { + "type": "SentimentAnalysisRequestConfig", + "id": 10 + }, + "webhookHeaders": { + "keyType": "string", + "type": "string", + "id": 14 } } }, - "Intents": { - "options": { - "(google.api.default_host)": "dialogflow.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + "QueryInput": { + "oneofs": { + "input": { + "oneof": [ + "audioConfig", + "text", + "event" + ] + } }, - "methods": { - "ListIntents": { - "requestType": "ListIntentsRequest", - "responseType": "ListIntentsResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/agent}/intents", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/agent/environments/*}/intents", - "(google.api.method_signature)": "parent,language_code" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/agent}/intents", - "additional_bindings": { - "get": "/v2/{parent=projects/*/agent/environments/*}/intents" - } - } - }, - { - "(google.api.method_signature)": "parent" - }, - { - "(google.api.method_signature)": "parent,language_code" - } - ] - }, - "GetIntent": { - "requestType": "GetIntentRequest", - "responseType": "Intent", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/agent/intents/*}", - "(google.api.method_signature)": "name,language_code" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/agent/intents/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.api.method_signature)": "name,language_code" - } - ] - }, - "CreateIntent": { - "requestType": "CreateIntentRequest", - "responseType": "Intent", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/agent}/intents", - "(google.api.http).body": "intent", - "(google.api.method_signature)": "parent,intent,language_code" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/agent}/intents", - "body": "intent" - } - }, - { - "(google.api.method_signature)": "parent,intent" - }, - { - "(google.api.method_signature)": "parent,intent,language_code" - } - ] - }, - "UpdateIntent": { - "requestType": "UpdateIntentRequest", - "responseType": "Intent", - "options": { - "(google.api.http).patch": "/v2/{intent.name=projects/*/agent/intents/*}", - "(google.api.http).body": "intent", - "(google.api.method_signature)": "intent,language_code,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{intent.name=projects/*/agent/intents/*}", - "body": "intent" - } - }, - { - "(google.api.method_signature)": "intent,language_code" - }, - { - "(google.api.method_signature)": "intent,language_code,update_mask" - } - ] - }, - "DeleteIntent": { - "requestType": "DeleteIntentRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/agent/intents/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/agent/intents/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] + "fields": { + "audioConfig": { + "type": "InputAudioConfig", + "id": 1 }, - "BatchUpdateIntents": { - "requestType": "BatchUpdateIntentsRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/agent}/intents:batchUpdate", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,intent_batch_inline", - "(google.longrunning.operation_info).response_type": "google.cloud.dialogflow.v2.BatchUpdateIntentsResponse", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/agent}/intents:batchUpdate", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,intent_batch_uri" - }, - { - "(google.api.method_signature)": "parent,intent_batch_inline" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.dialogflow.v2.BatchUpdateIntentsResponse", - "metadata_type": "google.protobuf.Struct" - } - } - ] + "text": { + "type": "TextInput", + "id": 2 }, - "BatchDeleteIntents": { - "requestType": "BatchDeleteIntentsRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/agent}/intents:batchDelete", - "(google.api.http).body": "*", - "(google.api.method_signature)": "parent,intents", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/agent}/intents:batchDelete", - "body": "*" - } - }, - { - "(google.api.method_signature)": "parent,intents" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.protobuf.Struct" - } - } - ] + "event": { + "type": "EventInput", + "id": 3 } } }, - "Intent": { - "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/Intent", - "(google.api.resource).pattern": "projects/{project}/agent/intents/{intent}" - }, + "QueryResult": { "fields": { - "name": { + "queryText": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 1 }, - "displayName": { + "languageCode": { "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "id": 15 }, - "webhookState": { - "type": "WebhookState", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "speechRecognitionConfidence": { + "type": "float", + "id": 2 }, - "priority": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "action": { + "type": "string", + "id": 3 }, - "isFallback": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "parameters": { + "type": "google.protobuf.Struct", + "id": 4 }, - "mlDisabled": { + "allRequiredParamsPresent": { "type": "bool", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 5 }, - "inputContextNames": { - "rule": "repeated", + "fulfillmentText": { "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 6 }, - "events": { + "fulfillmentMessages": { "rule": "repeated", + "type": "Intent.Message", + "id": 7 + }, + "webhookSource": { "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "id": 8 }, - "trainingPhrases": { + "webhookPayload": { + "type": "google.protobuf.Struct", + "id": 9 + }, + "outputContexts": { "rule": "repeated", - "type": "TrainingPhrase", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "type": "Context", + "id": 10 }, - "action": { + "intent": { + "type": "Intent", + "id": 11 + }, + "intentDetectionConfidence": { + "type": "float", + "id": 12 + }, + "diagnosticInfo": { + "type": "google.protobuf.Struct", + "id": 14 + }, + "sentimentAnalysisResult": { + "type": "SentimentAnalysisResult", + "id": 17 + } + } + }, + "StreamingDetectIntentRequest": { + "fields": { + "session": { "type": "string", - "id": 10, + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" } }, - "outputContexts": { - "rule": "repeated", - "type": "Context", - "id": 11, + "queryParams": { + "type": "QueryParameters", + "id": 2 + }, + "queryInput": { + "type": "QueryInput", + "id": 3, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "resetContexts": { + "singleUtterance": { "type": "bool", - "id": 12, + "id": 4, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "deprecated": true } }, - "parameters": { + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 5 + }, + "outputAudioConfigMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "inputAudio": { + "type": "bytes", + "id": 6 + } + } + }, + "StreamingDetectIntentResponse": { + "fields": { + "responseId": { + "type": "string", + "id": 1 + }, + "recognitionResult": { + "type": "StreamingRecognitionResult", + "id": 2 + }, + "queryResult": { + "type": "QueryResult", + "id": 3 + }, + "webhookStatus": { + "type": "google.rpc.Status", + "id": 4 + }, + "outputAudio": { + "type": "bytes", + "id": 5 + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 6 + } + } + }, + "StreamingRecognitionResult": { + "fields": { + "messageType": { + "type": "MessageType", + "id": 1 + }, + "transcript": { + "type": "string", + "id": 2 + }, + "isFinal": { + "type": "bool", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "speechWordInfo": { "rule": "repeated", - "type": "Parameter", - "id": 13, + "type": "SpeechWordInfo", + "id": 7 + }, + "speechEndOffset": { + "type": "google.protobuf.Duration", + "id": 8 + } + }, + "nested": { + "MessageType": { + "values": { + "MESSAGE_TYPE_UNSPECIFIED": 0, + "TRANSCRIPT": 1, + "END_OF_SINGLE_UTTERANCE": 2 + } + } + } + }, + "TextInput": { + "fields": { + "text": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "messages": { - "rule": "repeated", - "type": "Message", - "id": 14, + "languageCode": { + "type": "string", + "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } - }, - "defaultResponsePlatforms": { - "rule": "repeated", - "type": "Message.Platform", - "id": 15, + } + } + }, + "EventInput": { + "fields": { + "name": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "rootFollowupIntentName": { - "type": "string", - "id": 16 + "parameters": { + "type": "google.protobuf.Struct", + "id": 2 }, - "parentFollowupIntentName": { + "languageCode": { "type": "string", - "id": 17 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SentimentAnalysisRequestConfig": { + "fields": { + "analyzeQueryTextSentiment": { + "type": "bool", + "id": 1 + } + } + }, + "SentimentAnalysisResult": { + "fields": { + "queryTextSentiment": { + "type": "Sentiment", + "id": 1 + } + } + }, + "Sentiment": { + "fields": { + "score": { + "type": "float", + "id": 1 }, - "followupIntentInfo": { - "rule": "repeated", - "type": "FollowupIntentInfo", - "id": 18 + "magnitude": { + "type": "float", + "id": 2 } + } + }, + "Contexts": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" }, - "nested": { - "TrainingPhrase": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "Type", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "parts": { - "rule": "repeated", - "type": "Part", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "methods": { + "ListContexts": { + "requestType": "ListContextsRequest", + "responseType": "ListContextsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/agent/sessions/*}/contexts", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/agent/sessions/*}/contexts", + "additional_bindings": { + "get": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts" + } } }, - "timesAddedCount": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + { + "(google.api.method_signature)": "parent" } + ] + }, + "GetContext": { + "requestType": "GetContextRequest", + "responseType": "Context", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/agent/sessions/*/contexts/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}", + "(google.api.method_signature)": "name" }, - "nested": { - "Part": { - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "entityType": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "alias": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "userDefined": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/agent/sessions/*/contexts/*}", + "additional_bindings": { + "get": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}" } } }, - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "EXAMPLE": 1, - "TEMPLATE": 2 - } + { + "(google.api.method_signature)": "name" } - } + ] }, - "Parameter": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "value": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "defaultValue": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "entityTypeDisplayName": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mandatory": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "prompts": { - "rule": "repeated", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" + "CreateContext": { + "requestType": "CreateContextRequest", + "responseType": "Context", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/agent/sessions/*}/contexts", + "(google.api.http).body": "context", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts", + "(google.api.http).additional_bindings.body": "context", + "(google.api.method_signature)": "parent,context" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/agent/sessions/*}/contexts", + "body": "context", + "additional_bindings": { + "post": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts", + "body": "context" + } } }, - "isList": { - "type": "bool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + { + "(google.api.method_signature)": "parent,context" } - } + ] }, - "Message": { - "oneofs": { - "message": { - "oneof": [ - "text", - "image", - "quickReplies", - "card", - "payload", - "simpleResponses", - "basicCard", - "suggestions", - "linkOutSuggestion", - "listSelect", - "carouselSelect", - "browseCarouselCard", - "tableCard", - "mediaContent" - ] - } + "UpdateContext": { + "requestType": "UpdateContextRequest", + "responseType": "Context", + "options": { + "(google.api.http).patch": "/v2/{context.name=projects/*/agent/sessions/*/contexts/*}", + "(google.api.http).body": "context", + "(google.api.http).additional_bindings.patch": "/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}", + "(google.api.http).additional_bindings.body": "context", + "(google.api.method_signature)": "context,update_mask" }, - "fields": { - "text": { - "type": "Text", - "id": 1 - }, - "image": { - "type": "Image", - "id": 2 - }, - "quickReplies": { - "type": "QuickReplies", - "id": 3 - }, - "card": { - "type": "Card", - "id": 4 - }, - "payload": { - "type": "google.protobuf.Struct", - "id": 5 - }, - "simpleResponses": { - "type": "SimpleResponses", - "id": 7 - }, - "basicCard": { - "type": "BasicCard", - "id": 8 - }, - "suggestions": { - "type": "Suggestions", - "id": 9 - }, - "linkOutSuggestion": { - "type": "LinkOutSuggestion", - "id": 10 - }, - "listSelect": { - "type": "ListSelect", - "id": 11 - }, - "carouselSelect": { - "type": "CarouselSelect", - "id": 12 - }, - "browseCarouselCard": { - "type": "BrowseCarouselCard", - "id": 22 - }, - "tableCard": { - "type": "TableCard", - "id": 23 - }, - "mediaContent": { - "type": "MediaContent", - "id": 24 - }, - "platform": { - "type": "Platform", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{context.name=projects/*/agent/sessions/*/contexts/*}", + "body": "context", + "additional_bindings": { + "patch": "/v2/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}", + "body": "context" + } } + }, + { + "(google.api.method_signature)": "context,update_mask" } + ] + }, + "DeleteContext": { + "requestType": "DeleteContextRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/agent/sessions/*/contexts/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}", + "(google.api.method_signature)": "name" }, - "nested": { - "Text": { - "fields": { - "text": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/agent/sessions/*/contexts/*}", + "additional_bindings": { + "delete": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}" } } }, - "Image": { - "fields": { - "imageUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "accessibilityText": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + { + "(google.api.method_signature)": "name" + } + ] + }, + "DeleteAllContexts": { + "requestType": "DeleteAllContextsRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{parent=projects/*/agent/sessions/*}/contexts", + "(google.api.http).additional_bindings.delete": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{parent=projects/*/agent/sessions/*}/contexts", + "additional_bindings": { + "delete": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts" } } }, - "QuickReplies": { - "fields": { - "title": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "quickReplies": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "Context": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Context", + "(google.api.resource).pattern": "projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "lifespanCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "parameters": { + "type": "google.protobuf.Struct", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListContextsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Context" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListContextsResponse": { + "fields": { + "contexts": { + "rule": "repeated", + "type": "Context", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetContextRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Context" + } + } + } + }, + "CreateContextRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Context" + } + }, + "context": { + "type": "Context", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateContextRequest": { + "fields": { + "context": { + "type": "Context", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteContextRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Context" + } + } + } + }, + "DeleteAllContextsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Context" + } + } + } + }, + "Intents": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListIntents": { + "requestType": "ListIntentsRequest", + "responseType": "ListIntentsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/agent}/intents", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/agent/environments/*}/intents", + "(google.api.method_signature)": "parent,language_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/agent}/intents", + "additional_bindings": { + "get": "/v2/{parent=projects/*/agent/environments/*}/intents" } } }, - "Card": { - "fields": { - "title": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subtitle": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "imageUri": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "buttons": { - "rule": "repeated", - "type": "Button", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Button": { - "fields": { - "text": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "postback": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } + { + "(google.api.method_signature)": "parent" }, - "SimpleResponse": { - "fields": { - "textToSpeech": { - "type": "string", - "id": 1 - }, - "ssml": { - "type": "string", - "id": 2 - }, - "displayText": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } + { + "(google.api.method_signature)": "parent,language_code" + } + ] + }, + "GetIntent": { + "requestType": "GetIntentRequest", + "responseType": "Intent", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/agent/intents/*}", + "(google.api.method_signature)": "name,language_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/agent/intents/*}" } }, - "SimpleResponses": { - "fields": { - "simpleResponses": { - "rule": "repeated", - "type": "SimpleResponse", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } + { + "(google.api.method_signature)": "name" }, - "BasicCard": { - "fields": { - "title": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "subtitle": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "formattedText": { - "type": "string", - "id": 3 - }, - "image": { - "type": "Image", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "buttons": { - "rule": "repeated", - "type": "Button", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Button": { - "fields": { - "title": { - "type": "string", - "id": 1 - }, - "openUriAction": { - "type": "OpenUriAction", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "OpenUriAction": { - "fields": { - "uri": { - "type": "string", - "id": 1 - } - } - } - } - } + { + "(google.api.method_signature)": "name,language_code" + } + ] + }, + "CreateIntent": { + "requestType": "CreateIntentRequest", + "responseType": "Intent", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/agent}/intents", + "(google.api.http).body": "intent", + "(google.api.method_signature)": "parent,intent,language_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/agent}/intents", + "body": "intent" } }, - "Suggestion": { - "fields": { - "title": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } + { + "(google.api.method_signature)": "parent,intent" + }, + { + "(google.api.method_signature)": "parent,intent,language_code" + } + ] + }, + "UpdateIntent": { + "requestType": "UpdateIntentRequest", + "responseType": "Intent", + "options": { + "(google.api.http).patch": "/v2/{intent.name=projects/*/agent/intents/*}", + "(google.api.http).body": "intent", + "(google.api.method_signature)": "intent,language_code,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{intent.name=projects/*/agent/intents/*}", + "body": "intent" } }, - "Suggestions": { - "fields": { - "suggestions": { - "rule": "repeated", - "type": "Suggestion", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } + { + "(google.api.method_signature)": "intent,language_code" + }, + { + "(google.api.method_signature)": "intent,language_code,update_mask" + } + ] + }, + "DeleteIntent": { + "requestType": "DeleteIntentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/agent/intents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/agent/intents/*}" } }, - "LinkOutSuggestion": { - "fields": { - "destinationName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "uri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchUpdateIntents": { + "requestType": "BatchUpdateIntentsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/agent}/intents:batchUpdate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,intent_batch_inline", + "(google.longrunning.operation_info).response_type": "google.cloud.dialogflow.v2.BatchUpdateIntentsResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/agent}/intents:batchUpdate", + "body": "*" } }, - "ListSelect": { - "fields": { - "title": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "items": { - "rule": "repeated", - "type": "Item", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "subtitle": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Item": { - "fields": { - "info": { - "type": "SelectItemInfo", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "title": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "image": { - "type": "Image", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } + { + "(google.api.method_signature)": "parent,intent_batch_uri" }, - "CarouselSelect": { - "fields": { - "items": { - "rule": "repeated", - "type": "Item", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "Item": { - "fields": { - "info": { - "type": "SelectItemInfo", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "title": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "image": { - "type": "Image", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - } - } + { + "(google.api.method_signature)": "parent,intent_batch_inline" }, - "SelectItemInfo": { - "fields": { - "key": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "synonyms": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.dialogflow.v2.BatchUpdateIntentsResponse", + "metadata_type": "google.protobuf.Struct" } - }, - "MediaContent": { - "fields": { - "mediaType": { - "type": "ResponseMediaType", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mediaObjects": { - "rule": "repeated", - "type": "ResponseMediaObject", - "id": 2 - } - }, - "nested": { - "ResponseMediaObject": { - "oneofs": { - "image": { - "oneof": [ - "largeImage", - "icon" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "largeImage": { - "type": "Image", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "icon": { - "type": "Image", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "contentUrl": { - "type": "string", - "id": 5 - } - } - }, - "ResponseMediaType": { - "values": { - "RESPONSE_MEDIA_TYPE_UNSPECIFIED": 0, - "AUDIO": 1 - } - } + } + ] + }, + "BatchDeleteIntents": { + "requestType": "BatchDeleteIntentsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/agent}/intents:batchDelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,intents", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/agent}/intents:batchDelete", + "body": "*" } }, - "BrowseCarouselCard": { - "fields": { - "items": { - "rule": "repeated", - "type": "BrowseCarouselCardItem", - "id": 1 - }, - "imageDisplayOptions": { - "type": "ImageDisplayOptions", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "BrowseCarouselCardItem": { - "fields": { - "openUriAction": { - "type": "OpenUrlAction", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "image": { - "type": "Image", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "footer": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "OpenUrlAction": { - "fields": { - "url": { - "type": "string", - "id": 1 - }, - "urlTypeHint": { - "type": "UrlTypeHint", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "UrlTypeHint": { - "values": { - "URL_TYPE_HINT_UNSPECIFIED": 0, - "AMP_ACTION": 1, - "AMP_CONTENT": 2 - } - } - } - } - } - }, - "ImageDisplayOptions": { - "values": { - "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED": 0, - "GRAY": 1, - "WHITE": 2, - "CROPPED": 3, - "BLURRED_BACKGROUND": 4 - } - } - } - }, - "TableCard": { - "fields": { - "title": { - "type": "string", - "id": 1 - }, - "subtitle": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "image": { - "type": "Image", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "columnProperties": { - "rule": "repeated", - "type": "ColumnProperties", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "rows": { - "rule": "repeated", - "type": "TableCardRow", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "buttons": { - "rule": "repeated", - "type": "BasicCard.Button", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ColumnProperties": { - "fields": { - "header": { - "type": "string", - "id": 1 - }, - "horizontalAlignment": { - "type": "HorizontalAlignment", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "HorizontalAlignment": { - "values": { - "HORIZONTAL_ALIGNMENT_UNSPECIFIED": 0, - "LEADING": 1, - "CENTER": 2, - "TRAILING": 3 - } - } - } - }, - "TableCardRow": { - "fields": { - "cells": { - "rule": "repeated", - "type": "TableCardCell", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "dividerAfter": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "TableCardCell": { - "fields": { - "text": { - "type": "string", - "id": 1 - } - } + { + "(google.api.method_signature)": "parent,intents" }, - "Platform": { - "values": { - "PLATFORM_UNSPECIFIED": 0, - "FACEBOOK": 1, - "SLACK": 2, - "TELEGRAM": 3, - "KIK": 4, - "SKYPE": 5, - "LINE": 6, - "VIBER": 7, - "ACTIONS_ON_GOOGLE": 8, - "GOOGLE_HANGOUTS": 11 + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" } } - } - }, - "FollowupIntentInfo": { - "fields": { - "followupIntentName": { - "type": "string", - "id": 1 - }, - "parentFollowupIntentName": { - "type": "string", - "id": 2 - } - } - }, - "WebhookState": { - "values": { - "WEBHOOK_STATE_UNSPECIFIED": 0, - "WEBHOOK_STATE_ENABLED": 1, - "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING": 2 - } + ] } } }, - "ListIntentsRequest": { + "Intent": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Intent", + "(google.api.resource).pattern": "projects/{project}/agent/intents/{intent}" + }, "fields": { - "parent": { + "name": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + "(google.api.field_behavior)": "OPTIONAL" } }, - "languageCode": { + "displayName": { "type": "string", "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "webhookState": { + "type": "WebhookState", + "id": 6, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "intentView": { - "type": "IntentView", + "priority": { + "type": "int32", "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "pageSize": { - "type": "int32", + "isFallback": { + "type": "bool", "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "pageToken": { - "type": "string", - "id": 5, + "mlDisabled": { + "type": "bool", + "id": 19, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "ListIntentsResponse": { - "fields": { - "intents": { - "rule": "repeated", - "type": "Intent", - "id": 1 }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetIntentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, + "liveAgentHandoff": { + "type": "bool", + "id": 20, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + "(google.api.field_behavior)": "OPTIONAL" } }, - "languageCode": { - "type": "string", - "id": 2, + "endInteraction": { + "type": "bool", + "id": 21, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "intentView": { - "type": "IntentView", - "id": 3, + "inputContextNames": { + "rule": "repeated", + "type": "string", + "id": 7, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "CreateIntentRequest": { - "fields": { - "parent": { + }, + "events": { + "rule": "repeated", "type": "string", - "id": 1, + "id": 8, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + "(google.api.field_behavior)": "OPTIONAL" } }, - "intent": { - "type": "Intent", - "id": 2, + "trainingPhrases": { + "rule": "repeated", + "type": "TrainingPhrase", + "id": 9, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } }, - "languageCode": { + "action": { "type": "string", - "id": 3, + "id": 10, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "intentView": { - "type": "IntentView", - "id": 4, + "outputContexts": { + "rule": "repeated", + "type": "Context", + "id": 11, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "UpdateIntentRequest": { - "fields": { - "intent": { - "type": "Intent", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } }, - "languageCode": { - "type": "string", - "id": 2, + "resetContexts": { + "type": "bool", + "id": 12, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 3, + "parameters": { + "rule": "repeated", + "type": "Parameter", + "id": 13, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "intentView": { - "type": "IntentView", - "id": 4, + "messages": { + "rule": "repeated", + "type": "Message", + "id": 14, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "DeleteIntentRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" - } - } - } - }, - "BatchUpdateIntentsRequest": { - "oneofs": { - "intentBatch": { - "oneof": [ - "intentBatchUri", - "intentBatchInline" - ] - } - }, - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" - } - }, - "intentBatchUri": { - "type": "string", - "id": 2 - }, - "intentBatchInline": { - "type": "IntentBatch", - "id": 3 }, - "languageCode": { - "type": "string", - "id": 4, + "defaultResponsePlatforms": { + "rule": "repeated", + "type": "Message.Platform", + "id": 15, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "rootFollowupIntentName": { + "type": "string", + "id": 16 }, - "intentView": { - "type": "IntentView", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BatchUpdateIntentsResponse": { - "fields": { - "intents": { - "rule": "repeated", - "type": "Intent", - "id": 1 - } - } - }, - "BatchDeleteIntentsRequest": { - "fields": { - "parent": { + "parentFollowupIntentName": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" - } + "id": 17 }, - "intents": { - "rule": "repeated", - "type": "Intent", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "IntentBatch": { - "fields": { - "intents": { + "followupIntentInfo": { "rule": "repeated", - "type": "Intent", - "id": 1 + "type": "FollowupIntentInfo", + "id": 18 } - } - }, - "IntentView": { - "values": { - "INTENT_VIEW_UNSPECIFIED": 0, - "INTENT_VIEW_FULL": 1 - } - }, - "Sessions": { - "options": { - "(google.api.default_host)": "dialogflow.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" }, - "methods": { - "DetectIntent": { - "requestType": "DetectIntentRequest", - "responseType": "DetectIntentResponse", - "options": { - "(google.api.http).post": "/v2/{session=projects/*/agent/sessions/*}:detectIntent", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "session,query_input" + "nested": { + "TrainingPhrase": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parts": { + "rule": "repeated", + "type": "Part", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "timesAddedCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{session=projects/*/agent/sessions/*}:detectIntent", - "body": "*", - "additional_bindings": { - "post": "/v2/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent", - "body": "*" + "nested": { + "Part": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "entityType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "alias": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "userDefined": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - { - "(google.api.method_signature)": "session,query_input" + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "EXAMPLE": 1, + "TEMPLATE": 2 + } } - ] - }, - "StreamingDetectIntent": { - "requestType": "StreamingDetectIntentRequest", - "requestStream": true, - "responseType": "StreamingDetectIntentResponse", - "responseStream": true - } - } - }, - "DetectIntentRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" } }, - "queryParams": { - "type": "QueryParameters", - "id": 2 - }, - "queryInput": { - "type": "QueryInput", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "outputAudioConfig": { - "type": "OutputAudioConfig", - "id": 4 - }, - "outputAudioConfigMask": { - "type": "google.protobuf.FieldMask", - "id": 7 - }, - "inputAudio": { - "type": "bytes", - "id": 5 - } - } - }, - "DetectIntentResponse": { - "fields": { - "responseId": { - "type": "string", - "id": 1 - }, - "queryResult": { - "type": "QueryResult", - "id": 2 - }, - "webhookStatus": { - "type": "google.rpc.Status", - "id": 3 - }, - "outputAudio": { - "type": "bytes", - "id": 4 - }, - "outputAudioConfig": { - "type": "OutputAudioConfig", - "id": 6 - } - } - }, - "QueryParameters": { - "fields": { - "timeZone": { - "type": "string", - "id": 1 - }, - "geoLocation": { - "type": "google.type.LatLng", - "id": 2 - }, - "contexts": { - "rule": "repeated", - "type": "Context", - "id": 3 - }, - "resetContexts": { - "type": "bool", - "id": 4 - }, - "sessionEntityTypes": { - "rule": "repeated", - "type": "SessionEntityType", - "id": 5 - }, - "payload": { - "type": "google.protobuf.Struct", - "id": 6 - }, - "sentimentAnalysisRequestConfig": { - "type": "SentimentAnalysisRequestConfig", - "id": 10 - }, - "webhookHeaders": { - "keyType": "string", - "type": "string", - "id": 14 - } - } - }, - "QueryInput": { - "oneofs": { - "input": { - "oneof": [ - "audioConfig", - "text", - "event" - ] - } - }, - "fields": { - "audioConfig": { - "type": "InputAudioConfig", - "id": 1 - }, - "text": { - "type": "TextInput", - "id": 2 - }, - "event": { - "type": "EventInput", - "id": 3 - } - } - }, - "QueryResult": { - "fields": { - "queryText": { - "type": "string", - "id": 1 - }, - "languageCode": { - "type": "string", - "id": 15 - }, - "speechRecognitionConfidence": { - "type": "float", - "id": 2 - }, - "action": { - "type": "string", - "id": 3 - }, - "parameters": { - "type": "google.protobuf.Struct", - "id": 4 - }, - "allRequiredParamsPresent": { - "type": "bool", - "id": 5 - }, - "fulfillmentText": { - "type": "string", - "id": 6 - }, - "fulfillmentMessages": { - "rule": "repeated", - "type": "Intent.Message", - "id": 7 - }, - "webhookSource": { - "type": "string", - "id": 8 - }, - "webhookPayload": { - "type": "google.protobuf.Struct", - "id": 9 - }, - "outputContexts": { - "rule": "repeated", - "type": "Context", - "id": 10 - }, - "intent": { - "type": "Intent", - "id": 11 - }, - "intentDetectionConfidence": { - "type": "float", - "id": 12 - }, - "diagnosticInfo": { - "type": "google.protobuf.Struct", - "id": 14 - }, - "sentimentAnalysisResult": { - "type": "SentimentAnalysisResult", - "id": 17 - } - } - }, - "StreamingDetectIntentRequest": { - "fields": { - "session": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" - } - }, - "queryParams": { - "type": "QueryParameters", - "id": 2 - }, - "queryInput": { - "type": "QueryInput", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "singleUtterance": { - "type": "bool", - "id": 4, - "options": { - "deprecated": true + "Parameter": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "value": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "defaultValue": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entityTypeDisplayName": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mandatory": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "prompts": { + "rule": "repeated", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "isList": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } } }, - "outputAudioConfig": { - "type": "OutputAudioConfig", - "id": 5 - }, - "outputAudioConfigMask": { - "type": "google.protobuf.FieldMask", - "id": 7 - }, - "inputAudio": { - "type": "bytes", - "id": 6 - } - } - }, - "StreamingDetectIntentResponse": { - "fields": { - "responseId": { - "type": "string", - "id": 1 - }, - "recognitionResult": { - "type": "StreamingRecognitionResult", - "id": 2 - }, - "queryResult": { - "type": "QueryResult", - "id": 3 - }, - "webhookStatus": { - "type": "google.rpc.Status", - "id": 4 - }, - "outputAudio": { - "type": "bytes", - "id": 5 - }, - "outputAudioConfig": { - "type": "OutputAudioConfig", - "id": 6 - } - } - }, - "StreamingRecognitionResult": { - "fields": { - "messageType": { - "type": "MessageType", - "id": 1 - }, - "transcript": { - "type": "string", - "id": 2 - }, - "isFinal": { - "type": "bool", - "id": 3 - }, - "confidence": { - "type": "float", - "id": 4 - }, - "speechWordInfo": { - "rule": "repeated", - "type": "SpeechWordInfo", - "id": 7 - }, - "speechEndOffset": { - "type": "google.protobuf.Duration", - "id": 8 - } - }, - "nested": { - "MessageType": { - "values": { - "MESSAGE_TYPE_UNSPECIFIED": 0, - "TRANSCRIPT": 1, - "END_OF_SINGLE_UTTERANCE": 2 - } - } - } - }, - "TextInput": { - "fields": { - "text": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "languageCode": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "EventInput": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "parameters": { - "type": "google.protobuf.Struct", - "id": 2 - }, - "languageCode": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "SentimentAnalysisRequestConfig": { - "fields": { - "analyzeQueryTextSentiment": { - "type": "bool", - "id": 1 - } - } - }, - "SentimentAnalysisResult": { - "fields": { - "queryTextSentiment": { - "type": "Sentiment", - "id": 1 - } - } - }, - "Sentiment": { - "fields": { - "score": { - "type": "float", - "id": 1 - }, - "magnitude": { - "type": "float", - "id": 2 - } - } - }, - "SessionEntityTypes": { - "options": { - "(google.api.default_host)": "dialogflow.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" - }, - "methods": { - "ListSessionEntityTypes": { - "requestType": "ListSessionEntityTypesRequest", - "responseType": "ListSessionEntityTypesResponse", - "options": { - "(google.api.http).get": "/v2/{parent=projects/*/agent/sessions/*}/entityTypes", - "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{parent=projects/*/agent/sessions/*}/entityTypes", - "additional_bindings": { - "get": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes" - } - } - }, - { - "(google.api.method_signature)": "parent" + "Message": { + "oneofs": { + "message": { + "oneof": [ + "text", + "image", + "quickReplies", + "card", + "payload", + "simpleResponses", + "basicCard", + "suggestions", + "linkOutSuggestion", + "listSelect", + "carouselSelect", + "browseCarouselCard", + "tableCard", + "mediaContent" + ] } - ] - }, - "GetSessionEntityType": { - "requestType": "GetSessionEntityTypeRequest", - "responseType": "SessionEntityType", - "options": { - "(google.api.http).get": "/v2/{name=projects/*/agent/sessions/*/entityTypes/*}", - "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", - "(google.api.method_signature)": "name" }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2/{name=projects/*/agent/sessions/*/entityTypes/*}", - "additional_bindings": { - "get": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" - } - } + "fields": { + "text": { + "type": "Text", + "id": 1 }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateSessionEntityType": { - "requestType": "CreateSessionEntityTypeRequest", - "responseType": "SessionEntityType", - "options": { - "(google.api.http).post": "/v2/{parent=projects/*/agent/sessions/*}/entityTypes", - "(google.api.http).body": "session_entity_type", - "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes", - "(google.api.http).additional_bindings.body": "session_entity_type", - "(google.api.method_signature)": "parent,session_entity_type" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2/{parent=projects/*/agent/sessions/*}/entityTypes", - "body": "session_entity_type", - "additional_bindings": { - "post": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes", - "body": "session_entity_type" - } - } + "image": { + "type": "Image", + "id": 2 }, - { - "(google.api.method_signature)": "parent,session_entity_type" - } - ] - }, - "UpdateSessionEntityType": { - "requestType": "UpdateSessionEntityTypeRequest", - "responseType": "SessionEntityType", - "options": { - "(google.api.http).patch": "/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}", - "(google.api.http).body": "session_entity_type", - "(google.api.http).additional_bindings.patch": "/v2/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", - "(google.api.http).additional_bindings.body": "session_entity_type", - "(google.api.method_signature)": "session_entity_type,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}", - "body": "session_entity_type", - "additional_bindings": { - "patch": "/v2/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", - "body": "session_entity_type" - } - } + "quickReplies": { + "type": "QuickReplies", + "id": 3 }, - { - "(google.api.method_signature)": "session_entity_type" + "card": { + "type": "Card", + "id": 4 }, - { - "(google.api.method_signature)": "session_entity_type,update_mask" + "payload": { + "type": "google.protobuf.Struct", + "id": 5 + }, + "simpleResponses": { + "type": "SimpleResponses", + "id": 7 + }, + "basicCard": { + "type": "BasicCard", + "id": 8 + }, + "suggestions": { + "type": "Suggestions", + "id": 9 + }, + "linkOutSuggestion": { + "type": "LinkOutSuggestion", + "id": 10 + }, + "listSelect": { + "type": "ListSelect", + "id": 11 + }, + "carouselSelect": { + "type": "CarouselSelect", + "id": 12 + }, + "browseCarouselCard": { + "type": "BrowseCarouselCard", + "id": 22 + }, + "tableCard": { + "type": "TableCard", + "id": 23 + }, + "mediaContent": { + "type": "MediaContent", + "id": 24 + }, + "platform": { + "type": "Platform", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } - ] - }, - "DeleteSessionEntityType": { - "requestType": "DeleteSessionEntityTypeRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2/{name=projects/*/agent/sessions/*/entityTypes/*}", - "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", - "(google.api.method_signature)": "name" }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2/{name=projects/*/agent/sessions/*/entityTypes/*}", - "additional_bindings": { - "delete": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" + "nested": { + "Text": { + "fields": { + "text": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - { - "(google.api.method_signature)": "name" - } - ] - } - } - }, - "SessionEntityType": { - "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/SessionEntityType", - "(google.api.resource).pattern": "projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "entityOverrideMode": { - "type": "EntityOverrideMode", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "entities": { - "rule": "repeated", - "type": "EntityType.Entity", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "EntityOverrideMode": { - "values": { - "ENTITY_OVERRIDE_MODE_UNSPECIFIED": 0, - "ENTITY_OVERRIDE_MODE_OVERRIDE": 1, - "ENTITY_OVERRIDE_MODE_SUPPLEMENT": 2 - } - } - } - }, - "ListSessionEntityTypesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SessionEntityType" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListSessionEntityTypesResponse": { - "fields": { - "sessionEntityTypes": { - "rule": "repeated", - "type": "SessionEntityType", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetSessionEntityTypeRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/SessionEntityType" - } - } - } - }, - "CreateSessionEntityTypeRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SessionEntityType" - } - }, - "sessionEntityType": { - "type": "SessionEntityType", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "UpdateSessionEntityTypeRequest": { - "fields": { - "sessionEntityType": { - "type": "SessionEntityType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteSessionEntityTypeRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/SessionEntityType" - } - } - } - }, - "WebhookRequest": { - "fields": { - "session": { - "type": "string", - "id": 4 - }, - "responseId": { - "type": "string", - "id": 1 - }, - "queryResult": { - "type": "QueryResult", - "id": 2 - }, - "originalDetectIntentRequest": { - "type": "OriginalDetectIntentRequest", - "id": 3 - } - } - }, - "WebhookResponse": { - "fields": { - "fulfillmentText": { - "type": "string", - "id": 1 - }, - "fulfillmentMessages": { - "rule": "repeated", - "type": "Intent.Message", - "id": 2 - }, - "source": { - "type": "string", - "id": 3 - }, - "payload": { - "type": "google.protobuf.Struct", - "id": 4 - }, - "outputContexts": { - "rule": "repeated", - "type": "Context", - "id": 5 - }, - "followupEventInput": { - "type": "EventInput", - "id": 6 - }, - "sessionEntityTypes": { - "rule": "repeated", - "type": "SessionEntityType", - "id": 10 - } - } - }, - "OriginalDetectIntentRequest": { - "fields": { - "source": { - "type": "string", - "id": 1 - }, - "version": { - "type": "string", - "id": 2 - }, - "payload": { - "type": "google.protobuf.Struct", - "id": 3 - } - } - } - } - }, - "v2beta1": { - "options": { - "cc_enable_arenas": true, - "csharp_namespace": "Google.Cloud.Dialogflow.V2beta1", - "go_package": "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow", - "java_multiple_files": true, - "java_outer_classname": "WebhookProto", - "java_package": "com.google.cloud.dialogflow.v2beta1", - "objc_class_prefix": "DF", - "(google.api.resource_definition).type": "dialogflow.googleapis.com/Session", - "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/agent/sessions/{session}" - }, - "nested": { - "Agents": { - "options": { - "(google.api.default_host)": "dialogflow.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" - }, - "methods": { - "GetAgent": { - "requestType": "GetAgentRequest", - "responseType": "Agent", - "options": { - "(google.api.http).get": "/v2beta1/{parent=projects/*}/agent", - "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*}/agent", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta1/{parent=projects/*}/agent", - "additional_bindings": { - "get": "/v2beta1/{parent=projects/*/locations/*}/agent" + "Image": { + "fields": { + "imageUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accessibilityText": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "SetAgent": { - "requestType": "SetAgentRequest", - "responseType": "Agent", - "options": { - "(google.api.http).post": "/v2beta1/{agent.parent=projects/*}/agent", - "(google.api.http).body": "agent", - "(google.api.http).additional_bindings.post": "/v2beta1/{agent.parent=projects/*/locations/*}/agent", - "(google.api.http).additional_bindings.body": "agent", - "(google.api.method_signature)": "agent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta1/{agent.parent=projects/*}/agent", - "body": "agent", - "additional_bindings": { - "post": "/v2beta1/{agent.parent=projects/*/locations/*}/agent", - "body": "agent" + "QuickReplies": { + "fields": { + "title": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "quickReplies": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - { - "(google.api.method_signature)": "agent" - } - ] - }, - "DeleteAgent": { - "requestType": "DeleteAgentRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2beta1/{parent=projects/*}/agent", - "(google.api.http).additional_bindings.delete": "/v2beta1/{parent=projects/*/locations/*}/agent", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2beta1/{parent=projects/*}/agent", - "additional_bindings": { - "delete": "/v2beta1/{parent=projects/*/locations/*}/agent" + "Card": { + "fields": { + "title": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subtitle": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "imageUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "buttons": { + "rule": "repeated", + "type": "Button", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Button": { + "fields": { + "text": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "postback": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } } } }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "SearchAgents": { - "requestType": "SearchAgentsRequest", - "responseType": "SearchAgentsResponse", - "options": { - "(google.api.http).get": "/v2beta1/{parent=projects/*}/agent:search", - "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*}/agent:search", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta1/{parent=projects/*}/agent:search", - "additional_bindings": { - "get": "/v2beta1/{parent=projects/*/locations/*}/agent:search" + "SimpleResponse": { + "fields": { + "textToSpeech": { + "type": "string", + "id": 1 + }, + "ssml": { + "type": "string", + "id": 2 + }, + "displayText": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "TrainAgent": { - "requestType": "TrainAgentRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*}/agent:train", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*}/agent:train", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*}/agent:train", - "body": "*", - "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*}/agent:train", - "body": "*" + "SimpleResponses": { + "fields": { + "simpleResponses": { + "rule": "repeated", + "type": "SimpleResponse", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - { - "(google.api.method_signature)": "parent" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.protobuf.Struct" - } - } - ] - }, - "ExportAgent": { - "requestType": "ExportAgentRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*}/agent:export", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*}/agent:export", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent", - "(google.longrunning.operation_info).response_type": "google.cloud.dialogflow.v2beta1.ExportAgentResponse", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*}/agent:export", - "body": "*", - "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*}/agent:export", - "body": "*" + "BasicCard": { + "fields": { + "title": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "subtitle": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "formattedText": { + "type": "string", + "id": 3 + }, + "image": { + "type": "Image", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "buttons": { + "rule": "repeated", + "type": "Button", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Button": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "openUriAction": { + "type": "OpenUriAction", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "OpenUriAction": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + } + } } } }, - { - "(google.api.method_signature)": "parent" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.dialogflow.v2beta1.ExportAgentResponse", - "metadata_type": "google.protobuf.Struct" - } - } - ] - }, - "ImportAgent": { - "requestType": "ImportAgentRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*}/agent:import", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*}/agent:import", - "(google.api.http).additional_bindings.body": "*", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*}/agent:import", - "body": "*", - "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*}/agent:import", - "body": "*" + "Suggestion": { + "fields": { + "title": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.protobuf.Struct" - } - } - ] - }, - "RestoreAgent": { - "requestType": "RestoreAgentRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*}/agent:restore", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*}/agent:restore", - "(google.api.http).additional_bindings.body": "*", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*}/agent:restore", - "body": "*", - "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*}/agent:restore", - "body": "*" + "Suggestions": { + "fields": { + "suggestions": { + "rule": "repeated", + "type": "Suggestion", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.protobuf.Struct" - } - } - ] - }, - "GetValidationResult": { - "requestType": "GetValidationResultRequest", - "responseType": "ValidationResult", - "options": { - "(google.api.http).get": "/v2beta1/{parent=projects/*}/agent/validationResult", - "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*}/agent/validationResult" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta1/{parent=projects/*}/agent/validationResult", - "additional_bindings": { - "get": "/v2beta1/{parent=projects/*/locations/*}/agent/validationResult" + "LinkOutSuggestion": { + "fields": { + "destinationName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "uri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } - } - ] - } - } - }, - "Agent": { - "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/Agent", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/agent" - }, - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" - } - }, - "displayName": { - "type": "string", - "id": 2 - }, - "defaultLanguageCode": { - "type": "string", - "id": 3 - }, - "supportedLanguageCodes": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "timeZone": { + }, + "ListSelect": { + "fields": { + "title": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "items": { + "rule": "repeated", + "type": "Item", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "subtitle": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Item": { + "fields": { + "info": { + "type": "SelectItemInfo", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "title": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "image": { + "type": "Image", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "CarouselSelect": { + "fields": { + "items": { + "rule": "repeated", + "type": "Item", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Item": { + "fields": { + "info": { + "type": "SelectItemInfo", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "title": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "image": { + "type": "Image", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + } + } + }, + "SelectItemInfo": { + "fields": { + "key": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "synonyms": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "MediaContent": { + "fields": { + "mediaType": { + "type": "ResponseMediaType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "mediaObjects": { + "rule": "repeated", + "type": "ResponseMediaObject", + "id": 2 + } + }, + "nested": { + "ResponseMediaObject": { + "oneofs": { + "image": { + "oneof": [ + "largeImage", + "icon" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "largeImage": { + "type": "Image", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "icon": { + "type": "Image", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "contentUrl": { + "type": "string", + "id": 5 + } + } + }, + "ResponseMediaType": { + "values": { + "RESPONSE_MEDIA_TYPE_UNSPECIFIED": 0, + "AUDIO": 1 + } + } + } + }, + "BrowseCarouselCard": { + "fields": { + "items": { + "rule": "repeated", + "type": "BrowseCarouselCardItem", + "id": 1 + }, + "imageDisplayOptions": { + "type": "ImageDisplayOptions", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "BrowseCarouselCardItem": { + "fields": { + "openUriAction": { + "type": "OpenUrlAction", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "image": { + "type": "Image", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "footer": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "OpenUrlAction": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "urlTypeHint": { + "type": "UrlTypeHint", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "UrlTypeHint": { + "values": { + "URL_TYPE_HINT_UNSPECIFIED": 0, + "AMP_ACTION": 1, + "AMP_CONTENT": 2 + } + } + } + } + } + }, + "ImageDisplayOptions": { + "values": { + "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED": 0, + "GRAY": 1, + "WHITE": 2, + "CROPPED": 3, + "BLURRED_BACKGROUND": 4 + } + } + } + }, + "TableCard": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "subtitle": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "image": { + "type": "Image", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "columnProperties": { + "rule": "repeated", + "type": "ColumnProperties", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rows": { + "rule": "repeated", + "type": "TableCardRow", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "buttons": { + "rule": "repeated", + "type": "BasicCard.Button", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ColumnProperties": { + "fields": { + "header": { + "type": "string", + "id": 1 + }, + "horizontalAlignment": { + "type": "HorizontalAlignment", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "HorizontalAlignment": { + "values": { + "HORIZONTAL_ALIGNMENT_UNSPECIFIED": 0, + "LEADING": 1, + "CENTER": 2, + "TRAILING": 3 + } + } + } + }, + "TableCardRow": { + "fields": { + "cells": { + "rule": "repeated", + "type": "TableCardCell", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "dividerAfter": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TableCardCell": { + "fields": { + "text": { + "type": "string", + "id": 1 + } + } + }, + "Platform": { + "values": { + "PLATFORM_UNSPECIFIED": 0, + "FACEBOOK": 1, + "SLACK": 2, + "TELEGRAM": 3, + "KIK": 4, + "SKYPE": 5, + "LINE": 6, + "VIBER": 7, + "ACTIONS_ON_GOOGLE": 8, + "GOOGLE_HANGOUTS": 11 + } + } + } + }, + "FollowupIntentInfo": { + "fields": { + "followupIntentName": { + "type": "string", + "id": 1 + }, + "parentFollowupIntentName": { + "type": "string", + "id": 2 + } + } + }, + "WebhookState": { + "values": { + "WEBHOOK_STATE_UNSPECIFIED": 0, + "WEBHOOK_STATE_ENABLED": 1, + "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING": 2 + } + } + } + }, + "ListIntentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "intentView": { + "type": "IntentView", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListIntentsResponse": { + "fields": { + "intents": { + "rule": "repeated", + "type": "Intent", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetIntentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "intentView": { + "type": "IntentView", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateIntentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "intent": { + "type": "Intent", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "intentView": { + "type": "IntentView", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateIntentRequest": { + "fields": { + "intent": { + "type": "Intent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "intentView": { + "type": "IntentView", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteIntentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + } + } + }, + "BatchUpdateIntentsRequest": { + "oneofs": { + "intentBatch": { + "oneof": [ + "intentBatchUri", + "intentBatchInline" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "intentBatchUri": { + "type": "string", + "id": 2 + }, + "intentBatchInline": { + "type": "IntentBatch", + "id": 3 + }, + "languageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "intentView": { + "type": "IntentView", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchUpdateIntentsResponse": { + "fields": { + "intents": { + "rule": "repeated", + "type": "Intent", + "id": 1 + } + } + }, + "BatchDeleteIntentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "intents": { + "rule": "repeated", + "type": "Intent", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "IntentBatch": { + "fields": { + "intents": { + "rule": "repeated", + "type": "Intent", + "id": 1 + } + } + }, + "IntentView": { + "values": { + "INTENT_VIEW_UNSPECIFIED": 0, + "INTENT_VIEW_FULL": 1 + } + }, + "SessionEntityTypes": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListSessionEntityTypes": { + "requestType": "ListSessionEntityTypesRequest", + "responseType": "ListSessionEntityTypesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/agent/sessions/*}/entityTypes", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/agent/sessions/*}/entityTypes", + "additional_bindings": { + "get": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetSessionEntityType": { + "requestType": "GetSessionEntityTypeRequest", + "responseType": "SessionEntityType", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/agent/sessions/*/entityTypes/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/agent/sessions/*/entityTypes/*}", + "additional_bindings": { + "get": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateSessionEntityType": { + "requestType": "CreateSessionEntityTypeRequest", + "responseType": "SessionEntityType", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/agent/sessions/*}/entityTypes", + "(google.api.http).body": "session_entity_type", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes", + "(google.api.http).additional_bindings.body": "session_entity_type", + "(google.api.method_signature)": "parent,session_entity_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/agent/sessions/*}/entityTypes", + "body": "session_entity_type", + "additional_bindings": { + "post": "/v2/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes", + "body": "session_entity_type" + } + } + }, + { + "(google.api.method_signature)": "parent,session_entity_type" + } + ] + }, + "UpdateSessionEntityType": { + "requestType": "UpdateSessionEntityTypeRequest", + "responseType": "SessionEntityType", + "options": { + "(google.api.http).patch": "/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}", + "(google.api.http).body": "session_entity_type", + "(google.api.http).additional_bindings.patch": "/v2/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", + "(google.api.http).additional_bindings.body": "session_entity_type", + "(google.api.method_signature)": "session_entity_type,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}", + "body": "session_entity_type", + "additional_bindings": { + "patch": "/v2/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", + "body": "session_entity_type" + } + } + }, + { + "(google.api.method_signature)": "session_entity_type" + }, + { + "(google.api.method_signature)": "session_entity_type,update_mask" + } + ] + }, + "DeleteSessionEntityType": { + "requestType": "DeleteSessionEntityTypeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/agent/sessions/*/entityTypes/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/agent/sessions/*/entityTypes/*}", + "additional_bindings": { + "delete": "/v2/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "SessionEntityType": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/SessionEntityType", + "(google.api.resource).pattern": "projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "entityOverrideMode": { + "type": "EntityOverrideMode", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "entities": { + "rule": "repeated", + "type": "EntityType.Entity", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "EntityOverrideMode": { + "values": { + "ENTITY_OVERRIDE_MODE_UNSPECIFIED": 0, + "ENTITY_OVERRIDE_MODE_OVERRIDE": 1, + "ENTITY_OVERRIDE_MODE_SUPPLEMENT": 2 + } + } + } + }, + "ListSessionEntityTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SessionEntityType" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListSessionEntityTypesResponse": { + "fields": { + "sessionEntityTypes": { + "rule": "repeated", + "type": "SessionEntityType", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetSessionEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SessionEntityType" + } + } + } + }, + "CreateSessionEntityTypeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SessionEntityType" + } + }, + "sessionEntityType": { + "type": "SessionEntityType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateSessionEntityTypeRequest": { + "fields": { + "sessionEntityType": { + "type": "SessionEntityType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteSessionEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SessionEntityType" + } + } + } + }, + "EntityTypes": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListEntityTypes": { + "requestType": "ListEntityTypesRequest", + "responseType": "ListEntityTypesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/agent}/entityTypes", + "(google.api.method_signature)": "parent,language_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/agent}/entityTypes" + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.api.method_signature)": "parent,language_code" + } + ] + }, + "GetEntityType": { + "requestType": "GetEntityTypeRequest", + "responseType": "EntityType", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/agent/entityTypes/*}", + "(google.api.method_signature)": "name,language_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/agent/entityTypes/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.api.method_signature)": "name,language_code" + } + ] + }, + "CreateEntityType": { + "requestType": "CreateEntityTypeRequest", + "responseType": "EntityType", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/agent}/entityTypes", + "(google.api.http).body": "entity_type", + "(google.api.method_signature)": "parent,entity_type,language_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/agent}/entityTypes", + "body": "entity_type" + } + }, + { + "(google.api.method_signature)": "parent,entity_type" + }, + { + "(google.api.method_signature)": "parent,entity_type,language_code" + } + ] + }, + "UpdateEntityType": { + "requestType": "UpdateEntityTypeRequest", + "responseType": "EntityType", + "options": { + "(google.api.http).patch": "/v2/{entity_type.name=projects/*/agent/entityTypes/*}", + "(google.api.http).body": "entity_type", + "(google.api.method_signature)": "entity_type,language_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{entity_type.name=projects/*/agent/entityTypes/*}", + "body": "entity_type" + } + }, + { + "(google.api.method_signature)": "entity_type" + }, + { + "(google.api.method_signature)": "entity_type,language_code" + } + ] + }, + "DeleteEntityType": { + "requestType": "DeleteEntityTypeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/agent/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/agent/entityTypes/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchUpdateEntityTypes": { + "requestType": "BatchUpdateEntityTypesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/agent}/entityTypes:batchUpdate", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/agent}/entityTypes:batchUpdate", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.dialogflow.v2.BatchUpdateEntityTypesResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "BatchDeleteEntityTypes": { + "requestType": "BatchDeleteEntityTypesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/agent}/entityTypes:batchDelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,entity_type_names", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/agent}/entityTypes:batchDelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,entity_type_names" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "BatchCreateEntities": { + "requestType": "BatchCreateEntitiesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,entities,language_code", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,entities" + }, + { + "(google.api.method_signature)": "parent,entities,language_code" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "BatchUpdateEntities": { + "requestType": "BatchUpdateEntitiesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,entities,language_code", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,entities" + }, + { + "(google.api.method_signature)": "parent,entities,language_code" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "BatchDeleteEntities": { + "requestType": "BatchDeleteEntitiesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete", + "(google.api.http).body": "*", + "(google.api.method_signature)": "parent,entity_values,language_code", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete", + "body": "*" + } + }, + { + "(google.api.method_signature)": "parent,entity_values" + }, + { + "(google.api.method_signature)": "parent,entity_values,language_code" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + } + } + }, + "EntityType": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/EntityType", + "(google.api.resource).pattern": "projects/{project}/agent/entityTypes/{entity_type}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kind": { + "type": "Kind", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "autoExpansionMode": { + "type": "AutoExpansionMode", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableFuzzyExtraction": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Entity": { + "fields": { + "value": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "synonyms": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "Kind": { + "values": { + "KIND_UNSPECIFIED": 0, + "KIND_MAP": 1, + "KIND_LIST": 2, + "KIND_REGEXP": 3 + } + }, + "AutoExpansionMode": { + "values": { + "AUTO_EXPANSION_MODE_UNSPECIFIED": 0, + "AUTO_EXPANSION_MODE_DEFAULT": 1 + } + } + } + }, + "ListEntityTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListEntityTypesResponse": { + "fields": { + "entityTypes": { + "rule": "repeated", + "type": "EntityType", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateEntityTypeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityType": { + "type": "EntityType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateEntityTypeRequest": { + "fields": { + "entityType": { + "type": "EntityType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + } + } + }, + "BatchUpdateEntityTypesRequest": { + "oneofs": { + "entityTypeBatch": { + "oneof": [ + "entityTypeBatchUri", + "entityTypeBatchInline" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityTypeBatchUri": { + "type": "string", + "id": 2 + }, + "entityTypeBatchInline": { + "type": "EntityTypeBatch", + "id": 3 + }, + "languageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchUpdateEntityTypesResponse": { + "fields": { + "entityTypes": { + "rule": "repeated", + "type": "EntityType", + "id": 1 + } + } + }, + "BatchDeleteEntityTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityTypeNames": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateEntitiesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "entities": { + "rule": "repeated", + "type": "EntityType.Entity", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchUpdateEntitiesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "entities": { + "rule": "repeated", + "type": "EntityType.Entity", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchDeleteEntitiesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityValues": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EntityTypeBatch": { + "fields": { + "entityTypes": { + "rule": "repeated", + "type": "EntityType", + "id": 1 + } + } + }, + "Conversations": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreateConversation": { + "requestType": "CreateConversationRequest", + "responseType": "Conversation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/conversations", + "(google.api.http).body": "conversation", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/conversations", + "(google.api.http).additional_bindings.body": "conversation", + "(google.api.method_signature)": "parent,conversation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/conversations", + "body": "conversation", + "additional_bindings": { + "post": "/v2/{parent=projects/*/locations/*}/conversations", + "body": "conversation" + } + } + }, + { + "(google.api.method_signature)": "parent,conversation" + } + ] + }, + "ListConversations": { + "requestType": "ListConversationsRequest", + "responseType": "ListConversationsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/conversations", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/conversations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/conversations", + "additional_bindings": { + "get": "/v2/{parent=projects/*/locations/*}/conversations" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConversation": { + "requestType": "GetConversationRequest", + "responseType": "Conversation", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/conversations/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/conversations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/conversations/*}", + "additional_bindings": { + "get": "/v2/{name=projects/*/locations/*/conversations/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CompleteConversation": { + "requestType": "CompleteConversationRequest", + "responseType": "Conversation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/conversations/*}:complete", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{name=projects/*/locations/*/conversations/*}:complete", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/conversations/*}:complete", + "body": "*", + "additional_bindings": { + "post": "/v2/{name=projects/*/locations/*/conversations/*}:complete", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCallMatcher": { + "requestType": "CreateCallMatcherRequest", + "responseType": "CallMatcher", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/conversations/*}/callMatchers", + "(google.api.http).body": "call_matcher", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*/conversations/*}/callMatchers", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,call_matcher" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/conversations/*}/callMatchers", + "body": "call_matcher", + "additional_bindings": { + "post": "/v2/{parent=projects/*/locations/*/conversations/*}/callMatchers", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent,call_matcher" + } + ] + }, + "ListCallMatchers": { + "requestType": "ListCallMatchersRequest", + "responseType": "ListCallMatchersResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/conversations/*}/callMatchers", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*/conversations/*}/callMatchers", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/conversations/*}/callMatchers", + "additional_bindings": { + "get": "/v2/{parent=projects/*/locations/*/conversations/*}/callMatchers" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteCallMatcher": { + "requestType": "DeleteCallMatcherRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/conversations/*/callMatchers/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/conversations/*/callMatchers/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/conversations/*/callMatchers/*}", + "additional_bindings": { + "delete": "/v2/{name=projects/*/locations/*/conversations/*/callMatchers/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListMessages": { + "requestType": "ListMessagesRequest", + "responseType": "ListMessagesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/conversations/*}/messages", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*/conversations/*}/messages", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/conversations/*}/messages", + "additional_bindings": { + "get": "/v2/{parent=projects/*/locations/*/conversations/*}/messages" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "Conversation": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Conversation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/conversations/{conversation}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lifecycleState": { + "type": "LifecycleState", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conversationProfile": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ConversationProfile" + } + }, + "phoneNumber": { + "type": "ConversationPhoneNumber", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conversationStage": { + "type": "ConversationStage", + "id": 7 + } + }, + "nested": { + "LifecycleState": { + "values": { + "LIFECYCLE_STATE_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "COMPLETED": 2 + } + }, + "ConversationStage": { + "values": { + "CONVERSATION_STAGE_UNSPECIFIED": 0, + "VIRTUAL_AGENT_STAGE": 1, + "HUMAN_ASSIST_STAGE": 2 + } + } + } + }, + "CallMatcher": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/CallMatcher", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toHeader": { + "type": "string", + "id": 2 + }, + "fromHeader": { + "type": "string", + "id": 3 + }, + "callIdHeader": { + "type": "string", + "id": 4 + }, + "customHeaders": { + "type": "CustomHeaders", + "id": 5 + } + }, + "nested": { + "CustomHeaders": { + "fields": { + "ciscoGuid": { + "type": "string", + "id": 1 + } + } + } + } + }, + "CreateConversationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Conversation" + } + }, + "conversation": { + "type": "Conversation", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "conversationId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListConversationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Conversation" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 4 + } + } + }, + "ListConversationsResponse": { + "fields": { + "conversations": { + "rule": "repeated", + "type": "Conversation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetConversationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Conversation" + } + } + } + }, + "CompleteConversationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Conversation" + } + } + } + }, + "CreateCallMatcherRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/CallMatcher" + } + }, + "callMatcher": { + "type": "CallMatcher", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ListCallMatchersRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/CallMatcher" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListCallMatchersResponse": { + "fields": { + "callMatchers": { + "rule": "repeated", + "type": "CallMatcher", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "DeleteCallMatcherRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/CallMatcher" + } + } + } + }, + "ListMessagesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Message" + } + }, + "filter": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListMessagesResponse": { + "fields": { + "messages": { + "rule": "repeated", + "type": "Message", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ConversationPhoneNumber": { + "fields": { + "phoneNumber": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ConversationEvent": { + "oneofs": { + "payload": { + "oneof": [ + "newMessagePayload" + ] + } + }, + "fields": { + "conversation": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + }, + "errorStatus": { + "type": "google.rpc.Status", + "id": 3 + }, + "newMessagePayload": { + "type": "Message", + "id": 4 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "CONVERSATION_STARTED": 1, + "CONVERSATION_FINISHED": 2, + "HUMAN_INTERVENTION_NEEDED": 3, + "NEW_MESSAGE": 5, + "UNRECOVERABLE_ERROR": 4 + } + } + } + }, + "ConversationProfiles": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListConversationProfiles": { + "requestType": "ListConversationProfilesRequest", + "responseType": "ListConversationProfilesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/conversationProfiles", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/conversationProfiles", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/conversationProfiles", + "additional_bindings": { + "get": "/v2/{parent=projects/*/locations/*}/conversationProfiles" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConversationProfile": { + "requestType": "GetConversationProfileRequest", + "responseType": "ConversationProfile", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/conversationProfiles/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/conversationProfiles/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/conversationProfiles/*}", + "additional_bindings": { + "get": "/v2/{name=projects/*/locations/*/conversationProfiles/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateConversationProfile": { + "requestType": "CreateConversationProfileRequest", + "responseType": "ConversationProfile", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/conversationProfiles", + "(google.api.http).body": "conversation_profile", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/conversationProfiles", + "(google.api.http).additional_bindings.body": "conversation_profile", + "(google.api.method_signature)": "parent,conversation_profile" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/conversationProfiles", + "body": "conversation_profile", + "additional_bindings": { + "post": "/v2/{parent=projects/*/locations/*}/conversationProfiles", + "body": "conversation_profile" + } + } + }, + { + "(google.api.method_signature)": "parent,conversation_profile" + } + ] + }, + "UpdateConversationProfile": { + "requestType": "UpdateConversationProfileRequest", + "responseType": "ConversationProfile", + "options": { + "(google.api.http).patch": "/v2/{conversation_profile.name=projects/*/conversationProfiles/*}", + "(google.api.http).body": "conversation_profile", + "(google.api.http).additional_bindings.patch": "/v2/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}", + "(google.api.http).additional_bindings.body": "conversation_profile", + "(google.api.method_signature)": "conversation_profile,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{conversation_profile.name=projects/*/conversationProfiles/*}", + "body": "conversation_profile", + "additional_bindings": { + "patch": "/v2/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}", + "body": "conversation_profile" + } + } + }, + { + "(google.api.method_signature)": "conversation_profile,update_mask" + } + ] + }, + "DeleteConversationProfile": { + "requestType": "DeleteConversationProfileRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/conversationProfiles/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/conversationProfiles/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/conversationProfiles/*}", + "additional_bindings": { + "delete": "/v2/{name=projects/*/locations/*/conversationProfiles/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ConversationProfile": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/ConversationProfile", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "automatedAgentConfig": { + "type": "AutomatedAgentConfig", + "id": 3 + }, + "humanAgentAssistantConfig": { + "type": "HumanAgentAssistantConfig", + "id": 4 + }, + "humanAgentHandoffConfig": { + "type": "HumanAgentHandoffConfig", + "id": 5 + }, + "notificationConfig": { + "type": "NotificationConfig", + "id": 6 + }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 7 + }, + "newMessageEventNotificationConfig": { + "type": "NotificationConfig", + "id": 8 + }, + "sttConfig": { + "type": "SpeechToTextConfig", + "id": 9 + }, + "languageCode": { + "type": "string", + "id": 10 + } + } + }, + "ListConversationProfilesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/ConversationProfile" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListConversationProfilesResponse": { + "fields": { + "conversationProfiles": { + "rule": "repeated", + "type": "ConversationProfile", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetConversationProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ConversationProfile" + } + } + } + }, + "CreateConversationProfileRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/ConversationProfile" + } + }, + "conversationProfile": { + "type": "ConversationProfile", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateConversationProfileRequest": { + "fields": { + "conversationProfile": { + "type": "ConversationProfile", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteConversationProfileRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ConversationProfile" + } + } + } + }, + "AutomatedAgentConfig": { + "fields": { + "agent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + } + } + }, + "HumanAgentAssistantConfig": { + "fields": { + "notificationConfig": { + "type": "NotificationConfig", + "id": 2 + }, + "humanAgentSuggestionConfig": { + "type": "SuggestionConfig", + "id": 3 + }, + "endUserSuggestionConfig": { + "type": "SuggestionConfig", + "id": 4 + }, + "messageAnalysisConfig": { + "type": "MessageAnalysisConfig", + "id": 5 + } + }, + "nested": { + "SuggestionTriggerSettings": { + "fields": { + "noSmalltalk": { + "type": "bool", + "id": 1 + }, + "onlyEndUser": { + "type": "bool", + "id": 2 + } + } + }, + "SuggestionFeatureConfig": { + "fields": { + "suggestionFeature": { + "type": "SuggestionFeature", + "id": 5 + }, + "enableEventBasedSuggestion": { + "type": "bool", + "id": 3 + }, + "suggestionTriggerSettings": { + "type": "SuggestionTriggerSettings", + "id": 10 + }, + "queryConfig": { + "type": "SuggestionQueryConfig", + "id": 6 + }, + "conversationModelConfig": { + "type": "ConversationModelConfig", + "id": 7 + } + } + }, + "SuggestionConfig": { + "fields": { + "featureConfigs": { + "rule": "repeated", + "type": "SuggestionFeatureConfig", + "id": 2 + }, + "groupSuggestionResponses": { + "type": "bool", + "id": 3 + } + } + }, + "SuggestionQueryConfig": { + "oneofs": { + "querySource": { + "oneof": [ + "knowledgeBaseQuerySource", + "documentQuerySource", + "dialogflowQuerySource" + ] + } + }, + "fields": { + "knowledgeBaseQuerySource": { + "type": "KnowledgeBaseQuerySource", + "id": 1 + }, + "documentQuerySource": { + "type": "DocumentQuerySource", + "id": 2 + }, + "dialogflowQuerySource": { + "type": "DialogflowQuerySource", + "id": 3 + }, + "maxResults": { + "type": "int32", + "id": 4 + }, + "confidenceThreshold": { + "type": "float", + "id": 5 + }, + "contextFilterSettings": { + "type": "ContextFilterSettings", + "id": 7 + } + }, + "nested": { + "KnowledgeBaseQuerySource": { + "fields": { + "knowledgeBases": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/KnowledgeBase" + } + } + } + }, + "DocumentQuerySource": { + "fields": { + "documents": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" + } + } + } + }, + "DialogflowQuerySource": { + "fields": { + "agent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + } + } + }, + "ContextFilterSettings": { + "fields": { + "dropHandoffMessages": { + "type": "bool", + "id": 1 + }, + "dropVirtualAgentMessages": { + "type": "bool", + "id": 2 + }, + "dropIvrMessages": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "ConversationModelConfig": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ConversationModel" + } + } + } + }, + "MessageAnalysisConfig": { + "fields": { + "enableEntityExtraction": { + "type": "bool", + "id": 2 + }, + "enableSentimentAnalysis": { + "type": "bool", + "id": 3 + } + } + } + } + }, + "HumanAgentHandoffConfig": { + "oneofs": { + "agentService": { + "oneof": [ + "livePersonConfig", + "salesforceLiveAgentConfig" + ] + } + }, + "fields": { + "livePersonConfig": { + "type": "LivePersonConfig", + "id": 1 + }, + "salesforceLiveAgentConfig": { + "type": "SalesforceLiveAgentConfig", + "id": 2 + } + }, + "nested": { + "LivePersonConfig": { + "fields": { + "accountNumber": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SalesforceLiveAgentConfig": { + "fields": { + "organizationId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "deploymentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "buttonId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endpointDomain": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + } + } + }, + "NotificationConfig": { + "fields": { + "topic": { + "type": "string", + "id": 1 + }, + "messageFormat": { + "type": "MessageFormat", + "id": 2 + } + }, + "nested": { + "MessageFormat": { + "values": { + "MESSAGE_FORMAT_UNSPECIFIED": 0, + "PROTO": 1, + "JSON": 2 + } + } + } + }, + "LoggingConfig": { + "fields": { + "enableStackdriverLogging": { + "type": "bool", + "id": 3 + } + } + }, + "SuggestionFeature": { + "fields": { + "type": { + "type": "Type", + "id": 1 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ARTICLE_SUGGESTION": 1, + "FAQ": 2 + } + } + } + }, + "Documents": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListDocuments": { + "requestType": "ListDocumentsRequest", + "responseType": "ListDocumentsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/knowledgeBases/*}/documents", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/knowledgeBases/*}/documents", + "additional_bindings": { + "get": "/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDocument": { + "requestType": "GetDocumentRequest", + "responseType": "Document", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/knowledgeBases/*/documents/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/knowledgeBases/*/documents/*}", + "additional_bindings": { + "get": "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateDocument": { + "requestType": "CreateDocumentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*/knowledgeBases/*}/documents", + "(google.api.http).body": "document", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents", + "(google.api.http).additional_bindings.body": "document", + "(google.api.method_signature)": "parent,document", + "(google.longrunning.operation_info).response_type": "Document", + "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*/knowledgeBases/*}/documents", + "body": "document", + "additional_bindings": { + "post": "/v2/{parent=projects/*/locations/*/knowledgeBases/*}/documents", + "body": "document" + } + } + }, + { + "(google.api.method_signature)": "parent,document" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Document", + "metadata_type": "KnowledgeOperationMetadata" + } + } + ] + }, + "DeleteDocument": { + "requestType": "DeleteDocumentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/knowledgeBases/*/documents/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/knowledgeBases/*/documents/*}", + "additional_bindings": { + "delete": "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "KnowledgeOperationMetadata" + } + } + ] + }, + "UpdateDocument": { + "requestType": "UpdateDocumentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2/{document.name=projects/*/knowledgeBases/*/documents/*}", + "(google.api.http).body": "document", + "(google.api.http).additional_bindings.patch": "/v2/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}", + "(google.api.http).additional_bindings.body": "document", + "(google.api.method_signature)": "document,update_mask", + "(google.longrunning.operation_info).response_type": "Document", + "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{document.name=projects/*/knowledgeBases/*/documents/*}", + "body": "document", + "additional_bindings": { + "patch": "/v2/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}", + "body": "document" + } + } + }, + { + "(google.api.method_signature)": "document,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Document", + "metadata_type": "KnowledgeOperationMetadata" + } + } + ] + }, + "ReloadDocument": { + "requestType": "ReloadDocumentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2/{name=projects/*/knowledgeBases/*/documents/*}:reload", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,content_uri", + "(google.longrunning.operation_info).response_type": "Document", + "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{name=projects/*/knowledgeBases/*/documents/*}:reload", + "body": "*", + "additional_bindings": { + "post": "/v2/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "name,content_uri" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Document", + "metadata_type": "KnowledgeOperationMetadata" + } + } + ] + } + } + }, + "Document": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Document", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}" + }, + "oneofs": { + "source": { + "oneof": [ + "contentUri", + "rawContent" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "mimeType": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "knowledgeTypes": { + "rule": "repeated", + "type": "KnowledgeType", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "contentUri": { + "type": "string", + "id": 5 + }, + "rawContent": { + "type": "bytes", + "id": 9 + }, + "enableAutoReload": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "latestReloadStatus": { + "type": "ReloadStatus", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "ReloadStatus": { + "fields": { + "time": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "status": { + "type": "google.rpc.Status", + "id": 2 + } + } + }, + "KnowledgeType": { + "values": { + "KNOWLEDGE_TYPE_UNSPECIFIED": 0, + "FAQ": 1, + "EXTRACTIVE_QA": 2, + "ARTICLE_SUGGESTION": 3 + } + } + } + }, + "GetDocumentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" + } + } + } + }, + "ListDocumentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Document" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListDocumentsResponse": { + "fields": { + "documents": { + "rule": "repeated", + "type": "Document", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "CreateDocumentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Document" + } + }, + "document": { + "type": "Document", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteDocumentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" + } + } + } + }, + "UpdateDocumentRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ReloadDocumentRequest": { + "oneofs": { + "source": { + "oneof": [ + "contentUri" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" + } + }, + "contentUri": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "KnowledgeOperationMetadata": { + "fields": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "RUNNING": 2, + "DONE": 3 + } + } + } + }, + "Environments": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListEnvironments": { + "requestType": "ListEnvironmentsRequest", + "responseType": "ListEnvironmentsResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*/agent}/environments" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*/agent}/environments" + } + } + ] + } + } + }, + "Environment": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Environment", + "(google.api.resource).pattern": "projects/{project}/agent/environments/{environment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentVersion": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "STOPPED": 1, + "LOADING": 2, + "RUNNING": 3 + } + } + } + }, + "ListEnvironmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Environment" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListEnvironmentsResponse": { + "fields": { + "environments": { + "rule": "repeated", + "type": "Environment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "HumanAgentAssistantEvent": { + "fields": { + "conversation": { + "type": "string", + "id": 1 + }, + "participant": { + "type": "string", + "id": 3 + }, + "suggestionResults": { + "rule": "repeated", + "type": "SuggestionResult", + "id": 5 + } + } + }, + "KnowledgeBases": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListKnowledgeBases": { + "requestType": "ListKnowledgeBasesRequest", + "responseType": "ListKnowledgeBasesResponse", + "options": { + "(google.api.http).get": "/v2/{parent=projects/*}/knowledgeBases", + "(google.api.http).additional_bindings.get": "/v2/{parent=projects/*/locations/*}/knowledgeBases", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{parent=projects/*}/knowledgeBases", + "additional_bindings": { + "get": "/v2/{parent=projects/*/locations/*}/knowledgeBases" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetKnowledgeBase": { + "requestType": "GetKnowledgeBaseRequest", + "responseType": "KnowledgeBase", + "options": { + "(google.api.http).get": "/v2/{name=projects/*/knowledgeBases/*}", + "(google.api.http).additional_bindings.get": "/v2/{name=projects/*/locations/*/knowledgeBases/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2/{name=projects/*/knowledgeBases/*}", + "additional_bindings": { + "get": "/v2/{name=projects/*/locations/*/knowledgeBases/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateKnowledgeBase": { + "requestType": "CreateKnowledgeBaseRequest", + "responseType": "KnowledgeBase", + "options": { + "(google.api.http).post": "/v2/{parent=projects/*}/knowledgeBases", + "(google.api.http).body": "knowledge_base", + "(google.api.http).additional_bindings.post": "/v2/{parent=projects/*/locations/*}/knowledgeBases", + "(google.api.http).additional_bindings.body": "knowledge_base", + "(google.api.method_signature)": "parent,knowledge_base" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2/{parent=projects/*}/knowledgeBases", + "body": "knowledge_base", + "additional_bindings": { + "post": "/v2/{parent=projects/*/locations/*}/knowledgeBases", + "body": "knowledge_base" + } + } + }, + { + "(google.api.method_signature)": "parent,knowledge_base" + } + ] + }, + "DeleteKnowledgeBase": { + "requestType": "DeleteKnowledgeBaseRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2/{name=projects/*/knowledgeBases/*}", + "(google.api.http).additional_bindings.delete": "/v2/{name=projects/*/locations/*/knowledgeBases/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2/{name=projects/*/knowledgeBases/*}", + "additional_bindings": { + "delete": "/v2/{name=projects/*/locations/*/knowledgeBases/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateKnowledgeBase": { + "requestType": "UpdateKnowledgeBaseRequest", + "responseType": "KnowledgeBase", + "options": { + "(google.api.http).patch": "/v2/{knowledge_base.name=projects/*/knowledgeBases/*}", + "(google.api.http).body": "knowledge_base", + "(google.api.http).additional_bindings.patch": "/v2/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}", + "(google.api.http).additional_bindings.body": "knowledge_base", + "(google.api.method_signature)": "knowledge_base,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2/{knowledge_base.name=projects/*/knowledgeBases/*}", + "body": "knowledge_base", + "additional_bindings": { + "patch": "/v2/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}", + "body": "knowledge_base" + } + } + }, + { + "(google.api.method_signature)": "knowledge_base,update_mask" + } + ] + } + } + }, + "KnowledgeBase": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/KnowledgeBase", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 4 + } + } + }, + "ListKnowledgeBasesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/KnowledgeBase" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListKnowledgeBasesResponse": { + "fields": { + "knowledgeBases": { + "rule": "repeated", + "type": "KnowledgeBase", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetKnowledgeBaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/KnowledgeBase" + } + } + } + }, + "CreateKnowledgeBaseRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/KnowledgeBase" + } + }, + "knowledgeBase": { + "type": "KnowledgeBase", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DeleteKnowledgeBaseRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/KnowledgeBase" + } + }, + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateKnowledgeBaseRequest": { + "fields": { + "knowledgeBase": { + "type": "KnowledgeBase", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "WebhookRequest": { + "fields": { + "session": { + "type": "string", + "id": 4 + }, + "responseId": { + "type": "string", + "id": 1 + }, + "queryResult": { + "type": "QueryResult", + "id": 2 + }, + "originalDetectIntentRequest": { + "type": "OriginalDetectIntentRequest", + "id": 3 + } + } + }, + "WebhookResponse": { + "fields": { + "fulfillmentText": { + "type": "string", + "id": 1 + }, + "fulfillmentMessages": { + "rule": "repeated", + "type": "Intent.Message", + "id": 2 + }, + "source": { + "type": "string", + "id": 3 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 4 + }, + "outputContexts": { + "rule": "repeated", + "type": "Context", + "id": 5 + }, + "followupEventInput": { + "type": "EventInput", + "id": 6 + }, + "sessionEntityTypes": { + "rule": "repeated", + "type": "SessionEntityType", + "id": 10 + } + } + }, + "OriginalDetectIntentRequest": { + "fields": { + "source": { + "type": "string", + "id": 1 + }, + "version": { + "type": "string", + "id": 2 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 3 + } + } + } + } + }, + "v2beta1": { + "options": { + "cc_enable_arenas": true, + "csharp_namespace": "Google.Cloud.Dialogflow.V2beta1", + "go_package": "google.golang.org/genproto/googleapis/cloud/dialogflow/v2beta1;dialogflow", + "java_multiple_files": true, + "java_outer_classname": "WebhookProto", + "java_package": "com.google.cloud.dialogflow.v2beta1", + "objc_class_prefix": "DF", + "(google.api.resource_definition).type": "dialogflow.googleapis.com/Session", + "(google.api.resource_definition).pattern": "projects/{project}/locations/{location}/agent/sessions/{session}" + }, + "nested": { + "Agents": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "GetAgent": { + "requestType": "GetAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).get": "/v2beta1/{parent=projects/*}/agent", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*}/agent", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*}/agent", + "additional_bindings": { + "get": "/v2beta1/{parent=projects/*/locations/*}/agent" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SetAgent": { + "requestType": "SetAgentRequest", + "responseType": "Agent", + "options": { + "(google.api.http).post": "/v2beta1/{agent.parent=projects/*}/agent", + "(google.api.http).body": "agent", + "(google.api.http).additional_bindings.post": "/v2beta1/{agent.parent=projects/*/locations/*}/agent", + "(google.api.http).additional_bindings.body": "agent", + "(google.api.method_signature)": "agent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{agent.parent=projects/*}/agent", + "body": "agent", + "additional_bindings": { + "post": "/v2beta1/{agent.parent=projects/*/locations/*}/agent", + "body": "agent" + } + } + }, + { + "(google.api.method_signature)": "agent" + } + ] + }, + "DeleteAgent": { + "requestType": "DeleteAgentRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2beta1/{parent=projects/*}/agent", + "(google.api.http).additional_bindings.delete": "/v2beta1/{parent=projects/*/locations/*}/agent", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2beta1/{parent=projects/*}/agent", + "additional_bindings": { + "delete": "/v2beta1/{parent=projects/*/locations/*}/agent" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SearchAgents": { + "requestType": "SearchAgentsRequest", + "responseType": "SearchAgentsResponse", + "options": { + "(google.api.http).get": "/v2beta1/{parent=projects/*}/agent:search", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*}/agent:search", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*}/agent:search", + "additional_bindings": { + "get": "/v2beta1/{parent=projects/*/locations/*}/agent:search" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "TrainAgent": { + "requestType": "TrainAgentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*}/agent:train", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*}/agent:train", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*}/agent:train", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*}/agent:train", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "ExportAgent": { + "requestType": "ExportAgentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*}/agent:export", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*}/agent:export", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent", + "(google.longrunning.operation_info).response_type": "google.cloud.dialogflow.v2beta1.ExportAgentResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*}/agent:export", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*}/agent:export", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.dialogflow.v2beta1.ExportAgentResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "ImportAgent": { + "requestType": "ImportAgentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*}/agent:import", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*}/agent:import", + "(google.api.http).additional_bindings.body": "*", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*}/agent:import", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*}/agent:import", + "body": "*" + } + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "RestoreAgent": { + "requestType": "RestoreAgentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*}/agent:restore", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*}/agent:restore", + "(google.api.http).additional_bindings.body": "*", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*}/agent:restore", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*}/agent:restore", + "body": "*" + } + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "GetValidationResult": { + "requestType": "GetValidationResultRequest", + "responseType": "ValidationResult", + "options": { + "(google.api.http).get": "/v2beta1/{parent=projects/*}/agent/validationResult", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*}/agent/validationResult" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*}/agent/validationResult", + "additional_bindings": { + "get": "/v2beta1/{parent=projects/*/locations/*}/agent/validationResult" + } + } + } + ] + } + } + }, + "Agent": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Agent", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agent" + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "cloudresourcemanager.googleapis.com/Project" + } + }, + "displayName": { + "type": "string", + "id": 2 + }, + "defaultLanguageCode": { + "type": "string", + "id": 3 + }, + "supportedLanguageCodes": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "timeZone": { + "type": "string", + "id": 5 + }, + "description": { + "type": "string", + "id": 6 + }, + "avatarUri": { + "type": "string", + "id": 7 + }, + "enableLogging": { + "type": "bool", + "id": 8 + }, + "matchMode": { + "type": "MatchMode", + "id": 9, + "options": { + "deprecated": true + } + }, + "classificationThreshold": { + "type": "float", + "id": 10 + }, + "apiVersion": { + "type": "ApiVersion", + "id": 14 + }, + "tier": { + "type": "Tier", + "id": 15 + } + }, + "nested": { + "MatchMode": { + "values": { + "MATCH_MODE_UNSPECIFIED": 0, + "MATCH_MODE_HYBRID": 1, + "MATCH_MODE_ML_ONLY": 2 + } + }, + "ApiVersion": { + "values": { + "API_VERSION_UNSPECIFIED": 0, + "API_VERSION_V1": 1, + "API_VERSION_V2": 2, + "API_VERSION_V2_BETA_1": 3 + } + }, + "Tier": { + "values": { + "TIER_UNSPECIFIED": 0, + "TIER_STANDARD": 1, + "TIER_ENTERPRISE": 2, + "TIER_ENTERPRISE_PLUS": 3 + } + } + } + }, + "GetAgentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + } + } + } + }, + "SetAgentRequest": { + "fields": { + "agent": { + "type": "Agent", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteAgentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + } + } + } + }, + "SubAgent": { + "fields": { + "project": { + "type": "string", + "id": 1 + }, + "environment": { + "type": "string", + "id": 2 + } + } + }, + "SearchAgentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "SearchAgentsResponse": { + "fields": { + "agents": { + "rule": "repeated", + "type": "Agent", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "TrainAgentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + } + } + } + }, + "ExportAgentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + } + }, + "agentUri": { + "type": "string", + "id": 2 + } + } + }, + "ExportAgentResponse": { + "oneofs": { + "agent": { + "oneof": [ + "agentUri", + "agentContent" + ] + } + }, + "fields": { + "agentUri": { + "type": "string", + "id": 1 + }, + "agentContent": { + "type": "bytes", + "id": 2 + } + } + }, + "ImportAgentRequest": { + "oneofs": { + "agent": { + "oneof": [ + "agentUri", + "agentContent" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + } + }, + "agentUri": { + "type": "string", + "id": 2 + }, + "agentContent": { + "type": "bytes", + "id": 3 + } + } + }, + "RestoreAgentRequest": { + "oneofs": { + "agent": { + "oneof": [ + "agentUri", + "agentContent" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + } + }, + "agentUri": { + "type": "string", + "id": 2 + }, + "agentContent": { + "type": "bytes", + "id": 3 + } + } + }, + "GetValidationResultRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + } + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Environments": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListEnvironments": { + "requestType": "ListEnvironmentsRequest", + "responseType": "ListEnvironmentsResponse", + "options": { + "(google.api.http).get": "/v2beta1/{parent=projects/*/agent}/environments", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*/agent}/environments", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*/agent}/environments", + "additional_bindings": { + "get": "/v2beta1/{parent=projects/*/locations/*/agent}/environments" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "Environment": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Environment", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agent/environments/{environment}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "agentVersion": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "STOPPED": 1, + "LOADING": 2, + "RUNNING": 3 + } + } + } + }, + "ListEnvironmentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Environment" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListEnvironmentsResponse": { + "fields": { + "environments": { + "rule": "repeated", + "type": "Environment", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "SpeechContext": { + "fields": { + "phrases": { + "rule": "repeated", + "type": "string", + "id": 1 + }, + "boost": { + "type": "float", + "id": 2 + } + } + }, + "AudioEncoding": { + "values": { + "AUDIO_ENCODING_UNSPECIFIED": 0, + "AUDIO_ENCODING_LINEAR_16": 1, + "AUDIO_ENCODING_FLAC": 2, + "AUDIO_ENCODING_MULAW": 3, + "AUDIO_ENCODING_AMR": 4, + "AUDIO_ENCODING_AMR_WB": 5, + "AUDIO_ENCODING_OGG_OPUS": 6, + "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": 7 + } + }, + "SpeechWordInfo": { + "fields": { + "word": { + "type": "string", + "id": 3 + }, + "startOffset": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "endOffset": { + "type": "google.protobuf.Duration", + "id": 2 + }, + "confidence": { + "type": "float", + "id": 4 + } + } + }, + "SpeechModelVariant": { + "values": { + "SPEECH_MODEL_VARIANT_UNSPECIFIED": 0, + "USE_BEST_AVAILABLE": 1, + "USE_STANDARD": 2, + "USE_ENHANCED": 3 + } + }, + "InputAudioConfig": { + "fields": { + "audioEncoding": { + "type": "AudioEncoding", + "id": 1 + }, + "sampleRateHertz": { + "type": "int32", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 + }, + "enableWordInfo": { + "type": "bool", + "id": 13 + }, + "phraseHints": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "deprecated": true + } + }, + "speechContexts": { + "rule": "repeated", + "type": "SpeechContext", + "id": 11 + }, + "model": { + "type": "string", + "id": 7 + }, + "modelVariant": { + "type": "SpeechModelVariant", + "id": 10 + }, + "singleUtterance": { + "type": "bool", + "id": 8 + }, + "disableNoSpeechRecognizedEvent": { + "type": "bool", + "id": 14 + } + } + }, + "VoiceSelectionParams": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "ssmlGender": { + "type": "SsmlVoiceGender", + "id": 2 + } + } + }, + "SynthesizeSpeechConfig": { + "fields": { + "speakingRate": { + "type": "double", + "id": 1 + }, + "pitch": { + "type": "double", + "id": 2 + }, + "volumeGainDb": { + "type": "double", + "id": 3 + }, + "effectsProfileId": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "voice": { + "type": "VoiceSelectionParams", + "id": 4 + } + } + }, + "SsmlVoiceGender": { + "values": { + "SSML_VOICE_GENDER_UNSPECIFIED": 0, + "SSML_VOICE_GENDER_MALE": 1, + "SSML_VOICE_GENDER_FEMALE": 2, + "SSML_VOICE_GENDER_NEUTRAL": 3 + } + }, + "OutputAudioConfig": { + "fields": { + "audioEncoding": { + "type": "OutputAudioEncoding", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "sampleRateHertz": { + "type": "int32", + "id": 2 + }, + "synthesizeSpeechConfig": { + "type": "SynthesizeSpeechConfig", + "id": 3 + } + } + }, + "TelephonyDtmfEvents": { + "fields": { + "dtmfEvents": { + "rule": "repeated", + "type": "TelephonyDtmf", + "id": 1 + } + } + }, + "OutputAudioEncoding": { + "values": { + "OUTPUT_AUDIO_ENCODING_UNSPECIFIED": 0, + "OUTPUT_AUDIO_ENCODING_LINEAR_16": 1, + "OUTPUT_AUDIO_ENCODING_MP3": 2, + "OUTPUT_AUDIO_ENCODING_OGG_OPUS": 3 + } + }, + "SpeechToTextConfig": { + "fields": { + "speechModelVariant": { + "type": "SpeechModelVariant", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TelephonyDtmf": { + "values": { + "TELEPHONY_DTMF_UNSPECIFIED": 0, + "DTMF_ONE": 1, + "DTMF_TWO": 2, + "DTMF_THREE": 3, + "DTMF_FOUR": 4, + "DTMF_FIVE": 5, + "DTMF_SIX": 6, + "DTMF_SEVEN": 7, + "DTMF_EIGHT": 8, + "DTMF_NINE": 9, + "DTMF_ZERO": 10, + "DTMF_A": 11, + "DTMF_B": 12, + "DTMF_C": 13, + "DTMF_D": 14, + "DTMF_STAR": 15, + "DTMF_POUND": 16 + } + }, + "ValidationError": { + "fields": { + "severity": { + "type": "Severity", + "id": 1 + }, + "entries": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "errorMessage": { + "type": "string", + "id": 4 + } + }, + "nested": { + "Severity": { + "values": { + "SEVERITY_UNSPECIFIED": 0, + "INFO": 1, + "WARNING": 2, + "ERROR": 3, + "CRITICAL": 4 + } + } + } + }, + "ValidationResult": { + "fields": { + "validationErrors": { + "rule": "repeated", + "type": "ValidationError", + "id": 1 + } + } + }, + "AnswerRecords": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "GetAnswerRecord": { + "requestType": "GetAnswerRecordRequest", + "responseType": "AnswerRecord", + "options": { + "deprecated": true, + "(google.api.http).get": "/v2beta1/{name=projects/*/answerRecords/*}", + "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/locations/*/answerRecords/*}" + }, + "parsedOptions": [ + { + "deprecated": true + }, + { + "(google.api.http)": { + "get": "/v2beta1/{name=projects/*/answerRecords/*}", + "additional_bindings": { + "get": "/v2beta1/{name=projects/*/locations/*/answerRecords/*}" + } + } + } + ] + }, + "ListAnswerRecords": { + "requestType": "ListAnswerRecordsRequest", + "responseType": "ListAnswerRecordsResponse", + "options": { + "(google.api.http).get": "/v2beta1/{parent=projects/*}/answerRecords", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*}/answerRecords", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*}/answerRecords", + "additional_bindings": { + "get": "/v2beta1/{parent=projects/*/locations/*}/answerRecords" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateAnswerRecord": { + "requestType": "UpdateAnswerRecordRequest", + "responseType": "AnswerRecord", + "options": { + "(google.api.http).patch": "/v2beta1/{answer_record.name=projects/*/answerRecords/*}", + "(google.api.http).body": "answer_record", + "(google.api.http).additional_bindings.patch": "/v2beta1/{answer_record.name=projects/*/locations/*/answerRecords/*}", + "(google.api.http).additional_bindings.body": "answer_record", + "(google.api.method_signature)": "answer_record,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2beta1/{answer_record.name=projects/*/answerRecords/*}", + "body": "answer_record", + "additional_bindings": { + "patch": "/v2beta1/{answer_record.name=projects/*/locations/*/answerRecords/*}", + "body": "answer_record" + } + } + }, + { + "(google.api.method_signature)": "answer_record,update_mask" + } + ] + } + } + }, + "AnswerRecord": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/AnswerRecord", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/answerRecords/{answer_record}" + }, + "oneofs": { + "record": { + "oneof": [ + "agentAssistantRecord" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "answerFeedback": { + "type": "AnswerFeedback", + "id": 3 + }, + "agentAssistantRecord": { + "type": "AgentAssistantRecord", + "id": 4 + } + } + }, + "AgentAssistantRecord": { + "oneofs": { + "answer": { + "oneof": [ + "articleSuggestionAnswer", + "faqAnswer" + ] + } + }, + "fields": { + "articleSuggestionAnswer": { + "type": "ArticleAnswer", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "faqAnswer": { + "type": "FaqAnswer", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "AnswerFeedback": { + "oneofs": { + "detailFeedback": { + "oneof": [ + "agentAssistantDetailFeedback" + ] + } + }, + "fields": { + "correctnessLevel": { + "type": "CorrectnessLevel", + "id": 1 + }, + "agentAssistantDetailFeedback": { + "type": "AgentAssistantFeedback", + "id": 2 + }, + "clicked": { + "type": "bool", + "id": 3 + }, + "clickTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "displayed": { + "type": "bool", + "id": 4 + }, + "displayTime": { + "type": "google.protobuf.Timestamp", + "id": 6 + } + }, + "nested": { + "CorrectnessLevel": { + "values": { + "CORRECTNESS_LEVEL_UNSPECIFIED": 0, + "NOT_CORRECT": 1, + "PARTIALLY_CORRECT": 2, + "FULLY_CORRECT": 3 + } + } + } + }, + "AgentAssistantFeedback": { + "fields": { + "answerRelevance": { + "type": "AnswerRelevance", + "id": 1 + }, + "documentCorrectness": { + "type": "DocumentCorrectness", + "id": 2 + }, + "documentEfficiency": { + "type": "DocumentEfficiency", + "id": 3 + }, + "summarizationFeedback": { + "type": "SummarizationFeedback", + "id": 4 + } + }, + "nested": { + "SummarizationFeedback": { + "fields": { + "startTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 1 + }, + "submitTimestamp": { + "type": "google.protobuf.Timestamp", + "id": 2 + }, + "summaryText": { + "type": "string", + "id": 3 + } + } + }, + "AnswerRelevance": { + "values": { + "ANSWER_RELEVANCE_UNSPECIFIED": 0, + "IRRELEVANT": 1, + "RELEVANT": 2 + } + }, + "DocumentCorrectness": { + "values": { + "DOCUMENT_CORRECTNESS_UNSPECIFIED": 0, + "INCORRECT": 1, + "CORRECT": 2 + } + }, + "DocumentEfficiency": { + "values": { + "DOCUMENT_EFFICIENCY_UNSPECIFIED": 0, + "INEFFICIENT": 1, + "EFFICIENT": 2 + } + } + } + }, + "GetAnswerRecordRequest": { + "fields": { + "name": { + "type": "string", + "id": 1 + } + } + }, + "ListAnswerRecordsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/AnswerRecord" + } + }, + "pageSize": { + "type": "int32", + "id": 3 + }, + "pageToken": { + "type": "string", + "id": 4 + } + } + }, + "ListAnswerRecordsResponse": { + "fields": { + "answerRecords": { + "rule": "repeated", + "type": "AnswerRecord", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateAnswerRecordRequest": { + "fields": { + "answerRecord": { + "type": "AnswerRecord", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/AnswerRecord" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "Participants": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreateParticipant": { + "requestType": "CreateParticipantRequest", + "responseType": "Participant", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/conversations/*}/participants", + "(google.api.http).body": "participant", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/conversations/*}/participants", + "(google.api.http).additional_bindings.body": "participant", + "(google.api.method_signature)": "parent,participant" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/conversations/*}/participants", + "body": "participant", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/conversations/*}/participants", + "body": "participant" + } + } + }, + { + "(google.api.method_signature)": "parent,participant" + } + ] + }, + "GetParticipant": { + "requestType": "GetParticipantRequest", + "responseType": "Participant", + "options": { + "(google.api.http).get": "/v2beta1/{name=projects/*/conversations/*/participants/*}", + "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/locations/*/conversations/*/participants/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{name=projects/*/conversations/*/participants/*}", + "additional_bindings": { + "get": "/v2beta1/{name=projects/*/locations/*/conversations/*/participants/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListParticipants": { + "requestType": "ListParticipantsRequest", + "responseType": "ListParticipantsResponse", + "options": { + "(google.api.http).get": "/v2beta1/{parent=projects/*/conversations/*}/participants", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*/conversations/*}/participants", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*/conversations/*}/participants", + "additional_bindings": { + "get": "/v2beta1/{parent=projects/*/locations/*/conversations/*}/participants" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "UpdateParticipant": { + "requestType": "UpdateParticipantRequest", + "responseType": "Participant", + "options": { + "(google.api.http).patch": "/v2beta1/{participant.name=projects/*/conversations/*/participants/*}", + "(google.api.http).body": "participant", + "(google.api.http).additional_bindings.patch": "/v2beta1/{participant.name=projects/*/locations/*/conversations/*/participants/*}", + "(google.api.http).additional_bindings.body": "participant", + "(google.api.method_signature)": "participant,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2beta1/{participant.name=projects/*/conversations/*/participants/*}", + "body": "participant", + "additional_bindings": { + "patch": "/v2beta1/{participant.name=projects/*/locations/*/conversations/*/participants/*}", + "body": "participant" + } + } + }, + { + "(google.api.method_signature)": "participant,update_mask" + } + ] + }, + "AnalyzeContent": { + "requestType": "AnalyzeContentRequest", + "responseType": "AnalyzeContentResponse", + "options": { + "(google.api.http).post": "/v2beta1/{participant=projects/*/conversations/*/participants/*}:analyzeContent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "participant,event_input" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{participant=projects/*/conversations/*/participants/*}:analyzeContent", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{participant=projects/*/locations/*/conversations/*/participants/*}:analyzeContent", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "participant,text_input" + }, + { + "(google.api.method_signature)": "participant,audio_input" + }, + { + "(google.api.method_signature)": "participant,event_input" + } + ] + }, + "StreamingAnalyzeContent": { + "requestType": "StreamingAnalyzeContentRequest", + "requestStream": true, + "responseType": "StreamingAnalyzeContentResponse", + "responseStream": true + }, + "SuggestArticles": { + "requestType": "SuggestArticlesRequest", + "responseType": "SuggestArticlesResponse", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestArticles", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestArticles", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SuggestFaqAnswers": { + "requestType": "SuggestFaqAnswersRequest", + "responseType": "SuggestFaqAnswersResponse", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestFaqAnswers", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "SuggestSmartReplies": { + "requestType": "SuggestSmartRepliesRequest", + "responseType": "SuggestSmartRepliesResponse", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:suggestSmartReplies", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/conversations/*/participants/*}/suggestions:suggestSmartReplies", + "body": "*" + } + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListSuggestions": { + "requestType": "ListSuggestionsRequest", + "responseType": "ListSuggestionsResponse", + "options": { + "deprecated": true, + "(google.api.http).get": "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions" + }, + "parsedOptions": [ + { + "deprecated": true + }, + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions" + } + } + ] + }, + "CompileSuggestion": { + "requestType": "CompileSuggestionRequest", + "responseType": "CompileSuggestionResponse", + "options": { + "deprecated": true, + "(google.api.http).post": "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:compile", + "(google.api.http).body": "*" + }, + "parsedOptions": [ + { + "deprecated": true + }, + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/conversations/*/participants/*}/suggestions:compile", + "body": "*" + } + } + ] + } + } + }, + "Participant": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Participant", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "role": { + "type": "Role", + "id": 2, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "obfuscatedExternalUserId": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Role": { + "values": { + "ROLE_UNSPECIFIED": 0, + "HUMAN_AGENT": 1, + "AUTOMATED_AGENT": 2, + "END_USER": 3 + } + } + } + }, + "Message": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Message", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "content": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "participant": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "participantRole": { + "type": "Participant.Role", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sendTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "messageAnnotation": { + "type": "MessageAnnotation", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sentimentAnalysis": { + "type": "SentimentAnalysisResult", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CreateParticipantRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Participant" + } + }, + "participant": { + "type": "Participant", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "GetParticipantRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Participant" + } + } + } + }, + "ListParticipantsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Participant" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListParticipantsResponse": { + "fields": { + "participants": { + "rule": "repeated", + "type": "Participant", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "UpdateParticipantRequest": { + "fields": { + "participant": { + "type": "Participant", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "InputText": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 + } + } + }, + "InputAudio": { + "fields": { + "config": { + "type": "InputAudioConfig", + "id": 1 + }, + "audio": { + "type": "bytes", + "id": 2 + } + } + }, + "AudioInput": { + "fields": { + "config": { + "type": "InputAudioConfig", + "id": 1 + }, + "audio": { + "type": "bytes", + "id": 2 + } + } + }, + "OutputAudio": { + "fields": { + "config": { + "type": "OutputAudioConfig", + "id": 1 + }, + "audio": { + "type": "bytes", + "id": 2 + } + } + }, + "AutomatedAgentReply": { + "oneofs": { + "response": { + "oneof": [ + "detectIntentResponse" + ] + }, + "match": { + "oneof": [ + "intent", + "event" + ] + } + }, + "fields": { + "detectIntentResponse": { + "type": "DetectIntentResponse", + "id": 1 + }, + "responseMessages": { + "rule": "repeated", + "type": "ResponseMessage", + "id": 3 + }, + "intent": { + "type": "string", + "id": 4, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + } + }, + "event": { + "type": "string", + "id": 5 + }, + "cxSessionParameters": { + "type": "google.protobuf.Struct", + "id": 6 + } + } + }, + "SuggestionFeature": { + "fields": { + "type": { + "type": "Type", + "id": 1 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ARTICLE_SUGGESTION": 1, + "FAQ": 2, + "SMART_REPLY": 3 + } + } + } + }, + "AnalyzeContentRequest": { + "oneofs": { + "input": { + "oneof": [ + "text", + "audio", + "textInput", + "audioInput", + "eventInput" + ] + } + }, + "fields": { + "participant": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Participant" + } + }, + "text": { + "type": "InputText", + "id": 3, + "options": { + "deprecated": true + } + }, + "audio": { + "type": "InputAudio", + "id": 4, + "options": { + "deprecated": true + } + }, + "textInput": { + "type": "TextInput", + "id": 6 + }, + "audioInput": { + "type": "AudioInput", + "id": 7 + }, + "eventInput": { + "type": "EventInput", + "id": 8 + }, + "replyAudioConfig": { + "type": "OutputAudioConfig", + "id": 5 + }, + "queryParams": { + "type": "QueryParameters", + "id": 9 + }, + "messageSendTime": { + "type": "google.protobuf.Timestamp", + "id": 10 + }, + "requestId": { + "type": "string", + "id": 11 + } + } + }, + "DtmfParameters": { + "fields": { + "acceptsDtmfInput": { + "type": "bool", + "id": 1 + } + } + }, + "AnalyzeContentResponse": { + "fields": { + "replyText": { + "type": "string", + "id": 1 + }, + "replyAudio": { + "type": "OutputAudio", + "id": 2 + }, + "automatedAgentReply": { + "type": "AutomatedAgentReply", + "id": 3 + }, + "message": { + "type": "Message", + "id": 5 + }, + "humanAgentSuggestionResults": { + "rule": "repeated", + "type": "SuggestionResult", + "id": 6 + }, + "endUserSuggestionResults": { + "rule": "repeated", + "type": "SuggestionResult", + "id": 7 + }, + "dtmfParameters": { + "type": "DtmfParameters", + "id": 9 + } + } + }, + "InputTextConfig": { + "fields": { + "languageCode": { + "type": "string", + "id": 1 + } + } + }, + "StreamingAnalyzeContentRequest": { + "oneofs": { + "config": { + "oneof": [ + "audioConfig", + "textConfig" + ] + }, + "input": { + "oneof": [ + "inputAudio", + "inputText", + "inputDtmf" + ] + } + }, + "fields": { + "participant": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Participant" + } + }, + "audioConfig": { + "type": "InputAudioConfig", + "id": 2 + }, + "textConfig": { + "type": "InputTextConfig", + "id": 3 + }, + "replyAudioConfig": { + "type": "OutputAudioConfig", + "id": 4 + }, + "inputAudio": { + "type": "bytes", + "id": 5 + }, + "inputText": { + "type": "string", + "id": 6 + }, + "inputDtmf": { + "type": "TelephonyDtmfEvents", + "id": 9 + }, + "queryParams": { + "type": "QueryParameters", + "id": 7 + }, + "enableExtendedStreaming": { + "type": "bool", + "id": 11 + } + } + }, + "StreamingAnalyzeContentResponse": { + "fields": { + "recognitionResult": { + "type": "StreamingRecognitionResult", + "id": 1 + }, + "replyText": { + "type": "string", + "id": 2 + }, + "replyAudio": { + "type": "OutputAudio", + "id": 3 + }, + "automatedAgentReply": { + "type": "AutomatedAgentReply", + "id": 4 + }, + "message": { + "type": "Message", + "id": 6 + }, + "humanAgentSuggestionResults": { + "rule": "repeated", + "type": "SuggestionResult", + "id": 7 + }, + "endUserSuggestionResults": { + "rule": "repeated", + "type": "SuggestionResult", + "id": 8 + }, + "dtmfParameters": { + "type": "DtmfParameters", + "id": 10 + } + } + }, + "AnnotatedMessagePart": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "entityType": { + "type": "string", + "id": 2 + }, + "formattedValue": { + "type": "google.protobuf.Value", + "id": 3 + } + } + }, + "MessageAnnotation": { + "fields": { + "parts": { + "rule": "repeated", + "type": "AnnotatedMessagePart", + "id": 1 + }, + "containEntities": { + "type": "bool", + "id": 2 + } + } + }, + "ArticleAnswer": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "snippets": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "metadata": { + "keyType": "string", "type": "string", "id": 5 }, - "description": { + "answerRecord": { "type": "string", "id": 6 + } + } + }, + "FaqAnswer": { + "fields": { + "answer": { + "type": "string", + "id": 1 }, - "avatarUri": { + "confidence": { + "type": "float", + "id": 2 + }, + "question": { "type": "string", - "id": 7 + "id": 3 }, - "enableLogging": { - "type": "bool", - "id": 8 + "source": { + "type": "string", + "id": 4 }, - "matchMode": { - "type": "MatchMode", - "id": 9, - "options": { - "deprecated": true - } + "metadata": { + "keyType": "string", + "type": "string", + "id": 5 }, - "classificationThreshold": { - "type": "float", - "id": 10 + "answerRecord": { + "type": "string", + "id": 6 + } + } + }, + "SmartReplyAnswer": { + "fields": { + "reply": { + "type": "string", + "id": 1 }, - "apiVersion": { - "type": "ApiVersion", - "id": 14 + "confidence": { + "type": "float", + "id": 2 }, - "tier": { - "type": "Tier", - "id": 15 + "answerRecord": { + "type": "string", + "id": 3 + } + } + }, + "SuggestionResult": { + "oneofs": { + "suggestionResponse": { + "oneof": [ + "error", + "suggestArticlesResponse", + "suggestFaqAnswersResponse", + "suggestSmartRepliesResponse" + ] } }, - "nested": { - "MatchMode": { - "values": { - "MATCH_MODE_UNSPECIFIED": 0, - "MATCH_MODE_HYBRID": 1, - "MATCH_MODE_ML_ONLY": 2 - } + "fields": { + "error": { + "type": "google.rpc.Status", + "id": 1 }, - "ApiVersion": { - "values": { - "API_VERSION_UNSPECIFIED": 0, - "API_VERSION_V1": 1, - "API_VERSION_V2": 2, - "API_VERSION_V2_BETA_1": 3 - } + "suggestArticlesResponse": { + "type": "SuggestArticlesResponse", + "id": 2 }, - "Tier": { - "values": { - "TIER_UNSPECIFIED": 0, - "TIER_STANDARD": 1, - "TIER_ENTERPRISE": 2, - "TIER_ENTERPRISE_PLUS": 3 - } + "suggestFaqAnswersResponse": { + "type": "SuggestFaqAnswersResponse", + "id": 3 + }, + "suggestSmartRepliesResponse": { + "type": "SuggestSmartRepliesResponse", + "id": 4 } } }, - "GetAgentRequest": { + "SuggestArticlesRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Participant" + } + }, + "latestMessage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Message" + } + }, + "contextSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "SetAgentRequest": { + "SuggestArticlesResponse": { "fields": { - "agent": { - "type": "Agent", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "articleAnswers": { + "rule": "repeated", + "type": "ArticleAnswer", + "id": 1 }, - "updateMask": { - "type": "google.protobuf.FieldMask", + "latestMessage": { + "type": "string", "id": 2 + }, + "contextSize": { + "type": "int32", + "id": 3 } } }, - "DeleteAgentRequest": { + "SuggestFaqAnswersRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Participant" + } + }, + "latestMessage": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Message" + } + }, + "contextSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } }, - "SubAgent": { + "SuggestFaqAnswersResponse": { "fields": { - "project": { - "type": "string", + "faqAnswers": { + "rule": "repeated", + "type": "FaqAnswer", "id": 1 }, - "environment": { + "latestMessage": { "type": "string", "id": 2 + }, + "contextSize": { + "type": "int32", + "id": 3 } } }, - "SearchAgentsRequest": { + "SuggestSmartRepliesRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Participant" + } + }, + "currentTextInput": { + "type": "TextInput", + "id": 4 + }, + "latestMessage": { + "type": "string", + "id": 2, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Message" + } + }, + "contextSize": { + "type": "int32", + "id": 3 + } + } + }, + "SuggestSmartRepliesResponse": { + "fields": { + "smartReplyAnswers": { + "rule": "repeated", + "type": "SmartReplyAnswer", + "id": 1 + }, + "latestMessage": { + "type": "string", + "id": 2 + }, + "contextSize": { + "type": "int32", + "id": 3 + } + } + }, + "Suggestion": { + "options": { + "deprecated": true + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "articles": { + "rule": "repeated", + "type": "Article", + "id": 2 + }, + "faqAnswers": { + "rule": "repeated", + "type": "FaqAnswer", + "id": 4 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5 + }, + "latestMessage": { + "type": "string", + "id": 7 + } + }, + "nested": { + "Article": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + }, + "snippets": { + "rule": "repeated", + "type": "string", + "id": 3 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "answerRecord": { + "type": "string", + "id": 6 + } + } + }, + "FaqAnswer": { + "fields": { + "answer": { + "type": "string", + "id": 1 + }, + "confidence": { + "type": "float", + "id": 2 + }, + "question": { + "type": "string", + "id": 3 + }, + "source": { + "type": "string", + "id": 4 + }, + "metadata": { + "keyType": "string", + "type": "string", + "id": 5 + }, + "answerRecord": { + "type": "string", + "id": 6 + } } + } + } + }, + "ListSuggestionsRequest": { + "options": { + "deprecated": true + }, + "fields": { + "parent": { + "type": "string", + "id": 1 }, "pageSize": { "type": "int32", @@ -4370,15 +9297,22 @@ }, "pageToken": { "type": "string", - "id": 3 + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 } } }, - "SearchAgentsResponse": { + "ListSuggestionsResponse": { + "options": { + "deprecated": true + }, "fields": { - "agents": { + "suggestions": { "rule": "repeated", - "type": "Agent", + "type": "Suggestion", "id": 1 }, "nextPageToken": { @@ -4387,841 +9321,606 @@ } } }, - "TrainAgentRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" - } - } - } - }, - "ExportAgentRequest": { + "CompileSuggestionRequest": { + "options": { + "deprecated": true + }, "fields": { "parent": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" - } + "id": 1 }, - "agentUri": { + "latestMessage": { "type": "string", "id": 2 - } - } - }, - "ExportAgentResponse": { - "oneofs": { - "agent": { - "oneof": [ - "agentUri", - "agentContent" - ] - } - }, - "fields": { - "agentUri": { - "type": "string", - "id": 1 }, - "agentContent": { - "type": "bytes", - "id": 2 + "contextSize": { + "type": "int32", + "id": 3 } } }, - "ImportAgentRequest": { - "oneofs": { - "agent": { - "oneof": [ - "agentUri", - "agentContent" - ] - } + "CompileSuggestionResponse": { + "options": { + "deprecated": true }, "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" - } + "suggestion": { + "type": "Suggestion", + "id": 1 }, - "agentUri": { + "latestMessage": { "type": "string", "id": 2 }, - "agentContent": { - "type": "bytes", + "contextSize": { + "type": "int32", "id": 3 } } }, - "RestoreAgentRequest": { + "ResponseMessage": { "oneofs": { - "agent": { + "message": { "oneof": [ - "agentUri", - "agentContent" + "text", + "payload", + "liveAgentHandoff", + "endInteraction" ] } }, "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" - } + "text": { + "type": "Text", + "id": 1 }, - "agentUri": { - "type": "string", + "payload": { + "type": "google.protobuf.Struct", "id": 2 }, - "agentContent": { - "type": "bytes", + "liveAgentHandoff": { + "type": "LiveAgentHandoff", "id": 3 + }, + "endInteraction": { + "type": "EndInteraction", + "id": 4 } - } - }, - "GetValidationResultRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Agent" + }, + "nested": { + "Text": { + "fields": { + "text": { + "rule": "repeated", + "type": "string", + "id": 1 + } } }, - "languageCode": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" + "LiveAgentHandoff": { + "fields": { + "metadata": { + "type": "google.protobuf.Struct", + "id": 1 + } } + }, + "EndInteraction": { + "fields": {} } } }, - "Environments": { + "Sessions": { "options": { "(google.api.default_host)": "dialogflow.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" }, "methods": { - "ListEnvironments": { - "requestType": "ListEnvironmentsRequest", - "responseType": "ListEnvironmentsResponse", + "DetectIntent": { + "requestType": "DetectIntentRequest", + "responseType": "DetectIntentResponse", "options": { - "(google.api.http).get": "/v2beta1/{parent=projects/*/agent}/environments", - "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*/agent}/environments", - "(google.api.method_signature)": "parent" + "(google.api.http).post": "/v2beta1/{session=projects/*/agent/sessions/*}:detectIntent", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{session=projects/*/locations/*/agent/environments/*/users/*/sessions/*}:detectIntent", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "session,query_input" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2beta1/{parent=projects/*/agent}/environments", - "additional_bindings": { - "get": "/v2beta1/{parent=projects/*/locations/*/agent}/environments" - } + "post": "/v2beta1/{session=projects/*/agent/sessions/*}:detectIntent", + "body": "*", + "additional_bindings": [ + { + "post": "/v2beta1/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent", + "body": "*" + }, + { + "post": "/v2beta1/{session=projects/*/locations/*/agent/sessions/*}:detectIntent", + "body": "*" + }, + { + "post": "/v2beta1/{session=projects/*/locations/*/agent/environments/*/users/*/sessions/*}:detectIntent", + "body": "*" + } + ] } }, { - "(google.api.method_signature)": "parent" + "(google.api.method_signature)": "session,query_input" } ] - } - } - }, - "Environment": { - "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/Environment", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/agent/environments/{environment}" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "agentVersion": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "state": { - "type": "State", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "STOPPED": 1, - "LOADING": 2, - "RUNNING": 3 - } + "StreamingDetectIntent": { + "requestType": "StreamingDetectIntentRequest", + "requestStream": true, + "responseType": "StreamingDetectIntentResponse", + "responseStream": true } } }, - "ListEnvironmentsRequest": { + "DetectIntentRequest": { "fields": { - "parent": { + "session": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Environment" + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" } }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "queryParams": { + "type": "QueryParameters", + "id": 2 }, - "pageToken": { - "type": "string", + "queryInput": { + "type": "QueryInput", "id": 3, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } - } - } - }, - "ListEnvironmentsResponse": { - "fields": { - "environments": { - "rule": "repeated", - "type": "Environment", - "id": 1 }, - "nextPageToken": { - "type": "string", - "id": 2 + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 4 + }, + "outputAudioConfigMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "inputAudio": { + "type": "bytes", + "id": 5 } } }, - "SpeechContext": { + "DetectIntentResponse": { "fields": { - "phrases": { - "rule": "repeated", + "responseId": { "type": "string", "id": 1 }, - "boost": { - "type": "float", + "queryResult": { + "type": "QueryResult", "id": 2 - } - } - }, - "AudioEncoding": { - "values": { - "AUDIO_ENCODING_UNSPECIFIED": 0, - "AUDIO_ENCODING_LINEAR_16": 1, - "AUDIO_ENCODING_FLAC": 2, - "AUDIO_ENCODING_MULAW": 3, - "AUDIO_ENCODING_AMR": 4, - "AUDIO_ENCODING_AMR_WB": 5, - "AUDIO_ENCODING_OGG_OPUS": 6, - "AUDIO_ENCODING_SPEEX_WITH_HEADER_BYTE": 7 - } - }, - "SpeechWordInfo": { - "fields": { - "word": { - "type": "string", - "id": 3 }, - "startOffset": { - "type": "google.protobuf.Duration", - "id": 1 + "alternativeQueryResults": { + "rule": "repeated", + "type": "QueryResult", + "id": 5 }, - "endOffset": { - "type": "google.protobuf.Duration", - "id": 2 + "webhookStatus": { + "type": "google.rpc.Status", + "id": 3 }, - "confidence": { - "type": "float", + "outputAudio": { + "type": "bytes", "id": 4 + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 6 } } }, - "SpeechModelVariant": { - "values": { - "SPEECH_MODEL_VARIANT_UNSPECIFIED": 0, - "USE_BEST_AVAILABLE": 1, - "USE_STANDARD": 2, - "USE_ENHANCED": 3 - } - }, - "InputAudioConfig": { + "QueryParameters": { "fields": { - "audioEncoding": { - "type": "AudioEncoding", + "timeZone": { + "type": "string", "id": 1 }, - "sampleRateHertz": { - "type": "int32", + "geoLocation": { + "type": "google.type.LatLng", "id": 2 }, - "languageCode": { - "type": "string", + "contexts": { + "rule": "repeated", + "type": "Context", "id": 3 }, - "enableWordInfo": { + "resetContexts": { "type": "bool", - "id": 13 + "id": 4 }, - "phraseHints": { + "sessionEntityTypes": { "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "deprecated": true - } + "type": "SessionEntityType", + "id": 5 }, - "speechContexts": { - "rule": "repeated", - "type": "SpeechContext", - "id": 11 + "payload": { + "type": "google.protobuf.Struct", + "id": 6 }, - "model": { + "knowledgeBaseNames": { + "rule": "repeated", "type": "string", - "id": 7 + "id": 12 }, - "modelVariant": { - "type": "SpeechModelVariant", + "sentimentAnalysisRequestConfig": { + "type": "SentimentAnalysisRequestConfig", "id": 10 }, - "singleUtterance": { - "type": "bool", - "id": 8 + "subAgents": { + "rule": "repeated", + "type": "SubAgent", + "id": 13 + }, + "webhookHeaders": { + "keyType": "string", + "type": "string", + "id": 14 } } }, - "VoiceSelectionParams": { + "QueryInput": { + "oneofs": { + "input": { + "oneof": [ + "audioConfig", + "text", + "event" + ] + } + }, "fields": { - "name": { - "type": "string", + "audioConfig": { + "type": "InputAudioConfig", "id": 1 }, - "ssmlGender": { - "type": "SsmlVoiceGender", + "text": { + "type": "TextInput", "id": 2 + }, + "event": { + "type": "EventInput", + "id": 3 } } }, - "SynthesizeSpeechConfig": { + "QueryResult": { "fields": { - "speakingRate": { - "type": "double", + "queryText": { + "type": "string", "id": 1 }, - "pitch": { - "type": "double", - "id": 2 + "languageCode": { + "type": "string", + "id": 15 }, - "volumeGainDb": { - "type": "double", - "id": 3 + "speechRecognitionConfidence": { + "type": "float", + "id": 2 }, - "effectsProfileId": { - "rule": "repeated", + "action": { "type": "string", - "id": 5 + "id": 3 }, - "voice": { - "type": "VoiceSelectionParams", + "parameters": { + "type": "google.protobuf.Struct", "id": 4 - } - } - }, - "SsmlVoiceGender": { - "values": { - "SSML_VOICE_GENDER_UNSPECIFIED": 0, - "SSML_VOICE_GENDER_MALE": 1, - "SSML_VOICE_GENDER_FEMALE": 2, - "SSML_VOICE_GENDER_NEUTRAL": 3 - } - }, - "OutputAudioConfig": { - "fields": { - "audioEncoding": { - "type": "OutputAudioEncoding", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } }, - "sampleRateHertz": { - "type": "int32", - "id": 2 + "allRequiredParamsPresent": { + "type": "bool", + "id": 5 }, - "synthesizeSpeechConfig": { - "type": "SynthesizeSpeechConfig", - "id": 3 - } - } - }, - "TelephonyDtmfEvents": { - "fields": { - "dtmfEvents": { + "fulfillmentText": { + "type": "string", + "id": 6 + }, + "fulfillmentMessages": { "rule": "repeated", - "type": "TelephonyDtmf", - "id": 1 - } - } - }, - "OutputAudioEncoding": { - "values": { - "OUTPUT_AUDIO_ENCODING_UNSPECIFIED": 0, - "OUTPUT_AUDIO_ENCODING_LINEAR_16": 1, - "OUTPUT_AUDIO_ENCODING_MP3": 2, - "OUTPUT_AUDIO_ENCODING_OGG_OPUS": 3 - } - }, - "TelephonyDtmf": { - "values": { - "TELEPHONY_DTMF_UNSPECIFIED": 0, - "DTMF_ONE": 1, - "DTMF_TWO": 2, - "DTMF_THREE": 3, - "DTMF_FOUR": 4, - "DTMF_FIVE": 5, - "DTMF_SIX": 6, - "DTMF_SEVEN": 7, - "DTMF_EIGHT": 8, - "DTMF_NINE": 9, - "DTMF_ZERO": 10, - "DTMF_A": 11, - "DTMF_B": 12, - "DTMF_C": 13, - "DTMF_D": 14, - "DTMF_STAR": 15, - "DTMF_POUND": 16 - } - }, - "ValidationError": { - "fields": { - "severity": { - "type": "Severity", - "id": 1 + "type": "Intent.Message", + "id": 7 + }, + "webhookSource": { + "type": "string", + "id": 8 + }, + "webhookPayload": { + "type": "google.protobuf.Struct", + "id": 9 }, - "entries": { + "outputContexts": { "rule": "repeated", - "type": "string", - "id": 3 + "type": "Context", + "id": 10 }, - "errorMessage": { - "type": "string", - "id": 4 - } - }, - "nested": { - "Severity": { - "values": { - "SEVERITY_UNSPECIFIED": 0, - "INFO": 1, - "WARNING": 2, - "ERROR": 3, - "CRITICAL": 4 - } + "intent": { + "type": "Intent", + "id": 11 + }, + "intentDetectionConfidence": { + "type": "float", + "id": 12 + }, + "diagnosticInfo": { + "type": "google.protobuf.Struct", + "id": 14 + }, + "sentimentAnalysisResult": { + "type": "SentimentAnalysisResult", + "id": 17 + }, + "knowledgeAnswers": { + "type": "KnowledgeAnswers", + "id": 18 } } }, - "ValidationResult": { + "KnowledgeAnswers": { "fields": { - "validationErrors": { + "answers": { "rule": "repeated", - "type": "ValidationError", + "type": "Answer", "id": 1 } - } - }, - "Contexts": { - "options": { - "(google.api.default_host)": "dialogflow.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" }, - "methods": { - "ListContexts": { - "requestType": "ListContextsRequest", - "responseType": "ListContextsResponse", - "options": { - "(google.api.http).get": "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts", - "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts", - "additional_bindings": [ - { - "get": "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts" - }, - { - "get": "/v2beta1/{parent=projects/*/locations/*/agent/sessions/*}/contexts" - }, - { - "get": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts" - } - ] - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetContext": { - "requestType": "GetContextRequest", - "responseType": "Context", - "options": { - "(google.api.http).get": "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}", - "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}", - "additional_bindings": [ - { - "get": "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}" - }, - { - "get": "/v2beta1/{name=projects/*/locations/*/agent/sessions/*/contexts/*}" - }, - { - "get": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}" - } - ] - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateContext": { - "requestType": "CreateContextRequest", - "responseType": "Context", - "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts", - "(google.api.http).body": "context", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts", - "(google.api.http).additional_bindings.body": "context", - "(google.api.method_signature)": "parent,context" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts", - "body": "context", - "additional_bindings": [ - { - "post": "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts", - "body": "context" - }, - { - "post": "/v2beta1/{parent=projects/*/locations/*/agent/sessions/*}/contexts", - "body": "context" - }, - { - "post": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts", - "body": "context" - } - ] + "nested": { + "Answer": { + "fields": { + "source": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" } }, - { - "(google.api.method_signature)": "parent,context" - } - ] - }, - "UpdateContext": { - "requestType": "UpdateContextRequest", - "responseType": "Context", - "options": { - "(google.api.http).patch": "/v2beta1/{context.name=projects/*/agent/sessions/*/contexts/*}", - "(google.api.http).body": "context", - "(google.api.http).additional_bindings.patch": "/v2beta1/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}", - "(google.api.http).additional_bindings.body": "context", - "(google.api.method_signature)": "context" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2beta1/{context.name=projects/*/agent/sessions/*/contexts/*}", - "body": "context", - "additional_bindings": [ - { - "patch": "/v2beta1/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}", - "body": "context" - }, - { - "patch": "/v2beta1/{context.name=projects/*/locations/*/agent/sessions/*/contexts/*}", - "body": "context" - }, - { - "patch": "/v2beta1/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}", - "body": "context" - } - ] - } + "faqQuestion": { + "type": "string", + "id": 2 }, - { - "(google.api.method_signature)": "context,update_mask" + "answer": { + "type": "string", + "id": 3 }, - { - "(google.api.method_signature)": "context" - } - ] - }, - "DeleteContext": { - "requestType": "DeleteContextRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}", - "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}", - "additional_bindings": [ - { - "delete": "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}" - }, - { - "delete": "/v2beta1/{name=projects/*/locations/*/agent/sessions/*/contexts/*}" - }, - { - "delete": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}" - } - ] - } + "matchConfidenceLevel": { + "type": "MatchConfidenceLevel", + "id": 4 }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "DeleteAllContexts": { - "requestType": "DeleteAllContextsRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts", - "(google.api.http).additional_bindings.delete": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts", - "additional_bindings": [ - { - "delete": "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts" - }, - { - "delete": "/v2beta1/{parent=projects/*/locations/*/agent/sessions/*}/contexts" - }, - { - "delete": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts" - } - ] + "matchConfidence": { + "type": "float", + "id": 5 + } + }, + "nested": { + "MatchConfidenceLevel": { + "values": { + "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED": 0, + "LOW": 1, + "MEDIUM": 2, + "HIGH": 3 } - }, - { - "(google.api.method_signature)": "parent" } - ] + } } } }, - "Context": { - "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/Context", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}" - }, + "StreamingDetectIntentRequest": { "fields": { - "name": { + "session": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" + } }, - "lifespanCount": { - "type": "int32", + "queryParams": { + "type": "QueryParameters", "id": 2 }, - "parameters": { - "type": "google.protobuf.Struct", - "id": 3 + "queryInput": { + "type": "QueryInput", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "singleUtterance": { + "type": "bool", + "id": 4, + "options": { + "deprecated": true + } + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 5 + }, + "outputAudioConfigMask": { + "type": "google.protobuf.FieldMask", + "id": 7 + }, + "inputAudio": { + "type": "bytes", + "id": 6 } } }, - "ListContextsRequest": { + "StreamingDetectIntentResponse": { "fields": { - "parent": { + "responseId": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Context" - } + "id": 1 }, - "pageSize": { - "type": "int32", + "recognitionResult": { + "type": "StreamingRecognitionResult", "id": 2 }, - "pageToken": { - "type": "string", + "queryResult": { + "type": "QueryResult", "id": 3 + }, + "alternativeQueryResults": { + "rule": "repeated", + "type": "QueryResult", + "id": 7 + }, + "webhookStatus": { + "type": "google.rpc.Status", + "id": 4 + }, + "outputAudio": { + "type": "bytes", + "id": 5 + }, + "outputAudioConfig": { + "type": "OutputAudioConfig", + "id": 6 } } }, - "ListContextsResponse": { + "StreamingRecognitionResult": { "fields": { - "contexts": { - "rule": "repeated", - "type": "Context", + "messageType": { + "type": "MessageType", "id": 1 }, - "nextPageToken": { + "transcript": { "type": "string", "id": 2 + }, + "isFinal": { + "type": "bool", + "id": 3 + }, + "confidence": { + "type": "float", + "id": 4 + }, + "stability": { + "type": "float", + "id": 6 + }, + "speechWordInfo": { + "rule": "repeated", + "type": "SpeechWordInfo", + "id": 7 + }, + "speechEndOffset": { + "type": "google.protobuf.Duration", + "id": 8 + }, + "dtmfDigits": { + "type": "TelephonyDtmfEvents", + "id": 5 + } + }, + "nested": { + "MessageType": { + "values": { + "MESSAGE_TYPE_UNSPECIFIED": 0, + "TRANSCRIPT": 1, + "END_OF_SINGLE_UTTERANCE": 2 + } } } }, - "GetContextRequest": { + "TextInput": { "fields": { - "name": { + "text": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Context" - } + "id": 1 + }, + "languageCode": { + "type": "string", + "id": 2 } } }, - "CreateContextRequest": { + "EventInput": { "fields": { - "parent": { + "name": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Context" - } + "id": 1 }, - "context": { - "type": "Context", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "parameters": { + "type": "google.protobuf.Struct", + "id": 2 + }, + "languageCode": { + "type": "string", + "id": 3 } } }, - "UpdateContextRequest": { + "SentimentAnalysisRequestConfig": { "fields": { - "context": { - "type": "Context", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "analyzeQueryTextSentiment": { + "type": "bool", + "id": 1 } } }, - "DeleteContextRequest": { + "SentimentAnalysisResult": { "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Context" - } + "queryTextSentiment": { + "type": "Sentiment", + "id": 1 } } }, - "DeleteAllContextsRequest": { + "Sentiment": { "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Context" - } + "score": { + "type": "float", + "id": 1 + }, + "magnitude": { + "type": "float", + "id": 2 } } }, - "Documents": { + "Contexts": { "options": { "(google.api.default_host)": "dialogflow.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" }, "methods": { - "ListDocuments": { - "requestType": "ListDocumentsRequest", - "responseType": "ListDocumentsResponse", + "ListContexts": { + "requestType": "ListContextsRequest", + "responseType": "ListContextsResponse", "options": { - "(google.api.http).get": "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents", - "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents", + "(google.api.http).get": "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents", + "get": "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts", "additional_bindings": [ { - "get": "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents" + "get": "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts" }, { - "get": "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents" + "get": "/v2beta1/{parent=projects/*/locations/*/agent/sessions/*}/contexts" + }, + { + "get": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts" } ] } @@ -5231,24 +9930,27 @@ } ] }, - "GetDocument": { - "requestType": "GetDocumentRequest", - "responseType": "Document", + "GetContext": { + "requestType": "GetContextRequest", + "responseType": "Context", "options": { - "(google.api.http).get": "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}", - "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}", + "(google.api.http).get": "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}", + "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}", + "get": "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}", "additional_bindings": [ { - "get": "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}" + "get": "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}" + }, + { + "get": "/v2beta1/{name=projects/*/locations/*/agent/sessions/*/contexts/*}" }, { - "get": "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}" + "get": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}" } ] } @@ -5258,282 +9960,171 @@ } ] }, - "CreateDocument": { - "requestType": "CreateDocumentRequest", - "responseType": "google.longrunning.Operation", + "CreateContext": { + "requestType": "CreateContextRequest", + "responseType": "Context", "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents", - "(google.api.http).body": "document", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents", - "(google.api.http).additional_bindings.body": "document", - "(google.api.method_signature)": "parent,document", - "(google.longrunning.operation_info).response_type": "Document", - "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + "(google.api.http).post": "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts", + "(google.api.http).body": "context", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts", + "(google.api.http).additional_bindings.body": "context", + "(google.api.method_signature)": "parent,context" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents", - "body": "document", + "post": "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts", + "body": "context", "additional_bindings": [ { - "post": "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents", - "body": "document" + "post": "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts", + "body": "context" }, { - "post": "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents", - "body": "document" + "post": "/v2beta1/{parent=projects/*/locations/*/agent/sessions/*}/contexts", + "body": "context" + }, + { + "post": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts", + "body": "context" } ] } }, { - "(google.api.method_signature)": "parent,document" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Document", - "metadata_type": "KnowledgeOperationMetadata" - } + "(google.api.method_signature)": "parent,context" } ] }, - "DeleteDocument": { - "requestType": "DeleteDocumentRequest", - "responseType": "google.longrunning.Operation", + "UpdateContext": { + "requestType": "UpdateContextRequest", + "responseType": "Context", "options": { - "(google.api.http).delete": "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}", - "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + "(google.api.http).patch": "/v2beta1/{context.name=projects/*/agent/sessions/*/contexts/*}", + "(google.api.http).body": "context", + "(google.api.http).additional_bindings.patch": "/v2beta1/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}", + "(google.api.http).additional_bindings.body": "context", + "(google.api.method_signature)": "context" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}", + "patch": "/v2beta1/{context.name=projects/*/agent/sessions/*/contexts/*}", + "body": "context", "additional_bindings": [ { - "delete": "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}" + "patch": "/v2beta1/{context.name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}", + "body": "context" }, { - "delete": "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}" + "patch": "/v2beta1/{context.name=projects/*/locations/*/agent/sessions/*/contexts/*}", + "body": "context" + }, + { + "patch": "/v2beta1/{context.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}", + "body": "context" } ] } }, { - "(google.api.method_signature)": "name" + "(google.api.method_signature)": "context,update_mask" }, { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "KnowledgeOperationMetadata" - } + "(google.api.method_signature)": "context" } ] }, - "UpdateDocument": { - "requestType": "UpdateDocumentRequest", - "responseType": "google.longrunning.Operation", + "DeleteContext": { + "requestType": "DeleteContextRequest", + "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).patch": "/v2beta1/{document.name=projects/*/knowledgeBases/*/documents/*}", - "(google.api.http).body": "document", - "(google.api.http).additional_bindings.patch": "/v2beta1/{document.name=projects/*/agent/knowledgeBases/*/documents/*}", - "(google.api.http).additional_bindings.body": "document", - "(google.api.method_signature)": "document", - "(google.longrunning.operation_info).response_type": "Document", - "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + "(google.api.http).delete": "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}", + "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}", + "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "patch": "/v2beta1/{document.name=projects/*/knowledgeBases/*/documents/*}", - "body": "document", + "delete": "/v2beta1/{name=projects/*/agent/sessions/*/contexts/*}", "additional_bindings": [ { - "patch": "/v2beta1/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}", - "body": "document" + "delete": "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/contexts/*}" }, { - "patch": "/v2beta1/{document.name=projects/*/agent/knowledgeBases/*/documents/*}", - "body": "document" + "delete": "/v2beta1/{name=projects/*/locations/*/agent/sessions/*/contexts/*}" + }, + { + "delete": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/contexts/*}" } ] } }, { - "(google.api.method_signature)": "document,update_mask" - }, - { - "(google.api.method_signature)": "document" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Document", - "metadata_type": "KnowledgeOperationMetadata" - } + "(google.api.method_signature)": "name" } ] }, - "ReloadDocument": { - "requestType": "ReloadDocumentRequest", - "responseType": "google.longrunning.Operation", + "DeleteAllContexts": { + "requestType": "DeleteAllContextsRequest", + "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).post": "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}:reload", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "name,gcs_source", - "(google.longrunning.operation_info).response_type": "Document", - "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + "(google.api.http).delete": "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts", + "(google.api.http).additional_bindings.delete": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts", + "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}:reload", - "body": "*", + "delete": "/v2beta1/{parent=projects/*/agent/sessions/*}/contexts", "additional_bindings": [ { - "post": "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload", - "body": "*" + "delete": "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/contexts" }, { - "post": "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload", - "body": "*" + "delete": "/v2beta1/{parent=projects/*/locations/*/agent/sessions/*}/contexts" + }, + { + "delete": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/contexts" } ] } }, { - "(google.api.method_signature)": "name,gcs_source" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Document", - "metadata_type": "KnowledgeOperationMetadata" - } + "(google.api.method_signature)": "parent" } ] } } }, - "Document": { + "Context": { "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/Document", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}" - }, - "oneofs": { - "source": { - "oneof": [ - "contentUri", - "content", - "rawContent" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "mimeType": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "knowledgeTypes": { - "rule": "repeated", - "type": "KnowledgeType", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "contentUri": { - "type": "string", - "id": 5 - }, - "content": { - "type": "string", - "id": 6, - "options": { - "deprecated": true - } - }, - "rawContent": { - "type": "bytes", - "id": 9 - }, - "enableAutoReload": { - "type": "bool", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "latestReloadStatus": { - "type": "ReloadStatus", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } + "(google.api.resource).type": "dialogflow.googleapis.com/Context", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}" }, - "nested": { - "ReloadStatus": { - "fields": { - "time": { - "type": "google.protobuf.Timestamp", - "id": 1 - }, - "status": { - "type": "google.rpc.Status", - "id": 2 - } - } - }, - "KnowledgeType": { - "values": { - "KNOWLEDGE_TYPE_UNSPECIFIED": 0, - "FAQ": 1, - "EXTRACTIVE_QA": 2 - } - } - } - }, - "GetDocumentRequest": { "fields": { "name": { "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" - } + "id": 1 + }, + "lifespanCount": { + "type": "int32", + "id": 2 + }, + "parameters": { + "type": "google.protobuf.Struct", + "id": 3 } } }, - "ListDocumentsRequest": { + "ListContextsRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Document" + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Context" } }, "pageSize": { @@ -5543,18 +10134,14 @@ "pageToken": { "type": "string", "id": 3 - }, - "filter": { - "type": "string", - "id": 4 } } }, - "ListDocumentsResponse": { + "ListContextsResponse": { "fields": { - "documents": { + "contexts": { "rule": "repeated", - "type": "Document", + "type": "Context", "id": 1 }, "nextPageToken": { @@ -5563,45 +10150,41 @@ } } }, - "CreateDocumentRequest": { + "GetContextRequest": { "fields": { - "parent": { + "name": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Document" - } - }, - "document": { - "type": "Document", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Context" } - }, - "importGcsCustomMetadata": { - "type": "bool", - "id": 3 } } }, - "DeleteDocumentRequest": { + "CreateContextRequest": { "fields": { - "name": { + "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Context" + } + }, + "context": { + "type": "Context", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" } } } }, - "UpdateDocumentRequest": { + "UpdateContextRequest": { "fields": { - "document": { - "type": "Document", + "context": { + "type": "Context", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED" @@ -5616,51 +10199,39 @@ } } }, - "KnowledgeOperationMetadata": { + "DeleteContextRequest": { "fields": { - "state": { - "type": "State", + "name": { + "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "PENDING": 1, - "RUNNING": 2, - "DONE": 3 + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Context" } } } }, - "ReloadDocumentRequest": { - "oneofs": { - "source": { - "oneof": [ - "gcsSource" - ] - } - }, + "DeleteAllContextsRequest": { "fields": { - "name": { + "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Context" + } + } + } + }, + "GcsSources": { + "fields": { + "uris": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" } - }, - "gcsSource": { - "type": "GcsSource", - "id": 3 - }, - "importGcsCustomMetadata": { - "type": "bool", - "id": 4 } } }, @@ -5672,27 +10243,32 @@ } } }, - "EntityTypes": { + "Intents": { "options": { "(google.api.default_host)": "dialogflow.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" }, "methods": { - "ListEntityTypes": { - "requestType": "ListEntityTypesRequest", - "responseType": "ListEntityTypesResponse", + "ListIntents": { + "requestType": "ListIntentsRequest", + "responseType": "ListIntentsResponse", "options": { - "(google.api.http).get": "/v2beta1/{parent=projects/*/agent}/entityTypes", - "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes", + "(google.api.http).get": "/v2beta1/{parent=projects/*/agent}/intents", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/agent/environments/*}/intents", "(google.api.method_signature)": "parent,language_code" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2beta1/{parent=projects/*/agent}/entityTypes", - "additional_bindings": { - "get": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes" - } + "get": "/v2beta1/{parent=projects/*/agent}/intents", + "additional_bindings": [ + { + "get": "/v2beta1/{parent=projects/*/locations/*/agent}/intents" + }, + { + "get": "/v2beta1/{parent=projects/*/agent/environments/*}/intents" + } + ] } }, { @@ -5703,20 +10279,20 @@ } ] }, - "GetEntityType": { - "requestType": "GetEntityTypeRequest", - "responseType": "EntityType", + "GetIntent": { + "requestType": "GetIntentRequest", + "responseType": "Intent", "options": { - "(google.api.http).get": "/v2beta1/{name=projects/*/agent/entityTypes/*}", - "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/locations/*/agent/entityTypes/*}", + "(google.api.http).get": "/v2beta1/{name=projects/*/agent/intents/*}", + "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/locations/*/agent/intents/*}", "(google.api.method_signature)": "name,language_code" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2beta1/{name=projects/*/agent/entityTypes/*}", + "get": "/v2beta1/{name=projects/*/agent/intents/*}", "additional_bindings": { - "get": "/v2beta1/{name=projects/*/locations/*/agent/entityTypes/*}" + "get": "/v2beta1/{name=projects/*/locations/*/agent/intents/*}" } } }, @@ -5728,1994 +10304,2876 @@ } ] }, - "CreateEntityType": { - "requestType": "CreateEntityTypeRequest", - "responseType": "EntityType", - "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*/agent}/entityTypes", - "(google.api.http).body": "entity_type", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes", - "(google.api.http).additional_bindings.body": "entity_type", - "(google.api.method_signature)": "parent,entity_type,language_code" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*/agent}/entityTypes", - "body": "entity_type", - "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes", - "body": "entity_type" - } - } - }, - { - "(google.api.method_signature)": "parent,entity_type" - }, - { - "(google.api.method_signature)": "parent,entity_type,language_code" - } - ] - }, - "UpdateEntityType": { - "requestType": "UpdateEntityTypeRequest", - "responseType": "EntityType", - "options": { - "(google.api.http).patch": "/v2beta1/{entity_type.name=projects/*/agent/entityTypes/*}", - "(google.api.http).body": "entity_type", - "(google.api.http).additional_bindings.patch": "/v2beta1/{entity_type.name=projects/*/locations/*/agent/entityTypes/*}", - "(google.api.http).additional_bindings.body": "entity_type", - "(google.api.method_signature)": "entity_type,language_code,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2beta1/{entity_type.name=projects/*/agent/entityTypes/*}", - "body": "entity_type", - "additional_bindings": { - "patch": "/v2beta1/{entity_type.name=projects/*/locations/*/agent/entityTypes/*}", - "body": "entity_type" - } - } - }, - { - "(google.api.method_signature)": "entity_type" - }, - { - "(google.api.method_signature)": "entity_type,language_code" - }, - { - "(google.api.method_signature)": "entity_type,language_code,update_mask" - } - ] - }, - "DeleteEntityType": { - "requestType": "DeleteEntityTypeRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2beta1/{name=projects/*/agent/entityTypes/*}", - "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/locations/*/agent/entityTypes/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2beta1/{name=projects/*/agent/entityTypes/*}", - "additional_bindings": { - "delete": "/v2beta1/{name=projects/*/locations/*/agent/entityTypes/*}" - } - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "BatchUpdateEntityTypes": { - "requestType": "BatchUpdateEntityTypesRequest", - "responseType": "google.longrunning.Operation", + "CreateIntent": { + "requestType": "CreateIntentRequest", + "responseType": "Intent", "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*/agent}/entityTypes:batchUpdate", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes:batchUpdate", - "(google.api.http).additional_bindings.body": "*", - "(google.longrunning.operation_info).response_type": "google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + "(google.api.http).post": "/v2beta1/{parent=projects/*/agent}/intents", + "(google.api.http).body": "intent", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent}/intents", + "(google.api.http).additional_bindings.body": "intent", + "(google.api.method_signature)": "parent,intent,language_code" }, "parsedOptions": [ { - "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*/agent}/entityTypes:batchUpdate", - "body": "*", + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/agent}/intents", + "body": "intent", "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes:batchUpdate", - "body": "*" + "post": "/v2beta1/{parent=projects/*/locations/*/agent}/intents", + "body": "intent" } } }, { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse", - "metadata_type": "google.protobuf.Struct" - } + "(google.api.method_signature)": "parent,intent" + }, + { + "(google.api.method_signature)": "parent,intent,language_code" } ] }, - "BatchDeleteEntityTypes": { - "requestType": "BatchDeleteEntityTypesRequest", - "responseType": "google.longrunning.Operation", + "UpdateIntent": { + "requestType": "UpdateIntentRequest", + "responseType": "Intent", "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*/agent}/entityTypes:batchDelete", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes:batchDelete", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent,entity_type_names", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + "(google.api.http).patch": "/v2beta1/{intent.name=projects/*/agent/intents/*}", + "(google.api.http).body": "intent", + "(google.api.http).additional_bindings.patch": "/v2beta1/{intent.name=projects/*/locations/*/agent/intents/*}", + "(google.api.http).additional_bindings.body": "intent", + "(google.api.method_signature)": "intent,language_code,update_mask" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*/agent}/entityTypes:batchDelete", - "body": "*", + "patch": "/v2beta1/{intent.name=projects/*/agent/intents/*}", + "body": "intent", "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes:batchDelete", - "body": "*" + "patch": "/v2beta1/{intent.name=projects/*/locations/*/agent/intents/*}", + "body": "intent" } } }, { - "(google.api.method_signature)": "parent,entity_type_names" + "(google.api.method_signature)": "intent,update_mask" }, { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.protobuf.Struct" - } + "(google.api.method_signature)": "intent" + }, + { + "(google.api.method_signature)": "intent,language_code" + }, + { + "(google.api.method_signature)": "intent,language_code,update_mask" } ] }, - "BatchCreateEntities": { - "requestType": "BatchCreateEntitiesRequest", - "responseType": "google.longrunning.Operation", + "DeleteIntent": { + "requestType": "DeleteIntentRequest", + "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchCreate", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent,entities,language_code", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + "(google.api.http).delete": "/v2beta1/{name=projects/*/agent/intents/*}", + "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/locations/*/agent/intents/*}", + "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate", - "body": "*", + "delete": "/v2beta1/{name=projects/*/agent/intents/*}", "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchCreate", - "body": "*" + "delete": "/v2beta1/{name=projects/*/locations/*/agent/intents/*}" } } }, { - "(google.api.method_signature)": "parent,entities" - }, - { - "(google.api.method_signature)": "parent,entities,language_code" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.protobuf.Struct" - } + "(google.api.method_signature)": "name" } ] }, - "BatchUpdateEntities": { - "requestType": "BatchUpdateEntitiesRequest", + "BatchUpdateIntents": { + "requestType": "BatchUpdateIntentsRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate", + "(google.api.http).post": "/v2beta1/{parent=projects/*/agent}/intents:batchUpdate", "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchUpdate", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent}/intents:batchUpdate", "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent,entities,language_code", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.api.method_signature)": "parent,intent_batch_inline", + "(google.longrunning.operation_info).response_type": "google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse", "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate", + "post": "/v2beta1/{parent=projects/*/agent}/intents:batchUpdate", "body": "*", "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchUpdate", + "post": "/v2beta1/{parent=projects/*/locations/*/agent}/intents:batchUpdate", "body": "*" } } }, { - "(google.api.method_signature)": "parent,entities" + "(google.api.method_signature)": "parent,intent_batch_uri" }, { - "(google.api.method_signature)": "parent,entities,language_code" + "(google.api.method_signature)": "parent,intent_batch_inline" }, { "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", + "response_type": "google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse", "metadata_type": "google.protobuf.Struct" } } ] }, - "BatchDeleteEntities": { - "requestType": "BatchDeleteEntitiesRequest", + "BatchDeleteIntents": { + "requestType": "BatchDeleteIntentsRequest", "responseType": "google.longrunning.Operation", "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete", + "(google.api.http).post": "/v2beta1/{parent=projects/*/agent}/intents:batchDelete", "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchDelete", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent}/intents:batchDelete", "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent,entity_values,language_code", + "(google.api.method_signature)": "parent,intents", "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete", + "post": "/v2beta1/{parent=projects/*/agent}/intents:batchDelete", "body": "*", "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchDelete", + "post": "/v2beta1/{parent=projects/*/locations/*/agent}/intents:batchDelete", "body": "*" } } }, { - "(google.api.method_signature)": "parent,entity_values" - }, - { - "(google.api.method_signature)": "parent,entity_values,language_code" + "(google.api.method_signature)": "parent,intents" }, { "(google.longrunning.operation_info)": { "response_type": "google.protobuf.Empty", "metadata_type": "google.protobuf.Struct" } - } - ] - } - } - }, - "EntityType": { - "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/EntityType", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/agent/entityTypes/{entity_type}" - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "kind": { - "type": "Kind", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "autoExpansionMode": { - "type": "AutoExpansionMode", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "entities": { - "rule": "repeated", - "type": "Entity", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enableFuzzyExtraction": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Entity": { - "fields": { - "value": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "synonyms": { - "rule": "repeated", - "type": "string", - "id": 2 - } - } - }, - "Kind": { - "values": { - "KIND_UNSPECIFIED": 0, - "KIND_MAP": 1, - "KIND_LIST": 2, - "KIND_REGEXP": 3 - } - }, - "AutoExpansionMode": { - "values": { - "AUTO_EXPANSION_MODE_UNSPECIFIED": 0, - "AUTO_EXPANSION_MODE_DEFAULT": 1 - } - } - } - }, - "ListEntityTypesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" - } - }, - "languageCode": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListEntityTypesResponse": { - "fields": { - "entityTypes": { - "rule": "repeated", - "type": "EntityType", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 + } + ] } } }, - "GetEntityTypeRequest": { + "Intent": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Intent", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agent/intents/{intent}" + }, "fields": { "name": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + "(google.api.field_behavior)": "OPTIONAL" } }, - "languageCode": { + "displayName": { "type": "string", "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CreateEntityTypeRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + "(google.api.field_behavior)": "REQUIRED" } }, - "entityType": { - "type": "EntityType", - "id": 2, + "webhookState": { + "type": "WebhookState", + "id": 6, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } }, - "languageCode": { - "type": "string", + "priority": { + "type": "int32", "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "UpdateEntityTypeRequest": { - "fields": { - "entityType": { - "type": "EntityType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } }, - "languageCode": { - "type": "string", - "id": 2, + "isFallback": { + "type": "bool", + "id": 4, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 3, + "mlEnabled": { + "type": "bool", + "id": 5, "options": { + "deprecated": true, "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "DeleteEntityTypeRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, + }, + "mlDisabled": { + "type": "bool", + "id": 19, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "BatchUpdateEntityTypesRequest": { - "oneofs": { - "entityTypeBatch": { - "oneof": [ - "entityTypeBatchUri", - "entityTypeBatchInline" - ] - } - }, - "fields": { - "parent": { - "type": "string", - "id": 1, + }, + "liveAgentHandoff": { + "type": "bool", + "id": 20, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + "(google.api.field_behavior)": "OPTIONAL" } }, - "entityTypeBatchUri": { - "type": "string", - "id": 2 - }, - "entityTypeBatchInline": { - "type": "EntityTypeBatch", - "id": 3 - }, - "languageCode": { - "type": "string", - "id": 4, + "endInteraction": { + "type": "bool", + "id": 21, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 5, + "inputContextNames": { + "rule": "repeated", + "type": "string", + "id": 7, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "BatchUpdateEntityTypesResponse": { - "fields": { - "entityTypes": { + }, + "events": { "rule": "repeated", - "type": "EntityType", - "id": 1 - } - } - }, - "BatchDeleteEntityTypesRequest": { - "fields": { - "parent": { "type": "string", - "id": 1, + "id": 8, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + "(google.api.field_behavior)": "OPTIONAL" } }, - "entityTypeNames": { + "trainingPhrases": { "rule": "repeated", - "type": "string", - "id": 2, + "type": "TrainingPhrase", + "id": 9, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "BatchCreateEntitiesRequest": { - "fields": { - "parent": { + }, + "action": { "type": "string", - "id": 1, + "id": 10, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + "(google.api.field_behavior)": "OPTIONAL" } }, - "entities": { + "outputContexts": { "rule": "repeated", - "type": "EntityType.Entity", - "id": 2, + "type": "Context", + "id": 11, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } }, - "languageCode": { - "type": "string", - "id": 3, + "resetContexts": { + "type": "bool", + "id": 12, "options": { "(google.api.field_behavior)": "OPTIONAL" } - } - } - }, - "BatchUpdateEntitiesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, + }, + "parameters": { + "rule": "repeated", + "type": "Parameter", + "id": 13, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + "(google.api.field_behavior)": "OPTIONAL" } }, - "entities": { + "messages": { "rule": "repeated", - "type": "EntityType.Entity", - "id": 2, + "type": "Message", + "id": 14 + }, + "defaultResponsePlatforms": { + "rule": "repeated", + "type": "Message.Platform", + "id": 15, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "OPTIONAL" } }, - "languageCode": { + "rootFollowupIntentName": { "type": "string", - "id": 3, + "id": 16, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 4 - } - } - }, - "BatchDeleteEntitiesRequest": { - "fields": { - "parent": { + "parentFollowupIntentName": { "type": "string", - "id": 1, + "id": 17, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "followupIntentInfo": { + "rule": "repeated", + "type": "FollowupIntentInfo", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "TrainingPhrase": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "type": { + "type": "Type", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "parts": { + "rule": "repeated", + "type": "Part", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "timesAddedCount": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Part": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "entityType": { + "type": "string", + "id": 2 + }, + "alias": { + "type": "string", + "id": 3 + }, + "userDefined": { + "type": "bool", + "id": 4 + } + } + }, + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "EXAMPLE": 1, + "TEMPLATE": 2 + } + } } }, - "entityValues": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "Parameter": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2 + }, + "value": { + "type": "string", + "id": 3 + }, + "defaultValue": { + "type": "string", + "id": 4 + }, + "entityTypeDisplayName": { + "type": "string", + "id": 5 + }, + "mandatory": { + "type": "bool", + "id": 6 + }, + "prompts": { + "rule": "repeated", + "type": "string", + "id": 7 + }, + "isList": { + "type": "bool", + "id": 8 + } } }, - "languageCode": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "EntityTypeBatch": { - "fields": { - "entityTypes": { - "rule": "repeated", - "type": "EntityType", - "id": 1 - } - } - }, - "Intents": { - "options": { - "(google.api.default_host)": "dialogflow.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" - }, - "methods": { - "ListIntents": { - "requestType": "ListIntentsRequest", - "responseType": "ListIntentsResponse", - "options": { - "(google.api.http).get": "/v2beta1/{parent=projects/*/agent}/intents", - "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/agent/environments/*}/intents", - "(google.api.method_signature)": "parent,language_code" + "Message": { + "oneofs": { + "message": { + "oneof": [ + "text", + "image", + "quickReplies", + "card", + "payload", + "simpleResponses", + "basicCard", + "suggestions", + "linkOutSuggestion", + "listSelect", + "carouselSelect", + "telephonyPlayAudio", + "telephonySynthesizeSpeech", + "telephonyTransferCall", + "rbmText", + "rbmStandaloneRichCard", + "rbmCarouselRichCard", + "browseCarouselCard", + "tableCard", + "mediaContent" + ] + } }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta1/{parent=projects/*/agent}/intents", - "additional_bindings": [ - { - "get": "/v2beta1/{parent=projects/*/locations/*/agent}/intents" + "fields": { + "text": { + "type": "Text", + "id": 1 + }, + "image": { + "type": "Image", + "id": 2 + }, + "quickReplies": { + "type": "QuickReplies", + "id": 3 + }, + "card": { + "type": "Card", + "id": 4 + }, + "payload": { + "type": "google.protobuf.Struct", + "id": 5 + }, + "simpleResponses": { + "type": "SimpleResponses", + "id": 7 + }, + "basicCard": { + "type": "BasicCard", + "id": 8 + }, + "suggestions": { + "type": "Suggestions", + "id": 9 + }, + "linkOutSuggestion": { + "type": "LinkOutSuggestion", + "id": 10 + }, + "listSelect": { + "type": "ListSelect", + "id": 11 + }, + "carouselSelect": { + "type": "CarouselSelect", + "id": 12 + }, + "telephonyPlayAudio": { + "type": "TelephonyPlayAudio", + "id": 13 + }, + "telephonySynthesizeSpeech": { + "type": "TelephonySynthesizeSpeech", + "id": 14 + }, + "telephonyTransferCall": { + "type": "TelephonyTransferCall", + "id": 15 + }, + "rbmText": { + "type": "RbmText", + "id": 18 + }, + "rbmStandaloneRichCard": { + "type": "RbmStandaloneCard", + "id": 19 + }, + "rbmCarouselRichCard": { + "type": "RbmCarouselCard", + "id": 20 + }, + "browseCarouselCard": { + "type": "BrowseCarouselCard", + "id": 22 + }, + "tableCard": { + "type": "TableCard", + "id": 23 + }, + "mediaContent": { + "type": "MediaContent", + "id": 24 + }, + "platform": { + "type": "Platform", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Text": { + "fields": { + "text": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Image": { + "fields": { + "imageUri": { + "type": "string", + "id": 1 + }, + "accessibilityText": { + "type": "string", + "id": 2 + } + } + }, + "QuickReplies": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "quickReplies": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "Card": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "subtitle": { + "type": "string", + "id": 2 + }, + "imageUri": { + "type": "string", + "id": 3 + }, + "buttons": { + "rule": "repeated", + "type": "Button", + "id": 4 + } + }, + "nested": { + "Button": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "postback": { + "type": "string", + "id": 2 + } + } + } + } + }, + "SimpleResponse": { + "fields": { + "textToSpeech": { + "type": "string", + "id": 1 + }, + "ssml": { + "type": "string", + "id": 2 + }, + "displayText": { + "type": "string", + "id": 3 + } + } + }, + "SimpleResponses": { + "fields": { + "simpleResponses": { + "rule": "repeated", + "type": "SimpleResponse", + "id": 1 + } + } + }, + "BasicCard": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "subtitle": { + "type": "string", + "id": 2 + }, + "formattedText": { + "type": "string", + "id": 3 + }, + "image": { + "type": "Image", + "id": 4 + }, + "buttons": { + "rule": "repeated", + "type": "Button", + "id": 5 + } + }, + "nested": { + "Button": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "openUriAction": { + "type": "OpenUriAction", + "id": 2 + } + }, + "nested": { + "OpenUriAction": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + } + } + } + } + }, + "Suggestion": { + "fields": { + "title": { + "type": "string", + "id": 1 + } + } + }, + "Suggestions": { + "fields": { + "suggestions": { + "rule": "repeated", + "type": "Suggestion", + "id": 1 + } + } + }, + "LinkOutSuggestion": { + "fields": { + "destinationName": { + "type": "string", + "id": 1 + }, + "uri": { + "type": "string", + "id": 2 + } + } + }, + "ListSelect": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "items": { + "rule": "repeated", + "type": "Item", + "id": 2 + }, + "subtitle": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Item": { + "fields": { + "info": { + "type": "SelectItemInfo", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "image": { + "type": "Image", + "id": 4 + } + } + } + } + }, + "CarouselSelect": { + "fields": { + "items": { + "rule": "repeated", + "type": "Item", + "id": 1 + } + }, + "nested": { + "Item": { + "fields": { + "info": { + "type": "SelectItemInfo", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "image": { + "type": "Image", + "id": 4 + } + } + } + } + }, + "SelectItemInfo": { + "fields": { + "key": { + "type": "string", + "id": 1 + }, + "synonyms": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "TelephonyPlayAudio": { + "fields": { + "audioUri": { + "type": "string", + "id": 1 + } + } + }, + "TelephonySynthesizeSpeech": { + "oneofs": { + "source": { + "oneof": [ + "text", + "ssml" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "ssml": { + "type": "string", + "id": 2 + } + } + }, + "TelephonyTransferCall": { + "fields": { + "phoneNumber": { + "type": "string", + "id": 1 + } + } + }, + "RbmText": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "rbmSuggestion": { + "rule": "repeated", + "type": "RbmSuggestion", + "id": 2 + } + } + }, + "RbmCarouselCard": { + "fields": { + "cardWidth": { + "type": "CardWidth", + "id": 1 + }, + "cardContents": { + "rule": "repeated", + "type": "RbmCardContent", + "id": 2 + } + }, + "nested": { + "CardWidth": { + "values": { + "CARD_WIDTH_UNSPECIFIED": 0, + "SMALL": 1, + "MEDIUM": 2 + } + } + } + }, + "RbmStandaloneCard": { + "fields": { + "cardOrientation": { + "type": "CardOrientation", + "id": 1 + }, + "thumbnailImageAlignment": { + "type": "ThumbnailImageAlignment", + "id": 2 + }, + "cardContent": { + "type": "RbmCardContent", + "id": 3 + } + }, + "nested": { + "CardOrientation": { + "values": { + "CARD_ORIENTATION_UNSPECIFIED": 0, + "HORIZONTAL": 1, + "VERTICAL": 2 + } + }, + "ThumbnailImageAlignment": { + "values": { + "THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED": 0, + "LEFT": 1, + "RIGHT": 2 + } + } + } + }, + "RbmCardContent": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "media": { + "type": "RbmMedia", + "id": 3 + }, + "suggestions": { + "rule": "repeated", + "type": "RbmSuggestion", + "id": 4 + } + }, + "nested": { + "RbmMedia": { + "fields": { + "fileUri": { + "type": "string", + "id": 1 + }, + "thumbnailUri": { + "type": "string", + "id": 2 + }, + "height": { + "type": "Height", + "id": 3 + } }, - { - "get": "/v2beta1/{parent=projects/*/agent/environments/*}/intents" + "nested": { + "Height": { + "values": { + "HEIGHT_UNSPECIFIED": 0, + "SHORT": 1, + "MEDIUM": 2, + "TALL": 3 + } + } + } + } + } + }, + "RbmSuggestion": { + "oneofs": { + "suggestion": { + "oneof": [ + "reply", + "action" + ] + } + }, + "fields": { + "reply": { + "type": "RbmSuggestedReply", + "id": 1 + }, + "action": { + "type": "RbmSuggestedAction", + "id": 2 + } + } + }, + "RbmSuggestedReply": { + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "postbackData": { + "type": "string", + "id": 2 + } + } + }, + "RbmSuggestedAction": { + "oneofs": { + "action": { + "oneof": [ + "dial", + "openUrl", + "shareLocation" + ] + } + }, + "fields": { + "text": { + "type": "string", + "id": 1 + }, + "postbackData": { + "type": "string", + "id": 2 + }, + "dial": { + "type": "RbmSuggestedActionDial", + "id": 3 + }, + "openUrl": { + "type": "RbmSuggestedActionOpenUri", + "id": 4 + }, + "shareLocation": { + "type": "RbmSuggestedActionShareLocation", + "id": 5 + } + }, + "nested": { + "RbmSuggestedActionDial": { + "fields": { + "phoneNumber": { + "type": "string", + "id": 1 + } + } + }, + "RbmSuggestedActionOpenUri": { + "fields": { + "uri": { + "type": "string", + "id": 1 + } + } + }, + "RbmSuggestedActionShareLocation": { + "fields": {} + } + } + }, + "MediaContent": { + "fields": { + "mediaType": { + "type": "ResponseMediaType", + "id": 1 + }, + "mediaObjects": { + "rule": "repeated", + "type": "ResponseMediaObject", + "id": 2 + } + }, + "nested": { + "ResponseMediaObject": { + "oneofs": { + "image": { + "oneof": [ + "largeImage", + "icon" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "largeImage": { + "type": "Image", + "id": 3 + }, + "icon": { + "type": "Image", + "id": 4 + }, + "contentUrl": { + "type": "string", + "id": 5 + } + } + }, + "ResponseMediaType": { + "values": { + "RESPONSE_MEDIA_TYPE_UNSPECIFIED": 0, + "AUDIO": 1 } - ] - } - }, - { - "(google.api.method_signature)": "parent" - }, - { - "(google.api.method_signature)": "parent,language_code" - } - ] - }, - "GetIntent": { - "requestType": "GetIntentRequest", - "responseType": "Intent", - "options": { - "(google.api.http).get": "/v2beta1/{name=projects/*/agent/intents/*}", - "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/locations/*/agent/intents/*}", - "(google.api.method_signature)": "name,language_code" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v2beta1/{name=projects/*/agent/intents/*}", - "additional_bindings": { - "get": "/v2beta1/{name=projects/*/locations/*/agent/intents/*}" } } }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.api.method_signature)": "name,language_code" - } - ] - }, - "CreateIntent": { - "requestType": "CreateIntentRequest", - "responseType": "Intent", - "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*/agent}/intents", - "(google.api.http).body": "intent", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent}/intents", - "(google.api.http).additional_bindings.body": "intent", - "(google.api.method_signature)": "parent,intent,language_code" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*/agent}/intents", - "body": "intent", - "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*/agent}/intents", - "body": "intent" + "BrowseCarouselCard": { + "fields": { + "items": { + "rule": "repeated", + "type": "BrowseCarouselCardItem", + "id": 1 + }, + "imageDisplayOptions": { + "type": "ImageDisplayOptions", + "id": 2 } - } - }, - { - "(google.api.method_signature)": "parent,intent" - }, - { - "(google.api.method_signature)": "parent,intent,language_code" - } - ] - }, - "UpdateIntent": { - "requestType": "UpdateIntentRequest", - "responseType": "Intent", - "options": { - "(google.api.http).patch": "/v2beta1/{intent.name=projects/*/agent/intents/*}", - "(google.api.http).body": "intent", - "(google.api.http).additional_bindings.patch": "/v2beta1/{intent.name=projects/*/locations/*/agent/intents/*}", - "(google.api.http).additional_bindings.body": "intent", - "(google.api.method_signature)": "intent,language_code,update_mask" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2beta1/{intent.name=projects/*/agent/intents/*}", - "body": "intent", - "additional_bindings": { - "patch": "/v2beta1/{intent.name=projects/*/locations/*/agent/intents/*}", - "body": "intent" + }, + "nested": { + "BrowseCarouselCardItem": { + "fields": { + "openUriAction": { + "type": "OpenUrlAction", + "id": 1 + }, + "title": { + "type": "string", + "id": 2 + }, + "description": { + "type": "string", + "id": 3 + }, + "image": { + "type": "Image", + "id": 4 + }, + "footer": { + "type": "string", + "id": 5 + } + }, + "nested": { + "OpenUrlAction": { + "fields": { + "url": { + "type": "string", + "id": 1 + }, + "urlTypeHint": { + "type": "UrlTypeHint", + "id": 3 + } + }, + "nested": { + "UrlTypeHint": { + "values": { + "URL_TYPE_HINT_UNSPECIFIED": 0, + "AMP_ACTION": 1, + "AMP_CONTENT": 2 + } + } + } + } + } + }, + "ImageDisplayOptions": { + "values": { + "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED": 0, + "GRAY": 1, + "WHITE": 2, + "CROPPED": 3, + "BLURRED_BACKGROUND": 4 + } } } }, - { - "(google.api.method_signature)": "intent,update_mask" - }, - { - "(google.api.method_signature)": "intent" - }, - { - "(google.api.method_signature)": "intent,language_code" - }, - { - "(google.api.method_signature)": "intent,language_code,update_mask" - } - ] - }, - "DeleteIntent": { - "requestType": "DeleteIntentRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2beta1/{name=projects/*/agent/intents/*}", - "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/locations/*/agent/intents/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2beta1/{name=projects/*/agent/intents/*}", - "additional_bindings": { - "delete": "/v2beta1/{name=projects/*/locations/*/agent/intents/*}" + "TableCard": { + "fields": { + "title": { + "type": "string", + "id": 1 + }, + "subtitle": { + "type": "string", + "id": 2 + }, + "image": { + "type": "Image", + "id": 3 + }, + "columnProperties": { + "rule": "repeated", + "type": "ColumnProperties", + "id": 4 + }, + "rows": { + "rule": "repeated", + "type": "TableCardRow", + "id": 5 + }, + "buttons": { + "rule": "repeated", + "type": "BasicCard.Button", + "id": 6 } } }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "BatchUpdateIntents": { - "requestType": "BatchUpdateIntentsRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*/agent}/intents:batchUpdate", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent}/intents:batchUpdate", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent,intent_batch_inline", - "(google.longrunning.operation_info).response_type": "google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*/agent}/intents:batchUpdate", - "body": "*", - "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*/agent}/intents:batchUpdate", - "body": "*" + "ColumnProperties": { + "fields": { + "header": { + "type": "string", + "id": 1 + }, + "horizontalAlignment": { + "type": "HorizontalAlignment", + "id": 2 + } + }, + "nested": { + "HorizontalAlignment": { + "values": { + "HORIZONTAL_ALIGNMENT_UNSPECIFIED": 0, + "LEADING": 1, + "CENTER": 2, + "TRAILING": 3 + } } } }, - { - "(google.api.method_signature)": "parent,intent_batch_uri" + "TableCardRow": { + "fields": { + "cells": { + "rule": "repeated", + "type": "TableCardCell", + "id": 1 + }, + "dividerAfter": { + "type": "bool", + "id": 2 + } + } }, - { - "(google.api.method_signature)": "parent,intent_batch_inline" + "TableCardCell": { + "fields": { + "text": { + "type": "string", + "id": 1 + } + } }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.cloud.dialogflow.v2beta1.BatchUpdateIntentsResponse", - "metadata_type": "google.protobuf.Struct" + "Platform": { + "values": { + "PLATFORM_UNSPECIFIED": 0, + "FACEBOOK": 1, + "SLACK": 2, + "TELEGRAM": 3, + "KIK": 4, + "SKYPE": 5, + "LINE": 6, + "VIBER": 7, + "ACTIONS_ON_GOOGLE": 8, + "TELEPHONY": 10, + "GOOGLE_HANGOUTS": 11 } } - ] + } }, - "BatchDeleteIntents": { - "requestType": "BatchDeleteIntentsRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*/agent}/intents:batchDelete", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent}/intents:batchDelete", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "parent,intents", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*/agent}/intents:batchDelete", - "body": "*", - "additional_bindings": { - "post": "/v2beta1/{parent=projects/*/locations/*/agent}/intents:batchDelete", - "body": "*" - } - } - }, - { - "(google.api.method_signature)": "parent,intents" + "FollowupIntentInfo": { + "fields": { + "followupIntentName": { + "type": "string", + "id": 1 }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "google.protobuf.Struct" - } + "parentFollowupIntentName": { + "type": "string", + "id": 2 } - ] + } + }, + "WebhookState": { + "values": { + "WEBHOOK_STATE_UNSPECIFIED": 0, + "WEBHOOK_STATE_ENABLED": 1, + "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING": 2 + } } } }, - "Intent": { - "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/Intent", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/agent/intents/{intent}" - }, + "ListIntentsRequest": { "fields": { - "name": { + "parent": { "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" } }, - "displayName": { + "languageCode": { "type": "string", "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "webhookState": { - "type": "WebhookState", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "priority": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "isFallback": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mlEnabled": { - "type": "bool", - "id": 5, - "options": { - "deprecated": true, - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "mlDisabled": { - "type": "bool", - "id": 19, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "endInteraction": { - "type": "bool", - "id": 21, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "intentView": { + "type": "IntentView", + "id": 3 }, - "inputContextNames": { - "rule": "repeated", - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "pageSize": { + "type": "int32", + "id": 4 }, - "events": { - "rule": "repeated", + "pageToken": { "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "trainingPhrases": { + "id": 5 + } + } + }, + "ListIntentsResponse": { + "fields": { + "intents": { "rule": "repeated", - "type": "TrainingPhrase", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "type": "Intent", + "id": 1 }, - "action": { + "nextPageToken": { "type": "string", - "id": 10, + "id": 2 + } + } + }, + "GetIntentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" } }, - "outputContexts": { - "rule": "repeated", - "type": "Context", - "id": 11, + "languageCode": { + "type": "string", + "id": 2, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "resetContexts": { - "type": "bool", - "id": 12, + "intentView": { + "type": "IntentView", + "id": 3 + } + } + }, + "CreateIntentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" } }, - "parameters": { - "rule": "repeated", - "type": "Parameter", - "id": 13, + "intent": { + "type": "Intent", + "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "messages": { - "rule": "repeated", - "type": "Message", - "id": 14 - }, - "defaultResponsePlatforms": { - "rule": "repeated", - "type": "Message.Platform", - "id": 15, + "languageCode": { + "type": "string", + "id": 3, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "rootFollowupIntentName": { - "type": "string", - "id": 16, + "intentView": { + "type": "IntentView", + "id": 4 + } + } + }, + "UpdateIntentRequest": { + "fields": { + "intent": { + "type": "Intent", + "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED" } }, - "parentFollowupIntentName": { + "languageCode": { "type": "string", - "id": 17, + "id": 2, "options": { "(google.api.field_behavior)": "OPTIONAL" } }, - "followupIntentInfo": { - "rule": "repeated", - "type": "FollowupIntentInfo", - "id": 18, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3 + }, + "intentView": { + "type": "IntentView", + "id": 4 + } + } + }, + "DeleteIntentRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" } } + } + }, + "BatchUpdateIntentsRequest": { + "oneofs": { + "intentBatch": { + "oneof": [ + "intentBatchUri", + "intentBatchInline" + ] + } }, - "nested": { - "TrainingPhrase": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "type": { - "type": "Type", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "parts": { - "rule": "repeated", - "type": "Part", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "timesAddedCount": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Part": { - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "entityType": { - "type": "string", - "id": 2 - }, - "alias": { - "type": "string", - "id": 3 - }, - "userDefined": { - "type": "bool", - "id": 4 - } - } - }, - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "EXAMPLE": 1, - "TEMPLATE": 2 - } - } - } - }, - "Parameter": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "displayName": { - "type": "string", - "id": 2 - }, - "value": { - "type": "string", - "id": 3 - }, - "defaultValue": { - "type": "string", - "id": 4 - }, - "entityTypeDisplayName": { - "type": "string", - "id": 5 - }, - "mandatory": { - "type": "bool", - "id": 6 - }, - "prompts": { - "rule": "repeated", - "type": "string", - "id": 7 - }, - "isList": { - "type": "bool", - "id": 8 - } + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" } - }, - "Message": { - "oneofs": { - "message": { - "oneof": [ - "text", - "image", - "quickReplies", - "card", - "payload", - "simpleResponses", - "basicCard", - "suggestions", - "linkOutSuggestion", - "listSelect", - "carouselSelect", - "telephonyPlayAudio", - "telephonySynthesizeSpeech", - "telephonyTransferCall", - "rbmText", - "rbmStandaloneRichCard", - "rbmCarouselRichCard", - "browseCarouselCard", - "tableCard", - "mediaContent" - ] - } - }, - "fields": { - "text": { - "type": "Text", - "id": 1 - }, - "image": { - "type": "Image", - "id": 2 - }, - "quickReplies": { - "type": "QuickReplies", - "id": 3 - }, - "card": { - "type": "Card", - "id": 4 - }, - "payload": { - "type": "google.protobuf.Struct", - "id": 5 - }, - "simpleResponses": { - "type": "SimpleResponses", - "id": 7 - }, - "basicCard": { - "type": "BasicCard", - "id": 8 - }, - "suggestions": { - "type": "Suggestions", - "id": 9 - }, - "linkOutSuggestion": { - "type": "LinkOutSuggestion", - "id": 10 - }, - "listSelect": { - "type": "ListSelect", - "id": 11 - }, - "carouselSelect": { - "type": "CarouselSelect", - "id": 12 - }, - "telephonyPlayAudio": { - "type": "TelephonyPlayAudio", - "id": 13 - }, - "telephonySynthesizeSpeech": { - "type": "TelephonySynthesizeSpeech", - "id": 14 - }, - "telephonyTransferCall": { - "type": "TelephonyTransferCall", - "id": 15 - }, - "rbmText": { - "type": "RbmText", - "id": 18 - }, - "rbmStandaloneRichCard": { - "type": "RbmStandaloneCard", - "id": 19 - }, - "rbmCarouselRichCard": { - "type": "RbmCarouselCard", - "id": 20 - }, - "browseCarouselCard": { - "type": "BrowseCarouselCard", - "id": 22 - }, - "tableCard": { - "type": "TableCard", - "id": 23 - }, - "mediaContent": { - "type": "MediaContent", - "id": 24 - }, - "platform": { - "type": "Platform", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } + }, + "intentBatchUri": { + "type": "string", + "id": 2 + }, + "intentBatchInline": { + "type": "IntentBatch", + "id": 3 + }, + "languageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 5 + }, + "intentView": { + "type": "IntentView", + "id": 6 + } + } + }, + "BatchUpdateIntentsResponse": { + "fields": { + "intents": { + "rule": "repeated", + "type": "Intent", + "id": 1 + } + } + }, + "BatchDeleteIntentsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + } + }, + "intents": { + "rule": "repeated", + "type": "Intent", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "IntentBatch": { + "fields": { + "intents": { + "rule": "repeated", + "type": "Intent", + "id": 1 + } + } + }, + "IntentView": { + "values": { + "INTENT_VIEW_UNSPECIFIED": 0, + "INTENT_VIEW_FULL": 1 + } + }, + "SessionEntityTypes": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListSessionEntityTypes": { + "requestType": "ListSessionEntityTypesRequest", + "responseType": "ListSessionEntityTypesResponse", + "options": { + "(google.api.http).get": "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes", + "(google.api.method_signature)": "parent" }, - "nested": { - "Text": { - "fields": { - "text": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Image": { - "fields": { - "imageUri": { - "type": "string", - "id": 1 - }, - "accessibilityText": { - "type": "string", - "id": 2 - } + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes", + "additional_bindings": [ + { + "get": "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes" + }, + { + "get": "/v2beta1/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes" + }, + { + "get": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes" + } + ] } }, - "QuickReplies": { - "fields": { - "title": { - "type": "string", - "id": 1 - }, - "quickReplies": { - "rule": "repeated", - "type": "string", - "id": 2 - } + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetSessionEntityType": { + "requestType": "GetSessionEntityTypeRequest", + "responseType": "SessionEntityType", + "options": { + "(google.api.http).get": "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}", + "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}", + "additional_bindings": [ + { + "get": "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" + }, + { + "get": "/v2beta1/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}" + }, + { + "get": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" + } + ] } }, - "Card": { - "fields": { - "title": { - "type": "string", - "id": 1 - }, - "subtitle": { - "type": "string", - "id": 2 - }, - "imageUri": { - "type": "string", - "id": 3 - }, - "buttons": { - "rule": "repeated", - "type": "Button", - "id": 4 - } - }, - "nested": { - "Button": { - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "postback": { - "type": "string", - "id": 2 - } + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateSessionEntityType": { + "requestType": "CreateSessionEntityTypeRequest", + "responseType": "SessionEntityType", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes", + "(google.api.http).body": "session_entity_type", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes", + "(google.api.http).additional_bindings.body": "session_entity_type", + "(google.api.method_signature)": "parent,session_entity_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes", + "body": "session_entity_type", + "additional_bindings": [ + { + "post": "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes", + "body": "session_entity_type" + }, + { + "post": "/v2beta1/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes", + "body": "session_entity_type" + }, + { + "post": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes", + "body": "session_entity_type" } - } + ] } }, - "SimpleResponse": { - "fields": { - "textToSpeech": { - "type": "string", - "id": 1 - }, - "ssml": { - "type": "string", - "id": 2 - }, - "displayText": { - "type": "string", - "id": 3 - } + { + "(google.api.method_signature)": "parent,session_entity_type" + } + ] + }, + "UpdateSessionEntityType": { + "requestType": "UpdateSessionEntityTypeRequest", + "responseType": "SessionEntityType", + "options": { + "(google.api.http).patch": "/v2beta1/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}", + "(google.api.http).body": "session_entity_type", + "(google.api.http).additional_bindings.patch": "/v2beta1/{session_entity_type.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", + "(google.api.http).additional_bindings.body": "session_entity_type", + "(google.api.method_signature)": "session_entity_type,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2beta1/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}", + "body": "session_entity_type", + "additional_bindings": [ + { + "patch": "/v2beta1/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", + "body": "session_entity_type" + }, + { + "patch": "/v2beta1/{session_entity_type.name=projects/*/locations/*/agent/sessions/*/entityTypes/*}", + "body": "session_entity_type" + }, + { + "patch": "/v2beta1/{session_entity_type.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", + "body": "session_entity_type" + } + ] } }, - "SimpleResponses": { - "fields": { - "simpleResponses": { - "rule": "repeated", - "type": "SimpleResponse", - "id": 1 - } - } + { + "(google.api.method_signature)": "session_entity_type" }, - "BasicCard": { - "fields": { - "title": { - "type": "string", - "id": 1 - }, - "subtitle": { - "type": "string", - "id": 2 - }, - "formattedText": { - "type": "string", - "id": 3 - }, - "image": { - "type": "Image", - "id": 4 - }, - "buttons": { - "rule": "repeated", - "type": "Button", - "id": 5 - } - }, - "nested": { - "Button": { - "fields": { - "title": { - "type": "string", - "id": 1 - }, - "openUriAction": { - "type": "OpenUriAction", - "id": 2 - } + { + "(google.api.method_signature)": "session_entity_type,update_mask" + } + ] + }, + "DeleteSessionEntityType": { + "requestType": "DeleteSessionEntityTypeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}", + "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}", + "additional_bindings": [ + { + "delete": "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" }, - "nested": { - "OpenUriAction": { - "fields": { - "uri": { - "type": "string", - "id": 1 - } - } - } + { + "delete": "/v2beta1/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}" + }, + { + "delete": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" } - } - } - }, - "Suggestion": { - "fields": { - "title": { - "type": "string", - "id": 1 - } + ] } }, - "Suggestions": { - "fields": { - "suggestions": { - "rule": "repeated", - "type": "Suggestion", - "id": 1 + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "SessionEntityType": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/SessionEntityType", + "(google.api.resource).pattern": "projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "entityOverrideMode": { + "type": "EntityOverrideMode", + "id": 2 + }, + "entities": { + "rule": "repeated", + "type": "EntityType.Entity", + "id": 3 + } + }, + "nested": { + "EntityOverrideMode": { + "values": { + "ENTITY_OVERRIDE_MODE_UNSPECIFIED": 0, + "ENTITY_OVERRIDE_MODE_OVERRIDE": 1, + "ENTITY_OVERRIDE_MODE_SUPPLEMENT": 2 + } + } + } + }, + "ListSessionEntityTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SessionEntityType" + } + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 + } + } + }, + "ListSessionEntityTypesResponse": { + "fields": { + "sessionEntityTypes": { + "rule": "repeated", + "type": "SessionEntityType", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetSessionEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SessionEntityType" + } + } + } + }, + "CreateSessionEntityTypeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SessionEntityType" + } + }, + "sessionEntityType": { + "type": "SessionEntityType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "UpdateSessionEntityTypeRequest": { + "fields": { + "sessionEntityType": { + "type": "SessionEntityType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2 + } + } + }, + "DeleteSessionEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/SessionEntityType" + } + } + } + }, + "EntityTypes": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListEntityTypes": { + "requestType": "ListEntityTypesRequest", + "responseType": "ListEntityTypesResponse", + "options": { + "(google.api.http).get": "/v2beta1/{parent=projects/*/agent}/entityTypes", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes", + "(google.api.method_signature)": "parent,language_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*/agent}/entityTypes", + "additional_bindings": { + "get": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes" } } }, - "LinkOutSuggestion": { - "fields": { - "destinationName": { - "type": "string", - "id": 1 - }, - "uri": { - "type": "string", - "id": 2 + { + "(google.api.method_signature)": "parent" + }, + { + "(google.api.method_signature)": "parent,language_code" + } + ] + }, + "GetEntityType": { + "requestType": "GetEntityTypeRequest", + "responseType": "EntityType", + "options": { + "(google.api.http).get": "/v2beta1/{name=projects/*/agent/entityTypes/*}", + "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/locations/*/agent/entityTypes/*}", + "(google.api.method_signature)": "name,language_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{name=projects/*/agent/entityTypes/*}", + "additional_bindings": { + "get": "/v2beta1/{name=projects/*/locations/*/agent/entityTypes/*}" } } }, - "ListSelect": { - "fields": { - "title": { - "type": "string", - "id": 1 - }, - "items": { - "rule": "repeated", - "type": "Item", - "id": 2 - }, - "subtitle": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Item": { - "fields": { - "info": { - "type": "SelectItemInfo", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "image": { - "type": "Image", - "id": 4 - } - } + { + "(google.api.method_signature)": "name" + }, + { + "(google.api.method_signature)": "name,language_code" + } + ] + }, + "CreateEntityType": { + "requestType": "CreateEntityTypeRequest", + "responseType": "EntityType", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/agent}/entityTypes", + "(google.api.http).body": "entity_type", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes", + "(google.api.http).additional_bindings.body": "entity_type", + "(google.api.method_signature)": "parent,entity_type,language_code" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/agent}/entityTypes", + "body": "entity_type", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes", + "body": "entity_type" } } }, - "CarouselSelect": { - "fields": { - "items": { - "rule": "repeated", - "type": "Item", - "id": 1 - } - }, - "nested": { - "Item": { - "fields": { - "info": { - "type": "SelectItemInfo", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "image": { - "type": "Image", - "id": 4 - } - } + { + "(google.api.method_signature)": "parent,entity_type" + }, + { + "(google.api.method_signature)": "parent,entity_type,language_code" + } + ] + }, + "UpdateEntityType": { + "requestType": "UpdateEntityTypeRequest", + "responseType": "EntityType", + "options": { + "(google.api.http).patch": "/v2beta1/{entity_type.name=projects/*/agent/entityTypes/*}", + "(google.api.http).body": "entity_type", + "(google.api.http).additional_bindings.patch": "/v2beta1/{entity_type.name=projects/*/locations/*/agent/entityTypes/*}", + "(google.api.http).additional_bindings.body": "entity_type", + "(google.api.method_signature)": "entity_type,language_code,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2beta1/{entity_type.name=projects/*/agent/entityTypes/*}", + "body": "entity_type", + "additional_bindings": { + "patch": "/v2beta1/{entity_type.name=projects/*/locations/*/agent/entityTypes/*}", + "body": "entity_type" } } }, - "SelectItemInfo": { - "fields": { - "key": { - "type": "string", - "id": 1 - }, - "synonyms": { - "rule": "repeated", - "type": "string", - "id": 2 + { + "(google.api.method_signature)": "entity_type" + }, + { + "(google.api.method_signature)": "entity_type,language_code" + }, + { + "(google.api.method_signature)": "entity_type,language_code,update_mask" + } + ] + }, + "DeleteEntityType": { + "requestType": "DeleteEntityTypeRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2beta1/{name=projects/*/agent/entityTypes/*}", + "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/locations/*/agent/entityTypes/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2beta1/{name=projects/*/agent/entityTypes/*}", + "additional_bindings": { + "delete": "/v2beta1/{name=projects/*/locations/*/agent/entityTypes/*}" } } }, - "TelephonyPlayAudio": { - "fields": { - "audioUri": { - "type": "string", - "id": 1 + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchUpdateEntityTypes": { + "requestType": "BatchUpdateEntityTypesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/agent}/entityTypes:batchUpdate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes:batchUpdate", + "(google.api.http).additional_bindings.body": "*", + "(google.longrunning.operation_info).response_type": "google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/agent}/entityTypes:batchUpdate", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes:batchUpdate", + "body": "*" } } }, - "TelephonySynthesizeSpeech": { - "oneofs": { - "source": { - "oneof": [ - "text", - "ssml" - ] - } - }, - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "ssml": { - "type": "string", - "id": 2 + { + "(google.longrunning.operation_info)": { + "response_type": "google.cloud.dialogflow.v2beta1.BatchUpdateEntityTypesResponse", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "BatchDeleteEntityTypes": { + "requestType": "BatchDeleteEntityTypesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/agent}/entityTypes:batchDelete", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes:batchDelete", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,entity_type_names", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/agent}/entityTypes:batchDelete", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/agent}/entityTypes:batchDelete", + "body": "*" } } }, - "TelephonyTransferCall": { - "fields": { - "phoneNumber": { - "type": "string", - "id": 1 - } - } + { + "(google.api.method_signature)": "parent,entity_type_names" }, - "RbmText": { - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "rbmSuggestion": { - "rule": "repeated", - "type": "RbmSuggestion", - "id": 2 + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "BatchCreateEntities": { + "requestType": "BatchCreateEntitiesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchCreate", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,entities,language_code", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchCreate", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchCreate", + "body": "*" } } }, - "RbmCarouselCard": { - "fields": { - "cardWidth": { - "type": "CardWidth", - "id": 1 - }, - "cardContents": { - "rule": "repeated", - "type": "RbmCardContent", - "id": 2 - } - }, - "nested": { - "CardWidth": { - "values": { - "CARD_WIDTH_UNSPECIFIED": 0, - "SMALL": 1, - "MEDIUM": 2 - } + { + "(google.api.method_signature)": "parent,entities" + }, + { + "(google.api.method_signature)": "parent,entities,language_code" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "BatchUpdateEntities": { + "requestType": "BatchUpdateEntitiesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchUpdate", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,entities,language_code", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchUpdate", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchUpdate", + "body": "*" } } }, - "RbmStandaloneCard": { - "fields": { - "cardOrientation": { - "type": "CardOrientation", - "id": 1 - }, - "thumbnailImageAlignment": { - "type": "ThumbnailImageAlignment", - "id": 2 - }, - "cardContent": { - "type": "RbmCardContent", - "id": 3 - } - }, - "nested": { - "CardOrientation": { - "values": { - "CARD_ORIENTATION_UNSPECIFIED": 0, - "HORIZONTAL": 1, - "VERTICAL": 2 - } - }, - "ThumbnailImageAlignment": { - "values": { - "THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED": 0, - "LEFT": 1, - "RIGHT": 2 - } + { + "(google.api.method_signature)": "parent,entities" + }, + { + "(google.api.method_signature)": "parent,entities,language_code" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + }, + "BatchDeleteEntities": { + "requestType": "BatchDeleteEntitiesRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchDelete", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,entity_values,language_code", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "google.protobuf.Struct" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/agent/entityTypes/*}/entities:batchDelete", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/agent/entityTypes/*}/entities:batchDelete", + "body": "*" } } }, - "RbmCardContent": { - "fields": { - "title": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 2 - }, - "media": { - "type": "RbmMedia", - "id": 3 - }, - "suggestions": { - "rule": "repeated", - "type": "RbmSuggestion", - "id": 4 - } - }, - "nested": { - "RbmMedia": { - "fields": { - "fileUri": { - "type": "string", - "id": 1 - }, - "thumbnailUri": { - "type": "string", - "id": 2 - }, - "height": { - "type": "Height", - "id": 3 - } - }, - "nested": { - "Height": { - "values": { - "HEIGHT_UNSPECIFIED": 0, - "SHORT": 1, - "MEDIUM": 2, - "TALL": 3 - } - } - } - } + { + "(google.api.method_signature)": "parent,entity_values" + }, + { + "(google.api.method_signature)": "parent,entity_values,language_code" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "google.protobuf.Struct" + } + } + ] + } + } + }, + "EntityType": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/EntityType", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/agent/entityTypes/{entity_type}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "kind": { + "type": "Kind", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "autoExpansionMode": { + "type": "AutoExpansionMode", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "entities": { + "rule": "repeated", + "type": "Entity", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enableFuzzyExtraction": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Entity": { + "fields": { + "value": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" } }, - "RbmSuggestion": { - "oneofs": { - "suggestion": { - "oneof": [ - "reply", - "action" - ] - } - }, - "fields": { - "reply": { - "type": "RbmSuggestedReply", - "id": 1 - }, - "action": { - "type": "RbmSuggestedAction", - "id": 2 + "synonyms": { + "rule": "repeated", + "type": "string", + "id": 2 + } + } + }, + "Kind": { + "values": { + "KIND_UNSPECIFIED": 0, + "KIND_MAP": 1, + "KIND_LIST": 2, + "KIND_REGEXP": 3 + } + }, + "AutoExpansionMode": { + "values": { + "AUTO_EXPANSION_MODE_UNSPECIFIED": 0, + "AUTO_EXPANSION_MODE_DEFAULT": 1 + } + } + } + }, + "ListEntityTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListEntityTypesResponse": { + "fields": { + "entityTypes": { + "rule": "repeated", + "type": "EntityType", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CreateEntityTypeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityType": { + "type": "EntityType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateEntityTypeRequest": { + "fields": { + "entityType": { + "type": "EntityType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteEntityTypeRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + } + } + }, + "BatchUpdateEntityTypesRequest": { + "oneofs": { + "entityTypeBatch": { + "oneof": [ + "entityTypeBatchUri", + "entityTypeBatchInline" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityTypeBatchUri": { + "type": "string", + "id": 2 + }, + "entityTypeBatchInline": { + "type": "EntityTypeBatch", + "id": 3 + }, + "languageCode": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchUpdateEntityTypesResponse": { + "fields": { + "entityTypes": { + "rule": "repeated", + "type": "EntityType", + "id": 1 + } + } + }, + "BatchDeleteEntityTypesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityTypeNames": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateEntitiesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "entities": { + "rule": "repeated", + "type": "EntityType.Entity", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BatchUpdateEntitiesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "entities": { + "rule": "repeated", + "type": "EntityType.Entity", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 4 + } + } + }, + "BatchDeleteEntitiesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/EntityType" + } + }, + "entityValues": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "languageCode": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "EntityTypeBatch": { + "fields": { + "entityTypes": { + "rule": "repeated", + "type": "EntityType", + "id": 1 + } + } + }, + "Conversations": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "CreateConversation": { + "requestType": "CreateConversationRequest", + "responseType": "Conversation", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*}/conversations", + "(google.api.http).body": "conversation", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*}/conversations", + "(google.api.http).additional_bindings.body": "conversation", + "(google.api.method_signature)": "parent,conversation" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*}/conversations", + "body": "conversation", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*}/conversations", + "body": "conversation" } } }, - "RbmSuggestedReply": { - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "postbackData": { - "type": "string", - "id": 2 + { + "(google.api.method_signature)": "parent,conversation" + } + ] + }, + "ListConversations": { + "requestType": "ListConversationsRequest", + "responseType": "ListConversationsResponse", + "options": { + "(google.api.http).get": "/v2beta1/{parent=projects/*}/conversations", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*}/conversations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*}/conversations", + "additional_bindings": { + "get": "/v2beta1/{parent=projects/*/locations/*}/conversations" } } }, - "RbmSuggestedAction": { - "oneofs": { - "action": { - "oneof": [ - "dial", - "openUrl", - "shareLocation" - ] - } - }, - "fields": { - "text": { - "type": "string", - "id": 1 - }, - "postbackData": { - "type": "string", - "id": 2 - }, - "dial": { - "type": "RbmSuggestedActionDial", - "id": 3 - }, - "openUrl": { - "type": "RbmSuggestedActionOpenUri", - "id": 4 - }, - "shareLocation": { - "type": "RbmSuggestedActionShareLocation", - "id": 5 - } - }, - "nested": { - "RbmSuggestedActionDial": { - "fields": { - "phoneNumber": { - "type": "string", - "id": 1 - } - } - }, - "RbmSuggestedActionOpenUri": { - "fields": { - "uri": { - "type": "string", - "id": 1 - } - } - }, - "RbmSuggestedActionShareLocation": { - "fields": {} + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetConversation": { + "requestType": "GetConversationRequest", + "responseType": "Conversation", + "options": { + "(google.api.http).get": "/v2beta1/{name=projects/*/conversations/*}", + "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/locations/*/conversations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{name=projects/*/conversations/*}", + "additional_bindings": { + "get": "/v2beta1/{name=projects/*/locations/*/conversations/*}" } } }, - "MediaContent": { - "fields": { - "mediaType": { - "type": "ResponseMediaType", - "id": 1 - }, - "mediaObjects": { - "rule": "repeated", - "type": "ResponseMediaObject", - "id": 2 - } - }, - "nested": { - "ResponseMediaObject": { - "oneofs": { - "image": { - "oneof": [ - "largeImage", - "icon" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 2 - }, - "largeImage": { - "type": "Image", - "id": 3 - }, - "icon": { - "type": "Image", - "id": 4 - }, - "contentUrl": { - "type": "string", - "id": 5 - } - } - }, - "ResponseMediaType": { - "values": { - "RESPONSE_MEDIA_TYPE_UNSPECIFIED": 0, - "AUDIO": 1 - } + { + "(google.api.method_signature)": "name" + } + ] + }, + "CompleteConversation": { + "requestType": "CompleteConversationRequest", + "responseType": "Conversation", + "options": { + "(google.api.http).post": "/v2beta1/{name=projects/*/conversations/*}:complete", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{name=projects/*/locations/*/conversations/*}:complete", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{name=projects/*/conversations/*}:complete", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{name=projects/*/locations/*/conversations/*}:complete", + "body": "*" } } }, - "BrowseCarouselCard": { - "fields": { - "items": { - "rule": "repeated", - "type": "BrowseCarouselCardItem", - "id": 1 - }, - "imageDisplayOptions": { - "type": "ImageDisplayOptions", - "id": 2 - } - }, - "nested": { - "BrowseCarouselCardItem": { - "fields": { - "openUriAction": { - "type": "OpenUrlAction", - "id": 1 - }, - "title": { - "type": "string", - "id": 2 - }, - "description": { - "type": "string", - "id": 3 - }, - "image": { - "type": "Image", - "id": 4 - }, - "footer": { - "type": "string", - "id": 5 - } - }, - "nested": { - "OpenUrlAction": { - "fields": { - "url": { - "type": "string", - "id": 1 - }, - "urlTypeHint": { - "type": "UrlTypeHint", - "id": 3 - } - }, - "nested": { - "UrlTypeHint": { - "values": { - "URL_TYPE_HINT_UNSPECIFIED": 0, - "AMP_ACTION": 1, - "AMP_CONTENT": 2 - } - } - } - } - } - }, - "ImageDisplayOptions": { - "values": { - "IMAGE_DISPLAY_OPTIONS_UNSPECIFIED": 0, - "GRAY": 1, - "WHITE": 2, - "CROPPED": 3, - "BLURRED_BACKGROUND": 4 - } + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateCallMatcher": { + "requestType": "CreateCallMatcherRequest", + "responseType": "CallMatcher", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/conversations/*}/callMatchers", + "(google.api.http).body": "call_matcher", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/conversations/*}/callMatchers", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent,call_matcher" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/conversations/*}/callMatchers", + "body": "call_matcher", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/conversations/*}/callMatchers", + "body": "*" } } }, - "TableCard": { - "fields": { - "title": { - "type": "string", - "id": 1 - }, - "subtitle": { - "type": "string", - "id": 2 - }, - "image": { - "type": "Image", - "id": 3 - }, - "columnProperties": { - "rule": "repeated", - "type": "ColumnProperties", - "id": 4 - }, - "rows": { - "rule": "repeated", - "type": "TableCardRow", - "id": 5 - }, - "buttons": { - "rule": "repeated", - "type": "BasicCard.Button", - "id": 6 + { + "(google.api.method_signature)": "parent,call_matcher" + } + ] + }, + "ListCallMatchers": { + "requestType": "ListCallMatchersRequest", + "responseType": "ListCallMatchersResponse", + "options": { + "(google.api.http).get": "/v2beta1/{parent=projects/*/conversations/*}/callMatchers", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*/conversations/*}/callMatchers", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*/conversations/*}/callMatchers", + "additional_bindings": { + "get": "/v2beta1/{parent=projects/*/locations/*/conversations/*}/callMatchers" } } }, - "ColumnProperties": { - "fields": { - "header": { - "type": "string", - "id": 1 - }, - "horizontalAlignment": { - "type": "HorizontalAlignment", - "id": 2 - } - }, - "nested": { - "HorizontalAlignment": { - "values": { - "HORIZONTAL_ALIGNMENT_UNSPECIFIED": 0, - "LEADING": 1, - "CENTER": 2, - "TRAILING": 3 - } + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteCallMatcher": { + "requestType": "DeleteCallMatcherRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2beta1/{name=projects/*/conversations/*/callMatchers/*}", + "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/locations/*/conversations/*/callMatchers/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2beta1/{name=projects/*/conversations/*/callMatchers/*}", + "additional_bindings": { + "delete": "/v2beta1/{name=projects/*/locations/*/conversations/*/callMatchers/*}" } } }, - "TableCardRow": { - "fields": { - "cells": { - "rule": "repeated", - "type": "TableCardCell", - "id": 1 - }, - "dividerAfter": { - "type": "bool", - "id": 2 + { + "(google.api.method_signature)": "name" + } + ] + }, + "BatchCreateMessages": { + "requestType": "BatchCreateMessagesRequest", + "responseType": "BatchCreateMessagesResponse", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/conversations/*}/messages:batchCreate", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/conversations/*}/messages:batchCreate", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/conversations/*}/messages:batchCreate", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/conversations/*}/messages:batchCreate", + "body": "*" } } }, - "TableCardCell": { - "fields": { - "text": { - "type": "string", - "id": 1 + { + "(google.api.method_signature)": "parent" + } + ] + }, + "ListMessages": { + "requestType": "ListMessagesRequest", + "responseType": "ListMessagesResponse", + "options": { + "(google.api.http).get": "/v2beta1/{parent=projects/*/conversations/*}/messages", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*/conversations/*}/messages", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*/conversations/*}/messages", + "additional_bindings": { + "get": "/v2beta1/{parent=projects/*/locations/*/conversations/*}/messages" } } }, - "Platform": { - "values": { - "PLATFORM_UNSPECIFIED": 0, - "FACEBOOK": 1, - "SLACK": 2, - "TELEGRAM": 3, - "KIK": 4, - "SKYPE": 5, - "LINE": 6, - "VIBER": 7, - "ACTIONS_ON_GOOGLE": 8, - "TELEPHONY": 10, - "GOOGLE_HANGOUTS": 11 - } + { + "(google.api.method_signature)": "parent" } + ] + } + } + }, + "Conversation": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Conversation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/conversations/{conversation}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lifecycleState": { + "type": "LifecycleState", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conversationProfile": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ConversationProfile" + } + }, + "phoneNumber": { + "type": "ConversationPhoneNumber", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "conversationStage": { + "type": "ConversationStage", + "id": 7 + }, + "startTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" } }, - "FollowupIntentInfo": { + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LifecycleState": { + "values": { + "LIFECYCLE_STATE_UNSPECIFIED": 0, + "IN_PROGRESS": 1, + "COMPLETED": 2 + } + }, + "ConversationStage": { + "values": { + "CONVERSATION_STAGE_UNSPECIFIED": 0, + "VIRTUAL_AGENT_STAGE": 1, + "HUMAN_ASSIST_STAGE": 2 + } + } + } + }, + "ConversationPhoneNumber": { + "fields": { + "phoneNumber": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CallMatcher": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/CallMatcher", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "toHeader": { + "type": "string", + "id": 2 + }, + "fromHeader": { + "type": "string", + "id": 3 + }, + "callIdHeader": { + "type": "string", + "id": 4 + }, + "customHeaders": { + "type": "CustomHeaders", + "id": 5 + } + }, + "nested": { + "CustomHeaders": { "fields": { - "followupIntentName": { + "ciscoGuid": { "type": "string", "id": 1 - }, - "parentFollowupIntentName": { - "type": "string", - "id": 2 } } - }, - "WebhookState": { - "values": { - "WEBHOOK_STATE_UNSPECIFIED": 0, - "WEBHOOK_STATE_ENABLED": 1, - "WEBHOOK_STATE_ENABLED_FOR_SLOT_FILLING": 2 - } } } }, - "ListIntentsRequest": { + "CreateConversationRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Conversation" } }, - "languageCode": { - "type": "string", + "conversation": { + "type": "Conversation", "id": 2, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED" } }, - "intentView": { - "type": "IntentView", - "id": 3 + "conversationId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListConversationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Conversation" + } }, "pageSize": { "type": "int32", - "id": 4 + "id": 2 }, "pageToken": { "type": "string", - "id": 5 + "id": 3 + }, + "filter": { + "type": "string", + "id": 4 } } }, - "ListIntentsResponse": { + "ListConversationsResponse": { "fields": { - "intents": { + "conversations": { "rule": "repeated", - "type": "Intent", + "type": "Conversation", "id": 1 }, "nextPageToken": { @@ -7724,210 +13182,235 @@ } } }, - "GetIntentRequest": { + "GetConversationRequest": { "fields": { "name": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Conversation" } - }, - "languageCode": { + } + } + }, + "CompleteConversationRequest": { + "fields": { + "name": { "type": "string", - "id": 2, + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Conversation" } - }, - "intentView": { - "type": "IntentView", - "id": 3 } } }, - "CreateIntentRequest": { + "CreateCallMatcherRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" - } - }, - "intent": { - "type": "Intent", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "languageCode": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/CallMatcher" } }, - "intentView": { - "type": "IntentView", - "id": 4 + "callMatcher": { + "type": "CallMatcher", + "id": 2 } } }, - "UpdateIntentRequest": { + "ListCallMatchersRequest": { "fields": { - "intent": { - "type": "Intent", + "parent": { + "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/CallMatcher" } }, - "languageCode": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } + "pageSize": { + "type": "int32", + "id": 2 }, - "updateMask": { - "type": "google.protobuf.FieldMask", + "pageToken": { + "type": "string", "id": 3 + } + } + }, + "ListCallMatchersResponse": { + "fields": { + "callMatchers": { + "rule": "repeated", + "type": "CallMatcher", + "id": 1 }, - "intentView": { - "type": "IntentView", - "id": 4 + "nextPageToken": { + "type": "string", + "id": 2 } } }, - "DeleteIntentRequest": { + "DeleteCallMatcherRequest": { "fields": { "name": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Intent" + "(google.api.resource_reference).type": "dialogflow.googleapis.com/CallMatcher" } } } }, - "BatchUpdateIntentsRequest": { - "oneofs": { - "intentBatch": { - "oneof": [ - "intentBatchUri", - "intentBatchInline" - ] - } - }, + "CreateMessageRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Conversation" } }, - "intentBatchUri": { - "type": "string", - "id": 2 - }, - "intentBatchInline": { - "type": "IntentBatch", - "id": 3 - }, - "languageCode": { + "message": { + "type": "Message", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "BatchCreateMessagesRequest": { + "fields": { + "parent": { "type": "string", - "id": 4, + "id": 1, "options": { - "(google.api.field_behavior)": "OPTIONAL" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Conversation" } }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 5 - }, - "intentView": { - "type": "IntentView", - "id": 6 + "requests": { + "rule": "repeated", + "type": "CreateMessageRequest", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - "BatchUpdateIntentsResponse": { + "BatchCreateMessagesResponse": { "fields": { - "intents": { + "messages": { "rule": "repeated", - "type": "Intent", + "type": "Message", "id": 1 } } }, - "BatchDeleteIntentsRequest": { + "ListMessagesRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Intent" + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Message" } }, - "intents": { - "rule": "repeated", - "type": "Intent", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } + "filter": { + "type": "string", + "id": 4 + }, + "pageSize": { + "type": "int32", + "id": 2 + }, + "pageToken": { + "type": "string", + "id": 3 } } }, - "IntentBatch": { + "ListMessagesResponse": { "fields": { - "intents": { + "messages": { "rule": "repeated", - "type": "Intent", + "type": "Message", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ConversationEvent": { + "oneofs": { + "payload": { + "oneof": [ + "newMessagePayload" + ] + } + }, + "fields": { + "conversation": { + "type": "string", "id": 1 + }, + "type": { + "type": "Type", + "id": 2 + }, + "errorStatus": { + "type": "google.rpc.Status", + "id": 3 + }, + "newMessagePayload": { + "type": "Message", + "id": 4 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "CONVERSATION_STARTED": 1, + "CONVERSATION_FINISHED": 2, + "NEW_MESSAGE": 5, + "UNRECOVERABLE_ERROR": 4 + } } } }, - "IntentView": { - "values": { - "INTENT_VIEW_UNSPECIFIED": 0, - "INTENT_VIEW_FULL": 1 - } - }, - "KnowledgeBases": { + "ConversationProfiles": { "options": { "(google.api.default_host)": "dialogflow.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" }, "methods": { - "ListKnowledgeBases": { - "requestType": "ListKnowledgeBasesRequest", - "responseType": "ListKnowledgeBasesResponse", + "ListConversationProfiles": { + "requestType": "ListConversationProfilesRequest", + "responseType": "ListConversationProfilesResponse", "options": { - "(google.api.http).get": "/v2beta1/{parent=projects/*}/knowledgeBases", - "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/agent}/knowledgeBases", + "(google.api.http).get": "/v2beta1/{parent=projects/*}/conversationProfiles", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*}/conversationProfiles", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2beta1/{parent=projects/*}/knowledgeBases", - "additional_bindings": [ - { - "get": "/v2beta1/{parent=projects/*/locations/*}/knowledgeBases" - }, - { - "get": "/v2beta1/{parent=projects/*/agent}/knowledgeBases" - } - ] + "get": "/v2beta1/{parent=projects/*}/conversationProfiles", + "additional_bindings": { + "get": "/v2beta1/{parent=projects/*/locations/*}/conversationProfiles" + } } }, { @@ -7935,26 +13418,21 @@ } ] }, - "GetKnowledgeBase": { - "requestType": "GetKnowledgeBaseRequest", - "responseType": "KnowledgeBase", + "GetConversationProfile": { + "requestType": "GetConversationProfileRequest", + "responseType": "ConversationProfile", "options": { - "(google.api.http).get": "/v2beta1/{name=projects/*/knowledgeBases/*}", - "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/agent/knowledgeBases/*}", + "(google.api.http).get": "/v2beta1/{name=projects/*/conversationProfiles/*}", + "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/locations/*/conversationProfiles/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2beta1/{name=projects/*/knowledgeBases/*}", - "additional_bindings": [ - { - "get": "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*}" - }, - { - "get": "/v2beta1/{name=projects/*/agent/knowledgeBases/*}" - } - ] + "get": "/v2beta1/{name=projects/*/conversationProfiles/*}", + "additional_bindings": { + "get": "/v2beta1/{name=projects/*/locations/*/conversationProfiles/*}" + } } }, { @@ -7962,133 +13440,449 @@ } ] }, - "CreateKnowledgeBase": { - "requestType": "CreateKnowledgeBaseRequest", - "responseType": "KnowledgeBase", + "CreateConversationProfile": { + "requestType": "CreateConversationProfileRequest", + "responseType": "ConversationProfile", "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*}/knowledgeBases", - "(google.api.http).body": "knowledge_base", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/agent}/knowledgeBases", - "(google.api.http).additional_bindings.body": "knowledge_base", - "(google.api.method_signature)": "parent,knowledge_base" + "(google.api.http).post": "/v2beta1/{parent=projects/*}/conversationProfiles", + "(google.api.http).body": "conversation_profile", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*}/conversationProfiles", + "(google.api.http).additional_bindings.body": "conversation_profile", + "(google.api.method_signature)": "parent,conversation_profile" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*}/knowledgeBases", - "body": "knowledge_base", - "additional_bindings": [ - { - "post": "/v2beta1/{parent=projects/*/locations/*}/knowledgeBases", - "body": "knowledge_base" - }, - { - "post": "/v2beta1/{parent=projects/*/agent}/knowledgeBases", - "body": "knowledge_base" + "post": "/v2beta1/{parent=projects/*}/conversationProfiles", + "body": "conversation_profile", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*}/conversationProfiles", + "body": "conversation_profile" + } + } + }, + { + "(google.api.method_signature)": "parent,conversation_profile" + } + ] + }, + "UpdateConversationProfile": { + "requestType": "UpdateConversationProfileRequest", + "responseType": "ConversationProfile", + "options": { + "(google.api.http).patch": "/v2beta1/{conversation_profile.name=projects/*/conversationProfiles/*}", + "(google.api.http).body": "conversation_profile", + "(google.api.http).additional_bindings.patch": "/v2beta1/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}", + "(google.api.http).additional_bindings.body": "conversation_profile", + "(google.api.method_signature)": "conversation_profile,update_mask" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2beta1/{conversation_profile.name=projects/*/conversationProfiles/*}", + "body": "conversation_profile", + "additional_bindings": { + "patch": "/v2beta1/{conversation_profile.name=projects/*/locations/*/conversationProfiles/*}", + "body": "conversation_profile" + } + } + }, + { + "(google.api.method_signature)": "conversation_profile,update_mask" + } + ] + }, + "DeleteConversationProfile": { + "requestType": "DeleteConversationProfileRequest", + "responseType": "google.protobuf.Empty", + "options": { + "(google.api.http).delete": "/v2beta1/{name=projects/*/conversationProfiles/*}", + "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/locations/*/conversationProfiles/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2beta1/{name=projects/*/conversationProfiles/*}", + "additional_bindings": { + "delete": "/v2beta1/{name=projects/*/locations/*/conversationProfiles/*}" + } + } + }, + { + "(google.api.method_signature)": "name" + } + ] + } + } + }, + "ConversationProfile": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/ConversationProfile", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}" + }, + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "automatedAgentConfig": { + "type": "AutomatedAgentConfig", + "id": 3 + }, + "humanAgentAssistantConfig": { + "type": "HumanAgentAssistantConfig", + "id": 4 + }, + "humanAgentHandoffConfig": { + "type": "HumanAgentHandoffConfig", + "id": 5 + }, + "notificationConfig": { + "type": "NotificationConfig", + "id": 6 + }, + "loggingConfig": { + "type": "LoggingConfig", + "id": 7 + }, + "newMessageEventNotificationConfig": { + "type": "NotificationConfig", + "id": 8 + }, + "sttConfig": { + "type": "SpeechToTextConfig", + "id": 9 + }, + "languageCode": { + "type": "string", + "id": 10 + } + } + }, + "AutomatedAgentConfig": { + "fields": { + "agent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + } + } + }, + "HumanAgentAssistantConfig": { + "fields": { + "notificationConfig": { + "type": "NotificationConfig", + "id": 2 + }, + "humanAgentSuggestionConfig": { + "type": "SuggestionConfig", + "id": 3 + }, + "endUserSuggestionConfig": { + "type": "SuggestionConfig", + "id": 4 + }, + "messageAnalysisConfig": { + "type": "MessageAnalysisConfig", + "id": 5 + } + }, + "nested": { + "SuggestionTriggerSettings": { + "fields": { + "noSmallTalk": { + "type": "bool", + "id": 1 + }, + "onlyEndUser": { + "type": "bool", + "id": 2 + } + } + }, + "SuggestionFeatureConfig": { + "fields": { + "suggestionFeature": { + "type": "SuggestionFeature", + "id": 5 + }, + "enableEventBasedSuggestion": { + "type": "bool", + "id": 3 + }, + "suggestionTriggerSettings": { + "type": "SuggestionTriggerSettings", + "id": 10 + }, + "queryConfig": { + "type": "SuggestionQueryConfig", + "id": 6 + }, + "conversationModelConfig": { + "type": "ConversationModelConfig", + "id": 7 + } + } + }, + "SuggestionConfig": { + "fields": { + "featureConfigs": { + "rule": "repeated", + "type": "SuggestionFeatureConfig", + "id": 2 + }, + "groupSuggestionResponses": { + "type": "bool", + "id": 3 + } + } + }, + "SuggestionQueryConfig": { + "oneofs": { + "querySource": { + "oneof": [ + "knowledgeBaseQuerySource", + "documentQuerySource", + "dialogflowQuerySource" + ] + } + }, + "fields": { + "knowledgeBaseQuerySource": { + "type": "KnowledgeBaseQuerySource", + "id": 1 + }, + "documentQuerySource": { + "type": "DocumentQuerySource", + "id": 2 + }, + "dialogflowQuerySource": { + "type": "DialogflowQuerySource", + "id": 3 + }, + "maxResults": { + "type": "int32", + "id": 4 + }, + "confidenceThreshold": { + "type": "float", + "id": 5 + }, + "contextFilterSettings": { + "type": "ContextFilterSettings", + "id": 7 + } + }, + "nested": { + "KnowledgeBaseQuerySource": { + "fields": { + "knowledgeBases": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/KnowledgeBase" } - ] + } + } + }, + "DocumentQuerySource": { + "fields": { + "documents": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" + } + } + } + }, + "DialogflowQuerySource": { + "fields": { + "agent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Agent" + } + } } }, - { - "(google.api.method_signature)": "parent,knowledge_base" + "ContextFilterSettings": { + "fields": { + "dropHandoffMessages": { + "type": "bool", + "id": 1 + }, + "dropVirtualAgentMessages": { + "type": "bool", + "id": 2 + }, + "dropIvrMessages": { + "type": "bool", + "id": 3 + } + } } - ] + } }, - "DeleteKnowledgeBase": { - "requestType": "DeleteKnowledgeBaseRequest", - "responseType": "google.protobuf.Empty", - "options": { - "(google.api.http).delete": "/v2beta1/{name=projects/*/knowledgeBases/*}", - "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/agent/knowledgeBases/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v2beta1/{name=projects/*/knowledgeBases/*}", - "additional_bindings": [ - { - "delete": "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*}" - }, - { - "delete": "/v2beta1/{name=projects/*/agent/knowledgeBases/*}" - } - ] + "ConversationModelConfig": { + "fields": { + "model": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ConversationModel" } + } + } + }, + "MessageAnalysisConfig": { + "fields": { + "enableEntityExtraction": { + "type": "bool", + "id": 2 }, - { - "(google.api.method_signature)": "name" + "enableSentimentAnalysis": { + "type": "bool", + "id": 3 } + } + } + } + }, + "HumanAgentHandoffConfig": { + "oneofs": { + "agentService": { + "oneof": [ + "livePersonConfig", + "salesforceLiveAgentConfig" ] + } + }, + "fields": { + "livePersonConfig": { + "type": "LivePersonConfig", + "id": 1 }, - "UpdateKnowledgeBase": { - "requestType": "UpdateKnowledgeBaseRequest", - "responseType": "KnowledgeBase", - "options": { - "(google.api.http).patch": "/v2beta1/{knowledge_base.name=projects/*/knowledgeBases/*}", - "(google.api.http).body": "knowledge_base", - "(google.api.http).additional_bindings.patch": "/v2beta1/{knowledge_base.name=projects/*/agent/knowledgeBases/*}", - "(google.api.http).additional_bindings.body": "knowledge_base", - "(google.api.method_signature)": "knowledge_base" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v2beta1/{knowledge_base.name=projects/*/knowledgeBases/*}", - "body": "knowledge_base", - "additional_bindings": [ - { - "patch": "/v2beta1/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}", - "body": "knowledge_base" - }, - { - "patch": "/v2beta1/{knowledge_base.name=projects/*/agent/knowledgeBases/*}", - "body": "knowledge_base" - } - ] + "salesforceLiveAgentConfig": { + "type": "SalesforceLiveAgentConfig", + "id": 2 + } + }, + "nested": { + "LivePersonConfig": { + "fields": { + "accountNumber": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "SalesforceLiveAgentConfig": { + "fields": { + "organizationId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" } }, - { - "(google.api.method_signature)": "knowledge_base,update_mask" + "deploymentId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - { - "(google.api.method_signature)": "knowledge_base" + "buttonId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endpointDomain": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } - ] + } } } }, - "KnowledgeBase": { - "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/KnowledgeBase", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}" - }, + "NotificationConfig": { "fields": { - "name": { + "topic": { "type": "string", "id": 1 }, - "displayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "messageFormat": { + "type": "MessageFormat", + "id": 2 + } + }, + "nested": { + "MessageFormat": { + "values": { + "MESSAGE_FORMAT_UNSPECIFIED": 0, + "PROTO": 1, + "JSON": 2 } - }, - "languageCode": { - "type": "string", - "id": 4 } } }, - "ListKnowledgeBasesRequest": { + "LoggingConfig": { + "fields": { + "enableStackdriverLogging": { + "type": "bool", + "id": 3 + } + } + }, + "ListConversationProfilesRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/KnowledgeBase" + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/ConversationProfile" } }, "pageSize": { @@ -8098,18 +13892,14 @@ "pageToken": { "type": "string", "id": 3 - }, - "filter": { - "type": "string", - "id": 4 } } }, - "ListKnowledgeBasesResponse": { + "ListConversationProfilesResponse": { "fields": { - "knowledgeBases": { + "conversationProfiles": { "rule": "repeated", - "type": "KnowledgeBase", + "type": "ConversationProfile", "id": 1 }, "nextPageToken": { @@ -8118,584 +13908,681 @@ } } }, - "GetKnowledgeBaseRequest": { + "GetConversationProfileRequest": { "fields": { "name": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/KnowledgeBase" + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ConversationProfile" } } } }, - "CreateKnowledgeBaseRequest": { + "CreateConversationProfileRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/KnowledgeBase" - } - }, - "knowledgeBase": { - "type": "KnowledgeBase", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DeleteKnowledgeBaseRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/KnowledgeBase" - } - }, - "force": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateKnowledgeBaseRequest": { - "fields": { - "knowledgeBase": { - "type": "KnowledgeBase", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/ConversationProfile" } }, - "updateMask": { - "type": "google.protobuf.FieldMask", + "conversationProfile": { + "type": "ConversationProfile", "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Sessions": { - "options": { - "(google.api.default_host)": "dialogflow.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" - }, - "methods": { - "DetectIntent": { - "requestType": "DetectIntentRequest", - "responseType": "DetectIntentResponse", - "options": { - "(google.api.http).post": "/v2beta1/{session=projects/*/agent/sessions/*}:detectIntent", - "(google.api.http).body": "*", - "(google.api.http).additional_bindings.post": "/v2beta1/{session=projects/*/locations/*/agent/environments/*/users/*/sessions/*}:detectIntent", - "(google.api.http).additional_bindings.body": "*", - "(google.api.method_signature)": "session,query_input" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v2beta1/{session=projects/*/agent/sessions/*}:detectIntent", - "body": "*", - "additional_bindings": [ - { - "post": "/v2beta1/{session=projects/*/agent/environments/*/users/*/sessions/*}:detectIntent", - "body": "*" - }, - { - "post": "/v2beta1/{session=projects/*/locations/*/agent/sessions/*}:detectIntent", - "body": "*" - }, - { - "post": "/v2beta1/{session=projects/*/locations/*/agent/environments/*/users/*/sessions/*}:detectIntent", - "body": "*" - } - ] - } - }, - { - "(google.api.method_signature)": "session,query_input" - } - ] - }, - "StreamingDetectIntent": { - "requestType": "StreamingDetectIntentRequest", - "requestStream": true, - "responseType": "StreamingDetectIntentResponse", - "responseStream": true + "options": { + "(google.api.field_behavior)": "REQUIRED" + } } } }, - "DetectIntentRequest": { + "UpdateConversationProfileRequest": { "fields": { - "session": { - "type": "string", + "conversationProfile": { + "type": "ConversationProfile", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" + "(google.api.field_behavior)": "REQUIRED" } }, - "queryParams": { - "type": "QueryParameters", - "id": 2 - }, - "queryInput": { - "type": "QueryInput", - "id": 3, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" } - }, - "outputAudioConfig": { - "type": "OutputAudioConfig", - "id": 4 - }, - "outputAudioConfigMask": { - "type": "google.protobuf.FieldMask", - "id": 7 - }, - "inputAudio": { - "type": "bytes", - "id": 5 } } }, - "DetectIntentResponse": { + "DeleteConversationProfileRequest": { "fields": { - "responseId": { + "name": { "type": "string", - "id": 1 - }, - "queryResult": { - "type": "QueryResult", - "id": 2 - }, - "alternativeQueryResults": { - "rule": "repeated", - "type": "QueryResult", - "id": 5 - }, - "webhookStatus": { - "type": "google.rpc.Status", - "id": 3 - }, - "outputAudio": { - "type": "bytes", - "id": 4 - }, - "outputAudioConfig": { - "type": "OutputAudioConfig", - "id": 6 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/ConversationProfile" + } } } }, - "QueryParameters": { - "fields": { - "timeZone": { - "type": "string", - "id": 1 - }, - "geoLocation": { - "type": "google.type.LatLng", - "id": 2 - }, - "contexts": { - "rule": "repeated", - "type": "Context", - "id": 3 - }, - "resetContexts": { - "type": "bool", - "id": 4 + "Documents": { + "options": { + "(google.api.default_host)": "dialogflow.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" + }, + "methods": { + "ListDocuments": { + "requestType": "ListDocumentsRequest", + "responseType": "ListDocumentsResponse", + "options": { + "(google.api.http).get": "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents", + "additional_bindings": [ + { + "get": "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents" + }, + { + "get": "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents" + } + ] + } + }, + { + "(google.api.method_signature)": "parent" + } + ] }, - "sessionEntityTypes": { - "rule": "repeated", - "type": "SessionEntityType", - "id": 5 + "GetDocument": { + "requestType": "GetDocumentRequest", + "responseType": "Document", + "options": { + "(google.api.http).get": "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}", + "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}", + "additional_bindings": [ + { + "get": "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}" + }, + { + "get": "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + } + ] }, - "payload": { - "type": "google.protobuf.Struct", - "id": 6 + "CreateDocument": { + "requestType": "CreateDocumentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents", + "(google.api.http).body": "document", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents", + "(google.api.http).additional_bindings.body": "document", + "(google.api.method_signature)": "parent,document", + "(google.longrunning.operation_info).response_type": "Document", + "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents", + "body": "document", + "additional_bindings": [ + { + "post": "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents", + "body": "document" + }, + { + "post": "/v2beta1/{parent=projects/*/agent/knowledgeBases/*}/documents", + "body": "document" + } + ] + } + }, + { + "(google.api.method_signature)": "parent,document" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Document", + "metadata_type": "KnowledgeOperationMetadata" + } + } + ] }, - "knowledgeBaseNames": { - "rule": "repeated", - "type": "string", - "id": 12 + "ImportDocuments": { + "requestType": "ImportDocumentsRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents:import", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents:import", + "(google.api.http).additional_bindings.body": "*", + "(google.longrunning.operation_info).response_type": "ImportDocumentsResponse", + "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{parent=projects/*/knowledgeBases/*}/documents:import", + "body": "*", + "additional_bindings": { + "post": "/v2beta1/{parent=projects/*/locations/*/knowledgeBases/*}/documents:import", + "body": "*" + } + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ImportDocumentsResponse", + "metadata_type": "KnowledgeOperationMetadata" + } + } + ] }, - "sentimentAnalysisRequestConfig": { - "type": "SentimentAnalysisRequestConfig", - "id": 10 + "DeleteDocument": { + "requestType": "DeleteDocumentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}", + "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}", + "additional_bindings": [ + { + "delete": "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}" + }, + { + "delete": "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}" + } + ] + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "KnowledgeOperationMetadata" + } + } + ] }, - "subAgents": { - "rule": "repeated", - "type": "SubAgent", - "id": 13 + "UpdateDocument": { + "requestType": "UpdateDocumentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v2beta1/{document.name=projects/*/knowledgeBases/*/documents/*}", + "(google.api.http).body": "document", + "(google.api.http).additional_bindings.patch": "/v2beta1/{document.name=projects/*/agent/knowledgeBases/*/documents/*}", + "(google.api.http).additional_bindings.body": "document", + "(google.api.method_signature)": "document", + "(google.longrunning.operation_info).response_type": "Document", + "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v2beta1/{document.name=projects/*/knowledgeBases/*/documents/*}", + "body": "document", + "additional_bindings": [ + { + "patch": "/v2beta1/{document.name=projects/*/locations/*/knowledgeBases/*/documents/*}", + "body": "document" + }, + { + "patch": "/v2beta1/{document.name=projects/*/agent/knowledgeBases/*/documents/*}", + "body": "document" + } + ] + } + }, + { + "(google.api.method_signature)": "document,update_mask" + }, + { + "(google.api.method_signature)": "document" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Document", + "metadata_type": "KnowledgeOperationMetadata" + } + } + ] }, - "webhookHeaders": { - "keyType": "string", - "type": "string", - "id": 14 + "ReloadDocument": { + "requestType": "ReloadDocumentRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}:reload", + "(google.api.http).body": "*", + "(google.api.http).additional_bindings.post": "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload", + "(google.api.http).additional_bindings.body": "*", + "(google.api.method_signature)": "name,gcs_source", + "(google.longrunning.operation_info).response_type": "Document", + "(google.longrunning.operation_info).metadata_type": "KnowledgeOperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v2beta1/{name=projects/*/knowledgeBases/*/documents/*}:reload", + "body": "*", + "additional_bindings": [ + { + "post": "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*/documents/*}:reload", + "body": "*" + }, + { + "post": "/v2beta1/{name=projects/*/agent/knowledgeBases/*/documents/*}:reload", + "body": "*" + } + ] + } + }, + { + "(google.api.method_signature)": "name,gcs_source" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Document", + "metadata_type": "KnowledgeOperationMetadata" + } + } + ] } } }, - "QueryInput": { + "Document": { + "options": { + "(google.api.resource).type": "dialogflow.googleapis.com/Document", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}" + }, "oneofs": { - "input": { + "source": { "oneof": [ - "audioConfig", - "text", - "event" + "contentUri", + "content", + "rawContent" ] } }, "fields": { - "audioConfig": { - "type": "InputAudioConfig", - "id": 1 - }, - "text": { - "type": "TextInput", - "id": 2 - }, - "event": { - "type": "EventInput", - "id": 3 - } - } - }, - "QueryResult": { - "fields": { - "queryText": { + "name": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "languageCode": { + "displayName": { "type": "string", - "id": 15 - }, - "speechRecognitionConfidence": { - "type": "float", - "id": 2 + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "action": { + "mimeType": { "type": "string", - "id": 3 - }, - "parameters": { - "type": "google.protobuf.Struct", - "id": 4 + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "allRequiredParamsPresent": { - "type": "bool", - "id": 5 + "knowledgeTypes": { + "rule": "repeated", + "type": "KnowledgeType", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "fulfillmentText": { + "contentUri": { "type": "string", - "id": 6 - }, - "fulfillmentMessages": { - "rule": "repeated", - "type": "Intent.Message", - "id": 7 + "id": 5 }, - "webhookSource": { + "content": { "type": "string", - "id": 8 + "id": 6, + "options": { + "deprecated": true + } }, - "webhookPayload": { - "type": "google.protobuf.Struct", + "rawContent": { + "type": "bytes", "id": 9 }, - "outputContexts": { - "rule": "repeated", - "type": "Context", - "id": 10 - }, - "intent": { - "type": "Intent", - "id": 11 - }, - "intentDetectionConfidence": { - "type": "float", - "id": 12 - }, - "diagnosticInfo": { - "type": "google.protobuf.Struct", - "id": 14 + "enableAutoReload": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } }, - "sentimentAnalysisResult": { - "type": "SentimentAnalysisResult", - "id": 17 + "latestReloadStatus": { + "type": "ReloadStatus", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } }, - "knowledgeAnswers": { - "type": "KnowledgeAnswers", - "id": 18 - } - } - }, - "KnowledgeAnswers": { - "fields": { - "answers": { - "rule": "repeated", - "type": "Answer", - "id": 1 + "metadata": { + "keyType": "string", + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } }, "nested": { - "Answer": { + "ReloadStatus": { "fields": { - "source": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" - } + "time": { + "type": "google.protobuf.Timestamp", + "id": 1 }, - "faqQuestion": { - "type": "string", + "status": { + "type": "google.rpc.Status", "id": 2 - }, - "answer": { - "type": "string", - "id": 3 - }, - "matchConfidenceLevel": { - "type": "MatchConfidenceLevel", - "id": 4 - }, - "matchConfidence": { - "type": "float", - "id": 5 - } - }, - "nested": { - "MatchConfidenceLevel": { - "values": { - "MATCH_CONFIDENCE_LEVEL_UNSPECIFIED": 0, - "LOW": 1, - "MEDIUM": 2, - "HIGH": 3 - } } } + }, + "KnowledgeType": { + "values": { + "KNOWLEDGE_TYPE_UNSPECIFIED": 0, + "FAQ": 1, + "EXTRACTIVE_QA": 2, + "ARTICLE_SUGGESTION": 3, + "SMART_REPLY": 4 + } } } }, - "StreamingDetectIntentRequest": { + "GetDocumentRequest": { "fields": { - "session": { + "name": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/Session" - } - }, - "queryParams": { - "type": "QueryParameters", - "id": 2 - }, - "queryInput": { - "type": "QueryInput", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "singleUtterance": { - "type": "bool", - "id": 4, - "options": { - "deprecated": true + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" } - }, - "outputAudioConfig": { - "type": "OutputAudioConfig", - "id": 5 - }, - "outputAudioConfigMask": { - "type": "google.protobuf.FieldMask", - "id": 7 - }, - "inputAudio": { - "type": "bytes", - "id": 6 } } }, - "StreamingDetectIntentResponse": { + "ListDocumentsRequest": { "fields": { - "responseId": { + "parent": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Document" + } }, - "recognitionResult": { - "type": "StreamingRecognitionResult", + "pageSize": { + "type": "int32", "id": 2 }, - "queryResult": { - "type": "QueryResult", + "pageToken": { + "type": "string", "id": 3 }, - "alternativeQueryResults": { - "rule": "repeated", - "type": "QueryResult", - "id": 7 - }, - "webhookStatus": { - "type": "google.rpc.Status", + "filter": { + "type": "string", "id": 4 - }, - "outputAudio": { - "type": "bytes", - "id": 5 - }, - "outputAudioConfig": { - "type": "OutputAudioConfig", - "id": 6 } } }, - "StreamingRecognitionResult": { + "ListDocumentsResponse": { "fields": { - "messageType": { - "type": "MessageType", + "documents": { + "rule": "repeated", + "type": "Document", "id": 1 }, - "transcript": { + "nextPageToken": { "type": "string", "id": 2 + } + } + }, + "CreateDocumentRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Document" + } }, - "isFinal": { + "document": { + "type": "Document", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "importGcsCustomMetadata": { "type": "bool", "id": 3 - }, - "confidence": { - "type": "float", - "id": 4 - }, - "stability": { - "type": "float", - "id": 6 - }, - "speechWordInfo": { - "rule": "repeated", - "type": "SpeechWordInfo", - "id": 7 - }, - "speechEndOffset": { - "type": "google.protobuf.Duration", - "id": 8 - }, - "dtmfDigits": { - "type": "TelephonyDtmfEvents", - "id": 5 + } + } + }, + "ImportDocumentsRequest": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] } }, - "nested": { - "MessageType": { - "values": { - "MESSAGE_TYPE_UNSPECIFIED": 0, - "TRANSCRIPT": 1, - "END_OF_SINGLE_UTTERANCE": 2 + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/Document" + } + }, + "gcsSource": { + "type": "GcsSources", + "id": 2 + }, + "documentTemplate": { + "type": "ImportDocumentTemplate", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" } + }, + "importGcsCustomMetadata": { + "type": "bool", + "id": 4 } } }, - "TextInput": { + "ImportDocumentTemplate": { "fields": { - "text": { + "mimeType": { "type": "string", - "id": 1 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "languageCode": { + "knowledgeTypes": { + "rule": "repeated", + "type": "Document.KnowledgeType", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "metadata": { + "keyType": "string", "type": "string", - "id": 2 + "id": 3 } } }, - "EventInput": { + "ImportDocumentsResponse": { + "fields": { + "warnings": { + "rule": "repeated", + "type": "google.rpc.Status", + "id": 1 + } + } + }, + "DeleteDocumentRequest": { "fields": { "name": { "type": "string", - "id": 1 - }, - "parameters": { - "type": "google.protobuf.Struct", - "id": 2 + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" + } + } + } + }, + "UpdateDocumentRequest": { + "fields": { + "document": { + "type": "Document", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } }, - "languageCode": { - "type": "string", - "id": 3 + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - "SentimentAnalysisRequestConfig": { + "KnowledgeOperationMetadata": { "fields": { - "analyzeQueryTextSentiment": { + "state": { + "type": "State", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "PENDING": 1, + "RUNNING": 2, + "DONE": 3 + } + } + } + }, + "ReloadDocumentRequest": { + "oneofs": { + "source": { + "oneof": [ + "gcsSource" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/Document" + } + }, + "gcsSource": { + "type": "GcsSource", + "id": 3 + }, + "importGcsCustomMetadata": { "type": "bool", - "id": 1 - } - } - }, - "SentimentAnalysisResult": { - "fields": { - "queryTextSentiment": { - "type": "Sentiment", - "id": 1 + "id": 4 } } }, - "Sentiment": { + "HumanAgentAssistantEvent": { "fields": { - "score": { - "type": "float", + "conversation": { + "type": "string", "id": 1 }, - "magnitude": { - "type": "float", - "id": 2 + "participant": { + "type": "string", + "id": 3 + }, + "suggestionResults": { + "rule": "repeated", + "type": "SuggestionResult", + "id": 5 } } }, - "SessionEntityTypes": { + "KnowledgeBases": { "options": { "(google.api.default_host)": "dialogflow.googleapis.com", "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/dialogflow" }, "methods": { - "ListSessionEntityTypes": { - "requestType": "ListSessionEntityTypesRequest", - "responseType": "ListSessionEntityTypesResponse", + "ListKnowledgeBases": { + "requestType": "ListKnowledgeBasesRequest", + "responseType": "ListKnowledgeBasesResponse", "options": { - "(google.api.http).get": "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes", - "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes", + "(google.api.http).get": "/v2beta1/{parent=projects/*}/knowledgeBases", + "(google.api.http).additional_bindings.get": "/v2beta1/{parent=projects/*/agent}/knowledgeBases", "(google.api.method_signature)": "parent" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes", + "get": "/v2beta1/{parent=projects/*}/knowledgeBases", "additional_bindings": [ { - "get": "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes" - }, - { - "get": "/v2beta1/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes" + "get": "/v2beta1/{parent=projects/*/locations/*}/knowledgeBases" }, { - "get": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes" + "get": "/v2beta1/{parent=projects/*/agent}/knowledgeBases" } ] } @@ -8705,27 +14592,24 @@ } ] }, - "GetSessionEntityType": { - "requestType": "GetSessionEntityTypeRequest", - "responseType": "SessionEntityType", + "GetKnowledgeBase": { + "requestType": "GetKnowledgeBaseRequest", + "responseType": "KnowledgeBase", "options": { - "(google.api.http).get": "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}", - "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", + "(google.api.http).get": "/v2beta1/{name=projects/*/knowledgeBases/*}", + "(google.api.http).additional_bindings.get": "/v2beta1/{name=projects/*/agent/knowledgeBases/*}", "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "get": "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}", + "get": "/v2beta1/{name=projects/*/knowledgeBases/*}", "additional_bindings": [ { - "get": "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" - }, - { - "get": "/v2beta1/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}" + "get": "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*}" }, { - "get": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" + "get": "/v2beta1/{name=projects/*/agent/knowledgeBases/*}" } ] } @@ -8735,151 +14619,133 @@ } ] }, - "CreateSessionEntityType": { - "requestType": "CreateSessionEntityTypeRequest", - "responseType": "SessionEntityType", + "CreateKnowledgeBase": { + "requestType": "CreateKnowledgeBaseRequest", + "responseType": "KnowledgeBase", "options": { - "(google.api.http).post": "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes", - "(google.api.http).body": "session_entity_type", - "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes", - "(google.api.http).additional_bindings.body": "session_entity_type", - "(google.api.method_signature)": "parent,session_entity_type" + "(google.api.http).post": "/v2beta1/{parent=projects/*}/knowledgeBases", + "(google.api.http).body": "knowledge_base", + "(google.api.http).additional_bindings.post": "/v2beta1/{parent=projects/*/agent}/knowledgeBases", + "(google.api.http).additional_bindings.body": "knowledge_base", + "(google.api.method_signature)": "parent,knowledge_base" }, "parsedOptions": [ { "(google.api.http)": { - "post": "/v2beta1/{parent=projects/*/agent/sessions/*}/entityTypes", - "body": "session_entity_type", + "post": "/v2beta1/{parent=projects/*}/knowledgeBases", + "body": "knowledge_base", "additional_bindings": [ { - "post": "/v2beta1/{parent=projects/*/agent/environments/*/users/*/sessions/*}/entityTypes", - "body": "session_entity_type" - }, - { - "post": "/v2beta1/{parent=projects/*/locations/*/agent/sessions/*}/entityTypes", - "body": "session_entity_type" + "post": "/v2beta1/{parent=projects/*/locations/*}/knowledgeBases", + "body": "knowledge_base" }, { - "post": "/v2beta1/{parent=projects/*/locations/*/agent/environments/*/users/*/sessions/*}/entityTypes", - "body": "session_entity_type" + "post": "/v2beta1/{parent=projects/*/agent}/knowledgeBases", + "body": "knowledge_base" } ] } }, { - "(google.api.method_signature)": "parent,session_entity_type" + "(google.api.method_signature)": "parent,knowledge_base" } ] }, - "UpdateSessionEntityType": { - "requestType": "UpdateSessionEntityTypeRequest", - "responseType": "SessionEntityType", + "DeleteKnowledgeBase": { + "requestType": "DeleteKnowledgeBaseRequest", + "responseType": "google.protobuf.Empty", "options": { - "(google.api.http).patch": "/v2beta1/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}", - "(google.api.http).body": "session_entity_type", - "(google.api.http).additional_bindings.patch": "/v2beta1/{session_entity_type.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", - "(google.api.http).additional_bindings.body": "session_entity_type", - "(google.api.method_signature)": "session_entity_type,update_mask" + "(google.api.http).delete": "/v2beta1/{name=projects/*/knowledgeBases/*}", + "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/agent/knowledgeBases/*}", + "(google.api.method_signature)": "name" }, "parsedOptions": [ { "(google.api.http)": { - "patch": "/v2beta1/{session_entity_type.name=projects/*/agent/sessions/*/entityTypes/*}", - "body": "session_entity_type", + "delete": "/v2beta1/{name=projects/*/knowledgeBases/*}", "additional_bindings": [ { - "patch": "/v2beta1/{session_entity_type.name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", - "body": "session_entity_type" - }, - { - "patch": "/v2beta1/{session_entity_type.name=projects/*/locations/*/agent/sessions/*/entityTypes/*}", - "body": "session_entity_type" + "delete": "/v2beta1/{name=projects/*/locations/*/knowledgeBases/*}" }, { - "patch": "/v2beta1/{session_entity_type.name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", - "body": "session_entity_type" + "delete": "/v2beta1/{name=projects/*/agent/knowledgeBases/*}" } ] } }, { - "(google.api.method_signature)": "session_entity_type" - }, - { - "(google.api.method_signature)": "session_entity_type,update_mask" + "(google.api.method_signature)": "name" } ] }, - "DeleteSessionEntityType": { - "requestType": "DeleteSessionEntityTypeRequest", - "responseType": "google.protobuf.Empty", + "UpdateKnowledgeBase": { + "requestType": "UpdateKnowledgeBaseRequest", + "responseType": "KnowledgeBase", "options": { - "(google.api.http).delete": "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}", - "(google.api.http).additional_bindings.delete": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}", - "(google.api.method_signature)": "name" + "(google.api.http).patch": "/v2beta1/{knowledge_base.name=projects/*/knowledgeBases/*}", + "(google.api.http).body": "knowledge_base", + "(google.api.http).additional_bindings.patch": "/v2beta1/{knowledge_base.name=projects/*/agent/knowledgeBases/*}", + "(google.api.http).additional_bindings.body": "knowledge_base", + "(google.api.method_signature)": "knowledge_base" }, "parsedOptions": [ { "(google.api.http)": { - "delete": "/v2beta1/{name=projects/*/agent/sessions/*/entityTypes/*}", + "patch": "/v2beta1/{knowledge_base.name=projects/*/knowledgeBases/*}", + "body": "knowledge_base", "additional_bindings": [ { - "delete": "/v2beta1/{name=projects/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" - }, - { - "delete": "/v2beta1/{name=projects/*/locations/*/agent/sessions/*/entityTypes/*}" + "patch": "/v2beta1/{knowledge_base.name=projects/*/locations/*/knowledgeBases/*}", + "body": "knowledge_base" }, { - "delete": "/v2beta1/{name=projects/*/locations/*/agent/environments/*/users/*/sessions/*/entityTypes/*}" + "patch": "/v2beta1/{knowledge_base.name=projects/*/agent/knowledgeBases/*}", + "body": "knowledge_base" } ] } }, { - "(google.api.method_signature)": "name" + "(google.api.method_signature)": "knowledge_base,update_mask" + }, + { + "(google.api.method_signature)": "knowledge_base" } ] } } }, - "SessionEntityType": { + "KnowledgeBase": { "options": { - "(google.api.resource).type": "dialogflow.googleapis.com/SessionEntityType", - "(google.api.resource).pattern": "projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}" + "(google.api.resource).type": "dialogflow.googleapis.com/KnowledgeBase", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}" }, "fields": { "name": { "type": "string", "id": 1 }, - "entityOverrideMode": { - "type": "EntityOverrideMode", - "id": 2 - }, - "entities": { - "rule": "repeated", - "type": "EntityType.Entity", - "id": 3 - } - }, - "nested": { - "EntityOverrideMode": { - "values": { - "ENTITY_OVERRIDE_MODE_UNSPECIFIED": 0, - "ENTITY_OVERRIDE_MODE_OVERRIDE": 1, - "ENTITY_OVERRIDE_MODE_SUPPLEMENT": 2 + "displayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" } + }, + "languageCode": { + "type": "string", + "id": 4 } } }, - "ListSessionEntityTypesRequest": { + "ListKnowledgeBasesRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SessionEntityType" + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/KnowledgeBase" } }, "pageSize": { @@ -8889,14 +14755,18 @@ "pageToken": { "type": "string", "id": 3 + }, + "filter": { + "type": "string", + "id": 4 } } }, - "ListSessionEntityTypesResponse": { + "ListKnowledgeBasesResponse": { "fields": { - "sessionEntityTypes": { + "knowledgeBases": { "rule": "repeated", - "type": "SessionEntityType", + "type": "KnowledgeBase", "id": 1 }, "nextPageToken": { @@ -8905,30 +14775,30 @@ } } }, - "GetSessionEntityTypeRequest": { + "GetKnowledgeBaseRequest": { "fields": { "name": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/SessionEntityType" + "(google.api.resource_reference).type": "dialogflow.googleapis.com/KnowledgeBase" } } } }, - "CreateSessionEntityTypeRequest": { + "CreateKnowledgeBaseRequest": { "fields": { "parent": { "type": "string", "id": 1, "options": { "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/SessionEntityType" + "(google.api.resource_reference).child_type": "dialogflow.googleapis.com/KnowledgeBase" } }, - "sessionEntityType": { - "type": "SessionEntityType", + "knowledgeBase": { + "type": "KnowledgeBase", "id": 2, "options": { "(google.api.field_behavior)": "REQUIRED" @@ -8936,29 +14806,39 @@ } } }, - "UpdateSessionEntityTypeRequest": { + "DeleteKnowledgeBaseRequest": { "fields": { - "sessionEntityType": { - "type": "SessionEntityType", + "name": { + "type": "string", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED" + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "dialogflow.googleapis.com/KnowledgeBase" } }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2 + "force": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } } } }, - "DeleteSessionEntityTypeRequest": { + "UpdateKnowledgeBaseRequest": { "fields": { - "name": { - "type": "string", + "knowledgeBase": { + "type": "KnowledgeBase", "id": 1, "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "dialogflow.googleapis.com/SessionEntityType" + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" } } } @@ -9016,6 +14896,10 @@ "type": "EventInput", "id": 6 }, + "liveAgentHandoff": { + "type": "bool", + "id": 7 + }, "endInteraction": { "type": "bool", "id": 8 diff --git a/packages/google-cloud-dialogflow/src/index.ts b/packages/google-cloud-dialogflow/src/index.ts index d8d06b2191d..7c591962086 100644 --- a/packages/google-cloud-dialogflow/src/index.ts +++ b/packages/google-cloud-dialogflow/src/index.ts @@ -21,14 +21,26 @@ import * as v2beta1 from './v2beta1'; const AgentsClient = v2.AgentsClient; type AgentsClient = v2.AgentsClient; +const AnswerRecordsClient = v2.AnswerRecordsClient; +type AnswerRecordsClient = v2.AnswerRecordsClient; const ContextsClient = v2.ContextsClient; type ContextsClient = v2.ContextsClient; +const ConversationProfilesClient = v2.ConversationProfilesClient; +type ConversationProfilesClient = v2.ConversationProfilesClient; +const ConversationsClient = v2.ConversationsClient; +type ConversationsClient = v2.ConversationsClient; +const DocumentsClient = v2.DocumentsClient; +type DocumentsClient = v2.DocumentsClient; const EntityTypesClient = v2.EntityTypesClient; type EntityTypesClient = v2.EntityTypesClient; const EnvironmentsClient = v2.EnvironmentsClient; type EnvironmentsClient = v2.EnvironmentsClient; const IntentsClient = v2.IntentsClient; type IntentsClient = v2.IntentsClient; +const KnowledgeBasesClient = v2.KnowledgeBasesClient; +type KnowledgeBasesClient = v2.KnowledgeBasesClient; +const ParticipantsClient = v2.ParticipantsClient; +type ParticipantsClient = v2.ParticipantsClient; const SessionEntityTypesClient = v2.SessionEntityTypesClient; type SessionEntityTypesClient = v2.SessionEntityTypesClient; const SessionsClient = v2.SessionsClient; @@ -38,10 +50,16 @@ export { v2, v2beta1, AgentsClient, + AnswerRecordsClient, ContextsClient, + ConversationProfilesClient, + ConversationsClient, + DocumentsClient, EntityTypesClient, EnvironmentsClient, IntentsClient, + KnowledgeBasesClient, + ParticipantsClient, SessionEntityTypesClient, SessionsClient, }; @@ -49,10 +67,16 @@ export default { v2, v2beta1, AgentsClient, + AnswerRecordsClient, ContextsClient, + ConversationProfilesClient, + ConversationsClient, + DocumentsClient, EntityTypesClient, EnvironmentsClient, IntentsClient, + KnowledgeBasesClient, + ParticipantsClient, SessionEntityTypesClient, SessionsClient, }; diff --git a/packages/google-cloud-dialogflow/src/v2/agents_client.ts b/packages/google-cloud-dialogflow/src/v2/agents_client.ts index c3a9d8a68e1..006dcef3232 100644 --- a/packages/google-cloud-dialogflow/src/v2/agents_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/agents_client.ts @@ -195,6 +195,54 @@ export class AgentsClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), }; // Some of the methods on this service return "paged" results, @@ -2082,6 +2130,1042 @@ export class AgentsClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-dialogflow/src/v2/agents_proto_list.json b/packages/google-cloud-dialogflow/src/v2/agents_proto_list.json index 3cca442f6d7..2bb2f7b52ed 100644 --- a/packages/google-cloud-dialogflow/src/v2/agents_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2/agents_proto_list.json @@ -1,10 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", "../../protos/google/cloud/dialogflow/v2/audio_config.proto", "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", "../../protos/google/cloud/dialogflow/v2/entity_type.proto", "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", "../../protos/google/cloud/dialogflow/v2/session.proto", "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2/answer_records_client.ts b/packages/google-cloud-dialogflow/src/v2/answer_records_client.ts new file mode 100644 index 00000000000..5c4baa3ba6d --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/answer_records_client.ts @@ -0,0 +1,2271 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v2/answer_records_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './answer_records_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service for managing {@link google.cloud.dialogflow.v2.AnswerRecord|AnswerRecords}. + * @class + * @memberof v2 + */ +export class AnswerRecordsClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + answerRecordsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AnswerRecordsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AnswerRecordsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/entityTypes/{entity_type}' + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}' + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/intents/{intent}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectAgentEnvironmentUserSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}' + ), + projectAgentEnvironmentUserSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}' + ), + projectAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/contexts/{context}' + ), + projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listAnswerRecords: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'answerRecords' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.v2.AnswerRecords', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.answerRecordsStub) { + return this.answerRecordsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.v2.AnswerRecords. + this.answerRecordsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.v2.AnswerRecords' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.v2.AnswerRecords, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const answerRecordsStubMethods = [ + 'listAnswerRecords', + 'updateAnswerRecord', + ]; + for (const methodName of answerRecordsStubMethods) { + const callPromise = this.answerRecordsStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.answerRecordsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dialogflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + updateAnswerRecord( + request: protos.google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IAnswerRecord, + protos.google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest | undefined, + {} | undefined + ] + >; + updateAnswerRecord( + request: protos.google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IAnswerRecord, + | protos.google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAnswerRecord( + request: protos.google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IAnswerRecord, + | protos.google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified answer record. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.AnswerRecord} request.answerRecord + * Required. Answer record to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnswerRecord]{@link google.cloud.dialogflow.v2.AnswerRecord}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateAnswerRecord(request); + */ + updateAnswerRecord( + request: protos.google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IAnswerRecord, + | protos.google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IAnswerRecord, + | protos.google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IAnswerRecord, + protos.google.cloud.dialogflow.v2.IUpdateAnswerRecordRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'answer_record.name': request.answerRecord!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateAnswerRecord(request, options, callback); + } + + listAnswerRecords( + request: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IAnswerRecord[], + protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest | null, + protos.google.cloud.dialogflow.v2.IListAnswerRecordsResponse + ] + >; + listAnswerRecords( + request: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + | protos.google.cloud.dialogflow.v2.IListAnswerRecordsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IAnswerRecord + > + ): void; + listAnswerRecords( + request: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + | protos.google.cloud.dialogflow.v2.IListAnswerRecordsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IAnswerRecord + > + ): void; + /** + * Returns the list of all answer records in the specified project in reverse + * chronological order. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * @param {string} request.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). + * @param {number} [request.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. + * @param {string} [request.pageToken] + * Optional. The + * {@link google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token|ListAnswerRecordsResponse.next_page_token} + * value returned from a previous list request used to continue listing on + * the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [AnswerRecord]{@link google.cloud.dialogflow.v2.AnswerRecord}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAnswerRecordsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnswerRecords( + request: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + | protos.google.cloud.dialogflow.v2.IListAnswerRecordsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IAnswerRecord + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + | protos.google.cloud.dialogflow.v2.IListAnswerRecordsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IAnswerRecord + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IAnswerRecord[], + protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest | null, + protos.google.cloud.dialogflow.v2.IListAnswerRecordsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listAnswerRecords(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * @param {string} request.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). + * @param {number} [request.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. + * @param {string} [request.pageToken] + * Optional. The + * {@link google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token|ListAnswerRecordsResponse.next_page_token} + * value returned from a previous list request used to continue listing on + * the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [AnswerRecord]{@link google.cloud.dialogflow.v2.AnswerRecord} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAnswerRecordsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnswerRecordsStream( + request?: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listAnswerRecords.createStream( + this.innerApiCalls.listAnswerRecords as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAnswerRecords`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * @param {string} request.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). + * @param {number} [request.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. + * @param {string} [request.pageToken] + * Optional. The + * {@link google.cloud.dialogflow.v2.ListAnswerRecordsResponse.next_page_token|ListAnswerRecordsResponse.next_page_token} + * value returned from a previous list request used to continue listing on + * the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [AnswerRecord]{@link google.cloud.dialogflow.v2.AnswerRecord}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listAnswerRecordsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAnswerRecordsAsync( + request?: protos.google.cloud.dialogflow.v2.IListAnswerRecordsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listAnswerRecords.asyncIterate( + this.innerApiCalls['listAnswerRecords'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + agentPath(project: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project: string, entityType: string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath(project: string, environment: string) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionContext resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionEntityType resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionEntityTypePath( + project: string, + environment: string, + user: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentSessionContextPath( + project: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.render({ + project: project, + session: session, + context: context, + }); + } + + /** + * Parse the project from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentSessionEntityTypePath( + project: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.render({ + project: project, + session: session, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.answerRecordsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dialogflow/src/v2/answer_records_client_config.json b/packages/google-cloud-dialogflow/src/v2/answer_records_client_config.json new file mode 100644 index 00000000000..cc29e1ea884 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/answer_records_client_config.json @@ -0,0 +1,39 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.AnswerRecords": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListAnswerRecords": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateAnswerRecord": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/src/v2/answer_records_proto_list.json b/packages/google-cloud-dialogflow/src/v2/answer_records_proto_list.json new file mode 100644 index 00000000000..2bb2f7b52ed --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/answer_records_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", + "../../protos/google/cloud/dialogflow/v2/audio_config.proto", + "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", + "../../protos/google/cloud/dialogflow/v2/entity_type.proto", + "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", + "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", + "../../protos/google/cloud/dialogflow/v2/session.proto", + "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/v2/validation_result.proto", + "../../protos/google/cloud/dialogflow/v2/webhook.proto" +] diff --git a/packages/google-cloud-dialogflow/src/v2/contexts_client.ts b/packages/google-cloud-dialogflow/src/v2/contexts_client.ts index 4d359f60106..a4d6cfd98ad 100644 --- a/packages/google-cloud-dialogflow/src/v2/contexts_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/contexts_client.ts @@ -196,6 +196,54 @@ export class ContextsClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), }; // Some of the methods on this service return "paged" results, @@ -1576,6 +1624,1042 @@ export class ContextsClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-dialogflow/src/v2/contexts_proto_list.json b/packages/google-cloud-dialogflow/src/v2/contexts_proto_list.json index 3cca442f6d7..2bb2f7b52ed 100644 --- a/packages/google-cloud-dialogflow/src/v2/contexts_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2/contexts_proto_list.json @@ -1,10 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", "../../protos/google/cloud/dialogflow/v2/audio_config.proto", "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", "../../protos/google/cloud/dialogflow/v2/entity_type.proto", "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", "../../protos/google/cloud/dialogflow/v2/session.proto", "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client.ts b/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client.ts new file mode 100644 index 00000000000..93cda6fa29d --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client.ts @@ -0,0 +1,2572 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v2/conversation_profiles_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './conversation_profiles_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service for managing {@link google.cloud.dialogflow.v2.ConversationProfile|ConversationProfiles}. + * @class + * @memberof v2 + */ +export class ConversationProfilesClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + conversationProfilesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ConversationProfilesClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ConversationProfilesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/entityTypes/{entity_type}' + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}' + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/intents/{intent}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectAgentEnvironmentUserSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}' + ), + projectAgentEnvironmentUserSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}' + ), + projectAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/contexts/{context}' + ), + projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listConversationProfiles: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'conversationProfiles' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.v2.ConversationProfiles', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.conversationProfilesStub) { + return this.conversationProfilesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.v2.ConversationProfiles. + this.conversationProfilesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.v2.ConversationProfiles' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.v2.ConversationProfiles, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const conversationProfilesStubMethods = [ + 'listConversationProfiles', + 'getConversationProfile', + 'createConversationProfile', + 'updateConversationProfile', + 'deleteConversationProfile', + ]; + for (const methodName of conversationProfilesStubMethods) { + const callPromise = this.conversationProfilesStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.conversationProfilesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dialogflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getConversationProfile( + request: protos.google.cloud.dialogflow.v2.IGetConversationProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversationProfile, + ( + | protos.google.cloud.dialogflow.v2.IGetConversationProfileRequest + | undefined + ), + {} | undefined + ] + >; + getConversationProfile( + request: protos.google.cloud.dialogflow.v2.IGetConversationProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversationProfile, + | protos.google.cloud.dialogflow.v2.IGetConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConversationProfile( + request: protos.google.cloud.dialogflow.v2.IGetConversationProfileRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversationProfile, + | protos.google.cloud.dialogflow.v2.IGetConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves the specified conversation profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getConversationProfile(request); + */ + getConversationProfile( + request: protos.google.cloud.dialogflow.v2.IGetConversationProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IConversationProfile, + | protos.google.cloud.dialogflow.v2.IGetConversationProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IConversationProfile, + | protos.google.cloud.dialogflow.v2.IGetConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversationProfile, + ( + | protos.google.cloud.dialogflow.v2.IGetConversationProfileRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getConversationProfile( + request, + options, + callback + ); + } + createConversationProfile( + request: protos.google.cloud.dialogflow.v2.ICreateConversationProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversationProfile, + ( + | protos.google.cloud.dialogflow.v2.ICreateConversationProfileRequest + | undefined + ), + {} | undefined + ] + >; + createConversationProfile( + request: protos.google.cloud.dialogflow.v2.ICreateConversationProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversationProfile, + | protos.google.cloud.dialogflow.v2.ICreateConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createConversationProfile( + request: protos.google.cloud.dialogflow.v2.ICreateConversationProfileRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversationProfile, + | protos.google.cloud.dialogflow.v2.ICreateConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a conversation profile in the specified project. + * + * {@link |ConversationProfile.CreateTime} and {@link |ConversationProfile.UpdateTime} + * aren't populated in the response. You can retrieve them via + * {@link google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile|GetConversationProfile} API. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.v2.ConversationProfile} request.conversationProfile + * Required. The conversation profile to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createConversationProfile(request); + */ + createConversationProfile( + request: protos.google.cloud.dialogflow.v2.ICreateConversationProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IConversationProfile, + | protos.google.cloud.dialogflow.v2.ICreateConversationProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IConversationProfile, + | protos.google.cloud.dialogflow.v2.ICreateConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversationProfile, + ( + | protos.google.cloud.dialogflow.v2.ICreateConversationProfileRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createConversationProfile( + request, + options, + callback + ); + } + updateConversationProfile( + request: protos.google.cloud.dialogflow.v2.IUpdateConversationProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversationProfile, + ( + | protos.google.cloud.dialogflow.v2.IUpdateConversationProfileRequest + | undefined + ), + {} | undefined + ] + >; + updateConversationProfile( + request: protos.google.cloud.dialogflow.v2.IUpdateConversationProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversationProfile, + | protos.google.cloud.dialogflow.v2.IUpdateConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateConversationProfile( + request: protos.google.cloud.dialogflow.v2.IUpdateConversationProfileRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversationProfile, + | protos.google.cloud.dialogflow.v2.IUpdateConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified conversation profile. + * + * {@link |ConversationProfile.CreateTime} and {@link |ConversationProfile.UpdateTime} + * aren't populated in the response. You can retrieve them via + * {@link google.cloud.dialogflow.v2.ConversationProfiles.GetConversationProfile|GetConversationProfile} API. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.ConversationProfile} request.conversationProfile + * Required. The conversation profile to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateConversationProfile(request); + */ + updateConversationProfile( + request: protos.google.cloud.dialogflow.v2.IUpdateConversationProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IConversationProfile, + | protos.google.cloud.dialogflow.v2.IUpdateConversationProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IConversationProfile, + | protos.google.cloud.dialogflow.v2.IUpdateConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversationProfile, + ( + | protos.google.cloud.dialogflow.v2.IUpdateConversationProfileRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'conversation_profile.name': request.conversationProfile!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateConversationProfile( + request, + options, + callback + ); + } + deleteConversationProfile( + request: protos.google.cloud.dialogflow.v2.IDeleteConversationProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.v2.IDeleteConversationProfileRequest + | undefined + ), + {} | undefined + ] + >; + deleteConversationProfile( + request: protos.google.cloud.dialogflow.v2.IDeleteConversationProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2.IDeleteConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteConversationProfile( + request: protos.google.cloud.dialogflow.v2.IDeleteConversationProfileRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2.IDeleteConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified conversation profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deleteConversationProfile(request); + */ + deleteConversationProfile( + request: protos.google.cloud.dialogflow.v2.IDeleteConversationProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2.IDeleteConversationProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2.IDeleteConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.v2.IDeleteConversationProfileRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteConversationProfile( + request, + options, + callback + ); + } + + listConversationProfiles( + request: protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversationProfile[], + protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest | null, + protos.google.cloud.dialogflow.v2.IListConversationProfilesResponse + ] + >; + listConversationProfiles( + request: protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, + | protos.google.cloud.dialogflow.v2.IListConversationProfilesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IConversationProfile + > + ): void; + listConversationProfiles( + request: protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, + | protos.google.cloud.dialogflow.v2.IListConversationProfilesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IConversationProfile + > + ): void; + /** + * Returns the list of all conversation profiles in the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listConversationProfilesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listConversationProfiles( + request: protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, + | protos.google.cloud.dialogflow.v2.IListConversationProfilesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IConversationProfile + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, + | protos.google.cloud.dialogflow.v2.IListConversationProfilesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IConversationProfile + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversationProfile[], + protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest | null, + protos.google.cloud.dialogflow.v2.IListConversationProfilesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listConversationProfiles( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listConversationProfilesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listConversationProfilesStream( + request?: protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listConversationProfiles.createStream( + this.innerApiCalls.listConversationProfiles as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConversationProfiles`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ConversationProfile]{@link google.cloud.dialogflow.v2.ConversationProfile}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listConversationProfilesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listConversationProfilesAsync( + request?: protos.google.cloud.dialogflow.v2.IListConversationProfilesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listConversationProfiles.asyncIterate( + this.innerApiCalls['listConversationProfiles'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + agentPath(project: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project: string, entityType: string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath(project: string, environment: string) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionContext resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionEntityType resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionEntityTypePath( + project: string, + environment: string, + user: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentSessionContextPath( + project: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.render({ + project: project, + session: session, + context: context, + }); + } + + /** + * Parse the project from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentSessionEntityTypePath( + project: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.render({ + project: project, + session: session, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.conversationProfilesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client_config.json b/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client_config.json new file mode 100644 index 00000000000..10c64bdc279 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/conversation_profiles_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.ConversationProfiles": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListConversationProfiles": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/src/v2/conversation_profiles_proto_list.json b/packages/google-cloud-dialogflow/src/v2/conversation_profiles_proto_list.json new file mode 100644 index 00000000000..2bb2f7b52ed --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/conversation_profiles_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", + "../../protos/google/cloud/dialogflow/v2/audio_config.proto", + "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", + "../../protos/google/cloud/dialogflow/v2/entity_type.proto", + "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", + "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", + "../../protos/google/cloud/dialogflow/v2/session.proto", + "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/v2/validation_result.proto", + "../../protos/google/cloud/dialogflow/v2/webhook.proto" +] diff --git a/packages/google-cloud-dialogflow/src/v2/conversations_client.ts b/packages/google-cloud-dialogflow/src/v2/conversations_client.ts new file mode 100644 index 00000000000..bad1d052755 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/conversations_client.ts @@ -0,0 +1,3156 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v2/conversations_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './conversations_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service for managing {@link google.cloud.dialogflow.v2.Conversation|Conversations}. + * @class + * @memberof v2 + */ +export class ConversationsClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + conversationsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ConversationsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ConversationsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/entityTypes/{entity_type}' + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}' + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/intents/{intent}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectAgentEnvironmentUserSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}' + ), + projectAgentEnvironmentUserSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}' + ), + projectAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/contexts/{context}' + ), + projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listConversations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'conversations' + ), + listCallMatchers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'callMatchers' + ), + listMessages: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'messages' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.v2.Conversations', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.conversationsStub) { + return this.conversationsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.v2.Conversations. + this.conversationsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.v2.Conversations' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.v2.Conversations, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const conversationsStubMethods = [ + 'createConversation', + 'listConversations', + 'getConversation', + 'completeConversation', + 'createCallMatcher', + 'listCallMatchers', + 'deleteCallMatcher', + 'listMessages', + ]; + for (const methodName of conversationsStubMethods) { + const callPromise = this.conversationsStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.conversationsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dialogflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createConversation( + request: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversation, + protos.google.cloud.dialogflow.v2.ICreateConversationRequest | undefined, + {} | undefined + ] + >; + createConversation( + request: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.ICreateConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createConversation( + request: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.ICreateConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * 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 {@link google.cloud.dialogflow.v2.Conversation.conversation_profile|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 + * {@link google.cloud.dialogflow.v2.Intent|Intent} with {@link google.cloud.dialogflow.v2.Intent.live_agent_handoff|Intent.live_agent_handoff} is triggered, conversation + * will transfer to Assist Stage. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.v2.Conversation} request.conversation + * Required. The conversation to create. + * @param {string} [request.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 + * "{@link a-zA-Z0-9_-|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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createConversation(request); + */ + createConversation( + request: protos.google.cloud.dialogflow.v2.ICreateConversationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.ICreateConversationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.ICreateConversationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversation, + protos.google.cloud.dialogflow.v2.ICreateConversationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createConversation(request, options, callback); + } + getConversation( + request: protos.google.cloud.dialogflow.v2.IGetConversationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversation, + protos.google.cloud.dialogflow.v2.IGetConversationRequest | undefined, + {} | undefined + ] + >; + getConversation( + request: protos.google.cloud.dialogflow.v2.IGetConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.IGetConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConversation( + request: protos.google.cloud.dialogflow.v2.IGetConversationRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.IGetConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves the specific conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getConversation(request); + */ + getConversation( + request: protos.google.cloud.dialogflow.v2.IGetConversationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.IGetConversationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.IGetConversationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversation, + protos.google.cloud.dialogflow.v2.IGetConversationRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getConversation(request, options, callback); + } + completeConversation( + request: protos.google.cloud.dialogflow.v2.ICompleteConversationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversation, + ( + | protos.google.cloud.dialogflow.v2.ICompleteConversationRequest + | undefined + ), + {} | undefined + ] + >; + completeConversation( + request: protos.google.cloud.dialogflow.v2.ICompleteConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.ICompleteConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + completeConversation( + request: protos.google.cloud.dialogflow.v2.ICompleteConversationRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.ICompleteConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Completes the specified conversation. Finished conversations are purged + * from the database after 30 days. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.completeConversation(request); + */ + completeConversation( + request: protos.google.cloud.dialogflow.v2.ICompleteConversationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.ICompleteConversationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IConversation, + | protos.google.cloud.dialogflow.v2.ICompleteConversationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversation, + ( + | protos.google.cloud.dialogflow.v2.ICompleteConversationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.completeConversation(request, options, callback); + } + createCallMatcher( + request: protos.google.cloud.dialogflow.v2.ICreateCallMatcherRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.ICallMatcher, + protos.google.cloud.dialogflow.v2.ICreateCallMatcherRequest | undefined, + {} | undefined + ] + >; + createCallMatcher( + request: protos.google.cloud.dialogflow.v2.ICreateCallMatcherRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.ICallMatcher, + | protos.google.cloud.dialogflow.v2.ICreateCallMatcherRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCallMatcher( + request: protos.google.cloud.dialogflow.v2.ICreateCallMatcherRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.ICallMatcher, + | protos.google.cloud.dialogflow.v2.ICreateCallMatcherRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a call matcher that links incoming SIP calls to the specified + * conversation if they fulfill specified criteria. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource identifier of the conversation adding the call matcher. + * Format: `projects//locations//conversations/`. + * @param {google.cloud.dialogflow.v2.CallMatcher} request.callMatcher + * Required. The call matcher to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CallMatcher]{@link google.cloud.dialogflow.v2.CallMatcher}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createCallMatcher(request); + */ + createCallMatcher( + request: protos.google.cloud.dialogflow.v2.ICreateCallMatcherRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.ICallMatcher, + | protos.google.cloud.dialogflow.v2.ICreateCallMatcherRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.ICallMatcher, + | protos.google.cloud.dialogflow.v2.ICreateCallMatcherRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.ICallMatcher, + protos.google.cloud.dialogflow.v2.ICreateCallMatcherRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createCallMatcher(request, options, callback); + } + deleteCallMatcher( + request: protos.google.cloud.dialogflow.v2.IDeleteCallMatcherRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.v2.IDeleteCallMatcherRequest | undefined, + {} | undefined + ] + >; + deleteCallMatcher( + request: protos.google.cloud.dialogflow.v2.IDeleteCallMatcherRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2.IDeleteCallMatcherRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCallMatcher( + request: protos.google.cloud.dialogflow.v2.IDeleteCallMatcherRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2.IDeleteCallMatcherRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Requests deletion of a call matcher. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique identifier of the {@link google.cloud.dialogflow.v2.CallMatcher|CallMatcher} to delete. + * Format: `projects//locations//conversations//callMatchers/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deleteCallMatcher(request); + */ + deleteCallMatcher( + request: protos.google.cloud.dialogflow.v2.IDeleteCallMatcherRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2.IDeleteCallMatcherRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2.IDeleteCallMatcherRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.v2.IDeleteCallMatcherRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteCallMatcher(request, options, callback); + } + + listConversations( + request: protos.google.cloud.dialogflow.v2.IListConversationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversation[], + protos.google.cloud.dialogflow.v2.IListConversationsRequest | null, + protos.google.cloud.dialogflow.v2.IListConversationsResponse + ] + >; + listConversations( + request: protos.google.cloud.dialogflow.v2.IListConversationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListConversationsRequest, + | protos.google.cloud.dialogflow.v2.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IConversation + > + ): void; + listConversations( + request: protos.google.cloud.dialogflow.v2.IListConversationsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListConversationsRequest, + | protos.google.cloud.dialogflow.v2.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IConversation + > + ): void; + /** + * Returns the list of all conversations in the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {string} request.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). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Conversation]{@link google.cloud.dialogflow.v2.Conversation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listConversationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listConversations( + request: protos.google.cloud.dialogflow.v2.IListConversationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2.IListConversationsRequest, + | protos.google.cloud.dialogflow.v2.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IConversation + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListConversationsRequest, + | protos.google.cloud.dialogflow.v2.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IConversation + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IConversation[], + protos.google.cloud.dialogflow.v2.IListConversationsRequest | null, + protos.google.cloud.dialogflow.v2.IListConversationsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listConversations(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {string} request.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). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Conversation]{@link google.cloud.dialogflow.v2.Conversation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listConversationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listConversationsStream( + request?: protos.google.cloud.dialogflow.v2.IListConversationsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listConversations.createStream( + this.innerApiCalls.listConversations as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConversations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {string} request.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). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Conversation]{@link google.cloud.dialogflow.v2.Conversation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listConversationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listConversationsAsync( + request?: protos.google.cloud.dialogflow.v2.IListConversationsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listConversations.asyncIterate( + this.innerApiCalls['listConversations'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + listCallMatchers( + request: protos.google.cloud.dialogflow.v2.IListCallMatchersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.ICallMatcher[], + protos.google.cloud.dialogflow.v2.IListCallMatchersRequest | null, + protos.google.cloud.dialogflow.v2.IListCallMatchersResponse + ] + >; + listCallMatchers( + request: protos.google.cloud.dialogflow.v2.IListCallMatchersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListCallMatchersRequest, + | protos.google.cloud.dialogflow.v2.IListCallMatchersResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.ICallMatcher + > + ): void; + listCallMatchers( + request: protos.google.cloud.dialogflow.v2.IListCallMatchersRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListCallMatchersRequest, + | protos.google.cloud.dialogflow.v2.IListCallMatchersResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.ICallMatcher + > + ): void; + /** + * Returns the list of all call matchers in the specified conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all call matchers from. + * Format: `projects//locations//conversations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [CallMatcher]{@link google.cloud.dialogflow.v2.CallMatcher}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCallMatchersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCallMatchers( + request: protos.google.cloud.dialogflow.v2.IListCallMatchersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2.IListCallMatchersRequest, + | protos.google.cloud.dialogflow.v2.IListCallMatchersResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.ICallMatcher + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListCallMatchersRequest, + | protos.google.cloud.dialogflow.v2.IListCallMatchersResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.ICallMatcher + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.ICallMatcher[], + protos.google.cloud.dialogflow.v2.IListCallMatchersRequest | null, + protos.google.cloud.dialogflow.v2.IListCallMatchersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listCallMatchers(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all call matchers from. + * Format: `projects//locations//conversations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [CallMatcher]{@link google.cloud.dialogflow.v2.CallMatcher} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCallMatchersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCallMatchersStream( + request?: protos.google.cloud.dialogflow.v2.IListCallMatchersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listCallMatchers.createStream( + this.innerApiCalls.listCallMatchers as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCallMatchers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all call matchers from. + * Format: `projects//locations//conversations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CallMatcher]{@link google.cloud.dialogflow.v2.CallMatcher}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listCallMatchersAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listCallMatchersAsync( + request?: protos.google.cloud.dialogflow.v2.IListCallMatchersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listCallMatchers.asyncIterate( + this.innerApiCalls['listCallMatchers'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + listMessages( + request: protos.google.cloud.dialogflow.v2.IListMessagesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IMessage[], + protos.google.cloud.dialogflow.v2.IListMessagesRequest | null, + protos.google.cloud.dialogflow.v2.IListMessagesResponse + ] + >; + listMessages( + request: protos.google.cloud.dialogflow.v2.IListMessagesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListMessagesRequest, + | protos.google.cloud.dialogflow.v2.IListMessagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IMessage + > + ): void; + listMessages( + request: protos.google.cloud.dialogflow.v2.IListMessagesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListMessagesRequest, + | protos.google.cloud.dialogflow.v2.IListMessagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IMessage + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * @param {string} [request.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). + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Message]{@link google.cloud.dialogflow.v2.Message}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMessagesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMessages( + request: protos.google.cloud.dialogflow.v2.IListMessagesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2.IListMessagesRequest, + | protos.google.cloud.dialogflow.v2.IListMessagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IMessage + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListMessagesRequest, + | protos.google.cloud.dialogflow.v2.IListMessagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IMessage + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IMessage[], + protos.google.cloud.dialogflow.v2.IListMessagesRequest | null, + protos.google.cloud.dialogflow.v2.IListMessagesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listMessages(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * @param {string} [request.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). + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Message]{@link google.cloud.dialogflow.v2.Message} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMessagesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMessagesStream( + request?: protos.google.cloud.dialogflow.v2.IListMessagesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listMessages.createStream( + this.innerApiCalls.listMessages as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listMessages`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * @param {string} [request.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). + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Message]{@link google.cloud.dialogflow.v2.Message}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listMessagesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listMessagesAsync( + request?: protos.google.cloud.dialogflow.v2.IListMessagesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listMessages.asyncIterate( + this.innerApiCalls['listMessages'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + agentPath(project: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project: string, entityType: string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath(project: string, environment: string) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionContext resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionEntityType resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionEntityTypePath( + project: string, + environment: string, + user: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentSessionContextPath( + project: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.render({ + project: project, + session: session, + context: context, + }); + } + + /** + * Parse the project from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentSessionEntityTypePath( + project: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.render({ + project: project, + session: session, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.conversationsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dialogflow/src/v2/conversations_client_config.json b/packages/google-cloud-dialogflow/src/v2/conversations_client_config.json new file mode 100644 index 00000000000..7886f17ae49 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/conversations_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Conversations": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateConversation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListConversations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetConversation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CompleteConversation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateCallMatcher": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListCallMatchers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteCallMatcher": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListMessages": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/src/v2/conversations_proto_list.json b/packages/google-cloud-dialogflow/src/v2/conversations_proto_list.json new file mode 100644 index 00000000000..2bb2f7b52ed --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/conversations_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", + "../../protos/google/cloud/dialogflow/v2/audio_config.proto", + "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", + "../../protos/google/cloud/dialogflow/v2/entity_type.proto", + "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", + "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", + "../../protos/google/cloud/dialogflow/v2/session.proto", + "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/v2/validation_result.proto", + "../../protos/google/cloud/dialogflow/v2/webhook.proto" +] diff --git a/packages/google-cloud-dialogflow/src/v2/documents_client.ts b/packages/google-cloud-dialogflow/src/v2/documents_client.ts new file mode 100644 index 00000000000..9713c414ce6 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/documents_client.ts @@ -0,0 +1,2908 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + LROperation, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v2/documents_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './documents_client_config.json'; +import {operationsProtos} from 'google-gax'; +const version = require('../../../package.json').version; + +/** + * Service for managing knowledge {@link google.cloud.dialogflow.v2.Document|Documents}. + * @class + * @memberof v2 + */ +export class DocumentsClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + documentsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of DocumentsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof DocumentsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/entityTypes/{entity_type}' + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}' + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/intents/{intent}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectAgentEnvironmentUserSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}' + ), + projectAgentEnvironmentUserSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}' + ), + projectAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/contexts/{context}' + ), + projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listDocuments: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'documents' + ), + }; + + // This API contains "long-running operations", which return a + // an Operation object that allows for tracking of the operation, + // rather than holding a request open. + const protoFilesRoot = opts.fallback + ? this._gaxModule.protobuf.Root.fromJSON( + // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + ) + : this._gaxModule.protobuf.loadSync(nodejsProtoPath); + + this.operationsClient = this._gaxModule + .lro({ + auth: this.auth, + grpc: 'grpc' in this._gaxGrpc ? this._gaxGrpc.grpc : undefined, + }) + .operationsClient(opts); + const createDocumentResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.v2.Document' + ) as gax.protobuf.Type; + const createDocumentMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.v2.KnowledgeOperationMetadata' + ) as gax.protobuf.Type; + const deleteDocumentResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty' + ) as gax.protobuf.Type; + const deleteDocumentMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.v2.KnowledgeOperationMetadata' + ) as gax.protobuf.Type; + const updateDocumentResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.v2.Document' + ) as gax.protobuf.Type; + const updateDocumentMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.v2.KnowledgeOperationMetadata' + ) as gax.protobuf.Type; + const reloadDocumentResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.v2.Document' + ) as gax.protobuf.Type; + const reloadDocumentMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.v2.KnowledgeOperationMetadata' + ) as gax.protobuf.Type; + + this.descriptors.longrunning = { + createDocument: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createDocumentResponse.decode.bind(createDocumentResponse), + createDocumentMetadata.decode.bind(createDocumentMetadata) + ), + deleteDocument: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteDocumentResponse.decode.bind(deleteDocumentResponse), + deleteDocumentMetadata.decode.bind(deleteDocumentMetadata) + ), + updateDocument: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDocumentResponse.decode.bind(updateDocumentResponse), + updateDocumentMetadata.decode.bind(updateDocumentMetadata) + ), + reloadDocument: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + reloadDocumentResponse.decode.bind(reloadDocumentResponse), + reloadDocumentMetadata.decode.bind(reloadDocumentMetadata) + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.v2.Documents', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.documentsStub) { + return this.documentsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.v2.Documents. + this.documentsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.v2.Documents' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.v2.Documents, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const documentsStubMethods = [ + 'listDocuments', + 'getDocument', + 'createDocument', + 'deleteDocument', + 'updateDocument', + 'reloadDocument', + ]; + for (const methodName of documentsStubMethods) { + const callPromise = this.documentsStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.longrunning[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.documentsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dialogflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getDocument( + request: protos.google.cloud.dialogflow.v2.IGetDocumentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IGetDocumentRequest | undefined, + {} | undefined + ] + >; + getDocument( + request: protos.google.cloud.dialogflow.v2.IGetDocumentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IGetDocumentRequest | null | undefined, + {} | null | undefined + > + ): void; + getDocument( + request: protos.google.cloud.dialogflow.v2.IGetDocumentRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IGetDocumentRequest | null | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves the specified document. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document to retrieve. + * Format `projects//locations//knowledgeBases//documents/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Document]{@link google.cloud.dialogflow.v2.Document}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getDocument(request); + */ + getDocument( + request: protos.google.cloud.dialogflow.v2.IGetDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IDocument, + | protos.google.cloud.dialogflow.v2.IGetDocumentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IGetDocumentRequest | null | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IGetDocumentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getDocument(request, options, callback); + } + + createDocument( + request: protos.google.cloud.dialogflow.v2.ICreateDocumentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + createDocument( + request: protos.google.cloud.dialogflow.v2.ICreateDocumentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + createDocument( + request: protos.google.cloud.dialogflow.v2.ICreateDocumentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new document. + * + * Operation + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The knowledge base to create a document for. + * Format: `projects//locations//knowledgeBases/`. + * @param {google.cloud.dialogflow.v2.Document} request.document + * Required. The document to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.createDocument(request); + * const [response] = await operation.promise(); + */ + createDocument( + request: protos.google.cloud.dialogflow.v2.ICreateDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createDocument(request, options, callback); + } + /** + * Check the status of the long running operation returned by `createDocument()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkCreateDocumentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkCreateDocumentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dialogflow.v2.Document, + protos.google.cloud.dialogflow.v2.KnowledgeOperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.createDocument, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.v2.Document, + protos.google.cloud.dialogflow.v2.KnowledgeOperationMetadata + >; + } + deleteDocument( + request: protos.google.cloud.dialogflow.v2.IDeleteDocumentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + deleteDocument( + request: protos.google.cloud.dialogflow.v2.IDeleteDocumentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + deleteDocument( + request: protos.google.cloud.dialogflow.v2.IDeleteDocumentRequest, + callback: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified document. + * + * Operation + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document to delete. + * Format: `projects//locations//knowledgeBases//documents/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.deleteDocument(request); + * const [response] = await operation.promise(); + */ + deleteDocument( + request: protos.google.cloud.dialogflow.v2.IDeleteDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteDocument(request, options, callback); + } + /** + * Check the status of the long running operation returned by `deleteDocument()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkDeleteDocumentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkDeleteDocumentProgress( + name: string + ): Promise< + LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.dialogflow.v2.KnowledgeOperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.deleteDocument, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.protobuf.Empty, + protos.google.cloud.dialogflow.v2.KnowledgeOperationMetadata + >; + } + updateDocument( + request: protos.google.cloud.dialogflow.v2.IUpdateDocumentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + updateDocument( + request: protos.google.cloud.dialogflow.v2.IUpdateDocumentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + updateDocument( + request: protos.google.cloud.dialogflow.v2.IUpdateDocumentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified document. + * + * Operation + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.Document} request.document + * Required. The document to update. + * @param {google.protobuf.FieldMask} [request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.updateDocument(request); + * const [response] = await operation.promise(); + */ + updateDocument( + request: protos.google.cloud.dialogflow.v2.IUpdateDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'document.name': request.document!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateDocument(request, options, callback); + } + /** + * Check the status of the long running operation returned by `updateDocument()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkUpdateDocumentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkUpdateDocumentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dialogflow.v2.Document, + protos.google.cloud.dialogflow.v2.KnowledgeOperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.updateDocument, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.v2.Document, + protos.google.cloud.dialogflow.v2.KnowledgeOperationMetadata + >; + } + reloadDocument( + request: protos.google.cloud.dialogflow.v2.IReloadDocumentRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + reloadDocument( + request: protos.google.cloud.dialogflow.v2.IReloadDocumentRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + reloadDocument( + request: protos.google.cloud.dialogflow.v2.IReloadDocumentRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * 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 + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the document to reload. + * Format: `projects//locations//knowledgeBases//documents/` + * @param {string} [request.contentUri] + * Optional. 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:///`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.reloadDocument(request); + * const [response] = await operation.promise(); + */ + reloadDocument( + request: protos.google.cloud.dialogflow.v2.IReloadDocumentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.reloadDocument(request, options, callback); + } + /** + * Check the status of the long running operation returned by `reloadDocument()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkReloadDocumentProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkReloadDocumentProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dialogflow.v2.Document, + protos.google.cloud.dialogflow.v2.KnowledgeOperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.reloadDocument, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.v2.Document, + protos.google.cloud.dialogflow.v2.KnowledgeOperationMetadata + >; + } + listDocuments( + request: protos.google.cloud.dialogflow.v2.IListDocumentsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IDocument[], + protos.google.cloud.dialogflow.v2.IListDocumentsRequest | null, + protos.google.cloud.dialogflow.v2.IListDocumentsResponse + ] + >; + listDocuments( + request: protos.google.cloud.dialogflow.v2.IListDocumentsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListDocumentsRequest, + | protos.google.cloud.dialogflow.v2.IListDocumentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IDocument + > + ): void; + listDocuments( + request: protos.google.cloud.dialogflow.v2.IListDocumentsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListDocumentsRequest, + | protos.google.cloud.dialogflow.v2.IListDocumentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IDocument + > + ): void; + /** + * Returns the list of all documents of the knowledge base. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Document]{@link google.cloud.dialogflow.v2.Document}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listDocumentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDocuments( + request: protos.google.cloud.dialogflow.v2.IListDocumentsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2.IListDocumentsRequest, + | protos.google.cloud.dialogflow.v2.IListDocumentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IDocument + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListDocumentsRequest, + | protos.google.cloud.dialogflow.v2.IListDocumentsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IDocument + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IDocument[], + protos.google.cloud.dialogflow.v2.IListDocumentsRequest | null, + protos.google.cloud.dialogflow.v2.IListDocumentsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listDocuments(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Document]{@link google.cloud.dialogflow.v2.Document} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listDocumentsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listDocumentsStream( + request?: protos.google.cloud.dialogflow.v2.IListDocumentsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listDocuments.createStream( + this.innerApiCalls.listDocuments as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listDocuments`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The knowledge base to list all documents for. + * Format: `projects//locations//knowledgeBases/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Document]{@link google.cloud.dialogflow.v2.Document}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listDocumentsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listDocumentsAsync( + request?: protos.google.cloud.dialogflow.v2.IListDocumentsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listDocuments.asyncIterate( + this.innerApiCalls['listDocuments'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + agentPath(project: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project: string, entityType: string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath(project: string, environment: string) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionContext resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionEntityType resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionEntityTypePath( + project: string, + environment: string, + user: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentSessionContextPath( + project: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.render({ + project: project, + session: session, + context: context, + }); + } + + /** + * Parse the project from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentSessionEntityTypePath( + project: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.render({ + project: project, + session: session, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.documentsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dialogflow/src/v2/documents_client_config.json b/packages/google-cloud-dialogflow/src/v2/documents_client_config.json new file mode 100644 index 00000000000..23bb7e66621 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/documents_client_config.json @@ -0,0 +1,59 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Documents": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetDocument": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateDocument": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteDocument": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateDocument": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ReloadDocument": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/src/v2/documents_proto_list.json b/packages/google-cloud-dialogflow/src/v2/documents_proto_list.json new file mode 100644 index 00000000000..2bb2f7b52ed --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/documents_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", + "../../protos/google/cloud/dialogflow/v2/audio_config.proto", + "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", + "../../protos/google/cloud/dialogflow/v2/entity_type.proto", + "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", + "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", + "../../protos/google/cloud/dialogflow/v2/session.proto", + "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/v2/validation_result.proto", + "../../protos/google/cloud/dialogflow/v2/webhook.proto" +] diff --git a/packages/google-cloud-dialogflow/src/v2/entity_types_client.ts b/packages/google-cloud-dialogflow/src/v2/entity_types_client.ts index b2fc0afa3a9..6d23d1ad676 100644 --- a/packages/google-cloud-dialogflow/src/v2/entity_types_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/entity_types_client.ts @@ -195,6 +195,54 @@ export class EntityTypesClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), }; // Some of the methods on this service return "paged" results, @@ -2315,6 +2363,1042 @@ export class EntityTypesClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-dialogflow/src/v2/entity_types_proto_list.json b/packages/google-cloud-dialogflow/src/v2/entity_types_proto_list.json index 3cca442f6d7..2bb2f7b52ed 100644 --- a/packages/google-cloud-dialogflow/src/v2/entity_types_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2/entity_types_proto_list.json @@ -1,10 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", "../../protos/google/cloud/dialogflow/v2/audio_config.proto", "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", "../../protos/google/cloud/dialogflow/v2/entity_type.proto", "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", "../../protos/google/cloud/dialogflow/v2/session.proto", "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2/environments_client.ts b/packages/google-cloud-dialogflow/src/v2/environments_client.ts index 5ffc516d44d..abbc4076f9a 100644 --- a/packages/google-cloud-dialogflow/src/v2/environments_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/environments_client.ts @@ -193,6 +193,54 @@ export class EnvironmentsClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), }; // Some of the methods on this service return "paged" results, @@ -1034,6 +1082,1042 @@ export class EnvironmentsClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-dialogflow/src/v2/environments_proto_list.json b/packages/google-cloud-dialogflow/src/v2/environments_proto_list.json index 3cca442f6d7..2bb2f7b52ed 100644 --- a/packages/google-cloud-dialogflow/src/v2/environments_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2/environments_proto_list.json @@ -1,10 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", "../../protos/google/cloud/dialogflow/v2/audio_config.proto", "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", "../../protos/google/cloud/dialogflow/v2/entity_type.proto", "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", "../../protos/google/cloud/dialogflow/v2/session.proto", "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2/gapic_metadata.json b/packages/google-cloud-dialogflow/src/v2/gapic_metadata.json index 9fc8a3e0e7d..b6f537c641f 100644 --- a/packages/google-cloud-dialogflow/src/v2/gapic_metadata.json +++ b/packages/google-cloud-dialogflow/src/v2/gapic_metadata.json @@ -113,6 +113,44 @@ } } }, + "AnswerRecords": { + "clients": { + "grpc": { + "libraryClient": "AnswerRecordsClient", + "rpcs": { + "UpdateAnswerRecord": { + "methods": [ + "updateAnswerRecord" + ] + }, + "ListAnswerRecords": { + "methods": [ + "listAnswerRecords", + "listAnswerRecordsStream", + "listAnswerRecordsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AnswerRecordsClient", + "rpcs": { + "UpdateAnswerRecord": { + "methods": [ + "updateAnswerRecord" + ] + }, + "ListAnswerRecords": { + "methods": [ + "listAnswerRecords", + "listAnswerRecordsStream", + "listAnswerRecordsAsync" + ] + } + } + } + } + }, "Contexts": { "clients": { "grpc": { @@ -191,6 +229,258 @@ } } }, + "ConversationProfiles": { + "clients": { + "grpc": { + "libraryClient": "ConversationProfilesClient", + "rpcs": { + "GetConversationProfile": { + "methods": [ + "getConversationProfile" + ] + }, + "CreateConversationProfile": { + "methods": [ + "createConversationProfile" + ] + }, + "UpdateConversationProfile": { + "methods": [ + "updateConversationProfile" + ] + }, + "DeleteConversationProfile": { + "methods": [ + "deleteConversationProfile" + ] + }, + "ListConversationProfiles": { + "methods": [ + "listConversationProfiles", + "listConversationProfilesStream", + "listConversationProfilesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ConversationProfilesClient", + "rpcs": { + "GetConversationProfile": { + "methods": [ + "getConversationProfile" + ] + }, + "CreateConversationProfile": { + "methods": [ + "createConversationProfile" + ] + }, + "UpdateConversationProfile": { + "methods": [ + "updateConversationProfile" + ] + }, + "DeleteConversationProfile": { + "methods": [ + "deleteConversationProfile" + ] + }, + "ListConversationProfiles": { + "methods": [ + "listConversationProfiles", + "listConversationProfilesStream", + "listConversationProfilesAsync" + ] + } + } + } + } + }, + "Conversations": { + "clients": { + "grpc": { + "libraryClient": "ConversationsClient", + "rpcs": { + "CreateConversation": { + "methods": [ + "createConversation" + ] + }, + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "CompleteConversation": { + "methods": [ + "completeConversation" + ] + }, + "CreateCallMatcher": { + "methods": [ + "createCallMatcher" + ] + }, + "DeleteCallMatcher": { + "methods": [ + "deleteCallMatcher" + ] + }, + "ListConversations": { + "methods": [ + "listConversations", + "listConversationsStream", + "listConversationsAsync" + ] + }, + "ListCallMatchers": { + "methods": [ + "listCallMatchers", + "listCallMatchersStream", + "listCallMatchersAsync" + ] + }, + "ListMessages": { + "methods": [ + "listMessages", + "listMessagesStream", + "listMessagesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ConversationsClient", + "rpcs": { + "CreateConversation": { + "methods": [ + "createConversation" + ] + }, + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "CompleteConversation": { + "methods": [ + "completeConversation" + ] + }, + "CreateCallMatcher": { + "methods": [ + "createCallMatcher" + ] + }, + "DeleteCallMatcher": { + "methods": [ + "deleteCallMatcher" + ] + }, + "ListConversations": { + "methods": [ + "listConversations", + "listConversationsStream", + "listConversationsAsync" + ] + }, + "ListCallMatchers": { + "methods": [ + "listCallMatchers", + "listCallMatchersStream", + "listCallMatchersAsync" + ] + }, + "ListMessages": { + "methods": [ + "listMessages", + "listMessagesStream", + "listMessagesAsync" + ] + } + } + } + } + }, + "Documents": { + "clients": { + "grpc": { + "libraryClient": "DocumentsClient", + "rpcs": { + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "CreateDocument": { + "methods": [ + "createDocument" + ] + }, + "DeleteDocument": { + "methods": [ + "deleteDocument" + ] + }, + "UpdateDocument": { + "methods": [ + "updateDocument" + ] + }, + "ReloadDocument": { + "methods": [ + "reloadDocument" + ] + }, + "ListDocuments": { + "methods": [ + "listDocuments", + "listDocumentsStream", + "listDocumentsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "DocumentsClient", + "rpcs": { + "GetDocument": { + "methods": [ + "getDocument" + ] + }, + "CreateDocument": { + "methods": [ + "createDocument" + ] + }, + "DeleteDocument": { + "methods": [ + "deleteDocument" + ] + }, + "UpdateDocument": { + "methods": [ + "updateDocument" + ] + }, + "ReloadDocument": { + "methods": [ + "reloadDocument" + ] + }, + "ListDocuments": { + "methods": [ + "listDocuments", + "listDocumentsStream", + "listDocumentsAsync" + ] + } + } + } + } + }, "EntityTypes": { "clients": { "grpc": { @@ -425,6 +715,167 @@ } } }, + "KnowledgeBases": { + "clients": { + "grpc": { + "libraryClient": "KnowledgeBasesClient", + "rpcs": { + "GetKnowledgeBase": { + "methods": [ + "getKnowledgeBase" + ] + }, + "CreateKnowledgeBase": { + "methods": [ + "createKnowledgeBase" + ] + }, + "DeleteKnowledgeBase": { + "methods": [ + "deleteKnowledgeBase" + ] + }, + "UpdateKnowledgeBase": { + "methods": [ + "updateKnowledgeBase" + ] + }, + "ListKnowledgeBases": { + "methods": [ + "listKnowledgeBases", + "listKnowledgeBasesStream", + "listKnowledgeBasesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "KnowledgeBasesClient", + "rpcs": { + "GetKnowledgeBase": { + "methods": [ + "getKnowledgeBase" + ] + }, + "CreateKnowledgeBase": { + "methods": [ + "createKnowledgeBase" + ] + }, + "DeleteKnowledgeBase": { + "methods": [ + "deleteKnowledgeBase" + ] + }, + "UpdateKnowledgeBase": { + "methods": [ + "updateKnowledgeBase" + ] + }, + "ListKnowledgeBases": { + "methods": [ + "listKnowledgeBases", + "listKnowledgeBasesStream", + "listKnowledgeBasesAsync" + ] + } + } + } + } + }, + "Participants": { + "clients": { + "grpc": { + "libraryClient": "ParticipantsClient", + "rpcs": { + "CreateParticipant": { + "methods": [ + "createParticipant" + ] + }, + "GetParticipant": { + "methods": [ + "getParticipant" + ] + }, + "UpdateParticipant": { + "methods": [ + "updateParticipant" + ] + }, + "AnalyzeContent": { + "methods": [ + "analyzeContent" + ] + }, + "SuggestArticles": { + "methods": [ + "suggestArticles" + ] + }, + "SuggestFaqAnswers": { + "methods": [ + "suggestFaqAnswers" + ] + }, + "StreamingAnalyzeContent": { + "methods": [ + "streamingAnalyzeContent" + ] + }, + "ListParticipants": { + "methods": [ + "listParticipants", + "listParticipantsStream", + "listParticipantsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ParticipantsClient", + "rpcs": { + "CreateParticipant": { + "methods": [ + "createParticipant" + ] + }, + "GetParticipant": { + "methods": [ + "getParticipant" + ] + }, + "UpdateParticipant": { + "methods": [ + "updateParticipant" + ] + }, + "AnalyzeContent": { + "methods": [ + "analyzeContent" + ] + }, + "SuggestArticles": { + "methods": [ + "suggestArticles" + ] + }, + "SuggestFaqAnswers": { + "methods": [ + "suggestFaqAnswers" + ] + }, + "ListParticipants": { + "methods": [ + "listParticipants", + "listParticipantsStream", + "listParticipantsAsync" + ] + } + } + } + } + }, "SessionEntityTypes": { "clients": { "grpc": { diff --git a/packages/google-cloud-dialogflow/src/v2/index.ts b/packages/google-cloud-dialogflow/src/v2/index.ts index 0b3b41321c7..90228acd4e2 100644 --- a/packages/google-cloud-dialogflow/src/v2/index.ts +++ b/packages/google-cloud-dialogflow/src/v2/index.ts @@ -17,9 +17,15 @@ // ** All changes to this file may be overwritten. ** export {AgentsClient} from './agents_client'; +export {AnswerRecordsClient} from './answer_records_client'; export {ContextsClient} from './contexts_client'; +export {ConversationProfilesClient} from './conversation_profiles_client'; +export {ConversationsClient} from './conversations_client'; +export {DocumentsClient} from './documents_client'; export {EntityTypesClient} from './entity_types_client'; export {EnvironmentsClient} from './environments_client'; export {IntentsClient} from './intents_client'; +export {KnowledgeBasesClient} from './knowledge_bases_client'; +export {ParticipantsClient} from './participants_client'; export {SessionEntityTypesClient} from './session_entity_types_client'; export {SessionsClient} from './sessions_client'; diff --git a/packages/google-cloud-dialogflow/src/v2/intents_client.ts b/packages/google-cloud-dialogflow/src/v2/intents_client.ts index 0f8286238b2..ed189d49dc6 100644 --- a/packages/google-cloud-dialogflow/src/v2/intents_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/intents_client.ts @@ -195,6 +195,54 @@ export class IntentsClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), }; // Some of the methods on this service return "paged" results, @@ -1789,6 +1837,1042 @@ export class IntentsClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-dialogflow/src/v2/intents_proto_list.json b/packages/google-cloud-dialogflow/src/v2/intents_proto_list.json index 3cca442f6d7..2bb2f7b52ed 100644 --- a/packages/google-cloud-dialogflow/src/v2/intents_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2/intents_proto_list.json @@ -1,10 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", "../../protos/google/cloud/dialogflow/v2/audio_config.proto", "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", "../../protos/google/cloud/dialogflow/v2/entity_type.proto", "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", "../../protos/google/cloud/dialogflow/v2/session.proto", "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2/knowledge_bases_client.ts b/packages/google-cloud-dialogflow/src/v2/knowledge_bases_client.ts new file mode 100644 index 00000000000..e52acb43722 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/knowledge_bases_client.ts @@ -0,0 +1,2525 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v2/knowledge_bases_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './knowledge_bases_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service for managing {@link google.cloud.dialogflow.v2.KnowledgeBase|KnowledgeBases}. + * @class + * @memberof v2 + */ +export class KnowledgeBasesClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + knowledgeBasesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of KnowledgeBasesClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof KnowledgeBasesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/entityTypes/{entity_type}' + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}' + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/intents/{intent}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectAgentEnvironmentUserSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}' + ), + projectAgentEnvironmentUserSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}' + ), + projectAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/contexts/{context}' + ), + projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listKnowledgeBases: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'knowledgeBases' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.v2.KnowledgeBases', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.knowledgeBasesStub) { + return this.knowledgeBasesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.v2.KnowledgeBases. + this.knowledgeBasesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.v2.KnowledgeBases' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.v2.KnowledgeBases, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const knowledgeBasesStubMethods = [ + 'listKnowledgeBases', + 'getKnowledgeBase', + 'createKnowledgeBase', + 'deleteKnowledgeBase', + 'updateKnowledgeBase', + ]; + for (const methodName of knowledgeBasesStubMethods) { + const callPromise = this.knowledgeBasesStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.knowledgeBasesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dialogflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + protos.google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest | undefined, + {} | undefined + ] + >; + getKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + | protos.google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + | protos.google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves the specified knowledge base. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the knowledge base to retrieve. + * Format `projects//locations//knowledgeBases/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getKnowledgeBase(request); + */ + getKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + | protos.google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + | protos.google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + protos.google.cloud.dialogflow.v2.IGetKnowledgeBaseRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getKnowledgeBase(request, options, callback); + } + createKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + protos.google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest | undefined, + {} | undefined + ] + >; + createKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + | protos.google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + | protos.google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a knowledge base. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to create a knowledge base for. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.v2.KnowledgeBase} request.knowledgeBase + * Required. The knowledge base to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createKnowledgeBase(request); + */ + createKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + | protos.google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + | protos.google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + protos.google.cloud.dialogflow.v2.ICreateKnowledgeBaseRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createKnowledgeBase(request, options, callback); + } + deleteKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest | undefined, + {} | undefined + ] + >; + deleteKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified knowledge base. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the knowledge base to delete. + * Format: `projects//locations//knowledgeBases/`. + * @param {boolean} [request.force] + * Optional. Force deletes the knowledge base. When set to true, any documents + * in the knowledge base are also deleted. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deleteKnowledgeBase(request); + */ + deleteKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.v2.IDeleteKnowledgeBaseRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteKnowledgeBase(request, options, callback); + } + updateKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + protos.google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest | undefined, + {} | undefined + ] + >; + updateKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + | protos.google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + | protos.google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified knowledge base. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.KnowledgeBase} request.knowledgeBase + * Required. The knowledge base to update. + * @param {google.protobuf.FieldMask} [request.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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateKnowledgeBase(request); + */ + updateKnowledgeBase( + request: protos.google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + | protos.google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + | protos.google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IKnowledgeBase, + protos.google.cloud.dialogflow.v2.IUpdateKnowledgeBaseRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'knowledge_base.name': request.knowledgeBase!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateKnowledgeBase(request, options, callback); + } + + listKnowledgeBases( + request: protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IKnowledgeBase[], + protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest | null, + protos.google.cloud.dialogflow.v2.IListKnowledgeBasesResponse + ] + >; + listKnowledgeBases( + request: protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, + | protos.google.cloud.dialogflow.v2.IListKnowledgeBasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IKnowledgeBase + > + ): void; + listKnowledgeBases( + request: protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, + | protos.google.cloud.dialogflow.v2.IListKnowledgeBasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IKnowledgeBase + > + ): void; + /** + * Returns the list of all knowledge bases of the specified agent. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listKnowledgeBasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listKnowledgeBases( + request: protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, + | protos.google.cloud.dialogflow.v2.IListKnowledgeBasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IKnowledgeBase + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, + | protos.google.cloud.dialogflow.v2.IListKnowledgeBasesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IKnowledgeBase + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IKnowledgeBase[], + protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest | null, + protos.google.cloud.dialogflow.v2.IListKnowledgeBasesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listKnowledgeBases(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listKnowledgeBasesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listKnowledgeBasesStream( + request?: protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listKnowledgeBases.createStream( + this.innerApiCalls.listKnowledgeBases as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listKnowledgeBases`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list of knowledge bases for. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 10 and at most 100. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [KnowledgeBase]{@link google.cloud.dialogflow.v2.KnowledgeBase}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listKnowledgeBasesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listKnowledgeBasesAsync( + request?: protos.google.cloud.dialogflow.v2.IListKnowledgeBasesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listKnowledgeBases.asyncIterate( + this.innerApiCalls['listKnowledgeBases'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + agentPath(project: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project: string, entityType: string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath(project: string, environment: string) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionContext resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionEntityType resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionEntityTypePath( + project: string, + environment: string, + user: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentSessionContextPath( + project: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.render({ + project: project, + session: session, + context: context, + }); + } + + /** + * Parse the project from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentSessionEntityTypePath( + project: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.render({ + project: project, + session: session, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.knowledgeBasesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dialogflow/src/v2/knowledge_bases_client_config.json b/packages/google-cloud-dialogflow/src/v2/knowledge_bases_client_config.json new file mode 100644 index 00000000000..580ef4d8686 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/knowledge_bases_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.KnowledgeBases": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListKnowledgeBases": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateKnowledgeBase": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/src/v2/knowledge_bases_proto_list.json b/packages/google-cloud-dialogflow/src/v2/knowledge_bases_proto_list.json new file mode 100644 index 00000000000..2bb2f7b52ed --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/knowledge_bases_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", + "../../protos/google/cloud/dialogflow/v2/audio_config.proto", + "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", + "../../protos/google/cloud/dialogflow/v2/entity_type.proto", + "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", + "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", + "../../protos/google/cloud/dialogflow/v2/session.proto", + "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/v2/validation_result.proto", + "../../protos/google/cloud/dialogflow/v2/webhook.proto" +] diff --git a/packages/google-cloud-dialogflow/src/v2/participants_client.ts b/packages/google-cloud-dialogflow/src/v2/participants_client.ts new file mode 100644 index 00000000000..0bf8918056d --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/participants_client.ts @@ -0,0 +1,2809 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v2/participants_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './participants_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service for managing {@link google.cloud.dialogflow.v2.Participant|Participants}. + * @class + * @memberof v2 + */ +export class ParticipantsClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + participantsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ParticipantsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ParticipantsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + agentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent' + ), + entityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/entityTypes/{entity_type}' + ), + environmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}' + ), + intentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/intents/{intent}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectAgentEnvironmentUserSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}' + ), + projectAgentEnvironmentUserSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}' + ), + projectAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/contexts/{context}' + ), + projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listParticipants: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'participants' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingAnalyzeContent: new this._gaxModule.StreamDescriptor( + gax.StreamType.BIDI_STREAMING + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.v2.Participants', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.participantsStub) { + return this.participantsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.v2.Participants. + this.participantsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.v2.Participants' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.v2.Participants, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const participantsStubMethods = [ + 'createParticipant', + 'getParticipant', + 'listParticipants', + 'updateParticipant', + 'analyzeContent', + 'streamingAnalyzeContent', + 'suggestArticles', + 'suggestFaqAnswers', + ]; + for (const methodName of participantsStubMethods) { + const callPromise = this.participantsStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.participantsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dialogflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createParticipant( + request: protos.google.cloud.dialogflow.v2.ICreateParticipantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IParticipant, + protos.google.cloud.dialogflow.v2.ICreateParticipantRequest | undefined, + {} | undefined + ] + >; + createParticipant( + request: protos.google.cloud.dialogflow.v2.ICreateParticipantRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IParticipant, + | protos.google.cloud.dialogflow.v2.ICreateParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createParticipant( + request: protos.google.cloud.dialogflow.v2.ICreateParticipantRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IParticipant, + | protos.google.cloud.dialogflow.v2.ICreateParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new participant in a conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * @param {google.cloud.dialogflow.v2.Participant} request.participant + * Required. The participant to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2.Participant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createParticipant(request); + */ + createParticipant( + request: protos.google.cloud.dialogflow.v2.ICreateParticipantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IParticipant, + | protos.google.cloud.dialogflow.v2.ICreateParticipantRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IParticipant, + | protos.google.cloud.dialogflow.v2.ICreateParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IParticipant, + protos.google.cloud.dialogflow.v2.ICreateParticipantRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createParticipant(request, options, callback); + } + getParticipant( + request: protos.google.cloud.dialogflow.v2.IGetParticipantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IParticipant, + protos.google.cloud.dialogflow.v2.IGetParticipantRequest | undefined, + {} | undefined + ] + >; + getParticipant( + request: protos.google.cloud.dialogflow.v2.IGetParticipantRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IParticipant, + | protos.google.cloud.dialogflow.v2.IGetParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getParticipant( + request: protos.google.cloud.dialogflow.v2.IGetParticipantRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IParticipant, + | protos.google.cloud.dialogflow.v2.IGetParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves a conversation participant. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2.Participant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getParticipant(request); + */ + getParticipant( + request: protos.google.cloud.dialogflow.v2.IGetParticipantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IParticipant, + | protos.google.cloud.dialogflow.v2.IGetParticipantRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IParticipant, + | protos.google.cloud.dialogflow.v2.IGetParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IParticipant, + protos.google.cloud.dialogflow.v2.IGetParticipantRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getParticipant(request, options, callback); + } + updateParticipant( + request: protos.google.cloud.dialogflow.v2.IUpdateParticipantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IParticipant, + protos.google.cloud.dialogflow.v2.IUpdateParticipantRequest | undefined, + {} | undefined + ] + >; + updateParticipant( + request: protos.google.cloud.dialogflow.v2.IUpdateParticipantRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IParticipant, + | protos.google.cloud.dialogflow.v2.IUpdateParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateParticipant( + request: protos.google.cloud.dialogflow.v2.IUpdateParticipantRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IParticipant, + | protos.google.cloud.dialogflow.v2.IUpdateParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified participant. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2.Participant} request.participant + * Required. The participant to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to specify which fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2.Participant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateParticipant(request); + */ + updateParticipant( + request: protos.google.cloud.dialogflow.v2.IUpdateParticipantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IParticipant, + | protos.google.cloud.dialogflow.v2.IUpdateParticipantRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IParticipant, + | protos.google.cloud.dialogflow.v2.IUpdateParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IParticipant, + protos.google.cloud.dialogflow.v2.IUpdateParticipantRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'participant.name': request.participant!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateParticipant(request, options, callback); + } + analyzeContent( + request: protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse, + protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest | undefined, + {} | undefined + ] + >; + analyzeContent( + request: protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse, + | protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeContent( + request: protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse, + | protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * 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). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.participant + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * @param {google.cloud.dialogflow.v2.TextInput} request.textInput + * The natural language text to be processed. + * @param {google.cloud.dialogflow.v2.AudioInput} request.audioInput + * The natural language speech audio to be processed. + * @param {google.cloud.dialogflow.v2.EventInput} request.eventInput + * An input event to send to Dialogflow. + * @param {google.cloud.dialogflow.v2.OutputAudioConfig} request.replyAudioConfig + * 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. + * @param {google.cloud.dialogflow.v2.QueryParameters} request.queryParams + * Parameters for a Dialogflow virtual-agent query. + * @param {string} request.requestId + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnalyzeContentResponse]{@link google.cloud.dialogflow.v2.AnalyzeContentResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.analyzeContent(request); + */ + analyzeContent( + request: protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse, + | protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse, + | protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse, + protos.google.cloud.dialogflow.v2.IAnalyzeContentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + participant: request.participant || '', + }); + this.initialize(); + return this.innerApiCalls.analyzeContent(request, options, callback); + } + suggestArticles( + request: protos.google.cloud.dialogflow.v2.ISuggestArticlesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.ISuggestArticlesResponse, + protos.google.cloud.dialogflow.v2.ISuggestArticlesRequest | undefined, + {} | undefined + ] + >; + suggestArticles( + request: protos.google.cloud.dialogflow.v2.ISuggestArticlesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.ISuggestArticlesResponse, + | protos.google.cloud.dialogflow.v2.ISuggestArticlesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + suggestArticles( + request: protos.google.cloud.dialogflow.v2.ISuggestArticlesRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.ISuggestArticlesResponse, + | protos.google.cloud.dialogflow.v2.ISuggestArticlesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets suggested articles for a participant based on specific historical + * messages. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param {string} request.latestMessage + * 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/`. + * @param {number} request.contextSize + * Max number of messages prior to and including + * {@link google.cloud.dialogflow.v2.SuggestArticlesRequest.latest_message|latest_message} to use as context + * when compiling the suggestion. By default 20 and at most 50. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SuggestArticlesResponse]{@link google.cloud.dialogflow.v2.SuggestArticlesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.suggestArticles(request); + */ + suggestArticles( + request: protos.google.cloud.dialogflow.v2.ISuggestArticlesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.ISuggestArticlesResponse, + | protos.google.cloud.dialogflow.v2.ISuggestArticlesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.ISuggestArticlesResponse, + | protos.google.cloud.dialogflow.v2.ISuggestArticlesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.ISuggestArticlesResponse, + protos.google.cloud.dialogflow.v2.ISuggestArticlesRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.suggestArticles(request, options, callback); + } + suggestFaqAnswers( + request: protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse, + protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest | undefined, + {} | undefined + ] + >; + suggestFaqAnswers( + request: protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse, + | protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest + | null + | undefined, + {} | null | undefined + > + ): void; + suggestFaqAnswers( + request: protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse, + | protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets suggested faq answers for a participant based on specific historical + * messages. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param {string} request.latestMessage + * 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/`. + * @param {number} request.contextSize + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SuggestFaqAnswersResponse]{@link google.cloud.dialogflow.v2.SuggestFaqAnswersResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.suggestFaqAnswers(request); + */ + suggestFaqAnswers( + request: protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse, + | protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse, + | protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse, + protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.suggestFaqAnswers(request, options, callback); + } + + /** + * Adds a text (chat, for example), or audio (phone recording, for example) + * message from a participant into the conversation. + * Note: This method is only available through the gRPC API (not REST). + * + * The top-level message sent to the client by the server is + * `StreamingAnalyzeContentResponse`. Multiple response messages can be + * returned in order. The first one or more messages contain the + * `recognition_result` field. Each result represents a more complete + * transcript of what the user said. The next message contains the + * `reply_text` field and potentially the `reply_audio` field. The message can + * also contain the `automated_agent_reply` field. + * + * 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). + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing [StreamingAnalyzeContentRequest]{@link google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest} for write() method, and + * will emit objects representing [StreamingAnalyzeContentResponse]{@link google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse} on 'data' event asynchronously. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) + * for more details and examples. + * @example + * const stream = client.streamingAnalyzeContent(); + * stream.on('data', (response) => { ... }); + * stream.on('end', () => { ... }); + * stream.write(request); + * stream.end(); + */ + streamingAnalyzeContent(options?: CallOptions): gax.CancellableStream { + this.initialize(); + return this.innerApiCalls.streamingAnalyzeContent(options); + } + + listParticipants( + request: protos.google.cloud.dialogflow.v2.IListParticipantsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IParticipant[], + protos.google.cloud.dialogflow.v2.IListParticipantsRequest | null, + protos.google.cloud.dialogflow.v2.IListParticipantsResponse + ] + >; + listParticipants( + request: protos.google.cloud.dialogflow.v2.IListParticipantsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListParticipantsRequest, + | protos.google.cloud.dialogflow.v2.IListParticipantsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IParticipant + > + ): void; + listParticipants( + request: protos.google.cloud.dialogflow.v2.IListParticipantsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListParticipantsRequest, + | protos.google.cloud.dialogflow.v2.IListParticipantsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IParticipant + > + ): void; + /** + * Returns the list of all participants in the specified conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Participant]{@link google.cloud.dialogflow.v2.Participant}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listParticipantsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listParticipants( + request: protos.google.cloud.dialogflow.v2.IListParticipantsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2.IListParticipantsRequest, + | protos.google.cloud.dialogflow.v2.IListParticipantsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IParticipant + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2.IListParticipantsRequest, + | protos.google.cloud.dialogflow.v2.IListParticipantsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2.IParticipant + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2.IParticipant[], + protos.google.cloud.dialogflow.v2.IListParticipantsRequest | null, + protos.google.cloud.dialogflow.v2.IListParticipantsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listParticipants(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Participant]{@link google.cloud.dialogflow.v2.Participant} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listParticipantsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listParticipantsStream( + request?: protos.google.cloud.dialogflow.v2.IListParticipantsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listParticipants.createStream( + this.innerApiCalls.listParticipants as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listParticipants`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Participant]{@link google.cloud.dialogflow.v2.Participant}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listParticipantsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listParticipantsAsync( + request?: protos.google.cloud.dialogflow.v2.IListParticipantsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listParticipants.asyncIterate( + this.innerApiCalls['listParticipants'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified agent resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + agentPath(project: string) { + return this.pathTemplates.agentPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Agent resource. + * + * @param {string} agentName + * A fully-qualified path representing Agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromAgentName(agentName: string) { + return this.pathTemplates.agentPathTemplate.match(agentName).project; + } + + /** + * Return a fully-qualified entityType resource name string. + * + * @param {string} project + * @param {string} entity_type + * @returns {string} Resource name string. + */ + entityTypePath(project: string, entityType: string) { + return this.pathTemplates.entityTypePathTemplate.render({ + project: project, + entity_type: entityType, + }); + } + + /** + * Parse the project from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .project; + } + + /** + * Parse the entity_type from EntityType resource. + * + * @param {string} entityTypeName + * A fully-qualified path representing EntityType resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromEntityTypeName(entityTypeName: string) { + return this.pathTemplates.entityTypePathTemplate.match(entityTypeName) + .entity_type; + } + + /** + * Return a fully-qualified environment resource name string. + * + * @param {string} project + * @param {string} environment + * @returns {string} Resource name string. + */ + environmentPath(project: string, environment: string) { + return this.pathTemplates.environmentPathTemplate.render({ + project: project, + environment: environment, + }); + } + + /** + * Parse the project from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .project; + } + + /** + * Parse the environment from Environment resource. + * + * @param {string} environmentName + * A fully-qualified path representing Environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromEnvironmentName(environmentName: string) { + return this.pathTemplates.environmentPathTemplate.match(environmentName) + .environment; + } + + /** + * Return a fully-qualified intent resource name string. + * + * @param {string} project + * @param {string} intent + * @returns {string} Resource name string. + */ + intentPath(project: string, intent: string) { + return this.pathTemplates.intentPathTemplate.render({ + project: project, + intent: intent, + }); + } + + /** + * Parse the project from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).project; + } + + /** + * Parse the intent from Intent resource. + * + * @param {string} intentName + * A fully-qualified path representing Intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromIntentName(intentName: string) { + return this.pathTemplates.intentPathTemplate.match(intentName).intent; + } + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionContext resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionEntityType resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionEntityTypePath( + project: string, + environment: string, + user: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentSessionContextPath( + project: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.render({ + project: project, + session: session, + context: context, + }); + } + + /** + * Parse the project from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentSessionEntityTypePath( + project: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.render({ + project: project, + session: session, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.participantsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dialogflow/src/v2/participants_client_config.json b/packages/google-cloud-dialogflow/src/v2/participants_client_config.json new file mode 100644 index 00000000000..c9016c9103c --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/participants_client_config.json @@ -0,0 +1,69 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2.Participants": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListParticipants": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "AnalyzeContent": { + "timeout_millis": 220000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "StreamingAnalyzeContent": { + "timeout_millis": 220000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SuggestArticles": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SuggestFaqAnswers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/src/v2/participants_proto_list.json b/packages/google-cloud-dialogflow/src/v2/participants_proto_list.json new file mode 100644 index 00000000000..2bb2f7b52ed --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2/participants_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", + "../../protos/google/cloud/dialogflow/v2/audio_config.proto", + "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", + "../../protos/google/cloud/dialogflow/v2/entity_type.proto", + "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", + "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", + "../../protos/google/cloud/dialogflow/v2/session.proto", + "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/v2/validation_result.proto", + "../../protos/google/cloud/dialogflow/v2/webhook.proto" +] diff --git a/packages/google-cloud-dialogflow/src/v2/session_entity_types_client.ts b/packages/google-cloud-dialogflow/src/v2/session_entity_types_client.ts index ba6521aa161..cf452c391bd 100644 --- a/packages/google-cloud-dialogflow/src/v2/session_entity_types_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/session_entity_types_client.ts @@ -196,6 +196,54 @@ export class SessionEntityTypesClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), }; // Some of the methods on this service return "paged" results, @@ -1547,6 +1595,1042 @@ export class SessionEntityTypesClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-dialogflow/src/v2/session_entity_types_proto_list.json b/packages/google-cloud-dialogflow/src/v2/session_entity_types_proto_list.json index 3cca442f6d7..2bb2f7b52ed 100644 --- a/packages/google-cloud-dialogflow/src/v2/session_entity_types_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2/session_entity_types_proto_list.json @@ -1,10 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", "../../protos/google/cloud/dialogflow/v2/audio_config.proto", "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", "../../protos/google/cloud/dialogflow/v2/entity_type.proto", "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", "../../protos/google/cloud/dialogflow/v2/session.proto", "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2/sessions_client.ts b/packages/google-cloud-dialogflow/src/v2/sessions_client.ts index 77a4bdc6169..8a09e2860ad 100644 --- a/packages/google-cloud-dialogflow/src/v2/sessions_client.ts +++ b/packages/google-cloud-dialogflow/src/v2/sessions_client.ts @@ -190,6 +190,54 @@ export class SessionsClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), }; // Some of the methods on this service provide streaming responses. @@ -1095,6 +1143,1042 @@ export class SessionsClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-dialogflow/src/v2/sessions_proto_list.json b/packages/google-cloud-dialogflow/src/v2/sessions_proto_list.json index 3cca442f6d7..2bb2f7b52ed 100644 --- a/packages/google-cloud-dialogflow/src/v2/sessions_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2/sessions_proto_list.json @@ -1,10 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2/agent.proto", + "../../protos/google/cloud/dialogflow/v2/answer_record.proto", "../../protos/google/cloud/dialogflow/v2/audio_config.proto", "../../protos/google/cloud/dialogflow/v2/context.proto", + "../../protos/google/cloud/dialogflow/v2/conversation.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2/document.proto", "../../protos/google/cloud/dialogflow/v2/entity_type.proto", "../../protos/google/cloud/dialogflow/v2/environment.proto", + "../../protos/google/cloud/dialogflow/v2/gcs.proto", + "../../protos/google/cloud/dialogflow/v2/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2/intent.proto", + "../../protos/google/cloud/dialogflow/v2/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2/participant.proto", "../../protos/google/cloud/dialogflow/v2/session.proto", "../../protos/google/cloud/dialogflow/v2/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2beta1/agents_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/agents_client.ts index 64b553d6113..1d3ccc14655 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/agents_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/agents_client.ts @@ -195,6 +195,24 @@ export class AgentsClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/knowledgeBases/{knowledge_base}' ), @@ -219,6 +237,24 @@ export class AgentsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' ), @@ -2171,6 +2207,333 @@ export class AgentsClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectKnowledgeBase resource name string. * @@ -2687,6 +3050,458 @@ export class AgentsClient { ).entity_type; } + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectLocationKnowledgeBase resource name string. * diff --git a/packages/google-cloud-dialogflow/src/v2beta1/agents_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/agents_proto_list.json index 2ff3ebfebba..1669125f722 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/agents_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2beta1/agents_proto_list.json @@ -1,13 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", "../../protos/google/cloud/dialogflow/v2beta1/document.proto", "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", "../../protos/google/cloud/dialogflow/v2beta1/session.proto", "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2beta1/answer_records_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/answer_records_client.ts new file mode 100644 index 00000000000..b91e1fd1867 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2beta1/answer_records_client.ts @@ -0,0 +1,2802 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v2beta1/answer_records_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './answer_records_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service for managing {@link google.cloud.dialogflow.v2beta1.AnswerRecord|AnswerRecords}. + * @class + * @memberof v2beta1 + */ +export class AnswerRecordsClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + answerRecordsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of AnswerRecordsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof AnswerRecordsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectAgentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent' + ), + projectAgentEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/entityTypes/{entity_type}' + ), + projectAgentEnvironmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}' + ), + projectAgentEnvironmentUserSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}' + ), + projectAgentEnvironmentUserSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}' + ), + projectAgentIntentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/intents/{intent}' + ), + projectAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/contexts/{context}' + ), + projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAgentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent' + ), + projectLocationAgentEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/entityTypes/{entity_type}' + ), + projectLocationAgentEnvironmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/environments/{environment}' + ), + projectLocationAgentIntentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/intents/{intent}' + ), + projectLocationAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}' + ), + projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listAnswerRecords: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'answerRecords' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.v2beta1.AnswerRecords', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.answerRecordsStub) { + return this.answerRecordsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.v2beta1.AnswerRecords. + this.answerRecordsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.v2beta1.AnswerRecords' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.v2beta1.AnswerRecords, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const answerRecordsStubMethods = [ + 'getAnswerRecord', + 'listAnswerRecords', + 'updateAnswerRecord', + ]; + for (const methodName of answerRecordsStubMethods) { + const callPromise = this.answerRecordsStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.answerRecordsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dialogflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getAnswerRecord( + request: protos.google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord, + ( + | protos.google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest + | undefined + ), + {} | undefined + ] + >; + getAnswerRecord( + request: protos.google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord, + | protos.google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getAnswerRecord( + request: protos.google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord, + | protos.google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deprecated. + * Retrieves a specific answer record. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the answer record to retrieve. + * Format: `projects//locations//answerRecords/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnswerRecord]{@link google.cloud.dialogflow.v2beta1.AnswerRecord}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getAnswerRecord(request); + */ + getAnswerRecord( + request: protos.google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord, + | protos.google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord, + | protos.google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord, + ( + | protos.google.cloud.dialogflow.v2beta1.IGetAnswerRecordRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getAnswerRecord(request, options, callback); + } + updateAnswerRecord( + request: protos.google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord, + ( + | protos.google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest + | undefined + ), + {} | undefined + ] + >; + updateAnswerRecord( + request: protos.google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord, + | protos.google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateAnswerRecord( + request: protos.google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord, + | protos.google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified answer record. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.AnswerRecord} request.answerRecord + * Required. Answer record to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields get updated. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnswerRecord]{@link google.cloud.dialogflow.v2beta1.AnswerRecord}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateAnswerRecord(request); + */ + updateAnswerRecord( + request: protos.google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord, + | protos.google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord, + | protos.google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord, + ( + | protos.google.cloud.dialogflow.v2beta1.IUpdateAnswerRecordRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'answer_record.name': request.answerRecord!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateAnswerRecord(request, options, callback); + } + + listAnswerRecords( + request: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord[], + protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse + ] + >; + listAnswerRecords( + request: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord + > + ): void; + listAnswerRecords( + request: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord + > + ): void; + /** + * Returns the list of all answer records in the specified project in reverse + * chronological order. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * @param {number} request.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. + * @param {string} request.pageToken + * Optional. The + * {@link google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.next_page_token|ListAnswerRecordsResponse.next_page_token} + * value returned from a previous list request used to continue listing on + * the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [AnswerRecord]{@link google.cloud.dialogflow.v2beta1.AnswerRecord}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listAnswerRecordsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnswerRecords( + request: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IAnswerRecord[], + protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listAnswerRecords(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * @param {number} request.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. + * @param {string} request.pageToken + * Optional. The + * {@link google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.next_page_token|ListAnswerRecordsResponse.next_page_token} + * value returned from a previous list request used to continue listing on + * the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [AnswerRecord]{@link google.cloud.dialogflow.v2beta1.AnswerRecord} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listAnswerRecordsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listAnswerRecordsStream( + request?: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listAnswerRecords.createStream( + this.innerApiCalls.listAnswerRecords as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listAnswerRecords`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all answer records for in reverse + * chronological order. Format: `projects//locations/`. + * @param {number} request.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. + * @param {string} request.pageToken + * Optional. The + * {@link google.cloud.dialogflow.v2beta1.ListAnswerRecordsResponse.next_page_token|ListAnswerRecordsResponse.next_page_token} + * value returned from a previous list request used to continue listing on + * the next page. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [AnswerRecord]{@link google.cloud.dialogflow.v2beta1.AnswerRecord}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listAnswerRecordsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listAnswerRecordsAsync( + request?: protos.google.cloud.dialogflow.v2beta1.IListAnswerRecordsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listAnswerRecords.asyncIterate( + this.innerApiCalls['listAnswerRecords'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectAgent resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectAgentPath(project: string) { + return this.pathTemplates.projectAgentPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from ProjectAgent resource. + * + * @param {string} projectAgentName + * A fully-qualified path representing project_agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentName(projectAgentName: string) { + return this.pathTemplates.projectAgentPathTemplate.match(projectAgentName) + .project; + } + + /** + * Return a fully-qualified projectAgentEntityType resource name string. + * + * @param {string} project + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEntityTypePath(project: string, entityType: string) { + return this.pathTemplates.projectAgentEntityTypePathTemplate.render({ + project: project, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentEntityType resource. + * + * @param {string} projectAgentEntityTypeName + * A fully-qualified path representing project_agent_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEntityTypeName( + projectAgentEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEntityTypePathTemplate.match( + projectAgentEntityTypeName + ).project; + } + + /** + * Parse the entity_type from ProjectAgentEntityType resource. + * + * @param {string} projectAgentEntityTypeName + * A fully-qualified path representing project_agent_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEntityTypeName( + projectAgentEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEntityTypePathTemplate.match( + projectAgentEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentEnvironment resource name string. + * + * @param {string} project + * @param {string} environment + * @returns {string} Resource name string. + */ + projectAgentEnvironmentPath(project: string, environment: string) { + return this.pathTemplates.projectAgentEnvironmentPathTemplate.render({ + project: project, + environment: environment, + }); + } + + /** + * Parse the project from ProjectAgentEnvironment resource. + * + * @param {string} projectAgentEnvironmentName + * A fully-qualified path representing project_agent_environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentName( + projectAgentEnvironmentName: string + ) { + return this.pathTemplates.projectAgentEnvironmentPathTemplate.match( + projectAgentEnvironmentName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironment resource. + * + * @param {string} projectAgentEnvironmentName + * A fully-qualified path representing project_agent_environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentName( + projectAgentEnvironmentName: string + ) { + return this.pathTemplates.projectAgentEnvironmentPathTemplate.match( + projectAgentEnvironmentName + ).environment; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionContext resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionEntityType resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionEntityTypePath( + project: string, + environment: string, + user: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentIntent resource name string. + * + * @param {string} project + * @param {string} intent + * @returns {string} Resource name string. + */ + projectAgentIntentPath(project: string, intent: string) { + return this.pathTemplates.projectAgentIntentPathTemplate.render({ + project: project, + intent: intent, + }); + } + + /** + * Parse the project from ProjectAgentIntent resource. + * + * @param {string} projectAgentIntentName + * A fully-qualified path representing project_agent_intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentIntentName(projectAgentIntentName: string) { + return this.pathTemplates.projectAgentIntentPathTemplate.match( + projectAgentIntentName + ).project; + } + + /** + * Parse the intent from ProjectAgentIntent resource. + * + * @param {string} projectAgentIntentName + * A fully-qualified path representing project_agent_intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromProjectAgentIntentName(projectAgentIntentName: string) { + return this.pathTemplates.projectAgentIntentPathTemplate.match( + projectAgentIntentName + ).intent; + } + + /** + * Return a fully-qualified projectAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentSessionContextPath( + project: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.render({ + project: project, + session: session, + context: context, + }); + } + + /** + * Parse the project from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentSessionEntityTypePath( + project: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.render({ + project: project, + session: session, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAgent resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + projectLocationAgentPath(project: string, location: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from ProjectLocationAgent resource. + * + * @param {string} projectLocationAgentName + * A fully-qualified path representing project_location_agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentName(projectLocationAgentName: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.match( + projectLocationAgentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgent resource. + * + * @param {string} projectLocationAgentName + * A fully-qualified path representing project_location_agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentName(projectLocationAgentName: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.match( + projectLocationAgentName + ).location; + } + + /** + * Return a fully-qualified projectLocationAgentEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEntityTypePath( + project: string, + location: string, + entityType: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.render( + { + project: project, + location: location, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName + ).location; + } + + /** + * Parse the entity_type from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} environment + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentPath( + project: string, + location: string, + environment: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render( + { + project: project, + location: location, + environment: environment, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironment resource. + * + * @param {string} projectLocationAgentEnvironmentName + * A fully-qualified path representing project_location_agent_environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentName( + projectLocationAgentEnvironmentName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match( + projectLocationAgentEnvironmentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironment resource. + * + * @param {string} projectLocationAgentEnvironmentName + * A fully-qualified path representing project_location_agent_environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentName( + projectLocationAgentEnvironmentName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match( + projectLocationAgentEnvironmentName + ).location; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironment resource. + * + * @param {string} projectLocationAgentEnvironmentName + * A fully-qualified path representing project_location_agent_environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentName( + projectLocationAgentEnvironmentName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match( + projectLocationAgentEnvironmentName + ).environment; + } + + /** + * Return a fully-qualified projectLocationAgentIntent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intent + * @returns {string} Resource name string. + */ + projectLocationAgentIntentPath( + project: string, + location: string, + intent: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.render({ + project: project, + location: location, + intent: intent, + }); + } + + /** + * Parse the project from ProjectLocationAgentIntent resource. + * + * @param {string} projectLocationAgentIntentName + * A fully-qualified path representing project_location_agent_intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentIntentName( + projectLocationAgentIntentName: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.match( + projectLocationAgentIntentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentIntent resource. + * + * @param {string} projectLocationAgentIntentName + * A fully-qualified path representing project_location_agent_intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentIntentName( + projectLocationAgentIntentName: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.match( + projectLocationAgentIntentName + ).location; + } + + /** + * Parse the intent from ProjectLocationAgentIntent resource. + * + * @param {string} projectLocationAgentIntentName + * A fully-qualified path representing project_location_agent_intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromProjectLocationAgentIntentName( + projectLocationAgentIntentName: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.match( + projectLocationAgentIntentName + ).intent; + } + + /** + * Return a fully-qualified projectLocationAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectLocationAgentSessionContextPath( + project: string, + location: string, + session: string, + context: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.render( + { + project: project, + location: location, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).location; + } + + /** + * Parse the session from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).location; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.answerRecordsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dialogflow/src/v2beta1/answer_records_client_config.json b/packages/google-cloud-dialogflow/src/v2beta1/answer_records_client_config.json new file mode 100644 index 00000000000..34e2ae76e6c --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2beta1/answer_records_client_config.json @@ -0,0 +1,44 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2beta1.AnswerRecords": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "GetAnswerRecord": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListAnswerRecords": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateAnswerRecord": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/src/v2beta1/answer_records_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/answer_records_proto_list.json new file mode 100644 index 00000000000..1669125f722 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2beta1/answer_records_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", + "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2beta1/document.proto", + "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", + "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", + "../../protos/google/cloud/dialogflow/v2beta1/session.proto", + "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", + "../../protos/google/cloud/dialogflow/v2beta1/webhook.proto" +] diff --git a/packages/google-cloud-dialogflow/src/v2beta1/contexts_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/contexts_client.ts index 973f182f8f4..c32486b0862 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/contexts_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/contexts_client.ts @@ -196,6 +196,24 @@ export class ContextsClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/knowledgeBases/{knowledge_base}' ), @@ -220,6 +238,24 @@ export class ContextsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' ), @@ -1686,6 +1722,333 @@ export class ContextsClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectKnowledgeBase resource name string. * @@ -2202,6 +2565,458 @@ export class ContextsClient { ).entity_type; } + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectLocationKnowledgeBase resource name string. * diff --git a/packages/google-cloud-dialogflow/src/v2beta1/contexts_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/contexts_proto_list.json index 2ff3ebfebba..1669125f722 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/contexts_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2beta1/contexts_proto_list.json @@ -1,13 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", "../../protos/google/cloud/dialogflow/v2beta1/document.proto", "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", "../../protos/google/cloud/dialogflow/v2beta1/session.proto", "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_client.ts new file mode 100644 index 00000000000..30018ea90f4 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_client.ts @@ -0,0 +1,3017 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v2beta1/conversation_profiles_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './conversation_profiles_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service for managing {@link google.cloud.dialogflow.v2beta1.ConversationProfile|ConversationProfiles}. + * @class + * @memberof v2beta1 + */ +export class ConversationProfilesClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + conversationProfilesStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ConversationProfilesClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ConversationProfilesClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectAgentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent' + ), + projectAgentEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/entityTypes/{entity_type}' + ), + projectAgentEnvironmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}' + ), + projectAgentEnvironmentUserSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}' + ), + projectAgentEnvironmentUserSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}' + ), + projectAgentIntentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/intents/{intent}' + ), + projectAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/contexts/{context}' + ), + projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAgentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent' + ), + projectLocationAgentEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/entityTypes/{entity_type}' + ), + projectLocationAgentEnvironmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/environments/{environment}' + ), + projectLocationAgentIntentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/intents/{intent}' + ), + projectLocationAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}' + ), + projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listConversationProfiles: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'conversationProfiles' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.v2beta1.ConversationProfiles', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.conversationProfilesStub) { + return this.conversationProfilesStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.v2beta1.ConversationProfiles. + this.conversationProfilesStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.v2beta1.ConversationProfiles' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.v2beta1 + .ConversationProfiles, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const conversationProfilesStubMethods = [ + 'listConversationProfiles', + 'getConversationProfile', + 'createConversationProfile', + 'updateConversationProfile', + 'deleteConversationProfile', + ]; + for (const methodName of conversationProfilesStubMethods) { + const callPromise = this.conversationProfilesStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.conversationProfilesStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dialogflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + getConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + ( + | protos.google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest + | undefined + ), + {} | undefined + ] + >; + getConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + | protos.google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + | protos.google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves the specified conversation profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the conversation profile. + * Format: `projects//locations//conversationProfiles/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getConversationProfile(request); + */ + getConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + | protos.google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + | protos.google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + ( + | protos.google.cloud.dialogflow.v2beta1.IGetConversationProfileRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getConversationProfile( + request, + options, + callback + ); + } + createConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + ( + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest + | undefined + ), + {} | undefined + ] + >; + createConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a conversation profile in the specified project. + * + * {@link |ConversationProfile.CreateTime} and {@link |ConversationProfile.UpdateTime} + * aren't populated in the response. You can retrieve them via + * {@link google.cloud.dialogflow.v2beta1.ConversationProfiles.GetConversationProfile|GetConversationProfile} API. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to create a conversation profile for. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.v2beta1.ConversationProfile} request.conversationProfile + * Required. The conversation profile to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createConversationProfile(request); + */ + createConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + ( + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationProfileRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createConversationProfile( + request, + options, + callback + ); + } + updateConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + ( + | protos.google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest + | undefined + ), + {} | undefined + ] + >; + updateConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + | protos.google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + | protos.google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified conversation profile. + * + * {@link |ConversationProfile.CreateTime} and {@link |ConversationProfile.UpdateTime} + * aren't populated in the response. You can retrieve them via + * {@link google.cloud.dialogflow.v2beta1.ConversationProfiles.GetConversationProfile|GetConversationProfile} API. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.ConversationProfile} request.conversationProfile + * Required. The conversation profile to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to control which fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateConversationProfile(request); + */ + updateConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + | protos.google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + | protos.google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversationProfile, + ( + | protos.google.cloud.dialogflow.v2beta1.IUpdateConversationProfileRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'conversation_profile.name': request.conversationProfile!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateConversationProfile( + request, + options, + callback + ); + } + deleteConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest + | undefined + ), + {} | undefined + ] + >; + deleteConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deletes the specified conversation profile. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversation profile to delete. + * Format: `projects//locations//conversationProfiles/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deleteConversationProfile(request); + */ + deleteConversationProfile( + request: protos.google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.v2beta1.IDeleteConversationProfileRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteConversationProfile( + request, + options, + callback + ); + } + + listConversationProfiles( + request: protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversationProfile[], + protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse + ] + >; + listConversationProfiles( + request: protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IConversationProfile + > + ): void; + listConversationProfiles( + request: protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IConversationProfile + > + ): void; + /** + * Returns the list of all conversation profiles in the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listConversationProfilesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listConversationProfiles( + request: protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IConversationProfile + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IConversationProfile + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversationProfile[], + protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listConversationProfiles( + request, + options, + callback + ); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listConversationProfilesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listConversationProfilesStream( + request?: protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listConversationProfiles.createStream( + this.innerApiCalls.listConversationProfiles as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConversationProfiles`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project to list all conversation profiles from. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [ConversationProfile]{@link google.cloud.dialogflow.v2beta1.ConversationProfile}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listConversationProfilesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listConversationProfilesAsync( + request?: protos.google.cloud.dialogflow.v2beta1.IListConversationProfilesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listConversationProfiles.asyncIterate( + this.innerApiCalls['listConversationProfiles'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectAgent resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectAgentPath(project: string) { + return this.pathTemplates.projectAgentPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from ProjectAgent resource. + * + * @param {string} projectAgentName + * A fully-qualified path representing project_agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentName(projectAgentName: string) { + return this.pathTemplates.projectAgentPathTemplate.match(projectAgentName) + .project; + } + + /** + * Return a fully-qualified projectAgentEntityType resource name string. + * + * @param {string} project + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEntityTypePath(project: string, entityType: string) { + return this.pathTemplates.projectAgentEntityTypePathTemplate.render({ + project: project, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentEntityType resource. + * + * @param {string} projectAgentEntityTypeName + * A fully-qualified path representing project_agent_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEntityTypeName( + projectAgentEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEntityTypePathTemplate.match( + projectAgentEntityTypeName + ).project; + } + + /** + * Parse the entity_type from ProjectAgentEntityType resource. + * + * @param {string} projectAgentEntityTypeName + * A fully-qualified path representing project_agent_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEntityTypeName( + projectAgentEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEntityTypePathTemplate.match( + projectAgentEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentEnvironment resource name string. + * + * @param {string} project + * @param {string} environment + * @returns {string} Resource name string. + */ + projectAgentEnvironmentPath(project: string, environment: string) { + return this.pathTemplates.projectAgentEnvironmentPathTemplate.render({ + project: project, + environment: environment, + }); + } + + /** + * Parse the project from ProjectAgentEnvironment resource. + * + * @param {string} projectAgentEnvironmentName + * A fully-qualified path representing project_agent_environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentName( + projectAgentEnvironmentName: string + ) { + return this.pathTemplates.projectAgentEnvironmentPathTemplate.match( + projectAgentEnvironmentName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironment resource. + * + * @param {string} projectAgentEnvironmentName + * A fully-qualified path representing project_agent_environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentName( + projectAgentEnvironmentName: string + ) { + return this.pathTemplates.projectAgentEnvironmentPathTemplate.match( + projectAgentEnvironmentName + ).environment; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionContext resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionEntityType resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionEntityTypePath( + project: string, + environment: string, + user: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentIntent resource name string. + * + * @param {string} project + * @param {string} intent + * @returns {string} Resource name string. + */ + projectAgentIntentPath(project: string, intent: string) { + return this.pathTemplates.projectAgentIntentPathTemplate.render({ + project: project, + intent: intent, + }); + } + + /** + * Parse the project from ProjectAgentIntent resource. + * + * @param {string} projectAgentIntentName + * A fully-qualified path representing project_agent_intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentIntentName(projectAgentIntentName: string) { + return this.pathTemplates.projectAgentIntentPathTemplate.match( + projectAgentIntentName + ).project; + } + + /** + * Parse the intent from ProjectAgentIntent resource. + * + * @param {string} projectAgentIntentName + * A fully-qualified path representing project_agent_intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromProjectAgentIntentName(projectAgentIntentName: string) { + return this.pathTemplates.projectAgentIntentPathTemplate.match( + projectAgentIntentName + ).intent; + } + + /** + * Return a fully-qualified projectAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentSessionContextPath( + project: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.render({ + project: project, + session: session, + context: context, + }); + } + + /** + * Parse the project from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentSessionEntityTypePath( + project: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.render({ + project: project, + session: session, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAgent resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + projectLocationAgentPath(project: string, location: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from ProjectLocationAgent resource. + * + * @param {string} projectLocationAgentName + * A fully-qualified path representing project_location_agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentName(projectLocationAgentName: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.match( + projectLocationAgentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgent resource. + * + * @param {string} projectLocationAgentName + * A fully-qualified path representing project_location_agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentName(projectLocationAgentName: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.match( + projectLocationAgentName + ).location; + } + + /** + * Return a fully-qualified projectLocationAgentEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEntityTypePath( + project: string, + location: string, + entityType: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.render( + { + project: project, + location: location, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName + ).location; + } + + /** + * Parse the entity_type from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} environment + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentPath( + project: string, + location: string, + environment: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render( + { + project: project, + location: location, + environment: environment, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironment resource. + * + * @param {string} projectLocationAgentEnvironmentName + * A fully-qualified path representing project_location_agent_environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentName( + projectLocationAgentEnvironmentName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match( + projectLocationAgentEnvironmentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironment resource. + * + * @param {string} projectLocationAgentEnvironmentName + * A fully-qualified path representing project_location_agent_environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentName( + projectLocationAgentEnvironmentName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match( + projectLocationAgentEnvironmentName + ).location; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironment resource. + * + * @param {string} projectLocationAgentEnvironmentName + * A fully-qualified path representing project_location_agent_environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentName( + projectLocationAgentEnvironmentName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match( + projectLocationAgentEnvironmentName + ).environment; + } + + /** + * Return a fully-qualified projectLocationAgentIntent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intent + * @returns {string} Resource name string. + */ + projectLocationAgentIntentPath( + project: string, + location: string, + intent: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.render({ + project: project, + location: location, + intent: intent, + }); + } + + /** + * Parse the project from ProjectLocationAgentIntent resource. + * + * @param {string} projectLocationAgentIntentName + * A fully-qualified path representing project_location_agent_intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentIntentName( + projectLocationAgentIntentName: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.match( + projectLocationAgentIntentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentIntent resource. + * + * @param {string} projectLocationAgentIntentName + * A fully-qualified path representing project_location_agent_intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentIntentName( + projectLocationAgentIntentName: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.match( + projectLocationAgentIntentName + ).location; + } + + /** + * Parse the intent from ProjectLocationAgentIntent resource. + * + * @param {string} projectLocationAgentIntentName + * A fully-qualified path representing project_location_agent_intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromProjectLocationAgentIntentName( + projectLocationAgentIntentName: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.match( + projectLocationAgentIntentName + ).intent; + } + + /** + * Return a fully-qualified projectLocationAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectLocationAgentSessionContextPath( + project: string, + location: string, + session: string, + context: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.render( + { + project: project, + location: location, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).location; + } + + /** + * Parse the session from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).location; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.conversationProfilesStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_client_config.json b/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_client_config.json new file mode 100644 index 00000000000..1a172fb9198 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_client_config.json @@ -0,0 +1,54 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2beta1.ConversationProfiles": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListConversationProfiles": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteConversationProfile": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_proto_list.json new file mode 100644 index 00000000000..1669125f722 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2beta1/conversation_profiles_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", + "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2beta1/document.proto", + "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", + "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", + "../../protos/google/cloud/dialogflow/v2beta1/session.proto", + "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", + "../../protos/google/cloud/dialogflow/v2beta1/webhook.proto" +] diff --git a/packages/google-cloud-dialogflow/src/v2beta1/conversations_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/conversations_client.ts new file mode 100644 index 00000000000..f3292d78302 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2beta1/conversations_client.ts @@ -0,0 +1,3730 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v2beta1/conversations_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './conversations_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service for managing {@link google.cloud.dialogflow.v2beta1.Conversation|Conversations}. + * @class + * @memberof v2beta1 + */ +export class ConversationsClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + conversationsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ConversationsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ConversationsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectAgentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent' + ), + projectAgentEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/entityTypes/{entity_type}' + ), + projectAgentEnvironmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}' + ), + projectAgentEnvironmentUserSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}' + ), + projectAgentEnvironmentUserSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}' + ), + projectAgentIntentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/intents/{intent}' + ), + projectAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/contexts/{context}' + ), + projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAgentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent' + ), + projectLocationAgentEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/entityTypes/{entity_type}' + ), + projectLocationAgentEnvironmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/environments/{environment}' + ), + projectLocationAgentIntentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/intents/{intent}' + ), + projectLocationAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}' + ), + projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listConversations: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'conversations' + ), + listCallMatchers: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'callMatchers' + ), + listMessages: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'messages' + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.v2beta1.Conversations', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.conversationsStub) { + return this.conversationsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.v2beta1.Conversations. + this.conversationsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.v2beta1.Conversations' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.v2beta1.Conversations, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const conversationsStubMethods = [ + 'createConversation', + 'listConversations', + 'getConversation', + 'completeConversation', + 'createCallMatcher', + 'listCallMatchers', + 'deleteCallMatcher', + 'batchCreateMessages', + 'listMessages', + ]; + for (const methodName of conversationsStubMethods) { + const callPromise = this.conversationsStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = this.descriptors.page[methodName] || undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.conversationsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dialogflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createConversation( + request: protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversation, + ( + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest + | undefined + ), + {} | undefined + ] + >; + createConversation( + request: protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createConversation( + request: protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * 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 {@link google.cloud.dialogflow.v2beta1.Conversation.conversation_profile|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 + * {@link google.cloud.dialogflow.v2beta1.Intent|Intent} with {@link google.cloud.dialogflow.v2beta1.Intent.live_agent_handoff|Intent.live_agent_handoff} is triggered, conversation + * will transfer to Assist Stage. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource identifier of the project creating the conversation. + * Format: `projects//locations/`. + * @param {google.cloud.dialogflow.v2beta1.Conversation} request.conversation + * Required. The conversation to create. + * @param {string} [request.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 + * "{@link a-zA-Z0-9_-|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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2beta1.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createConversation(request); + */ + createConversation( + request: protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversation, + ( + | protos.google.cloud.dialogflow.v2beta1.ICreateConversationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createConversation(request, options, callback); + } + getConversation( + request: protos.google.cloud.dialogflow.v2beta1.IGetConversationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversation, + ( + | protos.google.cloud.dialogflow.v2beta1.IGetConversationRequest + | undefined + ), + {} | undefined + ] + >; + getConversation( + request: protos.google.cloud.dialogflow.v2beta1.IGetConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.IGetConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getConversation( + request: protos.google.cloud.dialogflow.v2beta1.IGetConversationRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.IGetConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves the specific conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the conversation. Format: + * `projects//locations//conversations/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2beta1.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getConversation(request); + */ + getConversation( + request: protos.google.cloud.dialogflow.v2beta1.IGetConversationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.IGetConversationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.IGetConversationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversation, + ( + | protos.google.cloud.dialogflow.v2beta1.IGetConversationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getConversation(request, options, callback); + } + completeConversation( + request: protos.google.cloud.dialogflow.v2beta1.ICompleteConversationRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversation, + ( + | protos.google.cloud.dialogflow.v2beta1.ICompleteConversationRequest + | undefined + ), + {} | undefined + ] + >; + completeConversation( + request: protos.google.cloud.dialogflow.v2beta1.ICompleteConversationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.ICompleteConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + completeConversation( + request: protos.google.cloud.dialogflow.v2beta1.ICompleteConversationRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.ICompleteConversationRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Completes the specified conversation. Finished conversations are purged + * from the database after 30 days. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Resource identifier of the conversation to close. + * Format: `projects//locations//conversations/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Conversation]{@link google.cloud.dialogflow.v2beta1.Conversation}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.completeConversation(request); + */ + completeConversation( + request: protos.google.cloud.dialogflow.v2beta1.ICompleteConversationRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.ICompleteConversationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IConversation, + | protos.google.cloud.dialogflow.v2beta1.ICompleteConversationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversation, + ( + | protos.google.cloud.dialogflow.v2beta1.ICompleteConversationRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.completeConversation(request, options, callback); + } + createCallMatcher( + request: protos.google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ICallMatcher, + ( + | protos.google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest + | undefined + ), + {} | undefined + ] + >; + createCallMatcher( + request: protos.google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ICallMatcher, + | protos.google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createCallMatcher( + request: protos.google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ICallMatcher, + | protos.google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a call matcher that links incoming SIP calls to the specified + * conversation if they fulfill specified criteria. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource identifier of the conversation adding the call matcher. + * Format: `projects//locations//conversations/`. + * @param {google.cloud.dialogflow.v2beta1.CallMatcher} request.callMatcher + * Required. The call matcher to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CallMatcher]{@link google.cloud.dialogflow.v2beta1.CallMatcher}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createCallMatcher(request); + */ + createCallMatcher( + request: protos.google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.ICallMatcher, + | protos.google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.ICallMatcher, + | protos.google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ICallMatcher, + ( + | protos.google.cloud.dialogflow.v2beta1.ICreateCallMatcherRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createCallMatcher(request, options, callback); + } + deleteCallMatcher( + request: protos.google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest, + options?: CallOptions + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest + | undefined + ), + {} | undefined + ] + >; + deleteCallMatcher( + request: protos.google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest, + options: CallOptions, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest + | null + | undefined, + {} | null | undefined + > + ): void; + deleteCallMatcher( + request: protos.google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest, + callback: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Requests deletion of a call matcher. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The unique identifier of the {@link google.cloud.dialogflow.v2beta1.CallMatcher|CallMatcher} to delete. + * Format: `projects//locations//conversations//callMatchers/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Empty]{@link google.protobuf.Empty}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.deleteCallMatcher(request); + */ + deleteCallMatcher( + request: protos.google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.IEmpty, + | protos.google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.protobuf.IEmpty, + ( + | protos.google.cloud.dialogflow.v2beta1.IDeleteCallMatcherRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.deleteCallMatcher(request, options, callback); + } + batchCreateMessages( + request: protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse, + ( + | protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest + | undefined + ), + {} | undefined + ] + >; + batchCreateMessages( + request: protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse, + | protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + batchCreateMessages( + request: protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse, + | protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Batch ingests messages to conversation. Customers can use this RPC to + * ingest historical messages to conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource identifier of the conversation to create message. + * Format: `projects//locations//conversations/`. + * @param {number[]} request.requests + * Required. A maximum of 1000 Messages can be created in a batch. + * {@link |CreateMessageRequest.message.send_time} is required. All created + * messages will have identical {@link google.cloud.dialogflow.v2beta1.Message.create_time|Message.create_time}. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [BatchCreateMessagesResponse]{@link google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.batchCreateMessages(request); + */ + batchCreateMessages( + request: protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse, + | protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse, + | protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse, + ( + | protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.batchCreateMessages(request, options, callback); + } + + listConversations( + request: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversation[], + protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListConversationsResponse + ] + >; + listConversations( + request: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IConversation + > + ): void; + listConversations( + request: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IConversation + > + ): void; + /** + * Returns the list of all conversations in the specified project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * Optional. The next_page_token value returned from a previous list request. + * @param {string} request.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). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Conversation]{@link google.cloud.dialogflow.v2beta1.Conversation}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listConversationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listConversations( + request: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IConversation + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListConversationsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IConversation + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IConversation[], + protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListConversationsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listConversations(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * Optional. The next_page_token value returned from a previous list request. + * @param {string} request.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). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Conversation]{@link google.cloud.dialogflow.v2beta1.Conversation} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listConversationsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listConversationsStream( + request?: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listConversations.createStream( + this.innerApiCalls.listConversations as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listConversations`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project from which to list all conversation. + * Format: `projects//locations/`. + * @param {number} request.pageSize + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * Optional. The next_page_token value returned from a previous list request. + * @param {string} request.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). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Conversation]{@link google.cloud.dialogflow.v2beta1.Conversation}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listConversationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listConversationsAsync( + request?: protos.google.cloud.dialogflow.v2beta1.IListConversationsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listConversations.asyncIterate( + this.innerApiCalls['listConversations'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + listCallMatchers( + request: protos.google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ICallMatcher[], + protos.google.cloud.dialogflow.v2beta1.IListCallMatchersRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListCallMatchersResponse + ] + >; + listCallMatchers( + request: protos.google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, + | protos.google.cloud.dialogflow.v2beta1.IListCallMatchersResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.ICallMatcher + > + ): void; + listCallMatchers( + request: protos.google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, + | protos.google.cloud.dialogflow.v2beta1.IListCallMatchersResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.ICallMatcher + > + ): void; + /** + * Returns the list of all call matchers in the specified conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all call matchers from. + * Format: `projects//locations//conversations/`. + * @param {number} request.pageSize + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [CallMatcher]{@link google.cloud.dialogflow.v2beta1.CallMatcher}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listCallMatchersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCallMatchers( + request: protos.google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, + | protos.google.cloud.dialogflow.v2beta1.IListCallMatchersResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.ICallMatcher + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, + | protos.google.cloud.dialogflow.v2beta1.IListCallMatchersResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.ICallMatcher + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ICallMatcher[], + protos.google.cloud.dialogflow.v2beta1.IListCallMatchersRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListCallMatchersResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listCallMatchers(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all call matchers from. + * Format: `projects//locations//conversations/`. + * @param {number} request.pageSize + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [CallMatcher]{@link google.cloud.dialogflow.v2beta1.CallMatcher} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listCallMatchersAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listCallMatchersStream( + request?: protos.google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listCallMatchers.createStream( + this.innerApiCalls.listCallMatchers as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listCallMatchers`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all call matchers from. + * Format: `projects//locations//conversations/`. + * @param {number} request.pageSize + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [CallMatcher]{@link google.cloud.dialogflow.v2beta1.CallMatcher}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listCallMatchersAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listCallMatchersAsync( + request?: protos.google.cloud.dialogflow.v2beta1.IListCallMatchersRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listCallMatchers.asyncIterate( + this.innerApiCalls['listCallMatchers'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + listMessages( + request: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IMessage[], + protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListMessagesResponse + ] + >; + listMessages( + request: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListMessagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IMessage + > + ): void; + listMessages( + request: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListMessagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IMessage + > + ): void; + /** + * 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. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * @param {string} request.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). + * @param {number} request.pageSize + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Message]{@link google.cloud.dialogflow.v2beta1.Message}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listMessagesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMessages( + request: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListMessagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IMessage + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + | protos.google.cloud.dialogflow.v2beta1.IListMessagesResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IMessage + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IMessage[], + protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListMessagesResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listMessages(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * @param {string} request.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). + * @param {number} request.pageSize + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Message]{@link google.cloud.dialogflow.v2beta1.Message} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listMessagesAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listMessagesStream( + request?: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listMessages.createStream( + this.innerApiCalls.listMessages as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listMessages`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the conversation to list messages for. + * Format: `projects//locations//conversations/` + * @param {string} request.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). + * @param {number} request.pageSize + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} request.pageToken + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Message]{@link google.cloud.dialogflow.v2beta1.Message}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listMessagesAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listMessagesAsync( + request?: protos.google.cloud.dialogflow.v2beta1.IListMessagesRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listMessages.asyncIterate( + this.innerApiCalls['listMessages'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectAgent resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectAgentPath(project: string) { + return this.pathTemplates.projectAgentPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from ProjectAgent resource. + * + * @param {string} projectAgentName + * A fully-qualified path representing project_agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentName(projectAgentName: string) { + return this.pathTemplates.projectAgentPathTemplate.match(projectAgentName) + .project; + } + + /** + * Return a fully-qualified projectAgentEntityType resource name string. + * + * @param {string} project + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEntityTypePath(project: string, entityType: string) { + return this.pathTemplates.projectAgentEntityTypePathTemplate.render({ + project: project, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentEntityType resource. + * + * @param {string} projectAgentEntityTypeName + * A fully-qualified path representing project_agent_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEntityTypeName( + projectAgentEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEntityTypePathTemplate.match( + projectAgentEntityTypeName + ).project; + } + + /** + * Parse the entity_type from ProjectAgentEntityType resource. + * + * @param {string} projectAgentEntityTypeName + * A fully-qualified path representing project_agent_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEntityTypeName( + projectAgentEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEntityTypePathTemplate.match( + projectAgentEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentEnvironment resource name string. + * + * @param {string} project + * @param {string} environment + * @returns {string} Resource name string. + */ + projectAgentEnvironmentPath(project: string, environment: string) { + return this.pathTemplates.projectAgentEnvironmentPathTemplate.render({ + project: project, + environment: environment, + }); + } + + /** + * Parse the project from ProjectAgentEnvironment resource. + * + * @param {string} projectAgentEnvironmentName + * A fully-qualified path representing project_agent_environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentName( + projectAgentEnvironmentName: string + ) { + return this.pathTemplates.projectAgentEnvironmentPathTemplate.match( + projectAgentEnvironmentName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironment resource. + * + * @param {string} projectAgentEnvironmentName + * A fully-qualified path representing project_agent_environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentName( + projectAgentEnvironmentName: string + ) { + return this.pathTemplates.projectAgentEnvironmentPathTemplate.match( + projectAgentEnvironmentName + ).environment; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionContext resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionEntityType resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionEntityTypePath( + project: string, + environment: string, + user: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentIntent resource name string. + * + * @param {string} project + * @param {string} intent + * @returns {string} Resource name string. + */ + projectAgentIntentPath(project: string, intent: string) { + return this.pathTemplates.projectAgentIntentPathTemplate.render({ + project: project, + intent: intent, + }); + } + + /** + * Parse the project from ProjectAgentIntent resource. + * + * @param {string} projectAgentIntentName + * A fully-qualified path representing project_agent_intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentIntentName(projectAgentIntentName: string) { + return this.pathTemplates.projectAgentIntentPathTemplate.match( + projectAgentIntentName + ).project; + } + + /** + * Parse the intent from ProjectAgentIntent resource. + * + * @param {string} projectAgentIntentName + * A fully-qualified path representing project_agent_intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromProjectAgentIntentName(projectAgentIntentName: string) { + return this.pathTemplates.projectAgentIntentPathTemplate.match( + projectAgentIntentName + ).intent; + } + + /** + * Return a fully-qualified projectAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentSessionContextPath( + project: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.render({ + project: project, + session: session, + context: context, + }); + } + + /** + * Parse the project from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentSessionEntityTypePath( + project: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.render({ + project: project, + session: session, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAgent resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + projectLocationAgentPath(project: string, location: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from ProjectLocationAgent resource. + * + * @param {string} projectLocationAgentName + * A fully-qualified path representing project_location_agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentName(projectLocationAgentName: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.match( + projectLocationAgentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgent resource. + * + * @param {string} projectLocationAgentName + * A fully-qualified path representing project_location_agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentName(projectLocationAgentName: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.match( + projectLocationAgentName + ).location; + } + + /** + * Return a fully-qualified projectLocationAgentEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEntityTypePath( + project: string, + location: string, + entityType: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.render( + { + project: project, + location: location, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName + ).location; + } + + /** + * Parse the entity_type from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} environment + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentPath( + project: string, + location: string, + environment: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render( + { + project: project, + location: location, + environment: environment, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironment resource. + * + * @param {string} projectLocationAgentEnvironmentName + * A fully-qualified path representing project_location_agent_environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentName( + projectLocationAgentEnvironmentName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match( + projectLocationAgentEnvironmentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironment resource. + * + * @param {string} projectLocationAgentEnvironmentName + * A fully-qualified path representing project_location_agent_environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentName( + projectLocationAgentEnvironmentName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match( + projectLocationAgentEnvironmentName + ).location; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironment resource. + * + * @param {string} projectLocationAgentEnvironmentName + * A fully-qualified path representing project_location_agent_environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentName( + projectLocationAgentEnvironmentName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match( + projectLocationAgentEnvironmentName + ).environment; + } + + /** + * Return a fully-qualified projectLocationAgentIntent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intent + * @returns {string} Resource name string. + */ + projectLocationAgentIntentPath( + project: string, + location: string, + intent: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.render({ + project: project, + location: location, + intent: intent, + }); + } + + /** + * Parse the project from ProjectLocationAgentIntent resource. + * + * @param {string} projectLocationAgentIntentName + * A fully-qualified path representing project_location_agent_intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentIntentName( + projectLocationAgentIntentName: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.match( + projectLocationAgentIntentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentIntent resource. + * + * @param {string} projectLocationAgentIntentName + * A fully-qualified path representing project_location_agent_intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentIntentName( + projectLocationAgentIntentName: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.match( + projectLocationAgentIntentName + ).location; + } + + /** + * Parse the intent from ProjectLocationAgentIntent resource. + * + * @param {string} projectLocationAgentIntentName + * A fully-qualified path representing project_location_agent_intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromProjectLocationAgentIntentName( + projectLocationAgentIntentName: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.match( + projectLocationAgentIntentName + ).intent; + } + + /** + * Return a fully-qualified projectLocationAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectLocationAgentSessionContextPath( + project: string, + location: string, + session: string, + context: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.render( + { + project: project, + location: location, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).location; + } + + /** + * Parse the session from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).location; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.conversationsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dialogflow/src/v2beta1/conversations_client_config.json b/packages/google-cloud-dialogflow/src/v2beta1/conversations_client_config.json new file mode 100644 index 00000000000..43899ff27fa --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2beta1/conversations_client_config.json @@ -0,0 +1,74 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2beta1.Conversations": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateConversation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListConversations": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetConversation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CompleteConversation": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CreateCallMatcher": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListCallMatchers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "DeleteCallMatcher": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "BatchCreateMessages": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListMessages": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/src/v2beta1/conversations_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/conversations_proto_list.json new file mode 100644 index 00000000000..1669125f722 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2beta1/conversations_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", + "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2beta1/document.proto", + "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", + "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", + "../../protos/google/cloud/dialogflow/v2beta1/session.proto", + "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", + "../../protos/google/cloud/dialogflow/v2beta1/webhook.proto" +] diff --git a/packages/google-cloud-dialogflow/src/v2beta1/documents_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/documents_client.ts index 1e1835a219d..20f65b7f9b1 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/documents_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/documents_client.ts @@ -195,6 +195,24 @@ export class DocumentsClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/knowledgeBases/{knowledge_base}' ), @@ -219,6 +237,24 @@ export class DocumentsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' ), @@ -260,6 +296,12 @@ export class DocumentsClient { const createDocumentMetadata = protoFilesRoot.lookup( '.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata' ) as gax.protobuf.Type; + const importDocumentsResponse = protoFilesRoot.lookup( + '.google.cloud.dialogflow.v2beta1.ImportDocumentsResponse' + ) as gax.protobuf.Type; + const importDocumentsMetadata = protoFilesRoot.lookup( + '.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata' + ) as gax.protobuf.Type; const deleteDocumentResponse = protoFilesRoot.lookup( '.google.protobuf.Empty' ) as gax.protobuf.Type; @@ -285,6 +327,11 @@ export class DocumentsClient { createDocumentResponse.decode.bind(createDocumentResponse), createDocumentMetadata.decode.bind(createDocumentMetadata) ), + importDocuments: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + importDocumentsResponse.decode.bind(importDocumentsResponse), + importDocumentsMetadata.decode.bind(importDocumentsMetadata) + ), deleteDocument: new this._gaxModule.LongrunningDescriptor( this.operationsClient, deleteDocumentResponse.decode.bind(deleteDocumentResponse), @@ -351,6 +398,7 @@ export class DocumentsClient { 'listDocuments', 'getDocument', 'createDocument', + 'importDocuments', 'deleteDocument', 'updateDocument', 'reloadDocument', @@ -691,6 +739,162 @@ export class DocumentsClient { protos.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata >; } + importDocuments( + request: protos.google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, + options?: CallOptions + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + >; + importDocuments( + request: protos.google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, + options: CallOptions, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + importDocuments( + request: protos.google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, + callback: Callback< + LROperation< + protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): void; + /** + * Create documents by importing data from external sources. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The knowledge base to import documents into. + * Format: `projects//locations//knowledgeBases/`. + * @param {google.cloud.dialogflow.v2beta1.GcsSources} request.gcsSource + * The Google Cloud Storage location for the documents. + * The path can include a wildcard. + * + * These URIs may have the forms + * `gs:///`. + * `gs:////*.`. + * @param {google.cloud.dialogflow.v2beta1.ImportDocumentTemplate} request.documentTemplate + * Required. Document template used for importing all the documents. + * @param {boolean} request.importGcsCustomMetadata + * Whether to import custom metadata from Google Cloud Storage. + * Only valid when the document source is Google Cloud Storage URI. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const [operation] = await client.importDocuments(request); + * const [response] = await operation.promise(); + */ + importDocuments( + request: protos.google.cloud.dialogflow.v2beta1.IImportDocumentsRequest, + optionsOrCallback?: + | CallOptions + | Callback< + LROperation< + protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + >, + callback?: Callback< + LROperation< + protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | null | undefined, + {} | null | undefined + > + ): Promise< + [ + LROperation< + protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >, + protos.google.longrunning.IOperation | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.importDocuments(request, options, callback); + } + /** + * Check the status of the long running operation returned by `importDocuments()`. + * @param {String} name + * The operation name that will be passed. + * @returns {Promise} - The promise which resolves to an object. + * The decoded operation object has result and metadata field to get information from. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations) + * for more details and examples. + * @example + * const decodedOperation = await checkImportDocumentsProgress(name); + * console.log(decodedOperation.result); + * console.log(decodedOperation.done); + * console.log(decodedOperation.metadata); + */ + async checkImportDocumentsProgress( + name: string + ): Promise< + LROperation< + protos.google.cloud.dialogflow.v2beta1.ImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata + > + > { + const request = new operationsProtos.google.longrunning.GetOperationRequest( + {name} + ); + const [operation] = await this.operationsClient.getOperation(request); + const decodeOperation = new gax.Operation( + operation, + this.descriptors.longrunning.importDocuments, + gax.createDefaultBackoffSettings() + ); + return decodeOperation as LROperation< + protos.google.cloud.dialogflow.v2beta1.ImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.KnowledgeOperationMetadata + >; + } deleteDocument( request: protos.google.cloud.dialogflow.v2beta1.IDeleteDocumentRequest, options?: CallOptions @@ -1934,186 +2138,513 @@ export class DocumentsClient { } /** - * Return a fully-qualified projectKnowledgeBase resource name string. + * Return a fully-qualified projectAnswerRecord resource name string. * * @param {string} project - * @param {string} knowledge_base + * @param {string} answer_record * @returns {string} Resource name string. */ - projectKnowledgeBasePath(project: string, knowledgeBase: string) { - return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ project: project, - knowledge_base: knowledgeBase, + answer_record: answerRecord, }); } /** - * Parse the project from ProjectKnowledgeBase resource. + * Parse the project from ProjectAnswerRecord resource. * - * @param {string} projectKnowledgeBaseName - * A fully-qualified path representing project_knowledge_base resource. + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. * @returns {string} A string representing the project. */ - matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { - return this.pathTemplates.projectKnowledgeBasePathTemplate.match( - projectKnowledgeBaseName + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName ).project; } /** - * Parse the knowledge_base from ProjectKnowledgeBase resource. + * Parse the answer_record from ProjectAnswerRecord resource. * - * @param {string} projectKnowledgeBaseName - * A fully-qualified path representing project_knowledge_base resource. - * @returns {string} A string representing the knowledge_base. + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. */ - matchKnowledgeBaseFromProjectKnowledgeBaseName( - projectKnowledgeBaseName: string + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string ) { - return this.pathTemplates.projectKnowledgeBasePathTemplate.match( - projectKnowledgeBaseName - ).knowledge_base; + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; } /** - * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * Return a fully-qualified projectConversation resource name string. * * @param {string} project - * @param {string} knowledge_base - * @param {string} document + * @param {string} conversation * @returns {string} Resource name string. */ - projectKnowledgeBaseDocumentPath( - project: string, - knowledgeBase: string, - document: string - ) { - return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ project: project, - knowledge_base: knowledgeBase, - document: document, + conversation: conversation, }); } /** - * Parse the project from ProjectKnowledgeBaseDocument resource. + * Parse the project from ProjectConversation resource. * - * @param {string} projectKnowledgeBaseDocumentName - * A fully-qualified path representing project_knowledge_base_document resource. + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. * @returns {string} A string representing the project. */ - matchProjectFromProjectKnowledgeBaseDocumentName( - projectKnowledgeBaseDocumentName: string - ) { - return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( - projectKnowledgeBaseDocumentName + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName ).project; } /** - * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * Parse the conversation from ProjectConversation resource. * - * @param {string} projectKnowledgeBaseDocumentName - * A fully-qualified path representing project_knowledge_base_document resource. - * @returns {string} A string representing the knowledge_base. + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. */ - matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( - projectKnowledgeBaseDocumentName: string + matchConversationFromProjectConversationName( + projectConversationName: string ) { - return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( - projectKnowledgeBaseDocumentName - ).knowledge_base; + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; } /** - * Parse the document from ProjectKnowledgeBaseDocument resource. + * Return a fully-qualified projectConversationCallMatcher resource name string. * - * @param {string} projectKnowledgeBaseDocumentName - * A fully-qualified path representing project_knowledge_base_document resource. - * @returns {string} A string representing the document. + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. */ - matchDocumentFromProjectKnowledgeBaseDocumentName( - projectKnowledgeBaseDocumentName: string + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string ) { - return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( - projectKnowledgeBaseDocumentName - ).document; + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); } /** - * Return a fully-qualified projectLocationAgent resource name string. + * Parse the project from ProjectConversationCallMatcher resource. * - * @param {string} project - * @param {string} location - * @returns {string} Resource name string. + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. */ - projectLocationAgentPath(project: string, location: string) { - return this.pathTemplates.projectLocationAgentPathTemplate.render({ - project: project, - location: location, - }); + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; } /** - * Parse the project from ProjectLocationAgent resource. + * Parse the conversation from ProjectConversationCallMatcher resource. * - * @param {string} projectLocationAgentName - * A fully-qualified path representing project_location_agent resource. - * @returns {string} A string representing the project. + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. */ - matchProjectFromProjectLocationAgentName(projectLocationAgentName: string) { - return this.pathTemplates.projectLocationAgentPathTemplate.match( - projectLocationAgentName - ).project; + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; } /** - * Parse the location from ProjectLocationAgent resource. + * Parse the call_matcher from ProjectConversationCallMatcher resource. * - * @param {string} projectLocationAgentName - * A fully-qualified path representing project_location_agent resource. - * @returns {string} A string representing the location. + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. */ - matchLocationFromProjectLocationAgentName(projectLocationAgentName: string) { - return this.pathTemplates.projectLocationAgentPathTemplate.match( - projectLocationAgentName - ).location; + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; } /** - * Return a fully-qualified projectLocationAgentEntityType resource name string. + * Return a fully-qualified projectConversationMessage resource name string. * * @param {string} project - * @param {string} location - * @param {string} entity_type + * @param {string} conversation + * @param {string} message * @returns {string} Resource name string. */ - projectLocationAgentEntityTypePath( + projectConversationMessagePath( project: string, - location: string, - entityType: string + conversation: string, + message: string ) { - return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.render( - { - project: project, - location: location, - entity_type: entityType, - } - ); + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); } /** - * Parse the project from ProjectLocationAgentEntityType resource. + * Parse the project from ProjectConversationMessage resource. * - * @param {string} projectLocationAgentEntityTypeName - * A fully-qualified path representing project_location_agent_entity_type resource. + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. * @returns {string} A string representing the project. */ - matchProjectFromProjectLocationAgentEntityTypeName( - projectLocationAgentEntityTypeName: string + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string ) { - return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( - projectLocationAgentEntityTypeName + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAgent resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + projectLocationAgentPath(project: string, location: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from ProjectLocationAgent resource. + * + * @param {string} projectLocationAgentName + * A fully-qualified path representing project_location_agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentName(projectLocationAgentName: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.match( + projectLocationAgentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgent resource. + * + * @param {string} projectLocationAgentName + * A fully-qualified path representing project_location_agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentName(projectLocationAgentName: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.match( + projectLocationAgentName + ).location; + } + + /** + * Return a fully-qualified projectLocationAgentEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEntityTypePath( + project: string, + location: string, + entityType: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.render( + { + project: project, + location: location, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName ).project; } @@ -2449,6 +2980,458 @@ export class DocumentsClient { ).entity_type; } + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectLocationKnowledgeBase resource name string. * diff --git a/packages/google-cloud-dialogflow/src/v2beta1/documents_client_config.json b/packages/google-cloud-dialogflow/src/v2beta1/documents_client_config.json index e5462271bcb..994669432ce 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/documents_client_config.json +++ b/packages/google-cloud-dialogflow/src/v2beta1/documents_client_config.json @@ -38,6 +38,11 @@ "retry_codes_name": "unavailable", "retry_params_name": "default" }, + "ImportDocuments": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, "DeleteDocument": { "timeout_millis": 60000, "retry_codes_name": "unavailable", diff --git a/packages/google-cloud-dialogflow/src/v2beta1/documents_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/documents_proto_list.json index 2ff3ebfebba..1669125f722 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/documents_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2beta1/documents_proto_list.json @@ -1,13 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", "../../protos/google/cloud/dialogflow/v2beta1/document.proto", "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", "../../protos/google/cloud/dialogflow/v2beta1/session.proto", "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2beta1/entity_types_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/entity_types_client.ts index 1aca04d2465..6c2d44cb616 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/entity_types_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/entity_types_client.ts @@ -195,6 +195,24 @@ export class EntityTypesClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/knowledgeBases/{knowledge_base}' ), @@ -219,6 +237,24 @@ export class EntityTypesClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' ), @@ -2403,6 +2439,333 @@ export class EntityTypesClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectKnowledgeBase resource name string. * @@ -2919,6 +3282,458 @@ export class EntityTypesClient { ).entity_type; } + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectLocationKnowledgeBase resource name string. * diff --git a/packages/google-cloud-dialogflow/src/v2beta1/entity_types_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/entity_types_proto_list.json index 2ff3ebfebba..1669125f722 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/entity_types_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2beta1/entity_types_proto_list.json @@ -1,13 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", "../../protos/google/cloud/dialogflow/v2beta1/document.proto", "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", "../../protos/google/cloud/dialogflow/v2beta1/session.proto", "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2beta1/environments_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/environments_client.ts index 15eb4a1be7a..10281c8fa29 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/environments_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/environments_client.ts @@ -193,6 +193,24 @@ export class EnvironmentsClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/knowledgeBases/{knowledge_base}' ), @@ -217,6 +235,24 @@ export class EnvironmentsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' ), @@ -1087,6 +1123,333 @@ export class EnvironmentsClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectKnowledgeBase resource name string. * @@ -1603,6 +1966,458 @@ export class EnvironmentsClient { ).entity_type; } + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectLocationKnowledgeBase resource name string. * diff --git a/packages/google-cloud-dialogflow/src/v2beta1/environments_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/environments_proto_list.json index 2ff3ebfebba..1669125f722 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/environments_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2beta1/environments_proto_list.json @@ -1,13 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", "../../protos/google/cloud/dialogflow/v2beta1/document.proto", "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", "../../protos/google/cloud/dialogflow/v2beta1/session.proto", "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2beta1/gapic_metadata.json b/packages/google-cloud-dialogflow/src/v2beta1/gapic_metadata.json index ed5878ccdfa..9026a1f52f2 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/gapic_metadata.json +++ b/packages/google-cloud-dialogflow/src/v2beta1/gapic_metadata.json @@ -113,6 +113,54 @@ } } }, + "AnswerRecords": { + "clients": { + "grpc": { + "libraryClient": "AnswerRecordsClient", + "rpcs": { + "GetAnswerRecord": { + "methods": [ + "getAnswerRecord" + ] + }, + "UpdateAnswerRecord": { + "methods": [ + "updateAnswerRecord" + ] + }, + "ListAnswerRecords": { + "methods": [ + "listAnswerRecords", + "listAnswerRecordsStream", + "listAnswerRecordsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "AnswerRecordsClient", + "rpcs": { + "GetAnswerRecord": { + "methods": [ + "getAnswerRecord" + ] + }, + "UpdateAnswerRecord": { + "methods": [ + "updateAnswerRecord" + ] + }, + "ListAnswerRecords": { + "methods": [ + "listAnswerRecords", + "listAnswerRecordsStream", + "listAnswerRecordsAsync" + ] + } + } + } + } + }, "Contexts": { "clients": { "grpc": { @@ -191,6 +239,190 @@ } } }, + "ConversationProfiles": { + "clients": { + "grpc": { + "libraryClient": "ConversationProfilesClient", + "rpcs": { + "GetConversationProfile": { + "methods": [ + "getConversationProfile" + ] + }, + "CreateConversationProfile": { + "methods": [ + "createConversationProfile" + ] + }, + "UpdateConversationProfile": { + "methods": [ + "updateConversationProfile" + ] + }, + "DeleteConversationProfile": { + "methods": [ + "deleteConversationProfile" + ] + }, + "ListConversationProfiles": { + "methods": [ + "listConversationProfiles", + "listConversationProfilesStream", + "listConversationProfilesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ConversationProfilesClient", + "rpcs": { + "GetConversationProfile": { + "methods": [ + "getConversationProfile" + ] + }, + "CreateConversationProfile": { + "methods": [ + "createConversationProfile" + ] + }, + "UpdateConversationProfile": { + "methods": [ + "updateConversationProfile" + ] + }, + "DeleteConversationProfile": { + "methods": [ + "deleteConversationProfile" + ] + }, + "ListConversationProfiles": { + "methods": [ + "listConversationProfiles", + "listConversationProfilesStream", + "listConversationProfilesAsync" + ] + } + } + } + } + }, + "Conversations": { + "clients": { + "grpc": { + "libraryClient": "ConversationsClient", + "rpcs": { + "CreateConversation": { + "methods": [ + "createConversation" + ] + }, + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "CompleteConversation": { + "methods": [ + "completeConversation" + ] + }, + "CreateCallMatcher": { + "methods": [ + "createCallMatcher" + ] + }, + "DeleteCallMatcher": { + "methods": [ + "deleteCallMatcher" + ] + }, + "BatchCreateMessages": { + "methods": [ + "batchCreateMessages" + ] + }, + "ListConversations": { + "methods": [ + "listConversations", + "listConversationsStream", + "listConversationsAsync" + ] + }, + "ListCallMatchers": { + "methods": [ + "listCallMatchers", + "listCallMatchersStream", + "listCallMatchersAsync" + ] + }, + "ListMessages": { + "methods": [ + "listMessages", + "listMessagesStream", + "listMessagesAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ConversationsClient", + "rpcs": { + "CreateConversation": { + "methods": [ + "createConversation" + ] + }, + "GetConversation": { + "methods": [ + "getConversation" + ] + }, + "CompleteConversation": { + "methods": [ + "completeConversation" + ] + }, + "CreateCallMatcher": { + "methods": [ + "createCallMatcher" + ] + }, + "DeleteCallMatcher": { + "methods": [ + "deleteCallMatcher" + ] + }, + "BatchCreateMessages": { + "methods": [ + "batchCreateMessages" + ] + }, + "ListConversations": { + "methods": [ + "listConversations", + "listConversationsStream", + "listConversationsAsync" + ] + }, + "ListCallMatchers": { + "methods": [ + "listCallMatchers", + "listCallMatchersStream", + "listCallMatchersAsync" + ] + }, + "ListMessages": { + "methods": [ + "listMessages", + "listMessagesStream", + "listMessagesAsync" + ] + } + } + } + } + }, "Documents": { "clients": { "grpc": { @@ -206,6 +438,11 @@ "createDocument" ] }, + "ImportDocuments": { + "methods": [ + "importDocuments" + ] + }, "DeleteDocument": { "methods": [ "deleteDocument" @@ -243,6 +480,11 @@ "createDocument" ] }, + "ImportDocuments": { + "methods": [ + "importDocuments" + ] + }, "DeleteDocument": { "methods": [ "deleteDocument" @@ -571,6 +813,133 @@ } } }, + "Participants": { + "clients": { + "grpc": { + "libraryClient": "ParticipantsClient", + "rpcs": { + "CreateParticipant": { + "methods": [ + "createParticipant" + ] + }, + "GetParticipant": { + "methods": [ + "getParticipant" + ] + }, + "UpdateParticipant": { + "methods": [ + "updateParticipant" + ] + }, + "AnalyzeContent": { + "methods": [ + "analyzeContent" + ] + }, + "SuggestArticles": { + "methods": [ + "suggestArticles" + ] + }, + "SuggestFaqAnswers": { + "methods": [ + "suggestFaqAnswers" + ] + }, + "SuggestSmartReplies": { + "methods": [ + "suggestSmartReplies" + ] + }, + "CompileSuggestion": { + "methods": [ + "compileSuggestion" + ] + }, + "StreamingAnalyzeContent": { + "methods": [ + "streamingAnalyzeContent" + ] + }, + "ListParticipants": { + "methods": [ + "listParticipants", + "listParticipantsStream", + "listParticipantsAsync" + ] + }, + "ListSuggestions": { + "methods": [ + "listSuggestions", + "listSuggestionsStream", + "listSuggestionsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "ParticipantsClient", + "rpcs": { + "CreateParticipant": { + "methods": [ + "createParticipant" + ] + }, + "GetParticipant": { + "methods": [ + "getParticipant" + ] + }, + "UpdateParticipant": { + "methods": [ + "updateParticipant" + ] + }, + "AnalyzeContent": { + "methods": [ + "analyzeContent" + ] + }, + "SuggestArticles": { + "methods": [ + "suggestArticles" + ] + }, + "SuggestFaqAnswers": { + "methods": [ + "suggestFaqAnswers" + ] + }, + "SuggestSmartReplies": { + "methods": [ + "suggestSmartReplies" + ] + }, + "CompileSuggestion": { + "methods": [ + "compileSuggestion" + ] + }, + "ListParticipants": { + "methods": [ + "listParticipants", + "listParticipantsStream", + "listParticipantsAsync" + ] + }, + "ListSuggestions": { + "methods": [ + "listSuggestions", + "listSuggestionsStream", + "listSuggestionsAsync" + ] + } + } + } + } + }, "SessionEntityTypes": { "clients": { "grpc": { diff --git a/packages/google-cloud-dialogflow/src/v2beta1/index.ts b/packages/google-cloud-dialogflow/src/v2beta1/index.ts index 1a137bda577..90228acd4e2 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/index.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/index.ts @@ -17,11 +17,15 @@ // ** All changes to this file may be overwritten. ** export {AgentsClient} from './agents_client'; +export {AnswerRecordsClient} from './answer_records_client'; export {ContextsClient} from './contexts_client'; +export {ConversationProfilesClient} from './conversation_profiles_client'; +export {ConversationsClient} from './conversations_client'; export {DocumentsClient} from './documents_client'; export {EntityTypesClient} from './entity_types_client'; export {EnvironmentsClient} from './environments_client'; export {IntentsClient} from './intents_client'; export {KnowledgeBasesClient} from './knowledge_bases_client'; +export {ParticipantsClient} from './participants_client'; export {SessionEntityTypesClient} from './session_entity_types_client'; export {SessionsClient} from './sessions_client'; diff --git a/packages/google-cloud-dialogflow/src/v2beta1/intents_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/intents_client.ts index 981c064561b..cc43b4f50ea 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/intents_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/intents_client.ts @@ -195,6 +195,24 @@ export class IntentsClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/knowledgeBases/{knowledge_base}' ), @@ -219,6 +237,24 @@ export class IntentsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' ), @@ -1882,6 +1918,333 @@ export class IntentsClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectKnowledgeBase resource name string. * @@ -2398,6 +2761,458 @@ export class IntentsClient { ).entity_type; } + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectLocationKnowledgeBase resource name string. * diff --git a/packages/google-cloud-dialogflow/src/v2beta1/intents_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/intents_proto_list.json index 2ff3ebfebba..1669125f722 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/intents_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2beta1/intents_proto_list.json @@ -1,13 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", "../../protos/google/cloud/dialogflow/v2beta1/document.proto", "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", "../../protos/google/cloud/dialogflow/v2beta1/session.proto", "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2beta1/knowledge_bases_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/knowledge_bases_client.ts index 3478285adf7..6354c2d3884 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/knowledge_bases_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/knowledge_bases_client.ts @@ -193,6 +193,24 @@ export class KnowledgeBasesClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/knowledgeBases/{knowledge_base}' ), @@ -217,6 +235,24 @@ export class KnowledgeBasesClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' ), @@ -1589,6 +1625,333 @@ export class KnowledgeBasesClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectKnowledgeBase resource name string. * @@ -2105,6 +2468,458 @@ export class KnowledgeBasesClient { ).entity_type; } + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectLocationKnowledgeBase resource name string. * diff --git a/packages/google-cloud-dialogflow/src/v2beta1/knowledge_bases_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/knowledge_bases_proto_list.json index 2ff3ebfebba..1669125f722 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/knowledge_bases_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2beta1/knowledge_bases_proto_list.json @@ -1,13 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", "../../protos/google/cloud/dialogflow/v2beta1/document.proto", "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", "../../protos/google/cloud/dialogflow/v2beta1/session.proto", "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2beta1/participants_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/participants_client.ts new file mode 100644 index 00000000000..b5399cfaf8e --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2beta1/participants_client.ts @@ -0,0 +1,3788 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +/* global window */ +import * as gax from 'google-gax'; +import { + Callback, + CallOptions, + Descriptors, + ClientOptions, + PaginationCallback, + GaxCall, +} from 'google-gax'; +import * as path from 'path'; + +import {Transform} from 'stream'; +import {RequestType} from 'google-gax/build/src/apitypes'; +import * as protos from '../../protos/protos'; +/** + * Client JSON configuration object, loaded from + * `src/v2beta1/participants_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './participants_client_config.json'; + +const version = require('../../../package.json').version; + +/** + * Service for managing {@link google.cloud.dialogflow.v2beta1.Participant|Participants}. + * @class + * @memberof v2beta1 + */ +export class ParticipantsClient { + private _terminated = false; + private _opts: ClientOptions; + private _gaxModule: typeof gax | typeof gax.fallback; + private _gaxGrpc: gax.GrpcClient | gax.fallback.GrpcClient; + private _protos: {}; + private _defaults: {[method: string]: gax.CallSettings}; + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + innerApiCalls: {[name: string]: Function}; + pathTemplates: {[name: string]: gax.PathTemplate}; + participantsStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of ParticipantsClient. + * + * @param {object} [options] - The configuration object. + * The options accepted by the constructor are described in detail + * in [this document](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#creating-the-client-instance). + * The common options are: + * @param {object} [options.credentials] - Credentials object. + * @param {string} [options.credentials.client_email] + * @param {string} [options.credentials.private_key] + * @param {string} [options.email] - Account email address. Required when + * using a .pem or .p12 keyFilename. + * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or + * .p12 key downloaded from the Google Developers Console. If you provide + * a path to a JSON file, the projectId option below is not necessary. + * NOTE: .pem and .p12 require you to specify options.email as well. + * @param {number} [options.port] - The port on which to connect to + * the remote host. + * @param {string} [options.projectId] - The project ID from the Google + * Developer's Console, e.g. 'grape-spaceship-123'. We will also check + * the environment variable GCLOUD_PROJECT for your project ID. If your + * app is running in an environment which supports + * {@link https://developers.google.com/identity/protocols/application-default-credentials Application Default Credentials}, + * your project ID will be detected automatically. + * @param {string} [options.apiEndpoint] - The domain name of the + * API remote host. + * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override. + * Follows the structure of {@link gapicConfig}. + * @param {boolean} [options.fallback] - Use HTTP fallback mode. + * In fallback mode, a special browser-compatible transport implementation is used + * instead of gRPC transport. In browser context (if the `window` object is defined) + * the fallback mode is enabled automatically; set `options.fallback` to `false` + * if you need to override this behavior. + */ + constructor(opts?: ClientOptions) { + // Ensure that options include all the required fields. + const staticMembers = this.constructor as typeof ParticipantsClient; + const servicePath = + opts?.servicePath || opts?.apiEndpoint || staticMembers.servicePath; + const port = opts?.port || staticMembers.port; + const clientConfig = opts?.clientConfig ?? {}; + const fallback = + opts?.fallback ?? + (typeof window !== 'undefined' && typeof window?.fetch === 'function'); + opts = Object.assign({servicePath, port, clientConfig, fallback}, opts); + + // If scopes are unset in options and we're connecting to a non-default endpoint, set scopes just in case. + if (servicePath !== staticMembers.servicePath && !('scopes' in opts)) { + opts['scopes'] = staticMembers.scopes; + } + + // Choose either gRPC or proto-over-HTTP implementation of google-gax. + this._gaxModule = opts.fallback ? gax.fallback : gax; + + // Create a `gaxGrpc` object, with any grpc-specific options sent to the client. + this._gaxGrpc = new this._gaxModule.GrpcClient(opts); + + // Save options to use in initialize() method. + this._opts = opts; + + // Save the auth object to the client, for use by other methods. + this.auth = this._gaxGrpc.auth as gax.GoogleAuth; + + // Set the default scopes in auth client if needed. + if (servicePath === staticMembers.servicePath) { + this.auth.defaultScopes = staticMembers.scopes; + } + + // Determine the client header string. + const clientHeader = [`gax/${this._gaxModule.version}`, `gapic/${version}`]; + if (typeof process !== 'undefined' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + // For Node.js, pass the path to JSON proto file. + // For browsers, pass the JSON content. + + const nodejsProtoPath = path.join( + __dirname, + '..', + '..', + 'protos', + 'protos.json' + ); + this._protos = this._gaxGrpc.loadProto( + opts.fallback + ? // eslint-disable-next-line @typescript-eslint/no-var-requires + require('../../protos/protos.json') + : nodejsProtoPath + ); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + projectAgentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent' + ), + projectAgentEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/entityTypes/{entity_type}' + ), + projectAgentEnvironmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}' + ), + projectAgentEnvironmentUserSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/contexts/{context}' + ), + projectAgentEnvironmentUserSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/environments/{environment}/users/{user}/sessions/{session}/entityTypes/{entity_type}' + ), + projectAgentIntentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/intents/{intent}' + ), + projectAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/contexts/{context}' + ), + projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), + projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}' + ), + projectKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + projectLocationAgentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent' + ), + projectLocationAgentEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/entityTypes/{entity_type}' + ), + projectLocationAgentEnvironmentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/environments/{environment}' + ), + projectLocationAgentIntentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/intents/{intent}' + ), + projectLocationAgentSessionContextPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/sessions/{session}/contexts/{context}' + ), + projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' + ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), + projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' + ), + projectLocationKnowledgeBaseDocumentPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}/documents/{document}' + ), + }; + + // Some of the methods on this service return "paged" results, + // (e.g. 50 results at a time, with tokens to get subsequent + // pages). Denote the keys used for pagination and results. + this.descriptors.page = { + listParticipants: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'participants' + ), + listSuggestions: new this._gaxModule.PageDescriptor( + 'pageToken', + 'nextPageToken', + 'suggestions' + ), + }; + + // Some of the methods on this service provide streaming responses. + // Provide descriptors for these. + this.descriptors.stream = { + streamingAnalyzeContent: new this._gaxModule.StreamDescriptor( + gax.StreamType.BIDI_STREAMING + ), + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.dialogflow.v2beta1.Participants', + gapicConfig as gax.ClientConfig, + opts.clientConfig || {}, + {'x-goog-api-client': clientHeader.join(' ')} + ); + + // Set up a dictionary of "inner API calls"; the core implementation + // of calling the API is handled in `google-gax`, with this code + // merely providing the destination and request information. + this.innerApiCalls = {}; + } + + /** + * Initialize the client. + * Performs asynchronous operations (such as authentication) and prepares the client. + * This function will be called automatically when any class method is called for the + * first time, but if you need to initialize it before calling an actual method, + * feel free to call initialize() directly. + * + * You can await on this method if you want to make sure the client is initialized. + * + * @returns {Promise} A promise that resolves to an authenticated service stub. + */ + initialize() { + // If the client stub promise is already initialized, return immediately. + if (this.participantsStub) { + return this.participantsStub; + } + + // Put together the "service stub" for + // google.cloud.dialogflow.v2beta1.Participants. + this.participantsStub = this._gaxGrpc.createStub( + this._opts.fallback + ? (this._protos as protobuf.Root).lookupService( + 'google.cloud.dialogflow.v2beta1.Participants' + ) + : // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.dialogflow.v2beta1.Participants, + this._opts + ) as Promise<{[method: string]: Function}>; + + // Iterate over each of the methods that the service provides + // and create an API call method for each. + const participantsStubMethods = [ + 'createParticipant', + 'getParticipant', + 'listParticipants', + 'updateParticipant', + 'analyzeContent', + 'streamingAnalyzeContent', + 'suggestArticles', + 'suggestFaqAnswers', + 'suggestSmartReplies', + 'listSuggestions', + 'compileSuggestion', + ]; + for (const methodName of participantsStubMethods) { + const callPromise = this.participantsStub.then( + stub => (...args: Array<{}>) => { + if (this._terminated) { + return Promise.reject('The client has already been closed.'); + } + const func = stub[methodName]; + return func.apply(stub, args); + }, + (err: Error | null | undefined) => () => { + throw err; + } + ); + + const descriptor = + this.descriptors.page[methodName] || + this.descriptors.stream[methodName] || + undefined; + const apiCall = this._gaxModule.createApiCall( + callPromise, + this._defaults[methodName], + descriptor + ); + + this.innerApiCalls[methodName] = apiCall; + } + + return this.participantsStub; + } + + /** + * The DNS address for this API service. + * @returns {string} The DNS address for this service. + */ + static get servicePath() { + return 'dialogflow.googleapis.com'; + } + + /** + * The DNS address for this API service - same as servicePath(), + * exists for compatibility reasons. + * @returns {string} The DNS address for this service. + */ + static get apiEndpoint() { + return 'dialogflow.googleapis.com'; + } + + /** + * The port for this API service. + * @returns {number} The default port for this service. + */ + static get port() { + return 443; + } + + /** + * The scopes needed to make gRPC calls for every method defined + * in this service. + * @returns {string[]} List of default scopes. + */ + static get scopes() { + return [ + 'https://www.googleapis.com/auth/cloud-platform', + 'https://www.googleapis.com/auth/dialogflow', + ]; + } + + getProjectId(): Promise; + getProjectId(callback: Callback): void; + /** + * Return the project ID used by this class. + * @returns {Promise} A promise that resolves to string containing the project ID. + */ + getProjectId( + callback?: Callback + ): Promise | void { + if (callback) { + this.auth.getProjectId(callback); + return; + } + return this.auth.getProjectId(); + } + + // ------------------- + // -- Service calls -- + // ------------------- + createParticipant( + request: protos.google.cloud.dialogflow.v2beta1.ICreateParticipantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IParticipant, + ( + | protos.google.cloud.dialogflow.v2beta1.ICreateParticipantRequest + | undefined + ), + {} | undefined + ] + >; + createParticipant( + request: protos.google.cloud.dialogflow.v2beta1.ICreateParticipantRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IParticipant, + | protos.google.cloud.dialogflow.v2beta1.ICreateParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + createParticipant( + request: protos.google.cloud.dialogflow.v2beta1.ICreateParticipantRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IParticipant, + | protos.google.cloud.dialogflow.v2beta1.ICreateParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Creates a new participant in a conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Resource identifier of the conversation adding the participant. + * Format: `projects//locations//conversations/`. + * @param {google.cloud.dialogflow.v2beta1.Participant} request.participant + * Required. The participant to create. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.createParticipant(request); + */ + createParticipant( + request: protos.google.cloud.dialogflow.v2beta1.ICreateParticipantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IParticipant, + | protos.google.cloud.dialogflow.v2beta1.ICreateParticipantRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IParticipant, + | protos.google.cloud.dialogflow.v2beta1.ICreateParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IParticipant, + ( + | protos.google.cloud.dialogflow.v2beta1.ICreateParticipantRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.createParticipant(request, options, callback); + } + getParticipant( + request: protos.google.cloud.dialogflow.v2beta1.IGetParticipantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IParticipant, + protos.google.cloud.dialogflow.v2beta1.IGetParticipantRequest | undefined, + {} | undefined + ] + >; + getParticipant( + request: protos.google.cloud.dialogflow.v2beta1.IGetParticipantRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IParticipant, + | protos.google.cloud.dialogflow.v2beta1.IGetParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + getParticipant( + request: protos.google.cloud.dialogflow.v2beta1.IGetParticipantRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IParticipant, + | protos.google.cloud.dialogflow.v2beta1.IGetParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Retrieves a conversation participant. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the participant. Format: + * `projects//locations//conversations//participants/`. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.getParticipant(request); + */ + getParticipant( + request: protos.google.cloud.dialogflow.v2beta1.IGetParticipantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IParticipant, + | protos.google.cloud.dialogflow.v2beta1.IGetParticipantRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IParticipant, + | protos.google.cloud.dialogflow.v2beta1.IGetParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IParticipant, + protos.google.cloud.dialogflow.v2beta1.IGetParticipantRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + name: request.name || '', + }); + this.initialize(); + return this.innerApiCalls.getParticipant(request, options, callback); + } + updateParticipant( + request: protos.google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IParticipant, + ( + | protos.google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest + | undefined + ), + {} | undefined + ] + >; + updateParticipant( + request: protos.google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IParticipant, + | protos.google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + updateParticipant( + request: protos.google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IParticipant, + | protos.google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Updates the specified participant. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.dialogflow.v2beta1.Participant} request.participant + * Required. The participant to update. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The mask to specify which fields to update. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.updateParticipant(request); + */ + updateParticipant( + request: protos.google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IParticipant, + | protos.google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IParticipant, + | protos.google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IParticipant, + ( + | protos.google.cloud.dialogflow.v2beta1.IUpdateParticipantRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + 'participant.name': request.participant!.name || '', + }); + this.initialize(); + return this.innerApiCalls.updateParticipant(request, options, callback); + } + analyzeContent( + request: protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, + protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest | undefined, + {} | undefined + ] + >; + analyzeContent( + request: protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, + | protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + analyzeContent( + request: protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, + | protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * 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). + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.participant + * Required. The name of the participant this text comes from. + * Format: `projects//locations//conversations//participants/`. + * @param {google.cloud.dialogflow.v2beta1.InputText} request.text + * The natural language text to be processed. + * @param {google.cloud.dialogflow.v2beta1.InputAudio} request.audio + * The natural language speech audio to be processed. + * @param {google.cloud.dialogflow.v2beta1.TextInput} request.textInput + * The natural language text to be processed. + * @param {google.cloud.dialogflow.v2beta1.AudioInput} request.audioInput + * The natural language speech audio to be processed. + * @param {google.cloud.dialogflow.v2beta1.EventInput} request.eventInput + * An input event to send to Dialogflow. + * @param {google.cloud.dialogflow.v2beta1.OutputAudioConfig} request.replyAudioConfig + * 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. + * @param {google.cloud.dialogflow.v2beta1.QueryParameters} request.queryParams + * Parameters for a Dialogflow virtual-agent query. + * @param {google.protobuf.Timestamp} request.messageSendTime + * Optional. The send time of the message from end user or human agent's + * perspective. It is used for identifying the same message under one + * participant. + * + * Given two messages under the same participant: + * - If send time are different regardless of whether the content of the + * messages are exactly the same, the conversation will regard them as + * two distinct messages sent by the participant. + * - If send time is the same regardless of whether the content of the + * messages are exactly the same, the conversation will regard them as + * same message, and ignore the message received later. + * + * If the value is not provided, a new request will always be regarded as a + * new message without any de-duplication. + * @param {string} request.requestId + * 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [AnalyzeContentResponse]{@link google.cloud.dialogflow.v2beta1.AnalyzeContentResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.analyzeContent(request); + */ + analyzeContent( + request: protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, + | protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, + | protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse, + protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentRequest | undefined, + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + participant: request.participant || '', + }); + this.initialize(); + return this.innerApiCalls.analyzeContent(request, options, callback); + } + suggestArticles( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse, + ( + | protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest + | undefined + ), + {} | undefined + ] + >; + suggestArticles( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + suggestArticles( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets suggested articles for a participant based on specific historical + * messages. + * + * Note that {@link google.cloud.dialogflow.v2beta1.Participants.ListSuggestions|ListSuggestions} will only list the auto-generated + * suggestions, while {@link google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion|CompileSuggestion} will try to compile suggestion + * based on the provided conversation context in the real time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param {string} [request.latestMessage] + * Optional. 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/`. + * @param {number} [request.contextSize] + * Optional. Max number of messages prior to and including + * {@link google.cloud.dialogflow.v2beta1.SuggestArticlesRequest.latest_message|latest_message} to use as context + * when compiling the suggestion. By default 20 and at most 50. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SuggestArticlesResponse]{@link google.cloud.dialogflow.v2beta1.SuggestArticlesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.suggestArticles(request); + */ + suggestArticles( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse, + ( + | protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.suggestArticles(request, options, callback); + } + suggestFaqAnswers( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, + ( + | protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest + | undefined + ), + {} | undefined + ] + >; + suggestFaqAnswers( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest + | null + | undefined, + {} | null | undefined + > + ): void; + suggestFaqAnswers( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets suggested faq answers for a participant based on specific historical + * messages. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param {string} [request.latestMessage] + * Optional. 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/`. + * @param {number} [request.contextSize] + * Optional. 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SuggestFaqAnswersResponse]{@link google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.suggestFaqAnswers(request); + */ + suggestFaqAnswers( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse, + ( + | protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.suggestFaqAnswers(request, options, callback); + } + suggestSmartReplies( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse, + ( + | protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest + | undefined + ), + {} | undefined + ] + >; + suggestSmartReplies( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + suggestSmartReplies( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Gets smart replies for a participant based on specific historical + * messages. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param {google.cloud.dialogflow.v2beta1.TextInput} request.currentTextInput + * The current natural language text segment to compile suggestion + * for. This provides a way for user to get follow up smart reply suggestion + * after a smart reply selection, without sending a text message. + * @param {string} request.latestMessage + * 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/`. + * @param {number} request.contextSize + * Optional. 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. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [SuggestSmartRepliesResponse]{@link google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.suggestSmartReplies(request); + */ + suggestSmartReplies( + request: protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse, + | protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse, + ( + | protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.suggestSmartReplies(request, options, callback); + } + compileSuggestion( + request: protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, + ( + | protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest + | undefined + ), + {} | undefined + ] + >; + compileSuggestion( + request: protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, + | protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + compileSuggestion( + request: protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, + callback: Callback< + protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, + | protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest + | null + | undefined, + {} | null | undefined + > + ): void; + /** + * Deprecated. use {@link google.cloud.dialogflow.v2beta1.Participants.SuggestArticles|SuggestArticles} and {@link google.cloud.dialogflow.v2beta1.Participants.SuggestFaqAnswers|SuggestFaqAnswers} instead. + * + * Gets suggestions for a participant based on specific historical + * messages. + * + * Note that {@link google.cloud.dialogflow.v2beta1.Participants.ListSuggestions|ListSuggestions} will only list the auto-generated + * suggestions, while {@link google.cloud.dialogflow.v2beta1.Participants.CompileSuggestion|CompileSuggestion} will try to compile suggestion + * based on the provided conversation context in the real time. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestion for. + * Format: `projects//locations//conversations//participants/`. + * @param {string} request.latestMessage + * Optional. 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/`. + * @param {number} request.contextSize + * Optional. Max number of messages prior to and including + * [latest_message] to use as context when compiling the + * suggestion. If zero or less than zero, 20 is used. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing [CompileSuggestionResponse]{@link google.cloud.dialogflow.v2beta1.CompileSuggestionResponse}. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods) + * for more details and examples. + * @example + * const [response] = await client.compileSuggestion(request); + */ + compileSuggestion( + request: protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest, + optionsOrCallback?: + | CallOptions + | Callback< + protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, + | protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, + | protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest + | null + | undefined, + {} | null | undefined + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse, + ( + | protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionRequest + | undefined + ), + {} | undefined + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.compileSuggestion(request, options, callback); + } + + /** + * Adds a text (e.g., chat) or audio (e.g., phone recording) message from a + * participant into the conversation. + * Note: This method is only available through the gRPC API (not REST). + * + * The top-level message sent to the client by the server is + * `StreamingAnalyzeContentResponse`. Multiple response messages can be + * returned in order. The first one or more messages contain the + * `recognition_result` field. Each result represents a more complete + * transcript of what the user said. The next message contains the + * `reply_text` field, and potentially the `reply_audio` and/or the + * `automated_agent_reply` fields. + * + * 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). + * + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which is both readable and writable. It accepts objects + * representing [StreamingAnalyzeContentRequest]{@link google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest} for write() method, and + * will emit objects representing [StreamingAnalyzeContentResponse]{@link google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse} on 'data' event asynchronously. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#bi-directional-streaming) + * for more details and examples. + * @example + * const stream = client.streamingAnalyzeContent(); + * stream.on('data', (response) => { ... }); + * stream.on('end', () => { ... }); + * stream.write(request); + * stream.end(); + */ + streamingAnalyzeContent(options?: CallOptions): gax.CancellableStream { + this.initialize(); + return this.innerApiCalls.streamingAnalyzeContent(options); + } + + listParticipants( + request: protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IParticipant[], + protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListParticipantsResponse + ] + >; + listParticipants( + request: protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListParticipantsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IParticipant + > + ): void; + listParticipants( + request: protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListParticipantsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IParticipant + > + ): void; + /** + * Returns the list of all participants in the specified conversation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listParticipantsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listParticipants( + request: protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListParticipantsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IParticipant + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListParticipantsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.IParticipant + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.IParticipant[], + protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListParticipantsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listParticipants(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Participant]{@link google.cloud.dialogflow.v2beta1.Participant} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listParticipantsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listParticipantsStream( + request?: protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listParticipants.createStream( + this.innerApiCalls.listParticipants as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listParticipants`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The conversation to list all participants from. + * Format: `projects//locations//conversations/`. + * @param {number} [request.pageSize] + * Optional. The maximum number of items to return in a single page. By + * default 100 and at most 1000. + * @param {string} [request.pageToken] + * Optional. The next_page_token value returned from a previous list request. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Participant]{@link google.cloud.dialogflow.v2beta1.Participant}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listParticipantsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listParticipantsAsync( + request?: protos.google.cloud.dialogflow.v2beta1.IListParticipantsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listParticipants.asyncIterate( + this.innerApiCalls['listParticipants'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + listSuggestions( + request: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + options?: CallOptions + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ISuggestion[], + protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListSuggestionsResponse + ] + >; + listSuggestions( + request: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListSuggestionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.ISuggestion + > + ): void; + listSuggestions( + request: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + callback: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListSuggestionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.ISuggestion + > + ): void; + /** + * Deprecated: Use inline suggestion, event based suggestion or + * Suggestion* API instead. + * See {@link google.cloud.dialogflow.v2beta1.HumanAgentAssistantConfig.name|HumanAgentAssistantConfig.name} for more + * details. + * Removal Date: 2020-09-01. + * + * Retrieves suggestions for live agents. + * + * This method should be used by human agent client software to fetch auto + * generated suggestions in real-time, while the conversation with an end user + * is in progress. The functionality is implemented in terms of the + * [list pagination](https://cloud.google.com/apis/design/design_patterns#list_pagination) + * design pattern. The client app should use the `next_page_token` field + * to fetch the next batch of suggestions. `suggestions` are sorted by + * `create_time` in descending order. + * To fetch latest suggestion, just set `page_size` to 1. + * To fetch new suggestions without duplication, send request with filter + * `create_time_epoch_microseconds > [first item's create_time of previous + * request]` and empty page_token. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * @param {number} request.pageSize + * Optional. The maximum number of items to return in a single page. The + * default value is 100; the maximum value is 1000. + * @param {string} request.pageToken + * Optional. The next_page_token value returned from a previous list request. + * @param {string} request.filter + * Optional. Filter on suggestions 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). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is Array of [Suggestion]{@link google.cloud.dialogflow.v2beta1.Suggestion}. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed and will merge results from all the pages into this array. + * Note that it can affect your quota. + * We recommend using `listSuggestionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSuggestions( + request: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + optionsOrCallback?: + | CallOptions + | PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListSuggestionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.ISuggestion + >, + callback?: PaginationCallback< + protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + | protos.google.cloud.dialogflow.v2beta1.IListSuggestionsResponse + | null + | undefined, + protos.google.cloud.dialogflow.v2beta1.ISuggestion + > + ): Promise< + [ + protos.google.cloud.dialogflow.v2beta1.ISuggestion[], + protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest | null, + protos.google.cloud.dialogflow.v2beta1.IListSuggestionsResponse + ] + > | void { + request = request || {}; + let options: CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + this.initialize(); + return this.innerApiCalls.listSuggestions(request, options, callback); + } + + /** + * Equivalent to `method.name.toCamelCase()`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * @param {number} request.pageSize + * Optional. The maximum number of items to return in a single page. The + * default value is 100; the maximum value is 1000. + * @param {string} request.pageToken + * Optional. The next_page_token value returned from a previous list request. + * @param {string} request.filter + * Optional. Filter on suggestions 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). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Stream} + * An object stream which emits an object representing [Suggestion]{@link google.cloud.dialogflow.v2beta1.Suggestion} on 'data' event. + * The client library will perform auto-pagination by default: it will call the API as many + * times as needed. Note that it can affect your quota. + * We recommend using `listSuggestionsAsync()` + * method described below for async iteration which you can stop as needed. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + */ + listSuggestionsStream( + request?: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + options?: CallOptions + ): Transform { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listSuggestions.createStream( + this.innerApiCalls.listSuggestions as gax.GaxCall, + request, + callSettings + ); + } + + /** + * Equivalent to `listSuggestions`, but returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The name of the participant to fetch suggestions for. + * Format: `projects//locations//conversations//participants/`. + * @param {number} request.pageSize + * Optional. The maximum number of items to return in a single page. The + * default value is 100; the maximum value is 1000. + * @param {string} request.pageToken + * Optional. The next_page_token value returned from a previous list request. + * @param {string} request.filter + * Optional. Filter on suggestions 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). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows [async iteration](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols). + * When you iterate the returned iterable, each element will be an object representing + * [Suggestion]{@link google.cloud.dialogflow.v2beta1.Suggestion}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the + * [documentation](https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination) + * for more details and examples. + * @example + * const iterable = client.listSuggestionsAsync(request); + * for await (const response of iterable) { + * // process response + * } + */ + listSuggestionsAsync( + request?: protos.google.cloud.dialogflow.v2beta1.IListSuggestionsRequest, + options?: CallOptions + ): AsyncIterable { + request = request || {}; + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers[ + 'x-goog-request-params' + ] = gax.routingHeader.fromParams({ + parent: request.parent || '', + }); + options = options || {}; + const callSettings = new gax.CallSettings(options); + this.initialize(); + return this.descriptors.page.listSuggestions.asyncIterate( + this.innerApiCalls['listSuggestions'] as GaxCall, + (request as unknown) as RequestType, + callSettings + ) as AsyncIterable; + } + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified project resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectPath(project: string) { + return this.pathTemplates.projectPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from Project resource. + * + * @param {string} projectName + * A fully-qualified path representing Project resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectName(projectName: string) { + return this.pathTemplates.projectPathTemplate.match(projectName).project; + } + + /** + * Return a fully-qualified projectAgent resource name string. + * + * @param {string} project + * @returns {string} Resource name string. + */ + projectAgentPath(project: string) { + return this.pathTemplates.projectAgentPathTemplate.render({ + project: project, + }); + } + + /** + * Parse the project from ProjectAgent resource. + * + * @param {string} projectAgentName + * A fully-qualified path representing project_agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentName(projectAgentName: string) { + return this.pathTemplates.projectAgentPathTemplate.match(projectAgentName) + .project; + } + + /** + * Return a fully-qualified projectAgentEntityType resource name string. + * + * @param {string} project + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEntityTypePath(project: string, entityType: string) { + return this.pathTemplates.projectAgentEntityTypePathTemplate.render({ + project: project, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentEntityType resource. + * + * @param {string} projectAgentEntityTypeName + * A fully-qualified path representing project_agent_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEntityTypeName( + projectAgentEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEntityTypePathTemplate.match( + projectAgentEntityTypeName + ).project; + } + + /** + * Parse the entity_type from ProjectAgentEntityType resource. + * + * @param {string} projectAgentEntityTypeName + * A fully-qualified path representing project_agent_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEntityTypeName( + projectAgentEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEntityTypePathTemplate.match( + projectAgentEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentEnvironment resource name string. + * + * @param {string} project + * @param {string} environment + * @returns {string} Resource name string. + */ + projectAgentEnvironmentPath(project: string, environment: string) { + return this.pathTemplates.projectAgentEnvironmentPathTemplate.render({ + project: project, + environment: environment, + }); + } + + /** + * Parse the project from ProjectAgentEnvironment resource. + * + * @param {string} projectAgentEnvironmentName + * A fully-qualified path representing project_agent_environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentName( + projectAgentEnvironmentName: string + ) { + return this.pathTemplates.projectAgentEnvironmentPathTemplate.match( + projectAgentEnvironmentName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironment resource. + * + * @param {string} projectAgentEnvironmentName + * A fully-qualified path representing project_agent_environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentName( + projectAgentEnvironmentName: string + ) { + return this.pathTemplates.projectAgentEnvironmentPathTemplate.match( + projectAgentEnvironmentName + ).environment; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionContext resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionContextPath( + project: string, + environment: string, + user: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentEnvironmentUserSessionContext resource. + * + * @param {string} projectAgentEnvironmentUserSessionContextName + * A fully-qualified path representing project_agent_environment_user_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentEnvironmentUserSessionContextName( + projectAgentEnvironmentUserSessionContextName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match( + projectAgentEnvironmentUserSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentEnvironmentUserSessionEntityType resource name string. + * + * @param {string} project + * @param {string} environment + * @param {string} user + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentEnvironmentUserSessionEntityTypePath( + project: string, + environment: string, + user: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render( + { + project: project, + environment: environment, + user: user, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).project; + } + + /** + * Parse the environment from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).environment; + } + + /** + * Parse the user from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the user. + */ + matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).user; + } + + /** + * Parse the session from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentEnvironmentUserSessionEntityType resource. + * + * @param {string} projectAgentEnvironmentUserSessionEntityTypeName + * A fully-qualified path representing project_agent_environment_user_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + projectAgentEnvironmentUserSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match( + projectAgentEnvironmentUserSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAgentIntent resource name string. + * + * @param {string} project + * @param {string} intent + * @returns {string} Resource name string. + */ + projectAgentIntentPath(project: string, intent: string) { + return this.pathTemplates.projectAgentIntentPathTemplate.render({ + project: project, + intent: intent, + }); + } + + /** + * Parse the project from ProjectAgentIntent resource. + * + * @param {string} projectAgentIntentName + * A fully-qualified path representing project_agent_intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentIntentName(projectAgentIntentName: string) { + return this.pathTemplates.projectAgentIntentPathTemplate.match( + projectAgentIntentName + ).project; + } + + /** + * Parse the intent from ProjectAgentIntent resource. + * + * @param {string} projectAgentIntentName + * A fully-qualified path representing project_agent_intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromProjectAgentIntentName(projectAgentIntentName: string) { + return this.pathTemplates.projectAgentIntentPathTemplate.match( + projectAgentIntentName + ).intent; + } + + /** + * Return a fully-qualified projectAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectAgentSessionContextPath( + project: string, + session: string, + context: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.render({ + project: project, + session: session, + context: context, + }); + } + + /** + * Parse the project from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectAgentSessionContext resource. + * + * @param {string} projectAgentSessionContextName + * A fully-qualified path representing project_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectAgentSessionContextName( + projectAgentSessionContextName: string + ) { + return this.pathTemplates.projectAgentSessionContextPathTemplate.match( + projectAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectAgentSessionEntityTypePath( + project: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.render({ + project: project, + session: session, + entity_type: entityType, + }); + } + + /** + * Parse the project from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the session from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectAgentSessionEntityType resource. + * + * @param {string} projectAgentSessionEntityTypeName + * A fully-qualified path representing project_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectAgentSessionEntityTypeName( + projectAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectAgentSessionEntityTypePathTemplate.match( + projectAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectKnowledgeBasePath(project: string, knowledgeBase: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseName(projectKnowledgeBaseName: string) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBase resource. + * + * @param {string} projectKnowledgeBaseName + * A fully-qualified path representing project_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseName( + projectKnowledgeBaseName: string + ) { + return this.pathTemplates.projectKnowledgeBasePathTemplate.match( + projectKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectKnowledgeBaseDocumentPath( + project: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render({ + project: project, + knowledge_base: knowledgeBase, + document: document, + }); + } + + /** + * Parse the project from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the knowledge_base from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectKnowledgeBaseDocument resource. + * + * @param {string} projectKnowledgeBaseDocumentName + * A fully-qualified path representing project_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectKnowledgeBaseDocumentName( + projectKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match( + projectKnowledgeBaseDocumentName + ).document; + } + + /** + * Return a fully-qualified projectLocationAgent resource name string. + * + * @param {string} project + * @param {string} location + * @returns {string} Resource name string. + */ + projectLocationAgentPath(project: string, location: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.render({ + project: project, + location: location, + }); + } + + /** + * Parse the project from ProjectLocationAgent resource. + * + * @param {string} projectLocationAgentName + * A fully-qualified path representing project_location_agent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentName(projectLocationAgentName: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.match( + projectLocationAgentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgent resource. + * + * @param {string} projectLocationAgentName + * A fully-qualified path representing project_location_agent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentName(projectLocationAgentName: string) { + return this.pathTemplates.projectLocationAgentPathTemplate.match( + projectLocationAgentName + ).location; + } + + /** + * Return a fully-qualified projectLocationAgentEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentEntityTypePath( + project: string, + location: string, + entityType: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.render( + { + project: project, + location: location, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName + ).location; + } + + /** + * Parse the entity_type from ProjectLocationAgentEntityType resource. + * + * @param {string} projectLocationAgentEntityTypeName + * A fully-qualified path representing project_location_agent_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentEntityTypeName( + projectLocationAgentEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentEntityTypePathTemplate.match( + projectLocationAgentEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAgentEnvironment resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} environment + * @returns {string} Resource name string. + */ + projectLocationAgentEnvironmentPath( + project: string, + location: string, + environment: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render( + { + project: project, + location: location, + environment: environment, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentEnvironment resource. + * + * @param {string} projectLocationAgentEnvironmentName + * A fully-qualified path representing project_location_agent_environment resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentEnvironmentName( + projectLocationAgentEnvironmentName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match( + projectLocationAgentEnvironmentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentEnvironment resource. + * + * @param {string} projectLocationAgentEnvironmentName + * A fully-qualified path representing project_location_agent_environment resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentEnvironmentName( + projectLocationAgentEnvironmentName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match( + projectLocationAgentEnvironmentName + ).location; + } + + /** + * Parse the environment from ProjectLocationAgentEnvironment resource. + * + * @param {string} projectLocationAgentEnvironmentName + * A fully-qualified path representing project_location_agent_environment resource. + * @returns {string} A string representing the environment. + */ + matchEnvironmentFromProjectLocationAgentEnvironmentName( + projectLocationAgentEnvironmentName: string + ) { + return this.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match( + projectLocationAgentEnvironmentName + ).environment; + } + + /** + * Return a fully-qualified projectLocationAgentIntent resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} intent + * @returns {string} Resource name string. + */ + projectLocationAgentIntentPath( + project: string, + location: string, + intent: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.render({ + project: project, + location: location, + intent: intent, + }); + } + + /** + * Parse the project from ProjectLocationAgentIntent resource. + * + * @param {string} projectLocationAgentIntentName + * A fully-qualified path representing project_location_agent_intent resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentIntentName( + projectLocationAgentIntentName: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.match( + projectLocationAgentIntentName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentIntent resource. + * + * @param {string} projectLocationAgentIntentName + * A fully-qualified path representing project_location_agent_intent resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentIntentName( + projectLocationAgentIntentName: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.match( + projectLocationAgentIntentName + ).location; + } + + /** + * Parse the intent from ProjectLocationAgentIntent resource. + * + * @param {string} projectLocationAgentIntentName + * A fully-qualified path representing project_location_agent_intent resource. + * @returns {string} A string representing the intent. + */ + matchIntentFromProjectLocationAgentIntentName( + projectLocationAgentIntentName: string + ) { + return this.pathTemplates.projectLocationAgentIntentPathTemplate.match( + projectLocationAgentIntentName + ).intent; + } + + /** + * Return a fully-qualified projectLocationAgentSessionContext resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @param {string} context + * @returns {string} Resource name string. + */ + projectLocationAgentSessionContextPath( + project: string, + location: string, + session: string, + context: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.render( + { + project: project, + location: location, + session: session, + context: context, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).location; + } + + /** + * Parse the session from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).session; + } + + /** + * Parse the context from ProjectLocationAgentSessionContext resource. + * + * @param {string} projectLocationAgentSessionContextName + * A fully-qualified path representing project_location_agent_session_context resource. + * @returns {string} A string representing the context. + */ + matchContextFromProjectLocationAgentSessionContextName( + projectLocationAgentSessionContextName: string + ) { + return this.pathTemplates.projectLocationAgentSessionContextPathTemplate.match( + projectLocationAgentSessionContextName + ).context; + } + + /** + * Return a fully-qualified projectLocationAgentSessionEntityType resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} session + * @param {string} entity_type + * @returns {string} Resource name string. + */ + projectLocationAgentSessionEntityTypePath( + project: string, + location: string, + session: string, + entityType: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render( + { + project: project, + location: location, + session: session, + entity_type: entityType, + } + ); + } + + /** + * Parse the project from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).project; + } + + /** + * Parse the location from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).location; + } + + /** + * Parse the session from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the session. + */ + matchSessionFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).session; + } + + /** + * Parse the entity_type from ProjectLocationAgentSessionEntityType resource. + * + * @param {string} projectLocationAgentSessionEntityTypeName + * A fully-qualified path representing project_location_agent_session_entity_type resource. + * @returns {string} A string representing the entity_type. + */ + matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + projectLocationAgentSessionEntityTypeName: string + ) { + return this.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match( + projectLocationAgentSessionEntityTypeName + ).entity_type; + } + + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBase resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBasePath( + project: string, + location: string, + knowledgeBase: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.render({ + project: project, + location: location, + knowledge_base: knowledgeBase, + }); + } + + /** + * Parse the project from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBase resource. + * + * @param {string} projectLocationKnowledgeBaseName + * A fully-qualified path representing project_location_knowledge_base resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + projectLocationKnowledgeBaseName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBasePathTemplate.match( + projectLocationKnowledgeBaseName + ).knowledge_base; + } + + /** + * Return a fully-qualified projectLocationKnowledgeBaseDocument resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} knowledge_base + * @param {string} document + * @returns {string} Resource name string. + */ + projectLocationKnowledgeBaseDocumentPath( + project: string, + location: string, + knowledgeBase: string, + document: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render( + { + project: project, + location: location, + knowledge_base: knowledgeBase, + document: document, + } + ); + } + + /** + * Parse the project from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).project; + } + + /** + * Parse the location from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).location; + } + + /** + * Parse the knowledge_base from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the knowledge_base. + */ + matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).knowledge_base; + } + + /** + * Parse the document from ProjectLocationKnowledgeBaseDocument resource. + * + * @param {string} projectLocationKnowledgeBaseDocumentName + * A fully-qualified path representing project_location_knowledge_base_document resource. + * @returns {string} A string representing the document. + */ + matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + projectLocationKnowledgeBaseDocumentName: string + ) { + return this.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match( + projectLocationKnowledgeBaseDocumentName + ).document; + } + + /** + * Terminate the gRPC channel and close the client. + * + * The client will no longer be usable and all future behavior is undefined. + * @returns {Promise} A promise that resolves when the client is closed. + */ + close(): Promise { + this.initialize(); + if (!this._terminated) { + return this.participantsStub!.then(stub => { + this._terminated = true; + stub.close(); + }); + } + return Promise.resolve(); + } +} diff --git a/packages/google-cloud-dialogflow/src/v2beta1/participants_client_config.json b/packages/google-cloud-dialogflow/src/v2beta1/participants_client_config.json new file mode 100644 index 00000000000..2b59076003d --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2beta1/participants_client_config.json @@ -0,0 +1,84 @@ +{ + "interfaces": { + "google.cloud.dialogflow.v2beta1.Participants": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "CreateParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "GetParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListParticipants": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "UpdateParticipant": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "AnalyzeContent": { + "timeout_millis": 220000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "StreamingAnalyzeContent": { + "timeout_millis": 220000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "SuggestArticles": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SuggestFaqAnswers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "SuggestSmartReplies": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "ListSuggestions": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + }, + "CompileSuggestion": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "default" + } + } + } + } +} diff --git a/packages/google-cloud-dialogflow/src/v2beta1/participants_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/participants_proto_list.json new file mode 100644 index 00000000000..1669125f722 --- /dev/null +++ b/packages/google-cloud-dialogflow/src/v2beta1/participants_proto_list.json @@ -0,0 +1,21 @@ +[ + "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", + "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", + "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", + "../../protos/google/cloud/dialogflow/v2beta1/document.proto", + "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", + "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", + "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", + "../../protos/google/cloud/dialogflow/v2beta1/session.proto", + "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", + "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", + "../../protos/google/cloud/dialogflow/v2beta1/webhook.proto" +] diff --git a/packages/google-cloud-dialogflow/src/v2beta1/session_entity_types_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/session_entity_types_client.ts index b332d4228ae..f72c8148842 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/session_entity_types_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/session_entity_types_client.ts @@ -196,6 +196,24 @@ export class SessionEntityTypesClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/knowledgeBases/{knowledge_base}' ), @@ -220,6 +238,24 @@ export class SessionEntityTypesClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' ), @@ -1642,6 +1678,333 @@ export class SessionEntityTypesClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectKnowledgeBase resource name string. * @@ -2158,6 +2521,458 @@ export class SessionEntityTypesClient { ).entity_type; } + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectLocationKnowledgeBase resource name string. * diff --git a/packages/google-cloud-dialogflow/src/v2beta1/session_entity_types_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/session_entity_types_proto_list.json index 2ff3ebfebba..1669125f722 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/session_entity_types_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2beta1/session_entity_types_proto_list.json @@ -1,13 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", "../../protos/google/cloud/dialogflow/v2beta1/document.proto", "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", "../../protos/google/cloud/dialogflow/v2beta1/session.proto", "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/src/v2beta1/sessions_client.ts b/packages/google-cloud-dialogflow/src/v2beta1/sessions_client.ts index 065d409cc5d..f3bd9b34b4f 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/sessions_client.ts +++ b/packages/google-cloud-dialogflow/src/v2beta1/sessions_client.ts @@ -190,6 +190,24 @@ export class SessionsClient { projectAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/answerRecords/{answer_record}' + ), + projectConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}' + ), + projectConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/messages/{message}' + ), + projectConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversations/{conversation}/participants/{participant}' + ), + projectConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/conversationProfiles/{conversation_profile}' + ), projectKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/knowledgeBases/{knowledge_base}' ), @@ -217,6 +235,24 @@ export class SessionsClient { projectLocationAgentSessionEntityTypePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/agent/sessions/{session}/entityTypes/{entity_type}' ), + projectLocationAnswerRecordPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/answerRecords/{answer_record}' + ), + projectLocationConversationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}' + ), + projectLocationConversationCallMatcherPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/callMatchers/{call_matcher}' + ), + projectLocationConversationMessagePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/messages/{message}' + ), + projectLocationConversationParticipantPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversations/{conversation}/participants/{participant}' + ), + projectLocationConversationProfilePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/conversationProfiles/{conversation_profile}' + ), projectLocationKnowledgeBasePathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}/locations/{location}/knowledgeBases/{knowledge_base}' ), @@ -1157,6 +1193,333 @@ export class SessionsClient { ).entity_type; } + /** + * Return a fully-qualified projectAnswerRecord resource name string. + * + * @param {string} project + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectAnswerRecordPath(project: string, answerRecord: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.render({ + project: project, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectAnswerRecordName(projectAnswerRecordName: string) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).project; + } + + /** + * Parse the answer_record from ProjectAnswerRecord resource. + * + * @param {string} projectAnswerRecordName + * A fully-qualified path representing project_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectAnswerRecordName( + projectAnswerRecordName: string + ) { + return this.pathTemplates.projectAnswerRecordPathTemplate.match( + projectAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectConversation resource name string. + * + * @param {string} project + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectConversationPath(project: string, conversation: string) { + return this.pathTemplates.projectConversationPathTemplate.render({ + project: project, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationName(projectConversationName: string) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).project; + } + + /** + * Parse the conversation from ProjectConversation resource. + * + * @param {string} projectConversationName + * A fully-qualified path representing project_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationName( + projectConversationName: string + ) { + return this.pathTemplates.projectConversationPathTemplate.match( + projectConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectConversationCallMatcherPath( + project: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.render( + { + project: project, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).project; + } + + /** + * Parse the conversation from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectConversationCallMatcher resource. + * + * @param {string} projectConversationCallMatcherName + * A fully-qualified path representing project_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectConversationCallMatcherName( + projectConversationCallMatcherName: string + ) { + return this.pathTemplates.projectConversationCallMatcherPathTemplate.match( + projectConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectConversationMessage resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectConversationMessagePath( + project: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.render({ + project: project, + conversation: conversation, + message: message, + }); + } + + /** + * Parse the project from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).project; + } + + /** + * Parse the conversation from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectConversationMessage resource. + * + * @param {string} projectConversationMessageName + * A fully-qualified path representing project_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectConversationMessageName( + projectConversationMessageName: string + ) { + return this.pathTemplates.projectConversationMessagePathTemplate.match( + projectConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectConversationParticipant resource name string. + * + * @param {string} project + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectConversationParticipantPath( + project: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.render( + { + project: project, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).project; + } + + /** + * Parse the conversation from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectConversationParticipant resource. + * + * @param {string} projectConversationParticipantName + * A fully-qualified path representing project_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectConversationParticipantName( + projectConversationParticipantName: string + ) { + return this.pathTemplates.projectConversationParticipantPathTemplate.match( + projectConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectConversationProfile resource name string. + * + * @param {string} project + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectConversationProfilePath(project: string, conversationProfile: string) { + return this.pathTemplates.projectConversationProfilePathTemplate.render({ + project: project, + conversation_profile: conversationProfile, + }); + } + + /** + * Parse the project from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).project; + } + + /** + * Parse the conversation_profile from ProjectConversationProfile resource. + * + * @param {string} projectConversationProfileName + * A fully-qualified path representing project_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectConversationProfileName( + projectConversationProfileName: string + ) { + return this.pathTemplates.projectConversationProfilePathTemplate.match( + projectConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectKnowledgeBase resource name string. * @@ -1738,6 +2101,458 @@ export class SessionsClient { ).entity_type; } + /** + * Return a fully-qualified projectLocationAnswerRecord resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} answer_record + * @returns {string} Resource name string. + */ + projectLocationAnswerRecordPath( + project: string, + location: string, + answerRecord: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.render({ + project: project, + location: location, + answer_record: answerRecord, + }); + } + + /** + * Parse the project from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).project; + } + + /** + * Parse the location from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).location; + } + + /** + * Parse the answer_record from ProjectLocationAnswerRecord resource. + * + * @param {string} projectLocationAnswerRecordName + * A fully-qualified path representing project_location_answer_record resource. + * @returns {string} A string representing the answer_record. + */ + matchAnswerRecordFromProjectLocationAnswerRecordName( + projectLocationAnswerRecordName: string + ) { + return this.pathTemplates.projectLocationAnswerRecordPathTemplate.match( + projectLocationAnswerRecordName + ).answer_record; + } + + /** + * Return a fully-qualified projectLocationConversation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @returns {string} Resource name string. + */ + projectLocationConversationPath( + project: string, + location: string, + conversation: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.render({ + project: project, + location: location, + conversation: conversation, + }); + } + + /** + * Parse the project from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).project; + } + + /** + * Parse the location from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversation resource. + * + * @param {string} projectLocationConversationName + * A fully-qualified path representing project_location_conversation resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationName( + projectLocationConversationName: string + ) { + return this.pathTemplates.projectLocationConversationPathTemplate.match( + projectLocationConversationName + ).conversation; + } + + /** + * Return a fully-qualified projectLocationConversationCallMatcher resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} call_matcher + * @returns {string} Resource name string. + */ + projectLocationConversationCallMatcherPath( + project: string, + location: string, + conversation: string, + callMatcher: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + call_matcher: callMatcher, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).conversation; + } + + /** + * Parse the call_matcher from ProjectLocationConversationCallMatcher resource. + * + * @param {string} projectLocationConversationCallMatcherName + * A fully-qualified path representing project_location_conversation_call_matcher resource. + * @returns {string} A string representing the call_matcher. + */ + matchCallMatcherFromProjectLocationConversationCallMatcherName( + projectLocationConversationCallMatcherName: string + ) { + return this.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match( + projectLocationConversationCallMatcherName + ).call_matcher; + } + + /** + * Return a fully-qualified projectLocationConversationMessage resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} message + * @returns {string} Resource name string. + */ + projectLocationConversationMessagePath( + project: string, + location: string, + conversation: string, + message: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + message: message, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).conversation; + } + + /** + * Parse the message from ProjectLocationConversationMessage resource. + * + * @param {string} projectLocationConversationMessageName + * A fully-qualified path representing project_location_conversation_message resource. + * @returns {string} A string representing the message. + */ + matchMessageFromProjectLocationConversationMessageName( + projectLocationConversationMessageName: string + ) { + return this.pathTemplates.projectLocationConversationMessagePathTemplate.match( + projectLocationConversationMessageName + ).message; + } + + /** + * Return a fully-qualified projectLocationConversationParticipant resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation + * @param {string} participant + * @returns {string} Resource name string. + */ + projectLocationConversationParticipantPath( + project: string, + location: string, + conversation: string, + participant: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.render( + { + project: project, + location: location, + conversation: conversation, + participant: participant, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).location; + } + + /** + * Parse the conversation from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the conversation. + */ + matchConversationFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).conversation; + } + + /** + * Parse the participant from ProjectLocationConversationParticipant resource. + * + * @param {string} projectLocationConversationParticipantName + * A fully-qualified path representing project_location_conversation_participant resource. + * @returns {string} A string representing the participant. + */ + matchParticipantFromProjectLocationConversationParticipantName( + projectLocationConversationParticipantName: string + ) { + return this.pathTemplates.projectLocationConversationParticipantPathTemplate.match( + projectLocationConversationParticipantName + ).participant; + } + + /** + * Return a fully-qualified projectLocationConversationProfile resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} conversation_profile + * @returns {string} Resource name string. + */ + projectLocationConversationProfilePath( + project: string, + location: string, + conversationProfile: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.render( + { + project: project, + location: location, + conversation_profile: conversationProfile, + } + ); + } + + /** + * Parse the project from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the project. + */ + matchProjectFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).project; + } + + /** + * Parse the location from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the location. + */ + matchLocationFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).location; + } + + /** + * Parse the conversation_profile from ProjectLocationConversationProfile resource. + * + * @param {string} projectLocationConversationProfileName + * A fully-qualified path representing project_location_conversation_profile resource. + * @returns {string} A string representing the conversation_profile. + */ + matchConversationProfileFromProjectLocationConversationProfileName( + projectLocationConversationProfileName: string + ) { + return this.pathTemplates.projectLocationConversationProfilePathTemplate.match( + projectLocationConversationProfileName + ).conversation_profile; + } + /** * Return a fully-qualified projectLocationKnowledgeBase resource name string. * diff --git a/packages/google-cloud-dialogflow/src/v2beta1/sessions_proto_list.json b/packages/google-cloud-dialogflow/src/v2beta1/sessions_proto_list.json index 2ff3ebfebba..1669125f722 100644 --- a/packages/google-cloud-dialogflow/src/v2beta1/sessions_proto_list.json +++ b/packages/google-cloud-dialogflow/src/v2beta1/sessions_proto_list.json @@ -1,13 +1,19 @@ [ "../../protos/google/cloud/dialogflow/v2beta1/agent.proto", + "../../protos/google/cloud/dialogflow/v2beta1/answer_record.proto", "../../protos/google/cloud/dialogflow/v2beta1/audio_config.proto", "../../protos/google/cloud/dialogflow/v2beta1/context.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_event.proto", + "../../protos/google/cloud/dialogflow/v2beta1/conversation_profile.proto", "../../protos/google/cloud/dialogflow/v2beta1/document.proto", "../../protos/google/cloud/dialogflow/v2beta1/entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/environment.proto", "../../protos/google/cloud/dialogflow/v2beta1/gcs.proto", + "../../protos/google/cloud/dialogflow/v2beta1/human_agent_assistant_event.proto", "../../protos/google/cloud/dialogflow/v2beta1/intent.proto", "../../protos/google/cloud/dialogflow/v2beta1/knowledge_base.proto", + "../../protos/google/cloud/dialogflow/v2beta1/participant.proto", "../../protos/google/cloud/dialogflow/v2beta1/session.proto", "../../protos/google/cloud/dialogflow/v2beta1/session_entity_type.proto", "../../protos/google/cloud/dialogflow/v2beta1/validation_result.proto", diff --git a/packages/google-cloud-dialogflow/synth.metadata b/packages/google-cloud-dialogflow/synth.metadata index 0f7ebd4bbf7..48a3f451a77 100644 --- a/packages/google-cloud-dialogflow/synth.metadata +++ b/packages/google-cloud-dialogflow/synth.metadata @@ -4,15 +4,15 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/nodejs-dialogflow.git", - "sha": "41c0c2b6402e2481d8c1a818086f21b61a7885d5" + "sha": "70e0afc22cef974b97b5af92bc873d0370e1608c" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "54020365f5a790dcff0bbcff5643adea2a199ccb", - "internalRef": "358315519" + "sha": "d652c6370bf66e325da6ac9ad82989fe7ee7bb4b", + "internalRef": "362183999" } }, { diff --git a/packages/google-cloud-dialogflow/system-test/fixtures/sample/src/index.js b/packages/google-cloud-dialogflow/system-test/fixtures/sample/src/index.js index 717fe314548..9cc67ec935d 100644 --- a/packages/google-cloud-dialogflow/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-dialogflow/system-test/fixtures/sample/src/index.js @@ -21,10 +21,16 @@ const dialogflow = require('@google-cloud/dialogflow'); function main() { const agentsClient = new dialogflow.AgentsClient(); + const answerRecordsClient = new dialogflow.AnswerRecordsClient(); const contextsClient = new dialogflow.ContextsClient(); + const conversationProfilesClient = new dialogflow.ConversationProfilesClient(); + const conversationsClient = new dialogflow.ConversationsClient(); + const documentsClient = new dialogflow.DocumentsClient(); const entityTypesClient = new dialogflow.EntityTypesClient(); const environmentsClient = new dialogflow.EnvironmentsClient(); const intentsClient = new dialogflow.IntentsClient(); + const knowledgeBasesClient = new dialogflow.KnowledgeBasesClient(); + const participantsClient = new dialogflow.ParticipantsClient(); const sessionEntityTypesClient = new dialogflow.SessionEntityTypesClient(); const sessionsClient = new dialogflow.SessionsClient(); } diff --git a/packages/google-cloud-dialogflow/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-dialogflow/system-test/fixtures/sample/src/index.ts index 4dea971cd29..79198e2e02e 100644 --- a/packages/google-cloud-dialogflow/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-dialogflow/system-test/fixtures/sample/src/index.ts @@ -18,10 +18,16 @@ import { AgentsClient, + AnswerRecordsClient, ContextsClient, + ConversationProfilesClient, + ConversationsClient, + DocumentsClient, EntityTypesClient, EnvironmentsClient, IntentsClient, + KnowledgeBasesClient, + ParticipantsClient, SessionEntityTypesClient, SessionsClient, } from '@google-cloud/dialogflow'; @@ -30,9 +36,23 @@ import { function doStuffWithAgentsClient(client: AgentsClient) { client.close(); } +function doStuffWithAnswerRecordsClient(client: AnswerRecordsClient) { + client.close(); +} function doStuffWithContextsClient(client: ContextsClient) { client.close(); } +function doStuffWithConversationProfilesClient( + client: ConversationProfilesClient +) { + client.close(); +} +function doStuffWithConversationsClient(client: ConversationsClient) { + client.close(); +} +function doStuffWithDocumentsClient(client: DocumentsClient) { + client.close(); +} function doStuffWithEntityTypesClient(client: EntityTypesClient) { client.close(); } @@ -42,6 +62,12 @@ function doStuffWithEnvironmentsClient(client: EnvironmentsClient) { function doStuffWithIntentsClient(client: IntentsClient) { client.close(); } +function doStuffWithKnowledgeBasesClient(client: KnowledgeBasesClient) { + client.close(); +} +function doStuffWithParticipantsClient(client: ParticipantsClient) { + client.close(); +} function doStuffWithSessionEntityTypesClient(client: SessionEntityTypesClient) { client.close(); } @@ -54,9 +80,21 @@ function main() { const agentsClient = new AgentsClient(); doStuffWithAgentsClient(agentsClient); // check that the client instance can be created + const answerRecordsClient = new AnswerRecordsClient(); + doStuffWithAnswerRecordsClient(answerRecordsClient); + // check that the client instance can be created const contextsClient = new ContextsClient(); doStuffWithContextsClient(contextsClient); // check that the client instance can be created + const conversationProfilesClient = new ConversationProfilesClient(); + doStuffWithConversationProfilesClient(conversationProfilesClient); + // check that the client instance can be created + const conversationsClient = new ConversationsClient(); + doStuffWithConversationsClient(conversationsClient); + // check that the client instance can be created + const documentsClient = new DocumentsClient(); + doStuffWithDocumentsClient(documentsClient); + // check that the client instance can be created const entityTypesClient = new EntityTypesClient(); doStuffWithEntityTypesClient(entityTypesClient); // check that the client instance can be created @@ -66,6 +104,12 @@ function main() { const intentsClient = new IntentsClient(); doStuffWithIntentsClient(intentsClient); // check that the client instance can be created + const knowledgeBasesClient = new KnowledgeBasesClient(); + doStuffWithKnowledgeBasesClient(knowledgeBasesClient); + // check that the client instance can be created + const participantsClient = new ParticipantsClient(); + doStuffWithParticipantsClient(participantsClient); + // check that the client instance can be created const sessionEntityTypesClient = new SessionEntityTypesClient(); doStuffWithSessionEntityTypesClient(sessionEntityTypesClient); // check that the client instance can be created diff --git a/packages/google-cloud-dialogflow/test/gapic_agents_v2.ts b/packages/google-cloud-dialogflow/test/gapic_agents_v2.ts index 05e1c640bf3..ee2e092794c 100644 --- a/packages/google-cloud-dialogflow/test/gapic_agents_v2.ts +++ b/packages/google-cloud-dialogflow/test/gapic_agents_v2.ts @@ -2323,5 +2323,1195 @@ describe('v2.AgentsClient', () => { ); }); }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new agentsModule.v2.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-dialogflow/test/gapic_agents_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_agents_v2beta1.ts index 57cd79081fc..c4cca2d4b2b 100644 --- a/packages/google-cloud-dialogflow/test/gapic_agents_v2beta1.ts +++ b/packages/google-cloud-dialogflow/test/gapic_agents_v2beta1.ts @@ -2371,58 +2371,897 @@ describe('v2beta1.AgentsClient', () => { }); }); + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new agentsModule.v2beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new agentsModule.v2beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new agentsModule.v2beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new agentsModule.v2beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new agentsModule.v2beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new agentsModule.v2beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectKnowledgeBase', () => { const fakePath = '/rendered/path/projectKnowledgeBase'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new agentsModule.v2beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new agentsModule.v2beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new agentsModule.v2beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new agentsModule.v2beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', }; const client = new agentsModule.v2beta1.AgentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBasePath', () => { - const result = client.projectKnowledgeBasePath( + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( 'projectValue', - 'knowledgeBaseValue' + 'locationValue', + 'environmentValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + intent: 'intentValue', + }; + const client = new agentsModule.v2beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( + 'projectValue', + 'locationValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new agentsModule.v2beta1.AgentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .render as SinonStub) .getCall(-1) - .calledWith(expectedParameters) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) ); }); - it('matchProjectFromProjectKnowledgeBaseName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseName( + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'projectValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'contextValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2430,73 +3269,93 @@ describe('v2beta1.AgentsClient', () => { }); }); - describe('projectKnowledgeBaseDocument', () => { - const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', - document: 'documentValue', + location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', }; const client = new agentsModule.v2beta1.AgentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBaseDocumentPath', () => { - const result = client.projectKnowledgeBaseDocumentPath( + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( 'projectValue', - 'knowledgeBaseValue', - 'documentValue' + 'locationValue', + 'sessionValue', + 'entityTypeValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'documentValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2504,58 +3363,73 @@ describe('v2beta1.AgentsClient', () => { }); }); - describe('projectLocationAgent', () => { - const fakePath = '/rendered/path/projectLocationAgent'; + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; const expectedParameters = { project: 'projectValue', location: 'locationValue', + answer_record: 'answerRecordValue', }; const client = new agentsModule.v2beta1.AgentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentPath', () => { - const result = client.projectLocationAgentPath( + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( 'projectValue', - 'locationValue' + 'locationValue', + 'answerRecordValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentName', () => { - const result = client.matchProjectFromProjectLocationAgentName( + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentName', () => { - const result = client.matchLocationFromProjectLocationAgentName( + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2563,73 +3437,73 @@ describe('v2beta1.AgentsClient', () => { }); }); - describe('projectLocationAgentEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentEntityType'; + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - entity_type: 'entityTypeValue', + conversation: 'conversationValue', }; const client = new agentsModule.v2beta1.AgentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEntityTypePath', () => { - const result = client.projectLocationAgentEntityTypePath( + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( 'projectValue', 'locationValue', - 'entityTypeValue' + 'conversationValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2637,73 +3511,93 @@ describe('v2beta1.AgentsClient', () => { }); }); - describe('projectLocationAgentEnvironment', () => { - const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - environment: 'environmentValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', }; const client = new agentsModule.v2beta1.AgentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEnvironmentPath', () => { - const result = client.projectLocationAgentEnvironmentPath( + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( 'projectValue', 'locationValue', - 'environmentValue' + 'conversationValue', + 'callMatcherValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( fakePath ); - assert.strictEqual(result, 'environmentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2711,73 +3605,88 @@ describe('v2beta1.AgentsClient', () => { }); }); - describe('projectLocationAgentIntent', () => { - const fakePath = '/rendered/path/projectLocationAgentIntent'; + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - intent: 'intentValue', + conversation: 'conversationValue', + message: 'messageValue', }; const client = new agentsModule.v2beta1.AgentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentIntentPath', () => { - const result = client.projectLocationAgentIntentPath( + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( 'projectValue', 'locationValue', - 'intentValue' + 'conversationValue', + 'messageValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentIntentName', () => { - const result = client.matchProjectFromProjectLocationAgentIntentName( + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentIntentName', () => { - const result = client.matchLocationFromProjectLocationAgentIntentName( + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchIntentFromProjectLocationAgentIntentName', () => { - const result = client.matchIntentFromProjectLocationAgentIntentName( + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( fakePath ); - assert.strictEqual(result, 'intentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2785,88 +3694,93 @@ describe('v2beta1.AgentsClient', () => { }); }); - describe('projectLocationAgentSessionContext', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - context: 'contextValue', + conversation: 'conversationValue', + participant: 'participantValue', }; const client = new agentsModule.v2beta1.AgentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionContextPath', () => { - const result = client.projectLocationAgentSessionContextPath( + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( 'projectValue', 'locationValue', - 'sessionValue', - 'contextValue' + 'conversationValue', + 'participantValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionContextName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionContextName( + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionContextName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionContextName( + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSessionFromProjectLocationAgentSessionContextName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionContextName( + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'sessionValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchContextFromProjectLocationAgentSessionContextName', () => { - const result = client.matchContextFromProjectLocationAgentSessionContextName( + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'contextValue'); + assert.strictEqual(result, 'participantValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2874,93 +3788,73 @@ describe('v2beta1.AgentsClient', () => { }); }); - describe('projectLocationAgentSessionEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - entity_type: 'entityTypeValue', + conversation_profile: 'conversationProfileValue', }; const client = new agentsModule.v2beta1.AgentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionEntityTypePath', () => { - const result = client.projectLocationAgentSessionEntityTypePath( + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( 'projectValue', 'locationValue', - 'sessionValue', - 'entityTypeValue' + 'conversationProfileValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate - .match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( - fakePath - ); - assert.strictEqual(result, 'sessionValue'); - assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationProfileValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) diff --git a/packages/google-cloud-dialogflow/test/gapic_answer_records_v2.ts b/packages/google-cloud-dialogflow/test/gapic_answer_records_v2.ts new file mode 100644 index 00000000000..c9ad8f6f81e --- /dev/null +++ b/packages/google-cloud-dialogflow/test/gapic_answer_records_v2.ts @@ -0,0 +1,2415 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as answerrecordsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.AnswerRecordsClient', () => { + it('has servicePath', () => { + const servicePath = answerrecordsModule.v2.AnswerRecordsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = answerrecordsModule.v2.AnswerRecordsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = answerrecordsModule.v2.AnswerRecordsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.answerRecordsStub, undefined); + await client.initialize(); + assert(client.answerRecordsStub); + }); + + it('has close method', () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('updateAnswerRecord', () => { + it('invokes updateAnswerRecord without error', async () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateAnswerRecordRequest() + ); + request.answerRecord = {}; + request.answerRecord.name = ''; + const expectedHeaderRequestParams = 'answer_record.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ); + client.innerApiCalls.updateAnswerRecord = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateAnswerRecord(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateAnswerRecord as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateAnswerRecord without error using callback', async () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateAnswerRecordRequest() + ); + request.answerRecord = {}; + request.answerRecord.name = ''; + const expectedHeaderRequestParams = 'answer_record.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ); + client.innerApiCalls.updateAnswerRecord = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateAnswerRecord( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IAnswerRecord | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateAnswerRecord as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateAnswerRecord with error', async () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateAnswerRecordRequest() + ); + request.answerRecord = {}; + request.answerRecord.name = ''; + const expectedHeaderRequestParams = 'answer_record.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAnswerRecord = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateAnswerRecord(request), expectedError); + assert( + (client.innerApiCalls.updateAnswerRecord as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listAnswerRecords', () => { + it('invokes listAnswerRecords without error', async () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ), + ]; + client.innerApiCalls.listAnswerRecords = stubSimpleCall(expectedResponse); + const [response] = await client.listAnswerRecords(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAnswerRecords as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAnswerRecords without error using callback', async () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ), + ]; + client.innerApiCalls.listAnswerRecords = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listAnswerRecords( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IAnswerRecord[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAnswerRecords as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAnswerRecords with error', async () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAnswerRecords = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAnswerRecords(request), expectedError); + assert( + (client.innerApiCalls.listAnswerRecords as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAnswerRecordsStream without error', async () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ), + ]; + client.descriptors.page.listAnswerRecords.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listAnswerRecordsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.AnswerRecord[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.AnswerRecord) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listAnswerRecords.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAnswerRecords, request) + ); + assert.strictEqual( + (client.descriptors.page.listAnswerRecords + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listAnswerRecordsStream with error', async () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAnswerRecords.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAnswerRecordsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.AnswerRecord[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.AnswerRecord) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAnswerRecords.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAnswerRecords, request) + ); + assert.strictEqual( + (client.descriptors.page.listAnswerRecords + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAnswerRecords without error', async () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnswerRecord() + ), + ]; + client.descriptors.page.listAnswerRecords.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2.IAnswerRecord[] = []; + const iterable = client.listAnswerRecordsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAnswerRecords + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAnswerRecords + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAnswerRecords with error', async () => { + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAnswerRecords.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAnswerRecordsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2.IAnswerRecord[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAnswerRecords + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAnswerRecords + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('agent', () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + entity_type: 'entityTypeValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath('projectValue', 'entityTypeValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('environment', () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('intent', () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + intent: 'intentValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath('projectValue', 'intentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionContext', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionContext'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionContextPath', () => { + const result = client.projectAgentEnvironmentUserSessionContextPath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchContextFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionEntityType', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionEntityTypePath', () => { + const result = client.projectAgentEnvironmentUserSessionEntityTypePath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionContext', () => { + const fakePath = '/rendered/path/projectAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionContextPath', () => { + const result = client.projectAgentSessionContextPath( + 'projectValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionContextName', () => { + const result = client.matchProjectFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionContextName', () => { + const result = client.matchSessionFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentSessionContextName', () => { + const result = client.matchContextFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionEntityTypePath', () => { + const result = client.projectAgentSessionEntityTypePath( + 'projectValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new answerrecordsModule.v2.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dialogflow/test/gapic_answer_records_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_answer_records_v2beta1.ts new file mode 100644 index 00000000000..e53814bc781 --- /dev/null +++ b/packages/google-cloud-dialogflow/test/gapic_answer_records_v2beta1.ts @@ -0,0 +1,3018 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as answerrecordsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2beta1.AnswerRecordsClient', () => { + it('has servicePath', () => { + const servicePath = + answerrecordsModule.v2beta1.AnswerRecordsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + answerrecordsModule.v2beta1.AnswerRecordsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = answerrecordsModule.v2beta1.AnswerRecordsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.answerRecordsStub, undefined); + await client.initialize(); + assert(client.answerRecordsStub); + }); + + it('has close method', () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getAnswerRecord', () => { + it('invokes getAnswerRecord without error', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ); + client.innerApiCalls.getAnswerRecord = stubSimpleCall(expectedResponse); + const [response] = await client.getAnswerRecord(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getAnswerRecord as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getAnswerRecord without error using callback', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ); + client.innerApiCalls.getAnswerRecord = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getAnswerRecord( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IAnswerRecord | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getAnswerRecord as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getAnswerRecord with error', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.GetAnswerRecordRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getAnswerRecord = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getAnswerRecord(request), expectedError); + assert( + (client.innerApiCalls.getAnswerRecord as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateAnswerRecord', () => { + it('invokes updateAnswerRecord without error', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest() + ); + request.answerRecord = {}; + request.answerRecord.name = ''; + const expectedHeaderRequestParams = 'answer_record.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ); + client.innerApiCalls.updateAnswerRecord = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateAnswerRecord(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateAnswerRecord as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateAnswerRecord without error using callback', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest() + ); + request.answerRecord = {}; + request.answerRecord.name = ''; + const expectedHeaderRequestParams = 'answer_record.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ); + client.innerApiCalls.updateAnswerRecord = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateAnswerRecord( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IAnswerRecord | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateAnswerRecord as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateAnswerRecord with error', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.UpdateAnswerRecordRequest() + ); + request.answerRecord = {}; + request.answerRecord.name = ''; + const expectedHeaderRequestParams = 'answer_record.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateAnswerRecord = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateAnswerRecord(request), expectedError); + assert( + (client.innerApiCalls.updateAnswerRecord as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listAnswerRecords', () => { + it('invokes listAnswerRecords without error', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ), + ]; + client.innerApiCalls.listAnswerRecords = stubSimpleCall(expectedResponse); + const [response] = await client.listAnswerRecords(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAnswerRecords as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAnswerRecords without error using callback', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ), + ]; + client.innerApiCalls.listAnswerRecords = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listAnswerRecords( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.v2beta1.IAnswerRecord[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listAnswerRecords as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listAnswerRecords with error', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listAnswerRecords = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listAnswerRecords(request), expectedError); + assert( + (client.innerApiCalls.listAnswerRecords as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listAnswerRecordsStream without error', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ), + ]; + client.descriptors.page.listAnswerRecords.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listAnswerRecordsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.AnswerRecord[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2beta1.AnswerRecord) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listAnswerRecords.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAnswerRecords, request) + ); + assert.strictEqual( + (client.descriptors.page.listAnswerRecords + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listAnswerRecordsStream with error', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAnswerRecords.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listAnswerRecordsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.AnswerRecord[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2beta1.AnswerRecord) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listAnswerRecords.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listAnswerRecords, request) + ); + assert.strictEqual( + (client.descriptors.page.listAnswerRecords + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAnswerRecords without error', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnswerRecord() + ), + ]; + client.descriptors.page.listAnswerRecords.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2beta1.IAnswerRecord[] = []; + const iterable = client.listAnswerRecordsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listAnswerRecords + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAnswerRecords + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listAnswerRecords with error', async () => { + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListAnswerRecordsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listAnswerRecords.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listAnswerRecordsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2beta1.IAnswerRecord[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listAnswerRecords + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listAnswerRecords + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgent', () => { + const fakePath = '/rendered/path/projectAgent'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentPath', () => { + const result = client.projectAgentPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentName', () => { + const result = client.matchProjectFromProjectAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEntityType', () => { + const fakePath = '/rendered/path/projectAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + entity_type: 'entityTypeValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEntityTypePath', () => { + const result = client.projectAgentEntityTypePath( + 'projectValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironment', () => { + const fakePath = '/rendered/path/projectAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentPath', () => { + const result = client.projectAgentEnvironmentPath( + 'projectValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionContext', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionContext'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionContextPath', () => { + const result = client.projectAgentEnvironmentUserSessionContextPath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchContextFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionEntityType', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionEntityTypePath', () => { + const result = client.projectAgentEnvironmentUserSessionEntityTypePath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentIntent', () => { + const fakePath = '/rendered/path/projectAgentIntent'; + const expectedParameters = { + project: 'projectValue', + intent: 'intentValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentIntentPath', () => { + const result = client.projectAgentIntentPath( + 'projectValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentIntentName', () => { + const result = client.matchProjectFromProjectAgentIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectAgentIntentName', () => { + const result = client.matchIntentFromProjectAgentIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionContext', () => { + const fakePath = '/rendered/path/projectAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionContextPath', () => { + const result = client.projectAgentSessionContextPath( + 'projectValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionContextName', () => { + const result = client.matchProjectFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionContextName', () => { + const result = client.matchSessionFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentSessionContextName', () => { + const result = client.matchContextFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionEntityTypePath', () => { + const result = client.projectAgentSessionEntityTypePath( + 'projectValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( + 'projectValue', + 'locationValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + intent: 'intentValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( + 'projectValue', + 'locationValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new answerrecordsModule.v2beta1.AnswerRecordsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dialogflow/test/gapic_contexts_v2.ts b/packages/google-cloud-dialogflow/test/gapic_contexts_v2.ts index 552369b09bb..94608ba7871 100644 --- a/packages/google-cloud-dialogflow/test/gapic_contexts_v2.ts +++ b/packages/google-cloud-dialogflow/test/gapic_contexts_v2.ts @@ -1698,5 +1698,1195 @@ describe('v2.ContextsClient', () => { ); }); }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new contextsModule.v2.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-dialogflow/test/gapic_contexts_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_contexts_v2beta1.ts index 005636fb956..8e654a4d8d5 100644 --- a/packages/google-cloud-dialogflow/test/gapic_contexts_v2beta1.ts +++ b/packages/google-cloud-dialogflow/test/gapic_contexts_v2beta1.ts @@ -1746,58 +1746,897 @@ describe('v2beta1.ContextsClient', () => { }); }); + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new contextsModule.v2beta1.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new contextsModule.v2beta1.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new contextsModule.v2beta1.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new contextsModule.v2beta1.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new contextsModule.v2beta1.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new contextsModule.v2beta1.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectKnowledgeBase', () => { const fakePath = '/rendered/path/projectKnowledgeBase'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new contextsModule.v2beta1.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new contextsModule.v2beta1.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new contextsModule.v2beta1.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new contextsModule.v2beta1.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', }; const client = new contextsModule.v2beta1.ContextsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBasePath', () => { - const result = client.projectKnowledgeBasePath( + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( 'projectValue', - 'knowledgeBaseValue' + 'locationValue', + 'environmentValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + intent: 'intentValue', + }; + const client = new contextsModule.v2beta1.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( + 'projectValue', + 'locationValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new contextsModule.v2beta1.ContextsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .render as SinonStub) .getCall(-1) - .calledWith(expectedParameters) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) ); }); - it('matchProjectFromProjectKnowledgeBaseName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseName( + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'projectValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'contextValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1805,73 +2644,93 @@ describe('v2beta1.ContextsClient', () => { }); }); - describe('projectKnowledgeBaseDocument', () => { - const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', - document: 'documentValue', + location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', }; const client = new contextsModule.v2beta1.ContextsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBaseDocumentPath', () => { - const result = client.projectKnowledgeBaseDocumentPath( + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( 'projectValue', - 'knowledgeBaseValue', - 'documentValue' + 'locationValue', + 'sessionValue', + 'entityTypeValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'documentValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1879,58 +2738,73 @@ describe('v2beta1.ContextsClient', () => { }); }); - describe('projectLocationAgent', () => { - const fakePath = '/rendered/path/projectLocationAgent'; + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; const expectedParameters = { project: 'projectValue', location: 'locationValue', + answer_record: 'answerRecordValue', }; const client = new contextsModule.v2beta1.ContextsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentPath', () => { - const result = client.projectLocationAgentPath( + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( 'projectValue', - 'locationValue' + 'locationValue', + 'answerRecordValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentName', () => { - const result = client.matchProjectFromProjectLocationAgentName( + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentName', () => { - const result = client.matchLocationFromProjectLocationAgentName( + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1938,73 +2812,73 @@ describe('v2beta1.ContextsClient', () => { }); }); - describe('projectLocationAgentEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentEntityType'; + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - entity_type: 'entityTypeValue', + conversation: 'conversationValue', }; const client = new contextsModule.v2beta1.ContextsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEntityTypePath', () => { - const result = client.projectLocationAgentEntityTypePath( + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( 'projectValue', 'locationValue', - 'entityTypeValue' + 'conversationValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2012,73 +2886,93 @@ describe('v2beta1.ContextsClient', () => { }); }); - describe('projectLocationAgentEnvironment', () => { - const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - environment: 'environmentValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', }; const client = new contextsModule.v2beta1.ContextsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEnvironmentPath', () => { - const result = client.projectLocationAgentEnvironmentPath( + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( 'projectValue', 'locationValue', - 'environmentValue' + 'conversationValue', + 'callMatcherValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( fakePath ); - assert.strictEqual(result, 'environmentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2086,73 +2980,88 @@ describe('v2beta1.ContextsClient', () => { }); }); - describe('projectLocationAgentIntent', () => { - const fakePath = '/rendered/path/projectLocationAgentIntent'; + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - intent: 'intentValue', + conversation: 'conversationValue', + message: 'messageValue', }; const client = new contextsModule.v2beta1.ContextsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentIntentPath', () => { - const result = client.projectLocationAgentIntentPath( + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( 'projectValue', 'locationValue', - 'intentValue' + 'conversationValue', + 'messageValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentIntentName', () => { - const result = client.matchProjectFromProjectLocationAgentIntentName( + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentIntentName', () => { - const result = client.matchLocationFromProjectLocationAgentIntentName( + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchIntentFromProjectLocationAgentIntentName', () => { - const result = client.matchIntentFromProjectLocationAgentIntentName( + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( fakePath ); - assert.strictEqual(result, 'intentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2160,88 +3069,93 @@ describe('v2beta1.ContextsClient', () => { }); }); - describe('projectLocationAgentSessionContext', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - context: 'contextValue', + conversation: 'conversationValue', + participant: 'participantValue', }; const client = new contextsModule.v2beta1.ContextsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionContextPath', () => { - const result = client.projectLocationAgentSessionContextPath( + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( 'projectValue', 'locationValue', - 'sessionValue', - 'contextValue' + 'conversationValue', + 'participantValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionContextName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionContextName( + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionContextName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionContextName( + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSessionFromProjectLocationAgentSessionContextName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionContextName( + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'sessionValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchContextFromProjectLocationAgentSessionContextName', () => { - const result = client.matchContextFromProjectLocationAgentSessionContextName( + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'contextValue'); + assert.strictEqual(result, 'participantValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2249,93 +3163,73 @@ describe('v2beta1.ContextsClient', () => { }); }); - describe('projectLocationAgentSessionEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - entity_type: 'entityTypeValue', + conversation_profile: 'conversationProfileValue', }; const client = new contextsModule.v2beta1.ContextsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionEntityTypePath', () => { - const result = client.projectLocationAgentSessionEntityTypePath( + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( 'projectValue', 'locationValue', - 'sessionValue', - 'entityTypeValue' + 'conversationProfileValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate - .match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( - fakePath - ); - assert.strictEqual(result, 'sessionValue'); - assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationProfileValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) diff --git a/packages/google-cloud-dialogflow/test/gapic_conversation_profiles_v2.ts b/packages/google-cloud-dialogflow/test/gapic_conversation_profiles_v2.ts new file mode 100644 index 00000000000..f28912680b9 --- /dev/null +++ b/packages/google-cloud-dialogflow/test/gapic_conversation_profiles_v2.ts @@ -0,0 +1,2878 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as conversationprofilesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.ConversationProfilesClient', () => { + it('has servicePath', () => { + const servicePath = + conversationprofilesModule.v2.ConversationProfilesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + conversationprofilesModule.v2.ConversationProfilesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = conversationprofilesModule.v2.ConversationProfilesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.conversationProfilesStub, undefined); + await client.initialize(); + assert(client.conversationProfilesStub); + }); + + it('has close method', () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getConversationProfile', () => { + it('invokes getConversationProfile without error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetConversationProfileRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ); + client.innerApiCalls.getConversationProfile = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getConversationProfile(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getConversationProfile without error using callback', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetConversationProfileRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ); + client.innerApiCalls.getConversationProfile = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getConversationProfile( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IConversationProfile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getConversationProfile with error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetConversationProfileRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getConversationProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getConversationProfile(request), + expectedError + ); + assert( + (client.innerApiCalls.getConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createConversationProfile', () => { + it('invokes createConversationProfile without error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateConversationProfileRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ); + client.innerApiCalls.createConversationProfile = stubSimpleCall( + expectedResponse + ); + const [response] = await client.createConversationProfile(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createConversationProfile without error using callback', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateConversationProfileRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ); + client.innerApiCalls.createConversationProfile = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createConversationProfile( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IConversationProfile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createConversationProfile with error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateConversationProfileRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createConversationProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createConversationProfile(request), + expectedError + ); + assert( + (client.innerApiCalls.createConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateConversationProfile', () => { + it('invokes updateConversationProfile without error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateConversationProfileRequest() + ); + request.conversationProfile = {}; + request.conversationProfile.name = ''; + const expectedHeaderRequestParams = 'conversation_profile.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ); + client.innerApiCalls.updateConversationProfile = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateConversationProfile(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateConversationProfile without error using callback', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateConversationProfileRequest() + ); + request.conversationProfile = {}; + request.conversationProfile.name = ''; + const expectedHeaderRequestParams = 'conversation_profile.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ); + client.innerApiCalls.updateConversationProfile = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateConversationProfile( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IConversationProfile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateConversationProfile with error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateConversationProfileRequest() + ); + request.conversationProfile = {}; + request.conversationProfile.name = ''; + const expectedHeaderRequestParams = 'conversation_profile.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConversationProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateConversationProfile(request), + expectedError + ); + assert( + (client.innerApiCalls.updateConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteConversationProfile', () => { + it('invokes deleteConversationProfile without error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteConversationProfileRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConversationProfile = stubSimpleCall( + expectedResponse + ); + const [response] = await client.deleteConversationProfile(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteConversationProfile without error using callback', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteConversationProfileRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConversationProfile = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteConversationProfile( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteConversationProfile with error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteConversationProfileRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConversationProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteConversationProfile(request), + expectedError + ); + assert( + (client.innerApiCalls.deleteConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listConversationProfiles', () => { + it('invokes listConversationProfiles without error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ), + ]; + client.innerApiCalls.listConversationProfiles = stubSimpleCall( + expectedResponse + ); + const [response] = await client.listConversationProfiles(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listConversationProfiles as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listConversationProfiles without error using callback', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ), + ]; + client.innerApiCalls.listConversationProfiles = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listConversationProfiles( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.v2.IConversationProfile[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listConversationProfiles as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listConversationProfiles with error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listConversationProfiles = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listConversationProfiles(request), + expectedError + ); + assert( + (client.innerApiCalls.listConversationProfiles as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listConversationProfilesStream without error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ), + ]; + client.descriptors.page.listConversationProfiles.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listConversationProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.ConversationProfile[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.ConversationProfile) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listConversationProfiles + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConversationProfiles, request) + ); + assert.strictEqual( + (client.descriptors.page.listConversationProfiles + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listConversationProfilesStream with error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listConversationProfiles.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listConversationProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.ConversationProfile[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.ConversationProfile) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listConversationProfiles + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConversationProfiles, request) + ); + assert.strictEqual( + (client.descriptors.page.listConversationProfiles + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listConversationProfiles without error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ConversationProfile() + ), + ]; + client.descriptors.page.listConversationProfiles.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2.IConversationProfile[] = []; + const iterable = client.listConversationProfilesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listConversationProfiles + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listConversationProfiles + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listConversationProfiles with error', async () => { + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listConversationProfiles.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listConversationProfilesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2.IConversationProfile[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listConversationProfiles + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listConversationProfiles + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('agent', () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath('projectValue', 'entityTypeValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('environment', () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('intent', () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + intent: 'intentValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath('projectValue', 'intentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionContext', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionContext'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionContextPath', () => { + const result = client.projectAgentEnvironmentUserSessionContextPath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchContextFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionEntityType', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionEntityTypePath', () => { + const result = client.projectAgentEnvironmentUserSessionEntityTypePath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionContext', () => { + const fakePath = '/rendered/path/projectAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionContextPath', () => { + const result = client.projectAgentSessionContextPath( + 'projectValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionContextName', () => { + const result = client.matchProjectFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionContextName', () => { + const result = client.matchSessionFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentSessionContextName', () => { + const result = client.matchContextFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionEntityTypePath', () => { + const result = client.projectAgentSessionEntityTypePath( + 'projectValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new conversationprofilesModule.v2.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dialogflow/test/gapic_conversation_profiles_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_conversation_profiles_v2beta1.ts new file mode 100644 index 00000000000..0934c7cd612 --- /dev/null +++ b/packages/google-cloud-dialogflow/test/gapic_conversation_profiles_v2beta1.ts @@ -0,0 +1,3382 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as conversationprofilesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2beta1.ConversationProfilesClient', () => { + it('has servicePath', () => { + const servicePath = + conversationprofilesModule.v2beta1.ConversationProfilesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + conversationprofilesModule.v2beta1.ConversationProfilesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = + conversationprofilesModule.v2beta1.ConversationProfilesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + fallback: true, + } + ); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + assert.strictEqual(client.conversationProfilesStub, undefined); + await client.initialize(); + assert(client.conversationProfilesStub); + }); + + it('has close method', () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getConversationProfile', () => { + it('invokes getConversationProfile without error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.GetConversationProfileRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ); + client.innerApiCalls.getConversationProfile = stubSimpleCall( + expectedResponse + ); + const [response] = await client.getConversationProfile(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getConversationProfile without error using callback', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.GetConversationProfileRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ); + client.innerApiCalls.getConversationProfile = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getConversationProfile( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IConversationProfile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getConversationProfile with error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.GetConversationProfileRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getConversationProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.getConversationProfile(request), + expectedError + ); + assert( + (client.innerApiCalls.getConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createConversationProfile', () => { + it('invokes createConversationProfile without error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ); + client.innerApiCalls.createConversationProfile = stubSimpleCall( + expectedResponse + ); + const [response] = await client.createConversationProfile(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createConversationProfile without error using callback', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ); + client.innerApiCalls.createConversationProfile = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createConversationProfile( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IConversationProfile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createConversationProfile with error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CreateConversationProfileRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createConversationProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.createConversationProfile(request), + expectedError + ); + assert( + (client.innerApiCalls.createConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateConversationProfile', () => { + it('invokes updateConversationProfile without error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest() + ); + request.conversationProfile = {}; + request.conversationProfile.name = ''; + const expectedHeaderRequestParams = 'conversation_profile.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ); + client.innerApiCalls.updateConversationProfile = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateConversationProfile(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateConversationProfile without error using callback', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest() + ); + request.conversationProfile = {}; + request.conversationProfile.name = ''; + const expectedHeaderRequestParams = 'conversation_profile.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ); + client.innerApiCalls.updateConversationProfile = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateConversationProfile( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IConversationProfile | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateConversationProfile with error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.UpdateConversationProfileRequest() + ); + request.conversationProfile = {}; + request.conversationProfile.name = ''; + const expectedHeaderRequestParams = 'conversation_profile.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateConversationProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.updateConversationProfile(request), + expectedError + ); + assert( + (client.innerApiCalls.updateConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteConversationProfile', () => { + it('invokes deleteConversationProfile without error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConversationProfile = stubSimpleCall( + expectedResponse + ); + const [response] = await client.deleteConversationProfile(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteConversationProfile without error using callback', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteConversationProfile = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteConversationProfile( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteConversationProfile with error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.DeleteConversationProfileRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteConversationProfile = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.deleteConversationProfile(request), + expectedError + ); + assert( + (client.innerApiCalls.deleteConversationProfile as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listConversationProfiles', () => { + it('invokes listConversationProfiles without error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ), + ]; + client.innerApiCalls.listConversationProfiles = stubSimpleCall( + expectedResponse + ); + const [response] = await client.listConversationProfiles(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listConversationProfiles as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listConversationProfiles without error using callback', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ), + ]; + client.innerApiCalls.listConversationProfiles = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listConversationProfiles( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.v2beta1.IConversationProfile[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listConversationProfiles as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listConversationProfiles with error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listConversationProfiles = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.listConversationProfiles(request), + expectedError + ); + assert( + (client.innerApiCalls.listConversationProfiles as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listConversationProfilesStream without error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ), + ]; + client.descriptors.page.listConversationProfiles.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listConversationProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.ConversationProfile[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.v2beta1.ConversationProfile + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listConversationProfiles + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConversationProfiles, request) + ); + assert.strictEqual( + (client.descriptors.page.listConversationProfiles + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listConversationProfilesStream with error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listConversationProfiles.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listConversationProfilesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.ConversationProfile[] = []; + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.v2beta1.ConversationProfile + ) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listConversationProfiles + .createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConversationProfiles, request) + ); + assert.strictEqual( + (client.descriptors.page.listConversationProfiles + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listConversationProfiles without error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ConversationProfile() + ), + ]; + client.descriptors.page.listConversationProfiles.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2beta1.IConversationProfile[] = []; + const iterable = client.listConversationProfilesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listConversationProfiles + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listConversationProfiles + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listConversationProfiles with error', async () => { + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationProfilesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listConversationProfiles.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listConversationProfilesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2beta1.IConversationProfile[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listConversationProfiles + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listConversationProfiles + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgent', () => { + const fakePath = '/rendered/path/projectAgent'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentPath', () => { + const result = client.projectAgentPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentName', () => { + const result = client.matchProjectFromProjectAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEntityType', () => { + const fakePath = '/rendered/path/projectAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEntityTypePath', () => { + const result = client.projectAgentEntityTypePath( + 'projectValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironment', () => { + const fakePath = '/rendered/path/projectAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentPath', () => { + const result = client.projectAgentEnvironmentPath( + 'projectValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionContext', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionContext'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionContextPath', () => { + const result = client.projectAgentEnvironmentUserSessionContextPath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchContextFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionEntityType', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionEntityTypePath', () => { + const result = client.projectAgentEnvironmentUserSessionEntityTypePath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentIntent', () => { + const fakePath = '/rendered/path/projectAgentIntent'; + const expectedParameters = { + project: 'projectValue', + intent: 'intentValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentIntentPath', () => { + const result = client.projectAgentIntentPath( + 'projectValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentIntentName', () => { + const result = client.matchProjectFromProjectAgentIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectAgentIntentName', () => { + const result = client.matchIntentFromProjectAgentIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionContext', () => { + const fakePath = '/rendered/path/projectAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionContextPath', () => { + const result = client.projectAgentSessionContextPath( + 'projectValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionContextName', () => { + const result = client.matchProjectFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionContextName', () => { + const result = client.matchSessionFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentSessionContextName', () => { + const result = client.matchContextFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionEntityTypePath', () => { + const result = client.projectAgentSessionEntityTypePath( + 'projectValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( + 'projectValue', + 'locationValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + intent: 'intentValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( + 'projectValue', + 'locationValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new conversationprofilesModule.v2beta1.ConversationProfilesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dialogflow/test/gapic_conversations_v2.ts b/packages/google-cloud-dialogflow/test/gapic_conversations_v2.ts new file mode 100644 index 00000000000..e0b78f6e119 --- /dev/null +++ b/packages/google-cloud-dialogflow/test/gapic_conversations_v2.ts @@ -0,0 +1,3466 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as conversationsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.ConversationsClient', () => { + it('has servicePath', () => { + const servicePath = conversationsModule.v2.ConversationsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = conversationsModule.v2.ConversationsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = conversationsModule.v2.ConversationsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new conversationsModule.v2.ConversationsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new conversationsModule.v2.ConversationsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.conversationsStub, undefined); + await client.initialize(); + assert(client.conversationsStub); + }); + + it('has close method', () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createConversation', () => { + it('invokes createConversation without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateConversationRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ); + client.innerApiCalls.createConversation = stubSimpleCall( + expectedResponse + ); + const [response] = await client.createConversation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createConversation without error using callback', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateConversationRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ); + client.innerApiCalls.createConversation = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createConversation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IConversation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createConversation with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateConversationRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createConversation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createConversation(request), expectedError); + assert( + (client.innerApiCalls.createConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getConversation', () => { + it('invokes getConversation without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetConversationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ); + client.innerApiCalls.getConversation = stubSimpleCall(expectedResponse); + const [response] = await client.getConversation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getConversation without error using callback', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetConversationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ); + client.innerApiCalls.getConversation = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getConversation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IConversation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getConversation with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetConversationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getConversation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getConversation(request), expectedError); + assert( + (client.innerApiCalls.getConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('completeConversation', () => { + it('invokes completeConversation without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CompleteConversationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ); + client.innerApiCalls.completeConversation = stubSimpleCall( + expectedResponse + ); + const [response] = await client.completeConversation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.completeConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes completeConversation without error using callback', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CompleteConversationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ); + client.innerApiCalls.completeConversation = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.completeConversation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IConversation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.completeConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes completeConversation with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CompleteConversationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.completeConversation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.completeConversation(request), expectedError); + assert( + (client.innerApiCalls.completeConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createCallMatcher', () => { + it('invokes createCallMatcher without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateCallMatcherRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ); + client.innerApiCalls.createCallMatcher = stubSimpleCall(expectedResponse); + const [response] = await client.createCallMatcher(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createCallMatcher as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createCallMatcher without error using callback', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateCallMatcherRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ); + client.innerApiCalls.createCallMatcher = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createCallMatcher( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.ICallMatcher | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createCallMatcher as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createCallMatcher with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateCallMatcherRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createCallMatcher = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createCallMatcher(request), expectedError); + assert( + (client.innerApiCalls.createCallMatcher as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteCallMatcher', () => { + it('invokes deleteCallMatcher without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteCallMatcherRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCallMatcher = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCallMatcher(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteCallMatcher as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteCallMatcher without error using callback', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteCallMatcherRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCallMatcher = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteCallMatcher( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteCallMatcher as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteCallMatcher with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteCallMatcherRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCallMatcher = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCallMatcher(request), expectedError); + assert( + (client.innerApiCalls.deleteCallMatcher as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listConversations', () => { + it('invokes listConversations without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ), + ]; + client.innerApiCalls.listConversations = stubSimpleCall(expectedResponse); + const [response] = await client.listConversations(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listConversations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listConversations without error using callback', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ), + ]; + client.innerApiCalls.listConversations = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listConversations( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IConversation[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listConversations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listConversations with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listConversations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listConversations(request), expectedError); + assert( + (client.innerApiCalls.listConversations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listConversationsStream without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ), + ]; + client.descriptors.page.listConversations.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listConversationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.Conversation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.Conversation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConversations, request) + ); + assert.strictEqual( + (client.descriptors.page.listConversations + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listConversationsStream with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listConversations.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listConversationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.Conversation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.Conversation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConversations, request) + ); + assert.strictEqual( + (client.descriptors.page.listConversations + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listConversations without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Conversation() + ), + ]; + client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2.IConversation[] = []; + const iterable = client.listConversationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listConversations + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listConversations + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listConversations with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listConversationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2.IConversation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listConversations + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listConversations + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listCallMatchers', () => { + it('invokes listCallMatchers without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ), + ]; + client.innerApiCalls.listCallMatchers = stubSimpleCall(expectedResponse); + const [response] = await client.listCallMatchers(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listCallMatchers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listCallMatchers without error using callback', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ), + ]; + client.innerApiCalls.listCallMatchers = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listCallMatchers( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.ICallMatcher[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listCallMatchers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listCallMatchers with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listCallMatchers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCallMatchers(request), expectedError); + assert( + (client.innerApiCalls.listCallMatchers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listCallMatchersStream without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ), + ]; + client.descriptors.page.listCallMatchers.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listCallMatchersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.CallMatcher[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.CallMatcher) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listCallMatchers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCallMatchers, request) + ); + assert.strictEqual( + (client.descriptors.page.listCallMatchers + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listCallMatchersStream with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listCallMatchers.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listCallMatchersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.CallMatcher[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.CallMatcher) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCallMatchers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCallMatchers, request) + ); + assert.strictEqual( + (client.descriptors.page.listCallMatchers + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCallMatchers without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CallMatcher() + ), + ]; + client.descriptors.page.listCallMatchers.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2.ICallMatcher[] = []; + const iterable = client.listCallMatchersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCallMatchers + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listCallMatchers + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCallMatchers with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listCallMatchers.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listCallMatchersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2.ICallMatcher[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCallMatchers + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listCallMatchers + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listMessages', () => { + it('invokes listMessages without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Message()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Message()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Message()), + ]; + client.innerApiCalls.listMessages = stubSimpleCall(expectedResponse); + const [response] = await client.listMessages(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listMessages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listMessages without error using callback', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Message()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Message()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Message()), + ]; + client.innerApiCalls.listMessages = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listMessages( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IMessage[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listMessages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listMessages with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listMessages = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listMessages(request), expectedError); + assert( + (client.innerApiCalls.listMessages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listMessagesStream without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Message()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Message()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Message()), + ]; + client.descriptors.page.listMessages.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listMessagesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.Message[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.Message) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listMessages.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMessages, request) + ); + assert.strictEqual( + (client.descriptors.page.listMessages + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listMessagesStream with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listMessages.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listMessagesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.Message[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.Message) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listMessages.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMessages, request) + ); + assert.strictEqual( + (client.descriptors.page.listMessages + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMessages without error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Message()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Message()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Message()), + ]; + client.descriptors.page.listMessages.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2.IMessage[] = []; + const iterable = client.listMessagesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMessages + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listMessages + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMessages with error', async () => { + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listMessages.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listMessagesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2.IMessage[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMessages + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listMessages + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('agent', () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath('projectValue', 'entityTypeValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('environment', () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('intent', () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + intent: 'intentValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath('projectValue', 'intentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionContext', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionContext'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionContextPath', () => { + const result = client.projectAgentEnvironmentUserSessionContextPath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchContextFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionEntityType', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionEntityTypePath', () => { + const result = client.projectAgentEnvironmentUserSessionEntityTypePath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionContext', () => { + const fakePath = '/rendered/path/projectAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionContextPath', () => { + const result = client.projectAgentSessionContextPath( + 'projectValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionContextName', () => { + const result = client.matchProjectFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionContextName', () => { + const result = client.matchSessionFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentSessionContextName', () => { + const result = client.matchContextFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionEntityTypePath', () => { + const result = client.projectAgentSessionEntityTypePath( + 'projectValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new conversationsModule.v2.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dialogflow/test/gapic_conversations_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_conversations_v2beta1.ts new file mode 100644 index 00000000000..c9175895644 --- /dev/null +++ b/packages/google-cloud-dialogflow/test/gapic_conversations_v2beta1.ts @@ -0,0 +1,4097 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as conversationsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2beta1.ConversationsClient', () => { + it('has servicePath', () => { + const servicePath = + conversationsModule.v2beta1.ConversationsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + conversationsModule.v2beta1.ConversationsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = conversationsModule.v2beta1.ConversationsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new conversationsModule.v2beta1.ConversationsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.conversationsStub, undefined); + await client.initialize(); + assert(client.conversationsStub); + }); + + it('has close method', () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createConversation', () => { + it('invokes createConversation without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CreateConversationRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ); + client.innerApiCalls.createConversation = stubSimpleCall( + expectedResponse + ); + const [response] = await client.createConversation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createConversation without error using callback', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CreateConversationRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ); + client.innerApiCalls.createConversation = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createConversation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IConversation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createConversation with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CreateConversationRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createConversation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createConversation(request), expectedError); + assert( + (client.innerApiCalls.createConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getConversation', () => { + it('invokes getConversation without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.GetConversationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ); + client.innerApiCalls.getConversation = stubSimpleCall(expectedResponse); + const [response] = await client.getConversation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getConversation without error using callback', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.GetConversationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ); + client.innerApiCalls.getConversation = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getConversation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IConversation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getConversation with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.GetConversationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getConversation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getConversation(request), expectedError); + assert( + (client.innerApiCalls.getConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('completeConversation', () => { + it('invokes completeConversation without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CompleteConversationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ); + client.innerApiCalls.completeConversation = stubSimpleCall( + expectedResponse + ); + const [response] = await client.completeConversation(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.completeConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes completeConversation without error using callback', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CompleteConversationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ); + client.innerApiCalls.completeConversation = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.completeConversation( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IConversation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.completeConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes completeConversation with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CompleteConversationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.completeConversation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.completeConversation(request), expectedError); + assert( + (client.innerApiCalls.completeConversation as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createCallMatcher', () => { + it('invokes createCallMatcher without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ); + client.innerApiCalls.createCallMatcher = stubSimpleCall(expectedResponse); + const [response] = await client.createCallMatcher(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createCallMatcher as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createCallMatcher without error using callback', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ); + client.innerApiCalls.createCallMatcher = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createCallMatcher( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.ICallMatcher | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createCallMatcher as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createCallMatcher with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CreateCallMatcherRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createCallMatcher = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createCallMatcher(request), expectedError); + assert( + (client.innerApiCalls.createCallMatcher as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteCallMatcher', () => { + it('invokes deleteCallMatcher without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCallMatcher = stubSimpleCall(expectedResponse); + const [response] = await client.deleteCallMatcher(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteCallMatcher as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteCallMatcher without error using callback', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteCallMatcher = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteCallMatcher( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteCallMatcher as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteCallMatcher with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.DeleteCallMatcherRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteCallMatcher = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteCallMatcher(request), expectedError); + assert( + (client.innerApiCalls.deleteCallMatcher as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('batchCreateMessages', () => { + it('invokes batchCreateMessages without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse() + ); + client.innerApiCalls.batchCreateMessages = stubSimpleCall( + expectedResponse + ); + const [response] = await client.batchCreateMessages(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchCreateMessages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes batchCreateMessages without error using callback', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.BatchCreateMessagesResponse() + ); + client.innerApiCalls.batchCreateMessages = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.batchCreateMessages( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IBatchCreateMessagesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.batchCreateMessages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes batchCreateMessages with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.BatchCreateMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.batchCreateMessages = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.batchCreateMessages(request), expectedError); + assert( + (client.innerApiCalls.batchCreateMessages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listConversations', () => { + it('invokes listConversations without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ), + ]; + client.innerApiCalls.listConversations = stubSimpleCall(expectedResponse); + const [response] = await client.listConversations(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listConversations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listConversations without error using callback', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ), + ]; + client.innerApiCalls.listConversations = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listConversations( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.v2beta1.IConversation[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listConversations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listConversations with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listConversations = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listConversations(request), expectedError); + assert( + (client.innerApiCalls.listConversations as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listConversationsStream without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ), + ]; + client.descriptors.page.listConversations.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listConversationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.Conversation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2beta1.Conversation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConversations, request) + ); + assert.strictEqual( + (client.descriptors.page.listConversations + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listConversationsStream with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listConversations.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listConversationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.Conversation[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2beta1.Conversation) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listConversations.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listConversations, request) + ); + assert.strictEqual( + (client.descriptors.page.listConversations + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listConversations without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Conversation() + ), + ]; + client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2beta1.IConversation[] = []; + const iterable = client.listConversationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listConversations + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listConversations + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listConversations with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListConversationsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listConversations.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listConversationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2beta1.IConversation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listConversations + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listConversations + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listCallMatchers', () => { + it('invokes listCallMatchers without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ), + ]; + client.innerApiCalls.listCallMatchers = stubSimpleCall(expectedResponse); + const [response] = await client.listCallMatchers(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listCallMatchers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listCallMatchers without error using callback', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ), + ]; + client.innerApiCalls.listCallMatchers = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listCallMatchers( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.v2beta1.ICallMatcher[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listCallMatchers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listCallMatchers with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listCallMatchers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listCallMatchers(request), expectedError); + assert( + (client.innerApiCalls.listCallMatchers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listCallMatchersStream without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ), + ]; + client.descriptors.page.listCallMatchers.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listCallMatchersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.CallMatcher[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2beta1.CallMatcher) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listCallMatchers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCallMatchers, request) + ); + assert.strictEqual( + (client.descriptors.page.listCallMatchers + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listCallMatchersStream with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listCallMatchers.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listCallMatchersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.CallMatcher[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2beta1.CallMatcher) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listCallMatchers.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listCallMatchers, request) + ); + assert.strictEqual( + (client.descriptors.page.listCallMatchers + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCallMatchers without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CallMatcher() + ), + ]; + client.descriptors.page.listCallMatchers.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2beta1.ICallMatcher[] = []; + const iterable = client.listCallMatchersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listCallMatchers + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listCallMatchers + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listCallMatchers with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListCallMatchersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listCallMatchers.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listCallMatchersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2beta1.ICallMatcher[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listCallMatchers + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listCallMatchers + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listMessages', () => { + it('invokes listMessages without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Message() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Message() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Message() + ), + ]; + client.innerApiCalls.listMessages = stubSimpleCall(expectedResponse); + const [response] = await client.listMessages(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listMessages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listMessages without error using callback', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Message() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Message() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Message() + ), + ]; + client.innerApiCalls.listMessages = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listMessages( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IMessage[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listMessages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listMessages with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listMessages = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listMessages(request), expectedError); + assert( + (client.innerApiCalls.listMessages as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listMessagesStream without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Message() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Message() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Message() + ), + ]; + client.descriptors.page.listMessages.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listMessagesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.Message[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2beta1.Message) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listMessages.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMessages, request) + ); + assert.strictEqual( + (client.descriptors.page.listMessages + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listMessagesStream with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listMessages.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listMessagesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.Message[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2beta1.Message) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listMessages.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listMessages, request) + ); + assert.strictEqual( + (client.descriptors.page.listMessages + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMessages without error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Message() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Message() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Message() + ), + ]; + client.descriptors.page.listMessages.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2beta1.IMessage[] = []; + const iterable = client.listMessagesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listMessages + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listMessages + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listMessages with error', async () => { + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListMessagesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listMessages.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listMessagesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2beta1.IMessage[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listMessages + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listMessages + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgent', () => { + const fakePath = '/rendered/path/projectAgent'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentPath', () => { + const result = client.projectAgentPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentName', () => { + const result = client.matchProjectFromProjectAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEntityType', () => { + const fakePath = '/rendered/path/projectAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEntityTypePath', () => { + const result = client.projectAgentEntityTypePath( + 'projectValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironment', () => { + const fakePath = '/rendered/path/projectAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentPath', () => { + const result = client.projectAgentEnvironmentPath( + 'projectValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionContext', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionContext'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionContextPath', () => { + const result = client.projectAgentEnvironmentUserSessionContextPath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchContextFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionEntityType', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionEntityTypePath', () => { + const result = client.projectAgentEnvironmentUserSessionEntityTypePath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentIntent', () => { + const fakePath = '/rendered/path/projectAgentIntent'; + const expectedParameters = { + project: 'projectValue', + intent: 'intentValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentIntentPath', () => { + const result = client.projectAgentIntentPath( + 'projectValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentIntentName', () => { + const result = client.matchProjectFromProjectAgentIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectAgentIntentName', () => { + const result = client.matchIntentFromProjectAgentIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionContext', () => { + const fakePath = '/rendered/path/projectAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionContextPath', () => { + const result = client.projectAgentSessionContextPath( + 'projectValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionContextName', () => { + const result = client.matchProjectFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionContextName', () => { + const result = client.matchSessionFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentSessionContextName', () => { + const result = client.matchContextFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionEntityTypePath', () => { + const result = client.projectAgentSessionEntityTypePath( + 'projectValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( + 'projectValue', + 'locationValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + intent: 'intentValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( + 'projectValue', + 'locationValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new conversationsModule.v2beta1.ConversationsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dialogflow/test/gapic_documents_v2.ts b/packages/google-cloud-dialogflow/test/gapic_documents_v2.ts new file mode 100644 index 00000000000..e4732ee3e81 --- /dev/null +++ b/packages/google-cloud-dialogflow/test/gapic_documents_v2.ts @@ -0,0 +1,3206 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as documentsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().rejects(callError) + : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback( + response?: ResponseType, + callError?: Error, + lroError?: Error +) { + const innerStub = lroError + ? sinon.stub().rejects(lroError) + : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError + ? sinon.stub().callsArgWith(2, callError) + : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.DocumentsClient', () => { + it('has servicePath', () => { + const servicePath = documentsModule.v2.DocumentsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = documentsModule.v2.DocumentsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = documentsModule.v2.DocumentsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new documentsModule.v2.DocumentsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new documentsModule.v2.DocumentsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.documentsStub, undefined); + await client.initialize(); + assert(client.documentsStub); + }); + + it('has close method', () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getDocument', () => { + it('invokes getDocument without error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetDocumentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Document() + ); + client.innerApiCalls.getDocument = stubSimpleCall(expectedResponse); + const [response] = await client.getDocument(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getDocument without error using callback', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetDocumentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Document() + ); + client.innerApiCalls.getDocument = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getDocument( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IDocument | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getDocument with error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetDocumentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getDocument = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getDocument(request), expectedError); + assert( + (client.innerApiCalls.getDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createDocument', () => { + it('invokes createDocument without error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDocument = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.createDocument(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createDocument without error using callback', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createDocument = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createDocument( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createDocument with call error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDocument = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.createDocument(request), expectedError); + assert( + (client.innerApiCalls.createDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createDocument with LRO error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateDocumentRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createDocument = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.createDocument(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.createDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkCreateDocumentProgress without error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkCreateDocumentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateDocumentProgress with error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkCreateDocumentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('deleteDocument', () => { + it('invokes deleteDocument without error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteDocumentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDocument = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.deleteDocument(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteDocument without error using callback', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteDocumentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteDocument = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteDocument( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.protobuf.IEmpty, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteDocument with call error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteDocumentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDocument = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteDocument(request), expectedError); + assert( + (client.innerApiCalls.deleteDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteDocument with LRO error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteDocumentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteDocument = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.deleteDocument(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.deleteDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkDeleteDocumentProgress without error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkDeleteDocumentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteDocumentProgress with error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkDeleteDocumentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('updateDocument', () => { + it('invokes updateDocument without error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateDocumentRequest() + ); + request.document = {}; + request.document.name = ''; + const expectedHeaderRequestParams = 'document.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDocument = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.updateDocument(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateDocument without error using callback', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateDocumentRequest() + ); + request.document = {}; + request.document.name = ''; + const expectedHeaderRequestParams = 'document.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDocument = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateDocument( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateDocument with call error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateDocumentRequest() + ); + request.document = {}; + request.document.name = ''; + const expectedHeaderRequestParams = 'document.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDocument = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.updateDocument(request), expectedError); + assert( + (client.innerApiCalls.updateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateDocument with LRO error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateDocumentRequest() + ); + request.document = {}; + request.document.name = ''; + const expectedHeaderRequestParams = 'document.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDocument = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.updateDocument(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.updateDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkUpdateDocumentProgress without error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkUpdateDocumentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDocumentProgress with error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkUpdateDocumentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('reloadDocument', () => { + it('invokes reloadDocument without error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ReloadDocumentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.reloadDocument = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.reloadDocument(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.reloadDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes reloadDocument without error using callback', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ReloadDocumentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.reloadDocument = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.reloadDocument( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.v2.IDocument, + protos.google.cloud.dialogflow.v2.IKnowledgeOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.reloadDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes reloadDocument with call error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ReloadDocumentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.reloadDocument = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.reloadDocument(request), expectedError); + assert( + (client.innerApiCalls.reloadDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes reloadDocument with LRO error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ReloadDocumentRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.reloadDocument = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.reloadDocument(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.reloadDocument as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkReloadDocumentProgress without error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkReloadDocumentProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkReloadDocumentProgress with error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkReloadDocumentProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + + describe('listDocuments', () => { + it('invokes listDocuments without error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListDocumentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Document()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Document()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Document()), + ]; + client.innerApiCalls.listDocuments = stubSimpleCall(expectedResponse); + const [response] = await client.listDocuments(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listDocuments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listDocuments without error using callback', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListDocumentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Document()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Document()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Document()), + ]; + client.innerApiCalls.listDocuments = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listDocuments( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IDocument[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listDocuments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listDocuments with error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListDocumentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listDocuments = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listDocuments(request), expectedError); + assert( + (client.innerApiCalls.listDocuments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listDocumentsStream without error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListDocumentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Document()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Document()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Document()), + ]; + client.descriptors.page.listDocuments.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listDocumentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.Document[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.Document) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listDocuments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDocuments, request) + ); + assert.strictEqual( + (client.descriptors.page.listDocuments + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listDocumentsStream with error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListDocumentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listDocuments.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listDocumentsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.Document[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.Document) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listDocuments.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listDocuments, request) + ); + assert.strictEqual( + (client.descriptors.page.listDocuments + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDocuments without error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListDocumentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Document()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Document()), + generateSampleMessage(new protos.google.cloud.dialogflow.v2.Document()), + ]; + client.descriptors.page.listDocuments.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2.IDocument[] = []; + const iterable = client.listDocumentsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDocuments + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listDocuments + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listDocuments with error', async () => { + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListDocumentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listDocuments.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listDocumentsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2.IDocument[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDocuments + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listDocuments + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('agent', () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + entity_type: 'entityTypeValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath('projectValue', 'entityTypeValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('environment', () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('intent', () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + intent: 'intentValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath('projectValue', 'intentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionContext', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionContext'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionContextPath', () => { + const result = client.projectAgentEnvironmentUserSessionContextPath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchContextFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionEntityType', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionEntityTypePath', () => { + const result = client.projectAgentEnvironmentUserSessionEntityTypePath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionContext', () => { + const fakePath = '/rendered/path/projectAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionContextPath', () => { + const result = client.projectAgentSessionContextPath( + 'projectValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionContextName', () => { + const result = client.matchProjectFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionContextName', () => { + const result = client.matchSessionFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentSessionContextName', () => { + const result = client.matchContextFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionEntityTypePath', () => { + const result = client.projectAgentSessionEntityTypePath( + 'projectValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new documentsModule.v2.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dialogflow/test/gapic_documents_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_documents_v2beta1.ts index 339033788db..f922cd36ad7 100644 --- a/packages/google-cloud-dialogflow/test/gapic_documents_v2beta1.ts +++ b/packages/google-cloud-dialogflow/test/gapic_documents_v2beta1.ts @@ -534,6 +534,202 @@ describe('v2beta1.DocumentsClient', () => { }); }); + describe('importDocuments', () => { + it('invokes importDocuments without error', async () => { + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ImportDocumentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importDocuments = stubLongRunningCall( + expectedResponse + ); + const [operation] = await client.importDocuments(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.importDocuments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes importDocuments without error using callback', async () => { + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ImportDocumentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.importDocuments = stubLongRunningCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.importDocuments( + request, + ( + err?: Error | null, + result?: LROperation< + protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + > | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const operation = (await promise) as LROperation< + protos.google.cloud.dialogflow.v2beta1.IImportDocumentsResponse, + protos.google.cloud.dialogflow.v2beta1.IKnowledgeOperationMetadata + >; + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.importDocuments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes importDocuments with call error', async () => { + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ImportDocumentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importDocuments = stubLongRunningCall( + undefined, + expectedError + ); + await assert.rejects(client.importDocuments(request), expectedError); + assert( + (client.innerApiCalls.importDocuments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes importDocuments with LRO error', async () => { + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ImportDocumentsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.importDocuments = stubLongRunningCall( + undefined, + undefined, + expectedError + ); + const [operation] = await client.importDocuments(request); + await assert.rejects(operation.promise(), expectedError); + assert( + (client.innerApiCalls.importDocuments as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes checkImportDocumentsProgress without error', async () => { + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedResponse = generateSampleMessage( + new operationsProtos.google.longrunning.Operation() + ); + expectedResponse.name = 'test'; + expectedResponse.response = {type_url: 'url', value: Buffer.from('')}; + expectedResponse.metadata = {type_url: 'url', value: Buffer.from('')}; + + client.operationsClient.getOperation = stubSimpleCall(expectedResponse); + const decodedOperation = await client.checkImportDocumentsProgress( + expectedResponse.name + ); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkImportDocumentsProgress with error', async () => { + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const expectedError = new Error('expected'); + + client.operationsClient.getOperation = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects( + client.checkImportDocumentsProgress(''), + expectedError + ); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + }); + describe('deleteDocument', () => { it('invokes deleteDocument without error', async () => { const client = new documentsModule.v2beta1.DocumentsClient({ @@ -2060,58 +2256,56 @@ describe('v2beta1.DocumentsClient', () => { }); }); - describe('projectKnowledgeBase', () => { - const fakePath = '/rendered/path/projectKnowledgeBase'; + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', + answer_record: 'answerRecordValue', }; const client = new documentsModule.v2beta1.DocumentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBasePath', () => { - const result = client.projectKnowledgeBasePath( + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( 'projectValue', - 'knowledgeBaseValue' + 'answerRecordValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectAnswerRecordPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectKnowledgeBaseName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseName( - fakePath - ); + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'answerRecordValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2119,73 +2313,56 @@ describe('v2beta1.DocumentsClient', () => { }); }); - describe('projectKnowledgeBaseDocument', () => { - const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', - document: 'documentValue', + conversation: 'conversationValue', }; const client = new documentsModule.v2beta1.DocumentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + client.pathTemplates.projectConversationPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + client.pathTemplates.projectConversationPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBaseDocumentPath', () => { - const result = client.projectKnowledgeBaseDocumentPath( + it('projectConversationPath', () => { + const result = client.projectConversationPath( 'projectValue', - 'knowledgeBaseValue', - 'documentValue' + 'conversationValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates.projectConversationPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( - fakePath - ); + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate - .match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( - fakePath - ); - assert.strictEqual(result, 'knowledgeBaseValue'); - assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates.projectConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( fakePath ); - assert.strictEqual(result, 'documentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates.projectConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2193,58 +2370,73 @@ describe('v2beta1.DocumentsClient', () => { }); }); - describe('projectLocationAgent', () => { - const fakePath = '/rendered/path/projectLocationAgent'; + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; const expectedParameters = { project: 'projectValue', - location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', }; const client = new documentsModule.v2beta1.DocumentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentPath', () => { - const result = client.projectLocationAgentPath( + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( 'projectValue', - 'locationValue' + 'conversationValue', + 'callMatcherValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectConversationCallMatcherPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentName', () => { - const result = client.matchProjectFromProjectLocationAgentName( + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentName', () => { - const result = client.matchLocationFromProjectLocationAgentName( + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( fakePath ); - assert.strictEqual(result, 'locationValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2252,34 +2444,433 @@ describe('v2beta1.DocumentsClient', () => { }); }); - describe('projectLocationAgentEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentEntityType'; + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; const expectedParameters = { project: 'projectValue', - location: 'locationValue', - entity_type: 'entityTypeValue', + conversation: 'conversationValue', + message: 'messageValue', }; const client = new documentsModule.v2beta1.DocumentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEntityTypePath', () => { - const result = client.projectLocationAgentEntityTypePath( + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( 'projectValue', - 'locationValue', - 'entityTypeValue' + 'conversationValue', + 'messageValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) @@ -2292,33 +2883,364 @@ describe('v2beta1.DocumentsClient', () => { ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', + }; + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( + 'projectValue', + 'locationValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + intent: 'intentValue', + }; + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( + 'projectValue', + 'locationValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( fakePath ); assert.strictEqual(result, 'entityTypeValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2326,73 +3248,73 @@ describe('v2beta1.DocumentsClient', () => { }); }); - describe('projectLocationAgentEnvironment', () => { - const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - environment: 'environmentValue', + answer_record: 'answerRecordValue', }; const client = new documentsModule.v2beta1.DocumentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEnvironmentPath', () => { - const result = client.projectLocationAgentEnvironmentPath( + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( 'projectValue', 'locationValue', - 'environmentValue' + 'answerRecordValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( fakePath ); - assert.strictEqual(result, 'environmentValue'); + assert.strictEqual(result, 'answerRecordValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2400,73 +3322,73 @@ describe('v2beta1.DocumentsClient', () => { }); }); - describe('projectLocationAgentIntent', () => { - const fakePath = '/rendered/path/projectLocationAgentIntent'; + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - intent: 'intentValue', + conversation: 'conversationValue', }; const client = new documentsModule.v2beta1.DocumentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentIntentPath', () => { - const result = client.projectLocationAgentIntentPath( + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( 'projectValue', 'locationValue', - 'intentValue' + 'conversationValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentIntentName', () => { - const result = client.matchProjectFromProjectLocationAgentIntentName( + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentIntentName', () => { - const result = client.matchLocationFromProjectLocationAgentIntentName( + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchIntentFromProjectLocationAgentIntentName', () => { - const result = client.matchIntentFromProjectLocationAgentIntentName( + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( fakePath ); - assert.strictEqual(result, 'intentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2474,88 +3396,93 @@ describe('v2beta1.DocumentsClient', () => { }); }); - describe('projectLocationAgentSessionContext', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - context: 'contextValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', }; const client = new documentsModule.v2beta1.DocumentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionContextPath', () => { - const result = client.projectLocationAgentSessionContextPath( + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( 'projectValue', 'locationValue', - 'sessionValue', - 'contextValue' + 'conversationValue', + 'callMatcherValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionContextName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionContextName( + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionContextName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionContextName( + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSessionFromProjectLocationAgentSessionContextName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionContextName( + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( fakePath ); - assert.strictEqual(result, 'sessionValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchContextFromProjectLocationAgentSessionContextName', () => { - const result = client.matchContextFromProjectLocationAgentSessionContextName( + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( fakePath ); - assert.strictEqual(result, 'contextValue'); + assert.strictEqual(result, 'callMatcherValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2563,93 +3490,256 @@ describe('v2beta1.DocumentsClient', () => { }); }); - describe('projectLocationAgentSessionEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - entity_type: 'entityTypeValue', + conversation: 'conversationValue', + message: 'messageValue', }; const client = new documentsModule.v2beta1.DocumentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionEntityTypePath', () => { - const result = client.projectLocationAgentSessionEntityTypePath( + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( 'projectValue', 'locationValue', - 'sessionValue', - 'entityTypeValue' + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' ); assert.strictEqual(result, fakePath); assert( (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + .projectLocationConversationParticipantPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'sessionValue'); + assert.strictEqual(result, 'conversationValue'); assert( (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'participantValue'); assert( (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new documentsModule.v2beta1.DocumentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) diff --git a/packages/google-cloud-dialogflow/test/gapic_entity_types_v2.ts b/packages/google-cloud-dialogflow/test/gapic_entity_types_v2.ts index 67a3d4a1973..f0bf2449d1f 100644 --- a/packages/google-cloud-dialogflow/test/gapic_entity_types_v2.ts +++ b/packages/google-cloud-dialogflow/test/gapic_entity_types_v2.ts @@ -2573,5 +2573,1195 @@ describe('v2.EntityTypesClient', () => { ); }); }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new entitytypesModule.v2.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-dialogflow/test/gapic_entity_types_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_entity_types_v2beta1.ts index dd44d29cc6b..5c6703d8f0d 100644 --- a/packages/google-cloud-dialogflow/test/gapic_entity_types_v2beta1.ts +++ b/packages/google-cloud-dialogflow/test/gapic_entity_types_v2beta1.ts @@ -2597,58 +2597,897 @@ describe('v2beta1.EntityTypesClient', () => { }); }); + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new entitytypesModule.v2beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new entitytypesModule.v2beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new entitytypesModule.v2beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new entitytypesModule.v2beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new entitytypesModule.v2beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new entitytypesModule.v2beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectKnowledgeBase', () => { const fakePath = '/rendered/path/projectKnowledgeBase'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new entitytypesModule.v2beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new entitytypesModule.v2beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new entitytypesModule.v2beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new entitytypesModule.v2beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', }; const client = new entitytypesModule.v2beta1.EntityTypesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBasePath', () => { - const result = client.projectKnowledgeBasePath( + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( 'projectValue', - 'knowledgeBaseValue' + 'locationValue', + 'environmentValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + intent: 'intentValue', + }; + const client = new entitytypesModule.v2beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( + 'projectValue', + 'locationValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new entitytypesModule.v2beta1.EntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .render as SinonStub) .getCall(-1) - .calledWith(expectedParameters) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) ); }); - it('matchProjectFromProjectKnowledgeBaseName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseName( + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'projectValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'contextValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2656,73 +3495,93 @@ describe('v2beta1.EntityTypesClient', () => { }); }); - describe('projectKnowledgeBaseDocument', () => { - const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', - document: 'documentValue', + location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', }; const client = new entitytypesModule.v2beta1.EntityTypesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBaseDocumentPath', () => { - const result = client.projectKnowledgeBaseDocumentPath( + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( 'projectValue', - 'knowledgeBaseValue', - 'documentValue' + 'locationValue', + 'sessionValue', + 'entityTypeValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'documentValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2730,58 +3589,73 @@ describe('v2beta1.EntityTypesClient', () => { }); }); - describe('projectLocationAgent', () => { - const fakePath = '/rendered/path/projectLocationAgent'; + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; const expectedParameters = { project: 'projectValue', location: 'locationValue', + answer_record: 'answerRecordValue', }; const client = new entitytypesModule.v2beta1.EntityTypesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentPath', () => { - const result = client.projectLocationAgentPath( + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( 'projectValue', - 'locationValue' + 'locationValue', + 'answerRecordValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentName', () => { - const result = client.matchProjectFromProjectLocationAgentName( + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentName', () => { - const result = client.matchLocationFromProjectLocationAgentName( + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2789,73 +3663,73 @@ describe('v2beta1.EntityTypesClient', () => { }); }); - describe('projectLocationAgentEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentEntityType'; + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - entity_type: 'entityTypeValue', + conversation: 'conversationValue', }; const client = new entitytypesModule.v2beta1.EntityTypesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEntityTypePath', () => { - const result = client.projectLocationAgentEntityTypePath( + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( 'projectValue', 'locationValue', - 'entityTypeValue' + 'conversationValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2863,73 +3737,93 @@ describe('v2beta1.EntityTypesClient', () => { }); }); - describe('projectLocationAgentEnvironment', () => { - const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - environment: 'environmentValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', }; const client = new entitytypesModule.v2beta1.EntityTypesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEnvironmentPath', () => { - const result = client.projectLocationAgentEnvironmentPath( + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( 'projectValue', 'locationValue', - 'environmentValue' + 'conversationValue', + 'callMatcherValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( fakePath ); - assert.strictEqual(result, 'environmentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2937,73 +3831,88 @@ describe('v2beta1.EntityTypesClient', () => { }); }); - describe('projectLocationAgentIntent', () => { - const fakePath = '/rendered/path/projectLocationAgentIntent'; + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - intent: 'intentValue', + conversation: 'conversationValue', + message: 'messageValue', }; const client = new entitytypesModule.v2beta1.EntityTypesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentIntentPath', () => { - const result = client.projectLocationAgentIntentPath( + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( 'projectValue', 'locationValue', - 'intentValue' + 'conversationValue', + 'messageValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentIntentName', () => { - const result = client.matchProjectFromProjectLocationAgentIntentName( + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentIntentName', () => { - const result = client.matchLocationFromProjectLocationAgentIntentName( + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchIntentFromProjectLocationAgentIntentName', () => { - const result = client.matchIntentFromProjectLocationAgentIntentName( + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( fakePath ); - assert.strictEqual(result, 'intentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -3011,88 +3920,93 @@ describe('v2beta1.EntityTypesClient', () => { }); }); - describe('projectLocationAgentSessionContext', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - context: 'contextValue', + conversation: 'conversationValue', + participant: 'participantValue', }; const client = new entitytypesModule.v2beta1.EntityTypesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionContextPath', () => { - const result = client.projectLocationAgentSessionContextPath( + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( 'projectValue', 'locationValue', - 'sessionValue', - 'contextValue' + 'conversationValue', + 'participantValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionContextName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionContextName( + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionContextName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionContextName( + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSessionFromProjectLocationAgentSessionContextName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionContextName( + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'sessionValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchContextFromProjectLocationAgentSessionContextName', () => { - const result = client.matchContextFromProjectLocationAgentSessionContextName( + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'contextValue'); + assert.strictEqual(result, 'participantValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -3100,93 +4014,73 @@ describe('v2beta1.EntityTypesClient', () => { }); }); - describe('projectLocationAgentSessionEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - entity_type: 'entityTypeValue', + conversation_profile: 'conversationProfileValue', }; const client = new entitytypesModule.v2beta1.EntityTypesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionEntityTypePath', () => { - const result = client.projectLocationAgentSessionEntityTypePath( + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( 'projectValue', 'locationValue', - 'sessionValue', - 'entityTypeValue' + 'conversationProfileValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate - .match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( - fakePath - ); - assert.strictEqual(result, 'sessionValue'); - assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationProfileValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) diff --git a/packages/google-cloud-dialogflow/test/gapic_environments_v2.ts b/packages/google-cloud-dialogflow/test/gapic_environments_v2.ts index ad6c3d9f2ac..1f5c23e6393 100644 --- a/packages/google-cloud-dialogflow/test/gapic_environments_v2.ts +++ b/packages/google-cloud-dialogflow/test/gapic_environments_v2.ts @@ -1104,5 +1104,1195 @@ describe('v2.EnvironmentsClient', () => { ); }); }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new environmentsModule.v2.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-dialogflow/test/gapic_environments_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_environments_v2beta1.ts index e8ced7c7c16..cd469b5e413 100644 --- a/packages/google-cloud-dialogflow/test/gapic_environments_v2beta1.ts +++ b/packages/google-cloud-dialogflow/test/gapic_environments_v2beta1.ts @@ -1132,58 +1132,897 @@ describe('v2beta1.EnvironmentsClient', () => { }); }); + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new environmentsModule.v2beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new environmentsModule.v2beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new environmentsModule.v2beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new environmentsModule.v2beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new environmentsModule.v2beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new environmentsModule.v2beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectKnowledgeBase', () => { const fakePath = '/rendered/path/projectKnowledgeBase'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new environmentsModule.v2beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new environmentsModule.v2beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new environmentsModule.v2beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new environmentsModule.v2beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', }; const client = new environmentsModule.v2beta1.EnvironmentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBasePath', () => { - const result = client.projectKnowledgeBasePath( + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( 'projectValue', - 'knowledgeBaseValue' + 'locationValue', + 'environmentValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + intent: 'intentValue', + }; + const client = new environmentsModule.v2beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( + 'projectValue', + 'locationValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new environmentsModule.v2beta1.EnvironmentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .render as SinonStub) .getCall(-1) - .calledWith(expectedParameters) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) ); }); - it('matchProjectFromProjectKnowledgeBaseName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseName( + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'projectValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'contextValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1191,73 +2030,93 @@ describe('v2beta1.EnvironmentsClient', () => { }); }); - describe('projectKnowledgeBaseDocument', () => { - const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', - document: 'documentValue', + location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', }; const client = new environmentsModule.v2beta1.EnvironmentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBaseDocumentPath', () => { - const result = client.projectKnowledgeBaseDocumentPath( + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( 'projectValue', - 'knowledgeBaseValue', - 'documentValue' + 'locationValue', + 'sessionValue', + 'entityTypeValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'documentValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1265,58 +2124,73 @@ describe('v2beta1.EnvironmentsClient', () => { }); }); - describe('projectLocationAgent', () => { - const fakePath = '/rendered/path/projectLocationAgent'; + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; const expectedParameters = { project: 'projectValue', location: 'locationValue', + answer_record: 'answerRecordValue', }; const client = new environmentsModule.v2beta1.EnvironmentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentPath', () => { - const result = client.projectLocationAgentPath( + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( 'projectValue', - 'locationValue' + 'locationValue', + 'answerRecordValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentName', () => { - const result = client.matchProjectFromProjectLocationAgentName( + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentName', () => { - const result = client.matchLocationFromProjectLocationAgentName( + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1324,73 +2198,73 @@ describe('v2beta1.EnvironmentsClient', () => { }); }); - describe('projectLocationAgentEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentEntityType'; + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - entity_type: 'entityTypeValue', + conversation: 'conversationValue', }; const client = new environmentsModule.v2beta1.EnvironmentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEntityTypePath', () => { - const result = client.projectLocationAgentEntityTypePath( + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( 'projectValue', 'locationValue', - 'entityTypeValue' + 'conversationValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1398,73 +2272,93 @@ describe('v2beta1.EnvironmentsClient', () => { }); }); - describe('projectLocationAgentEnvironment', () => { - const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - environment: 'environmentValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', }; const client = new environmentsModule.v2beta1.EnvironmentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEnvironmentPath', () => { - const result = client.projectLocationAgentEnvironmentPath( + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( 'projectValue', 'locationValue', - 'environmentValue' + 'conversationValue', + 'callMatcherValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( fakePath ); - assert.strictEqual(result, 'environmentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1472,73 +2366,88 @@ describe('v2beta1.EnvironmentsClient', () => { }); }); - describe('projectLocationAgentIntent', () => { - const fakePath = '/rendered/path/projectLocationAgentIntent'; + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - intent: 'intentValue', + conversation: 'conversationValue', + message: 'messageValue', }; const client = new environmentsModule.v2beta1.EnvironmentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentIntentPath', () => { - const result = client.projectLocationAgentIntentPath( + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( 'projectValue', 'locationValue', - 'intentValue' + 'conversationValue', + 'messageValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentIntentName', () => { - const result = client.matchProjectFromProjectLocationAgentIntentName( + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentIntentName', () => { - const result = client.matchLocationFromProjectLocationAgentIntentName( + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchIntentFromProjectLocationAgentIntentName', () => { - const result = client.matchIntentFromProjectLocationAgentIntentName( + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( fakePath ); - assert.strictEqual(result, 'intentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1546,88 +2455,93 @@ describe('v2beta1.EnvironmentsClient', () => { }); }); - describe('projectLocationAgentSessionContext', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - context: 'contextValue', + conversation: 'conversationValue', + participant: 'participantValue', }; const client = new environmentsModule.v2beta1.EnvironmentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionContextPath', () => { - const result = client.projectLocationAgentSessionContextPath( + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( 'projectValue', 'locationValue', - 'sessionValue', - 'contextValue' + 'conversationValue', + 'participantValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionContextName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionContextName( + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionContextName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionContextName( + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSessionFromProjectLocationAgentSessionContextName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionContextName( + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'sessionValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchContextFromProjectLocationAgentSessionContextName', () => { - const result = client.matchContextFromProjectLocationAgentSessionContextName( + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'contextValue'); + assert.strictEqual(result, 'participantValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1635,93 +2549,73 @@ describe('v2beta1.EnvironmentsClient', () => { }); }); - describe('projectLocationAgentSessionEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - entity_type: 'entityTypeValue', + conversation_profile: 'conversationProfileValue', }; const client = new environmentsModule.v2beta1.EnvironmentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionEntityTypePath', () => { - const result = client.projectLocationAgentSessionEntityTypePath( + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( 'projectValue', 'locationValue', - 'sessionValue', - 'entityTypeValue' + 'conversationProfileValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate - .match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( - fakePath - ); - assert.strictEqual(result, 'sessionValue'); - assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationProfileValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) diff --git a/packages/google-cloud-dialogflow/test/gapic_intents_v2.ts b/packages/google-cloud-dialogflow/test/gapic_intents_v2.ts index fe5c0fef641..5a2dff5c6db 100644 --- a/packages/google-cloud-dialogflow/test/gapic_intents_v2.ts +++ b/packages/google-cloud-dialogflow/test/gapic_intents_v2.ts @@ -1950,5 +1950,1195 @@ describe('v2.IntentsClient', () => { ); }); }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new intentsModule.v2.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-dialogflow/test/gapic_intents_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_intents_v2beta1.ts index 48fefc6eaa2..321447a6f90 100644 --- a/packages/google-cloud-dialogflow/test/gapic_intents_v2beta1.ts +++ b/packages/google-cloud-dialogflow/test/gapic_intents_v2beta1.ts @@ -1998,58 +1998,897 @@ describe('v2beta1.IntentsClient', () => { }); }); + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new intentsModule.v2beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new intentsModule.v2beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new intentsModule.v2beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new intentsModule.v2beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new intentsModule.v2beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new intentsModule.v2beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectKnowledgeBase', () => { const fakePath = '/rendered/path/projectKnowledgeBase'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new intentsModule.v2beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new intentsModule.v2beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new intentsModule.v2beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new intentsModule.v2beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', }; const client = new intentsModule.v2beta1.IntentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBasePath', () => { - const result = client.projectKnowledgeBasePath( + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( 'projectValue', - 'knowledgeBaseValue' + 'locationValue', + 'environmentValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + intent: 'intentValue', + }; + const client = new intentsModule.v2beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( + 'projectValue', + 'locationValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new intentsModule.v2beta1.IntentsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .render as SinonStub) .getCall(-1) - .calledWith(expectedParameters) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) ); }); - it('matchProjectFromProjectKnowledgeBaseName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseName( + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'projectValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'contextValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2057,73 +2896,93 @@ describe('v2beta1.IntentsClient', () => { }); }); - describe('projectKnowledgeBaseDocument', () => { - const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', - document: 'documentValue', + location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', }; const client = new intentsModule.v2beta1.IntentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBaseDocumentPath', () => { - const result = client.projectKnowledgeBaseDocumentPath( + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( 'projectValue', - 'knowledgeBaseValue', - 'documentValue' + 'locationValue', + 'sessionValue', + 'entityTypeValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'documentValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2131,58 +2990,73 @@ describe('v2beta1.IntentsClient', () => { }); }); - describe('projectLocationAgent', () => { - const fakePath = '/rendered/path/projectLocationAgent'; + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; const expectedParameters = { project: 'projectValue', location: 'locationValue', + answer_record: 'answerRecordValue', }; const client = new intentsModule.v2beta1.IntentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentPath', () => { - const result = client.projectLocationAgentPath( + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( 'projectValue', - 'locationValue' + 'locationValue', + 'answerRecordValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentName', () => { - const result = client.matchProjectFromProjectLocationAgentName( + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentName', () => { - const result = client.matchLocationFromProjectLocationAgentName( + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2190,73 +3064,73 @@ describe('v2beta1.IntentsClient', () => { }); }); - describe('projectLocationAgentEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentEntityType'; + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - entity_type: 'entityTypeValue', + conversation: 'conversationValue', }; const client = new intentsModule.v2beta1.IntentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEntityTypePath', () => { - const result = client.projectLocationAgentEntityTypePath( + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( 'projectValue', 'locationValue', - 'entityTypeValue' + 'conversationValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2264,73 +3138,93 @@ describe('v2beta1.IntentsClient', () => { }); }); - describe('projectLocationAgentEnvironment', () => { - const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - environment: 'environmentValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', }; const client = new intentsModule.v2beta1.IntentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEnvironmentPath', () => { - const result = client.projectLocationAgentEnvironmentPath( + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( 'projectValue', 'locationValue', - 'environmentValue' + 'conversationValue', + 'callMatcherValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( fakePath ); - assert.strictEqual(result, 'environmentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2338,73 +3232,88 @@ describe('v2beta1.IntentsClient', () => { }); }); - describe('projectLocationAgentIntent', () => { - const fakePath = '/rendered/path/projectLocationAgentIntent'; + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - intent: 'intentValue', + conversation: 'conversationValue', + message: 'messageValue', }; const client = new intentsModule.v2beta1.IntentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentIntentPath', () => { - const result = client.projectLocationAgentIntentPath( + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( 'projectValue', 'locationValue', - 'intentValue' + 'conversationValue', + 'messageValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentIntentName', () => { - const result = client.matchProjectFromProjectLocationAgentIntentName( + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentIntentName', () => { - const result = client.matchLocationFromProjectLocationAgentIntentName( + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchIntentFromProjectLocationAgentIntentName', () => { - const result = client.matchIntentFromProjectLocationAgentIntentName( + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( fakePath ); - assert.strictEqual(result, 'intentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2412,88 +3321,93 @@ describe('v2beta1.IntentsClient', () => { }); }); - describe('projectLocationAgentSessionContext', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - context: 'contextValue', + conversation: 'conversationValue', + participant: 'participantValue', }; const client = new intentsModule.v2beta1.IntentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionContextPath', () => { - const result = client.projectLocationAgentSessionContextPath( + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( 'projectValue', 'locationValue', - 'sessionValue', - 'contextValue' + 'conversationValue', + 'participantValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionContextName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionContextName( + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionContextName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionContextName( + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSessionFromProjectLocationAgentSessionContextName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionContextName( + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'sessionValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchContextFromProjectLocationAgentSessionContextName', () => { - const result = client.matchContextFromProjectLocationAgentSessionContextName( + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'contextValue'); + assert.strictEqual(result, 'participantValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2501,93 +3415,73 @@ describe('v2beta1.IntentsClient', () => { }); }); - describe('projectLocationAgentSessionEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - entity_type: 'entityTypeValue', + conversation_profile: 'conversationProfileValue', }; const client = new intentsModule.v2beta1.IntentsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionEntityTypePath', () => { - const result = client.projectLocationAgentSessionEntityTypePath( + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( 'projectValue', 'locationValue', - 'sessionValue', - 'entityTypeValue' + 'conversationProfileValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate - .match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( - fakePath - ); - assert.strictEqual(result, 'sessionValue'); - assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationProfileValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) diff --git a/packages/google-cloud-dialogflow/test/gapic_knowledge_bases_v2.ts b/packages/google-cloud-dialogflow/test/gapic_knowledge_bases_v2.ts new file mode 100644 index 00000000000..3766fa52e26 --- /dev/null +++ b/packages/google-cloud-dialogflow/test/gapic_knowledge_bases_v2.ts @@ -0,0 +1,2759 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as knowledgebasesModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.KnowledgeBasesClient', () => { + it('has servicePath', () => { + const servicePath = + knowledgebasesModule.v2.KnowledgeBasesClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + knowledgebasesModule.v2.KnowledgeBasesClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = knowledgebasesModule.v2.KnowledgeBasesClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.knowledgeBasesStub, undefined); + await client.initialize(); + assert(client.knowledgeBasesStub); + }); + + it('has close method', () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('getKnowledgeBase', () => { + it('invokes getKnowledgeBase without error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ); + client.innerApiCalls.getKnowledgeBase = stubSimpleCall(expectedResponse); + const [response] = await client.getKnowledgeBase(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getKnowledgeBase as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getKnowledgeBase without error using callback', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ); + client.innerApiCalls.getKnowledgeBase = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getKnowledgeBase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IKnowledgeBase | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getKnowledgeBase as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getKnowledgeBase with error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetKnowledgeBaseRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getKnowledgeBase = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getKnowledgeBase(request), expectedError); + assert( + (client.innerApiCalls.getKnowledgeBase as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('createKnowledgeBase', () => { + it('invokes createKnowledgeBase without error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ); + client.innerApiCalls.createKnowledgeBase = stubSimpleCall( + expectedResponse + ); + const [response] = await client.createKnowledgeBase(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createKnowledgeBase as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createKnowledgeBase without error using callback', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ); + client.innerApiCalls.createKnowledgeBase = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createKnowledgeBase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IKnowledgeBase | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createKnowledgeBase as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createKnowledgeBase with error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateKnowledgeBaseRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createKnowledgeBase = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createKnowledgeBase(request), expectedError); + assert( + (client.innerApiCalls.createKnowledgeBase as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('deleteKnowledgeBase', () => { + it('invokes deleteKnowledgeBase without error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteKnowledgeBase = stubSimpleCall( + expectedResponse + ); + const [response] = await client.deleteKnowledgeBase(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteKnowledgeBase as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes deleteKnowledgeBase without error using callback', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.protobuf.Empty() + ); + client.innerApiCalls.deleteKnowledgeBase = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.deleteKnowledgeBase( + request, + ( + err?: Error | null, + result?: protos.google.protobuf.IEmpty | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.deleteKnowledgeBase as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes deleteKnowledgeBase with error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.DeleteKnowledgeBaseRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteKnowledgeBase = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.deleteKnowledgeBase(request), expectedError); + assert( + (client.innerApiCalls.deleteKnowledgeBase as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateKnowledgeBase', () => { + it('invokes updateKnowledgeBase without error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest() + ); + request.knowledgeBase = {}; + request.knowledgeBase.name = ''; + const expectedHeaderRequestParams = 'knowledge_base.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ); + client.innerApiCalls.updateKnowledgeBase = stubSimpleCall( + expectedResponse + ); + const [response] = await client.updateKnowledgeBase(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateKnowledgeBase as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateKnowledgeBase without error using callback', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest() + ); + request.knowledgeBase = {}; + request.knowledgeBase.name = ''; + const expectedHeaderRequestParams = 'knowledge_base.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ); + client.innerApiCalls.updateKnowledgeBase = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateKnowledgeBase( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IKnowledgeBase | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateKnowledgeBase as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateKnowledgeBase with error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateKnowledgeBaseRequest() + ); + request.knowledgeBase = {}; + request.knowledgeBase.name = ''; + const expectedHeaderRequestParams = 'knowledge_base.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateKnowledgeBase = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateKnowledgeBase(request), expectedError); + assert( + (client.innerApiCalls.updateKnowledgeBase as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('listKnowledgeBases', () => { + it('invokes listKnowledgeBases without error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ), + ]; + client.innerApiCalls.listKnowledgeBases = stubSimpleCall( + expectedResponse + ); + const [response] = await client.listKnowledgeBases(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listKnowledgeBases as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listKnowledgeBases without error using callback', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ), + ]; + client.innerApiCalls.listKnowledgeBases = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listKnowledgeBases( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IKnowledgeBase[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listKnowledgeBases as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listKnowledgeBases with error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listKnowledgeBases = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listKnowledgeBases(request), expectedError); + assert( + (client.innerApiCalls.listKnowledgeBases as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listKnowledgeBasesStream without error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ), + ]; + client.descriptors.page.listKnowledgeBases.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listKnowledgeBasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.KnowledgeBase[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.KnowledgeBase) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listKnowledgeBases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listKnowledgeBases, request) + ); + assert.strictEqual( + (client.descriptors.page.listKnowledgeBases + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listKnowledgeBasesStream with error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listKnowledgeBases.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listKnowledgeBasesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.KnowledgeBase[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.KnowledgeBase) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listKnowledgeBases.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listKnowledgeBases, request) + ); + assert.strictEqual( + (client.descriptors.page.listKnowledgeBases + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listKnowledgeBases without error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.KnowledgeBase() + ), + ]; + client.descriptors.page.listKnowledgeBases.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2.IKnowledgeBase[] = []; + const iterable = client.listKnowledgeBasesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listKnowledgeBases + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listKnowledgeBases + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listKnowledgeBases with error', async () => { + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListKnowledgeBasesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listKnowledgeBases.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listKnowledgeBasesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2.IKnowledgeBase[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listKnowledgeBases + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listKnowledgeBases + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('agent', () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + entity_type: 'entityTypeValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath('projectValue', 'entityTypeValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('environment', () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('intent', () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + intent: 'intentValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath('projectValue', 'intentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionContext', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionContext'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionContextPath', () => { + const result = client.projectAgentEnvironmentUserSessionContextPath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchContextFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionEntityType', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionEntityTypePath', () => { + const result = client.projectAgentEnvironmentUserSessionEntityTypePath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionContext', () => { + const fakePath = '/rendered/path/projectAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionContextPath', () => { + const result = client.projectAgentSessionContextPath( + 'projectValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionContextName', () => { + const result = client.matchProjectFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionContextName', () => { + const result = client.matchSessionFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentSessionContextName', () => { + const result = client.matchContextFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionEntityTypePath', () => { + const result = client.projectAgentSessionEntityTypePath( + 'projectValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new knowledgebasesModule.v2.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dialogflow/test/gapic_knowledge_bases_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_knowledge_bases_v2beta1.ts index 454f82da383..1ca75ee378c 100644 --- a/packages/google-cloud-dialogflow/test/gapic_knowledge_bases_v2beta1.ts +++ b/packages/google-cloud-dialogflow/test/gapic_knowledge_bases_v2beta1.ts @@ -1591,58 +1591,897 @@ describe('v2beta1.KnowledgeBasesClient', () => { }); }); + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectKnowledgeBase', () => { const fakePath = '/rendered/path/projectKnowledgeBase'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', }; const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBasePath', () => { - const result = client.projectKnowledgeBasePath( + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( 'projectValue', - 'knowledgeBaseValue' + 'locationValue', + 'environmentValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + intent: 'intentValue', + }; + const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( + 'projectValue', + 'locationValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .render as SinonStub) .getCall(-1) - .calledWith(expectedParameters) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) ); }); - it('matchProjectFromProjectKnowledgeBaseName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseName( + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'projectValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'contextValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1650,73 +2489,93 @@ describe('v2beta1.KnowledgeBasesClient', () => { }); }); - describe('projectKnowledgeBaseDocument', () => { - const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', - document: 'documentValue', + location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', }; const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBaseDocumentPath', () => { - const result = client.projectKnowledgeBaseDocumentPath( + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( 'projectValue', - 'knowledgeBaseValue', - 'documentValue' + 'locationValue', + 'sessionValue', + 'entityTypeValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'documentValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1724,58 +2583,73 @@ describe('v2beta1.KnowledgeBasesClient', () => { }); }); - describe('projectLocationAgent', () => { - const fakePath = '/rendered/path/projectLocationAgent'; + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; const expectedParameters = { project: 'projectValue', location: 'locationValue', + answer_record: 'answerRecordValue', }; const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentPath', () => { - const result = client.projectLocationAgentPath( + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( 'projectValue', - 'locationValue' + 'locationValue', + 'answerRecordValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentName', () => { - const result = client.matchProjectFromProjectLocationAgentName( + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentName', () => { - const result = client.matchLocationFromProjectLocationAgentName( + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1783,73 +2657,73 @@ describe('v2beta1.KnowledgeBasesClient', () => { }); }); - describe('projectLocationAgentEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentEntityType'; + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - entity_type: 'entityTypeValue', + conversation: 'conversationValue', }; const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEntityTypePath', () => { - const result = client.projectLocationAgentEntityTypePath( + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( 'projectValue', 'locationValue', - 'entityTypeValue' + 'conversationValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1857,73 +2731,93 @@ describe('v2beta1.KnowledgeBasesClient', () => { }); }); - describe('projectLocationAgentEnvironment', () => { - const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - environment: 'environmentValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', }; const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEnvironmentPath', () => { - const result = client.projectLocationAgentEnvironmentPath( + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( 'projectValue', 'locationValue', - 'environmentValue' + 'conversationValue', + 'callMatcherValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( fakePath ); - assert.strictEqual(result, 'environmentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1931,73 +2825,88 @@ describe('v2beta1.KnowledgeBasesClient', () => { }); }); - describe('projectLocationAgentIntent', () => { - const fakePath = '/rendered/path/projectLocationAgentIntent'; + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - intent: 'intentValue', + conversation: 'conversationValue', + message: 'messageValue', }; const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentIntentPath', () => { - const result = client.projectLocationAgentIntentPath( + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( 'projectValue', 'locationValue', - 'intentValue' + 'conversationValue', + 'messageValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentIntentName', () => { - const result = client.matchProjectFromProjectLocationAgentIntentName( + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentIntentName', () => { - const result = client.matchLocationFromProjectLocationAgentIntentName( + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchIntentFromProjectLocationAgentIntentName', () => { - const result = client.matchIntentFromProjectLocationAgentIntentName( + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( fakePath ); - assert.strictEqual(result, 'intentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2005,88 +2914,93 @@ describe('v2beta1.KnowledgeBasesClient', () => { }); }); - describe('projectLocationAgentSessionContext', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - context: 'contextValue', + conversation: 'conversationValue', + participant: 'participantValue', }; const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionContextPath', () => { - const result = client.projectLocationAgentSessionContextPath( + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( 'projectValue', 'locationValue', - 'sessionValue', - 'contextValue' + 'conversationValue', + 'participantValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionContextName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionContextName( + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionContextName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionContextName( + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSessionFromProjectLocationAgentSessionContextName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionContextName( + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'sessionValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchContextFromProjectLocationAgentSessionContextName', () => { - const result = client.matchContextFromProjectLocationAgentSessionContextName( + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'contextValue'); + assert.strictEqual(result, 'participantValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2094,93 +3008,73 @@ describe('v2beta1.KnowledgeBasesClient', () => { }); }); - describe('projectLocationAgentSessionEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - entity_type: 'entityTypeValue', + conversation_profile: 'conversationProfileValue', }; const client = new knowledgebasesModule.v2beta1.KnowledgeBasesClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionEntityTypePath', () => { - const result = client.projectLocationAgentSessionEntityTypePath( + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( 'projectValue', 'locationValue', - 'sessionValue', - 'entityTypeValue' + 'conversationProfileValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate - .match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( - fakePath - ); - assert.strictEqual(result, 'sessionValue'); - assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationProfileValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) diff --git a/packages/google-cloud-dialogflow/test/gapic_participants_v2.ts b/packages/google-cloud-dialogflow/test/gapic_participants_v2.ts new file mode 100644 index 00000000000..6f2654b4cc6 --- /dev/null +++ b/packages/google-cloud-dialogflow/test/gapic_participants_v2.ts @@ -0,0 +1,3079 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as participantsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2.ParticipantsClient', () => { + it('has servicePath', () => { + const servicePath = participantsModule.v2.ParticipantsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = participantsModule.v2.ParticipantsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = participantsModule.v2.ParticipantsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new participantsModule.v2.ParticipantsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new participantsModule.v2.ParticipantsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.participantsStub, undefined); + await client.initialize(); + assert(client.participantsStub); + }); + + it('has close method', () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createParticipant', () => { + it('invokes createParticipant without error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateParticipantRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ); + client.innerApiCalls.createParticipant = stubSimpleCall(expectedResponse); + const [response] = await client.createParticipant(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createParticipant without error using callback', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateParticipantRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ); + client.innerApiCalls.createParticipant = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createParticipant( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IParticipant | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createParticipant with error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.CreateParticipantRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createParticipant = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createParticipant(request), expectedError); + assert( + (client.innerApiCalls.createParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getParticipant', () => { + it('invokes getParticipant without error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetParticipantRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ); + client.innerApiCalls.getParticipant = stubSimpleCall(expectedResponse); + const [response] = await client.getParticipant(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getParticipant without error using callback', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetParticipantRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ); + client.innerApiCalls.getParticipant = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getParticipant( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IParticipant | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getParticipant with error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.GetParticipantRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getParticipant = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getParticipant(request), expectedError); + assert( + (client.innerApiCalls.getParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateParticipant', () => { + it('invokes updateParticipant without error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateParticipantRequest() + ); + request.participant = {}; + request.participant.name = ''; + const expectedHeaderRequestParams = 'participant.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ); + client.innerApiCalls.updateParticipant = stubSimpleCall(expectedResponse); + const [response] = await client.updateParticipant(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateParticipant without error using callback', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateParticipantRequest() + ); + request.participant = {}; + request.participant.name = ''; + const expectedHeaderRequestParams = 'participant.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ); + client.innerApiCalls.updateParticipant = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateParticipant( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IParticipant | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateParticipant with error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.UpdateParticipantRequest() + ); + request.participant = {}; + request.participant.name = ''; + const expectedHeaderRequestParams = 'participant.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateParticipant = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateParticipant(request), expectedError); + assert( + (client.innerApiCalls.updateParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('analyzeContent', () => { + it('invokes analyzeContent without error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnalyzeContentRequest() + ); + request.participant = ''; + const expectedHeaderRequestParams = 'participant='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnalyzeContentResponse() + ); + client.innerApiCalls.analyzeContent = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeContent(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeContent as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeContent without error using callback', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnalyzeContentRequest() + ); + request.participant = ''; + const expectedHeaderRequestParams = 'participant='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnalyzeContentResponse() + ); + client.innerApiCalls.analyzeContent = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.analyzeContent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IAnalyzeContentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeContent as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes analyzeContent with error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.AnalyzeContentRequest() + ); + request.participant = ''; + const expectedHeaderRequestParams = 'participant='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.analyzeContent(request), expectedError); + assert( + (client.innerApiCalls.analyzeContent as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('suggestArticles', () => { + it('invokes suggestArticles without error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.SuggestArticlesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.SuggestArticlesResponse() + ); + client.innerApiCalls.suggestArticles = stubSimpleCall(expectedResponse); + const [response] = await client.suggestArticles(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.suggestArticles as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes suggestArticles without error using callback', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.SuggestArticlesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.SuggestArticlesResponse() + ); + client.innerApiCalls.suggestArticles = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.suggestArticles( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.ISuggestArticlesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.suggestArticles as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes suggestArticles with error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.SuggestArticlesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestArticles = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.suggestArticles(request), expectedError); + assert( + (client.innerApiCalls.suggestArticles as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('suggestFaqAnswers', () => { + it('invokes suggestFaqAnswers without error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse() + ); + client.innerApiCalls.suggestFaqAnswers = stubSimpleCall(expectedResponse); + const [response] = await client.suggestFaqAnswers(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.suggestFaqAnswers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes suggestFaqAnswers without error using callback', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.SuggestFaqAnswersResponse() + ); + client.innerApiCalls.suggestFaqAnswers = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.suggestFaqAnswers( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.ISuggestFaqAnswersResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.suggestFaqAnswers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes suggestFaqAnswers with error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.SuggestFaqAnswersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestFaqAnswers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.suggestFaqAnswers(request), expectedError); + assert( + (client.innerApiCalls.suggestFaqAnswers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('streamingAnalyzeContent', () => { + it('invokes streamingAnalyzeContent without error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse() + ); + client.innerApiCalls.streamingAnalyzeContent = stubBidiStreamingCall( + expectedResponse + ); + const stream = client.streamingAnalyzeContent(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.streamingAnalyzeContent as SinonStub) + .getCall(0) + .calledWithExactly(undefined) + ); + assert.deepStrictEqual( + (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( + 0 + ).args[0], + request + ); + }); + + it('invokes streamingAnalyzeContent with error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.StreamingAnalyzeContentRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingAnalyzeContent = stubBidiStreamingCall( + undefined, + expectedError + ); + const stream = client.streamingAnalyzeContent(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.v2.StreamingAnalyzeContentResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.streamingAnalyzeContent as SinonStub) + .getCall(0) + .calledWithExactly(undefined) + ); + assert.deepStrictEqual( + (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( + 0 + ).args[0], + request + ); + }); + }); + + describe('listParticipants', () => { + it('invokes listParticipants without error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ), + ]; + client.innerApiCalls.listParticipants = stubSimpleCall(expectedResponse); + const [response] = await client.listParticipants(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listParticipants as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listParticipants without error using callback', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ), + ]; + client.innerApiCalls.listParticipants = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listParticipants( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2.IParticipant[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listParticipants as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listParticipants with error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listParticipants = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listParticipants(request), expectedError); + assert( + (client.innerApiCalls.listParticipants as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listParticipantsStream without error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ), + ]; + client.descriptors.page.listParticipants.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listParticipantsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.Participant[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.Participant) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listParticipants.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listParticipants, request) + ); + assert.strictEqual( + (client.descriptors.page.listParticipants + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listParticipantsStream with error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listParticipants.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listParticipantsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2.Participant[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2.Participant) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listParticipants.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listParticipants, request) + ); + assert.strictEqual( + (client.descriptors.page.listParticipants + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listParticipants without error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2.Participant() + ), + ]; + client.descriptors.page.listParticipants.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2.IParticipant[] = []; + const iterable = client.listParticipantsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listParticipants + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listParticipants + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listParticipants with error', async () => { + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listParticipants.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listParticipantsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2.IParticipant[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listParticipants + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listParticipants + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('agent', () => { + const fakePath = '/rendered/path/agent'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.agentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.agentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('agentPath', () => { + const result = client.agentPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.agentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromAgentName', () => { + const result = client.matchProjectFromAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.agentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('entityType', () => { + const fakePath = '/rendered/path/entityType'; + const expectedParameters = { + project: 'projectValue', + entity_type: 'entityTypeValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.entityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.entityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('entityTypePath', () => { + const result = client.entityTypePath('projectValue', 'entityTypeValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.entityTypePathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEntityTypeName', () => { + const result = client.matchProjectFromEntityTypeName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromEntityTypeName', () => { + const result = client.matchEntityTypeFromEntityTypeName(fakePath); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.entityTypePathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('environment', () => { + const fakePath = '/rendered/path/environment'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.environmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.environmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('environmentPath', () => { + const result = client.environmentPath( + 'projectValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.environmentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromEnvironmentName', () => { + const result = client.matchProjectFromEnvironmentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromEnvironmentName', () => { + const result = client.matchEnvironmentFromEnvironmentName(fakePath); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.environmentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('intent', () => { + const fakePath = '/rendered/path/intent'; + const expectedParameters = { + project: 'projectValue', + intent: 'intentValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.intentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.intentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('intentPath', () => { + const result = client.intentPath('projectValue', 'intentValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.intentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromIntentName', () => { + const result = client.matchProjectFromIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromIntentName', () => { + const result = client.matchIntentFromIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.intentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionContext', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionContext'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionContextPath', () => { + const result = client.projectAgentEnvironmentUserSessionContextPath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchContextFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionEntityType', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionEntityTypePath', () => { + const result = client.projectAgentEnvironmentUserSessionEntityTypePath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionContext', () => { + const fakePath = '/rendered/path/projectAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionContextPath', () => { + const result = client.projectAgentSessionContextPath( + 'projectValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionContextName', () => { + const result = client.matchProjectFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionContextName', () => { + const result = client.matchSessionFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentSessionContextName', () => { + const result = client.matchContextFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionEntityTypePath', () => { + const result = client.projectAgentSessionEntityTypePath( + 'projectValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new participantsModule.v2.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dialogflow/test/gapic_participants_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_participants_v2beta1.ts new file mode 100644 index 00000000000..65530722c15 --- /dev/null +++ b/packages/google-cloud-dialogflow/test/gapic_participants_v2beta1.ts @@ -0,0 +1,4110 @@ +// Copyright 2021 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import * as protos from '../protos/protos'; +import * as assert from 'assert'; +import * as sinon from 'sinon'; +import {SinonStub} from 'sinon'; +import {describe, it} from 'mocha'; +import * as participantsModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf} from 'google-gax'; + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message).toObject( + instance as protobuf.Message, + {defaults: true} + ); + return (instance.constructor as typeof protobuf.Message).fromObject( + filledObject + ) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error + ? sinon.stub().rejects(error) + : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback( + response?: ResponseType, + error?: Error +) { + return error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); +} + +function stubBidiStreamingCall( + response?: ResponseType, + error?: Error +) { + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : sinon.stub().callsArgWith(2, null, response); + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + return sinon.stub().returns(mockStream); +} + +function stubPageStreamingCall( + responses?: ResponseType[], + error?: Error +) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error + ? sinon.stub().callsArgWith(2, error) + : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { + mockStream.write({}); + }); + } + setImmediate(() => { + mockStream.end(); + }); + } else { + setImmediate(() => { + mockStream.write({}); + }); + setImmediate(() => { + mockStream.end(); + }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall( + responses?: ResponseType[], + error?: Error +) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + }, + }; + }, + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v2beta1.ParticipantsClient', () => { + it('has servicePath', () => { + const servicePath = + participantsModule.v2beta1.ParticipantsClient.servicePath; + assert(servicePath); + }); + + it('has apiEndpoint', () => { + const apiEndpoint = + participantsModule.v2beta1.ParticipantsClient.apiEndpoint; + assert(apiEndpoint); + }); + + it('has port', () => { + const port = participantsModule.v2beta1.ParticipantsClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new participantsModule.v2beta1.ParticipantsClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.participantsStub, undefined); + await client.initialize(); + assert(client.participantsStub); + }); + + it('has close method', () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.close(); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon.stub().resolves(fakeProjectId); + const result = await client.getProjectId(); + assert.strictEqual(result, fakeProjectId); + assert((client.auth.getProjectId as SinonStub).calledWithExactly()); + }); + + it('has getProjectId method with callback', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.auth.getProjectId = sinon + .stub() + .callsArgWith(0, null, fakeProjectId); + const promise = new Promise((resolve, reject) => { + client.getProjectId((err?: Error | null, projectId?: string | null) => { + if (err) { + reject(err); + } else { + resolve(projectId); + } + }); + }); + const result = await promise; + assert.strictEqual(result, fakeProjectId); + }); + + describe('createParticipant', () => { + it('invokes createParticipant without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CreateParticipantRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ); + client.innerApiCalls.createParticipant = stubSimpleCall(expectedResponse); + const [response] = await client.createParticipant(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes createParticipant without error using callback', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CreateParticipantRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ); + client.innerApiCalls.createParticipant = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.createParticipant( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IParticipant | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.createParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes createParticipant with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CreateParticipantRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.createParticipant = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.createParticipant(request), expectedError); + assert( + (client.innerApiCalls.createParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('getParticipant', () => { + it('invokes getParticipant without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.GetParticipantRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ); + client.innerApiCalls.getParticipant = stubSimpleCall(expectedResponse); + const [response] = await client.getParticipant(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes getParticipant without error using callback', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.GetParticipantRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ); + client.innerApiCalls.getParticipant = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.getParticipant( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IParticipant | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.getParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes getParticipant with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.GetParticipantRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.getParticipant = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.getParticipant(request), expectedError); + assert( + (client.innerApiCalls.getParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('updateParticipant', () => { + it('invokes updateParticipant without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.UpdateParticipantRequest() + ); + request.participant = {}; + request.participant.name = ''; + const expectedHeaderRequestParams = 'participant.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ); + client.innerApiCalls.updateParticipant = stubSimpleCall(expectedResponse); + const [response] = await client.updateParticipant(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes updateParticipant without error using callback', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.UpdateParticipantRequest() + ); + request.participant = {}; + request.participant.name = ''; + const expectedHeaderRequestParams = 'participant.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ); + client.innerApiCalls.updateParticipant = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.updateParticipant( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IParticipant | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.updateParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes updateParticipant with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.UpdateParticipantRequest() + ); + request.participant = {}; + request.participant.name = ''; + const expectedHeaderRequestParams = 'participant.name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.updateParticipant = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.updateParticipant(request), expectedError); + assert( + (client.innerApiCalls.updateParticipant as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('analyzeContent', () => { + it('invokes analyzeContent without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnalyzeContentRequest() + ); + request.participant = ''; + const expectedHeaderRequestParams = 'participant='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnalyzeContentResponse() + ); + client.innerApiCalls.analyzeContent = stubSimpleCall(expectedResponse); + const [response] = await client.analyzeContent(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeContent as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes analyzeContent without error using callback', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnalyzeContentRequest() + ); + request.participant = ''; + const expectedHeaderRequestParams = 'participant='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnalyzeContentResponse() + ); + client.innerApiCalls.analyzeContent = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.analyzeContent( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.IAnalyzeContentResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.analyzeContent as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes analyzeContent with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.AnalyzeContentRequest() + ); + request.participant = ''; + const expectedHeaderRequestParams = 'participant='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.analyzeContent = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.analyzeContent(request), expectedError); + assert( + (client.innerApiCalls.analyzeContent as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('suggestArticles', () => { + it('invokes suggestArticles without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestArticlesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestArticlesResponse() + ); + client.innerApiCalls.suggestArticles = stubSimpleCall(expectedResponse); + const [response] = await client.suggestArticles(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.suggestArticles as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes suggestArticles without error using callback', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestArticlesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestArticlesResponse() + ); + client.innerApiCalls.suggestArticles = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.suggestArticles( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.ISuggestArticlesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.suggestArticles as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes suggestArticles with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestArticlesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestArticles = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.suggestArticles(request), expectedError); + assert( + (client.innerApiCalls.suggestArticles as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('suggestFaqAnswers', () => { + it('invokes suggestFaqAnswers without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse() + ); + client.innerApiCalls.suggestFaqAnswers = stubSimpleCall(expectedResponse); + const [response] = await client.suggestFaqAnswers(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.suggestFaqAnswers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes suggestFaqAnswers without error using callback', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersResponse() + ); + client.innerApiCalls.suggestFaqAnswers = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.suggestFaqAnswers( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.ISuggestFaqAnswersResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.suggestFaqAnswers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes suggestFaqAnswers with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestFaqAnswersRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestFaqAnswers = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.suggestFaqAnswers(request), expectedError); + assert( + (client.innerApiCalls.suggestFaqAnswers as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('suggestSmartReplies', () => { + it('invokes suggestSmartReplies without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse() + ); + client.innerApiCalls.suggestSmartReplies = stubSimpleCall( + expectedResponse + ); + const [response] = await client.suggestSmartReplies(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.suggestSmartReplies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes suggestSmartReplies without error using callback', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesResponse() + ); + client.innerApiCalls.suggestSmartReplies = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.suggestSmartReplies( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.ISuggestSmartRepliesResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.suggestSmartReplies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes suggestSmartReplies with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.SuggestSmartRepliesRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.suggestSmartReplies = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.suggestSmartReplies(request), expectedError); + assert( + (client.innerApiCalls.suggestSmartReplies as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('compileSuggestion', () => { + it('invokes compileSuggestion without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CompileSuggestionRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CompileSuggestionResponse() + ); + client.innerApiCalls.compileSuggestion = stubSimpleCall(expectedResponse); + const [response] = await client.compileSuggestion(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.compileSuggestion as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes compileSuggestion without error using callback', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CompileSuggestionRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CompileSuggestionResponse() + ); + client.innerApiCalls.compileSuggestion = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.compileSuggestion( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.ICompileSuggestionResponse | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.compileSuggestion as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes compileSuggestion with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.CompileSuggestionRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.compileSuggestion = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.compileSuggestion(request), expectedError); + assert( + (client.innerApiCalls.compileSuggestion as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + }); + + describe('streamingAnalyzeContent', () => { + it('invokes streamingAnalyzeContent without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest() + ); + const expectedResponse = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse() + ); + client.innerApiCalls.streamingAnalyzeContent = stubBidiStreamingCall( + expectedResponse + ); + const stream = client.streamingAnalyzeContent(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.streamingAnalyzeContent as SinonStub) + .getCall(0) + .calledWithExactly(undefined) + ); + assert.deepStrictEqual( + (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( + 0 + ).args[0], + request + ); + }); + + it('invokes streamingAnalyzeContent with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentRequest() + ); + const expectedError = new Error('expected'); + client.innerApiCalls.streamingAnalyzeContent = stubBidiStreamingCall( + undefined, + expectedError + ); + const stream = client.streamingAnalyzeContent(); + const promise = new Promise((resolve, reject) => { + stream.on( + 'data', + ( + response: protos.google.cloud.dialogflow.v2beta1.StreamingAnalyzeContentResponse + ) => { + resolve(response); + } + ); + stream.on('error', (err: Error) => { + reject(err); + }); + stream.write(request); + stream.end(); + }); + await assert.rejects(promise, expectedError); + assert( + (client.innerApiCalls.streamingAnalyzeContent as SinonStub) + .getCall(0) + .calledWithExactly(undefined) + ); + assert.deepStrictEqual( + (((stream as unknown) as PassThrough)._transform as SinonStub).getCall( + 0 + ).args[0], + request + ); + }); + }); + + describe('listParticipants', () => { + it('invokes listParticipants without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ), + ]; + client.innerApiCalls.listParticipants = stubSimpleCall(expectedResponse); + const [response] = await client.listParticipants(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listParticipants as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listParticipants without error using callback', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ), + ]; + client.innerApiCalls.listParticipants = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listParticipants( + request, + ( + err?: Error | null, + result?: + | protos.google.cloud.dialogflow.v2beta1.IParticipant[] + | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listParticipants as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listParticipants with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listParticipants = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listParticipants(request), expectedError); + assert( + (client.innerApiCalls.listParticipants as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listParticipantsStream without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ), + ]; + client.descriptors.page.listParticipants.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listParticipantsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.Participant[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2beta1.Participant) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listParticipants.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listParticipants, request) + ); + assert.strictEqual( + (client.descriptors.page.listParticipants + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listParticipantsStream with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listParticipants.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listParticipantsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.Participant[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2beta1.Participant) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listParticipants.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listParticipants, request) + ); + assert.strictEqual( + (client.descriptors.page.listParticipants + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listParticipants without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Participant() + ), + ]; + client.descriptors.page.listParticipants.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2beta1.IParticipant[] = []; + const iterable = client.listParticipantsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listParticipants + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listParticipants + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listParticipants with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListParticipantsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listParticipants.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listParticipantsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2beta1.IParticipant[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listParticipants + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listParticipants + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('listSuggestions', () => { + it('invokes listSuggestions without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListSuggestionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Suggestion() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Suggestion() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Suggestion() + ), + ]; + client.innerApiCalls.listSuggestions = stubSimpleCall(expectedResponse); + const [response] = await client.listSuggestions(request); + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSuggestions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSuggestions without error using callback', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListSuggestionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Suggestion() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Suggestion() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Suggestion() + ), + ]; + client.innerApiCalls.listSuggestions = stubSimpleCallWithCallback( + expectedResponse + ); + const promise = new Promise((resolve, reject) => { + client.listSuggestions( + request, + ( + err?: Error | null, + result?: protos.google.cloud.dialogflow.v2beta1.ISuggestion[] | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + } + ); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert( + (client.innerApiCalls.listSuggestions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions /*, callback defined above */) + ); + }); + + it('invokes listSuggestions with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListSuggestionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.innerApiCalls.listSuggestions = stubSimpleCall( + undefined, + expectedError + ); + await assert.rejects(client.listSuggestions(request), expectedError); + assert( + (client.innerApiCalls.listSuggestions as SinonStub) + .getCall(0) + .calledWith(request, expectedOptions, undefined) + ); + }); + + it('invokes listSuggestionsStream without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListSuggestionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Suggestion() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Suggestion() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Suggestion() + ), + ]; + client.descriptors.page.listSuggestions.createStream = stubPageStreamingCall( + expectedResponse + ); + const stream = client.listSuggestionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.Suggestion[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2beta1.Suggestion) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + const responses = await promise; + assert.deepStrictEqual(responses, expectedResponse); + assert( + (client.descriptors.page.listSuggestions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSuggestions, request) + ); + assert.strictEqual( + (client.descriptors.page.listSuggestions + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('invokes listSuggestionsStream with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListSuggestionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listSuggestions.createStream = stubPageStreamingCall( + undefined, + expectedError + ); + const stream = client.listSuggestionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.dialogflow.v2beta1.Suggestion[] = []; + stream.on( + 'data', + (response: protos.google.cloud.dialogflow.v2beta1.Suggestion) => { + responses.push(response); + } + ); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert( + (client.descriptors.page.listSuggestions.createStream as SinonStub) + .getCall(0) + .calledWith(client.innerApiCalls.listSuggestions, request) + ); + assert.strictEqual( + (client.descriptors.page.listSuggestions + .createStream as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSuggestions without error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListSuggestionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedResponse = [ + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Suggestion() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Suggestion() + ), + generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.Suggestion() + ), + ]; + client.descriptors.page.listSuggestions.asyncIterate = stubAsyncIterationCall( + expectedResponse + ); + const responses: protos.google.cloud.dialogflow.v2beta1.ISuggestion[] = []; + const iterable = client.listSuggestionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listSuggestions + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSuggestions + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + + it('uses async iteration with listSuggestions with error', async () => { + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.dialogflow.v2beta1.ListSuggestionsRequest() + ); + request.parent = ''; + const expectedHeaderRequestParams = 'parent='; + const expectedError = new Error('expected'); + client.descriptors.page.listSuggestions.asyncIterate = stubAsyncIterationCall( + undefined, + expectedError + ); + const iterable = client.listSuggestionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.dialogflow.v2beta1.ISuggestion[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listSuggestions + .asyncIterate as SinonStub).getCall(0).args[1], + request + ); + assert.strictEqual( + (client.descriptors.page.listSuggestions + .asyncIterate as SinonStub).getCall(0).args[2].otherArgs.headers[ + 'x-goog-request-params' + ], + expectedHeaderRequestParams + ); + }); + }); + + describe('Path templates', () => { + describe('project', () => { + const fakePath = '/rendered/path/project'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectPath', () => { + const result = client.projectPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectName', () => { + const result = client.matchProjectFromProjectName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgent', () => { + const fakePath = '/rendered/path/projectAgent'; + const expectedParameters = { + project: 'projectValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentPath', () => { + const result = client.projectAgentPath('projectValue'); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentPathTemplate.render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentName', () => { + const result = client.matchProjectFromProjectAgentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentPathTemplate.match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEntityType', () => { + const fakePath = '/rendered/path/projectAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + entity_type: 'entityTypeValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEntityTypePath', () => { + const result = client.projectAgentEntityTypePath( + 'projectValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironment', () => { + const fakePath = '/rendered/path/projectAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentPath', () => { + const result = client.projectAgentEnvironmentPath( + 'projectValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionContext', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionContext'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionContextPath', () => { + const result = client.projectAgentEnvironmentUserSessionContextPath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentEnvironmentUserSessionContextName', () => { + const result = client.matchContextFromProjectAgentEnvironmentUserSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentEnvironmentUserSessionEntityType', () => { + const fakePath = + '/rendered/path/projectAgentEnvironmentUserSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + environment: 'environmentValue', + user: 'userValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentEnvironmentUserSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentEnvironmentUserSessionEntityTypePath', () => { + const result = client.projectAgentEnvironmentUserSessionEntityTypePath( + 'projectValue', + 'environmentValue', + 'userValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEnvironmentFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchUserFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'userValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentEnvironmentUserSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectAgentEnvironmentUserSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentIntent', () => { + const fakePath = '/rendered/path/projectAgentIntent'; + const expectedParameters = { + project: 'projectValue', + intent: 'intentValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentIntentPath', () => { + const result = client.projectAgentIntentPath( + 'projectValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentIntentName', () => { + const result = client.matchProjectFromProjectAgentIntentName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectAgentIntentName', () => { + const result = client.matchIntentFromProjectAgentIntentName(fakePath); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionContext', () => { + const fakePath = '/rendered/path/projectAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionContextPath', () => { + const result = client.projectAgentSessionContextPath( + 'projectValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionContextName', () => { + const result = client.matchProjectFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionContextName', () => { + const result = client.matchSessionFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectAgentSessionContextName', () => { + const result = client.matchContextFromProjectAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAgentSessionEntityTypePath', () => { + const result = client.projectAgentSessionEntityTypePath( + 'projectValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( + 'projectValue', + 'locationValue', + 'environmentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + intent: 'intentValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( + 'projectValue', + 'locationValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'contextValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new participantsModule.v2beta1.ParticipantsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + }); +}); diff --git a/packages/google-cloud-dialogflow/test/gapic_session_entity_types_v2.ts b/packages/google-cloud-dialogflow/test/gapic_session_entity_types_v2.ts index 9a09b7a3a6b..fe4adc88670 100644 --- a/packages/google-cloud-dialogflow/test/gapic_session_entity_types_v2.ts +++ b/packages/google-cloud-dialogflow/test/gapic_session_entity_types_v2.ts @@ -1638,5 +1638,1195 @@ describe('v2.SessionEntityTypesClient', () => { ); }); }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new sessionentitytypesModule.v2.SessionEntityTypesClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-dialogflow/test/gapic_session_entity_types_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_session_entity_types_v2beta1.ts index f21f43dd482..6f73f44128a 100644 --- a/packages/google-cloud-dialogflow/test/gapic_session_entity_types_v2beta1.ts +++ b/packages/google-cloud-dialogflow/test/gapic_session_entity_types_v2beta1.ts @@ -1734,11 +1734,693 @@ describe('v2beta1.SessionEntityTypesClient', () => { }); }); + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectKnowledgeBase', () => { const fakePath = '/rendered/path/projectKnowledgeBase'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', }; const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( { @@ -1747,47 +2429,228 @@ describe('v2beta1.SessionEntityTypesClient', () => { } ); client.initialize(); - client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBasePath', () => { - const result = client.projectKnowledgeBasePath( + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( 'projectValue', - 'knowledgeBaseValue' + 'locationValue', + 'environmentValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + intent: 'intentValue', + }; + const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( + 'projectValue', + 'locationValue', + 'intentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( + { + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + } + ); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .render as SinonStub) .getCall(-1) - .calledWith(expectedParameters) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) ); }); - it('matchProjectFromProjectKnowledgeBaseName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseName( + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'projectValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'contextValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1795,12 +2658,13 @@ describe('v2beta1.SessionEntityTypesClient', () => { }); }); - describe('projectKnowledgeBaseDocument', () => { - const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', - document: 'documentValue', + location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', }; const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( { @@ -1809,61 +2673,80 @@ describe('v2beta1.SessionEntityTypesClient', () => { } ); client.initialize(); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBaseDocumentPath', () => { - const result = client.projectKnowledgeBaseDocumentPath( + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( 'projectValue', - 'knowledgeBaseValue', - 'documentValue' + 'locationValue', + 'sessionValue', + 'entityTypeValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( fakePath ); - assert.strictEqual(result, 'documentValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1871,11 +2754,12 @@ describe('v2beta1.SessionEntityTypesClient', () => { }); }); - describe('projectLocationAgent', () => { - const fakePath = '/rendered/path/projectLocationAgent'; + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; const expectedParameters = { project: 'projectValue', location: 'locationValue', + answer_record: 'answerRecordValue', }; const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( { @@ -1884,47 +2768,61 @@ describe('v2beta1.SessionEntityTypesClient', () => { } ); client.initialize(); - client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentPath', () => { - const result = client.projectLocationAgentPath( + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( 'projectValue', - 'locationValue' + 'locationValue', + 'answerRecordValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentName', () => { - const result = client.matchProjectFromProjectLocationAgentName( + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentName', () => { - const result = client.matchLocationFromProjectLocationAgentName( + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1932,12 +2830,12 @@ describe('v2beta1.SessionEntityTypesClient', () => { }); }); - describe('projectLocationAgentEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentEntityType'; + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - entity_type: 'entityTypeValue', + conversation: 'conversationValue', }; const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( { @@ -1946,61 +2844,61 @@ describe('v2beta1.SessionEntityTypesClient', () => { } ); client.initialize(); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEntityTypePath', () => { - const result = client.projectLocationAgentEntityTypePath( + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( 'projectValue', 'locationValue', - 'entityTypeValue' + 'conversationValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2008,12 +2906,13 @@ describe('v2beta1.SessionEntityTypesClient', () => { }); }); - describe('projectLocationAgentEnvironment', () => { - const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - environment: 'environmentValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', }; const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( { @@ -2022,61 +2921,80 @@ describe('v2beta1.SessionEntityTypesClient', () => { } ); client.initialize(); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEnvironmentPath', () => { - const result = client.projectLocationAgentEnvironmentPath( + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( 'projectValue', 'locationValue', - 'environmentValue' + 'conversationValue', + 'callMatcherValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( fakePath ); - assert.strictEqual(result, 'environmentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2084,12 +3002,13 @@ describe('v2beta1.SessionEntityTypesClient', () => { }); }); - describe('projectLocationAgentIntent', () => { - const fakePath = '/rendered/path/projectLocationAgentIntent'; + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - intent: 'intentValue', + conversation: 'conversationValue', + message: 'messageValue', }; const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( { @@ -2098,61 +3017,75 @@ describe('v2beta1.SessionEntityTypesClient', () => { } ); client.initialize(); - client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentIntentPath', () => { - const result = client.projectLocationAgentIntentPath( + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( 'projectValue', 'locationValue', - 'intentValue' + 'conversationValue', + 'messageValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentIntentName', () => { - const result = client.matchProjectFromProjectLocationAgentIntentName( + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentIntentName', () => { - const result = client.matchLocationFromProjectLocationAgentIntentName( + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchIntentFromProjectLocationAgentIntentName', () => { - const result = client.matchIntentFromProjectLocationAgentIntentName( + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( fakePath ); - assert.strictEqual(result, 'intentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2160,13 +3093,13 @@ describe('v2beta1.SessionEntityTypesClient', () => { }); }); - describe('projectLocationAgentSessionContext', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - context: 'contextValue', + conversation: 'conversationValue', + participant: 'participantValue', }; const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( { @@ -2175,75 +3108,80 @@ describe('v2beta1.SessionEntityTypesClient', () => { } ); client.initialize(); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionContextPath', () => { - const result = client.projectLocationAgentSessionContextPath( + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( 'projectValue', 'locationValue', - 'sessionValue', - 'contextValue' + 'conversationValue', + 'participantValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionContextName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionContextName( + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionContextName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionContextName( + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSessionFromProjectLocationAgentSessionContextName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionContextName( + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'sessionValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchContextFromProjectLocationAgentSessionContextName', () => { - const result = client.matchContextFromProjectLocationAgentSessionContextName( + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'contextValue'); + assert.strictEqual(result, 'participantValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -2251,13 +3189,12 @@ describe('v2beta1.SessionEntityTypesClient', () => { }); }); - describe('projectLocationAgentSessionEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - entity_type: 'entityTypeValue', + conversation_profile: 'conversationProfileValue', }; const client = new sessionentitytypesModule.v2beta1.SessionEntityTypesClient( { @@ -2266,80 +3203,61 @@ describe('v2beta1.SessionEntityTypesClient', () => { } ); client.initialize(); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionEntityTypePath', () => { - const result = client.projectLocationAgentSessionEntityTypePath( + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( 'projectValue', 'locationValue', - 'sessionValue', - 'entityTypeValue' + 'conversationProfileValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate - .match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( - fakePath - ); - assert.strictEqual(result, 'sessionValue'); - assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationProfileValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) diff --git a/packages/google-cloud-dialogflow/test/gapic_sessions_v2.ts b/packages/google-cloud-dialogflow/test/gapic_sessions_v2.ts index 9b48af389ec..16a0f1b2aef 100644 --- a/packages/google-cloud-dialogflow/test/gapic_sessions_v2.ts +++ b/packages/google-cloud-dialogflow/test/gapic_sessions_v2.ts @@ -1053,5 +1053,1195 @@ describe('v2.SessionsClient', () => { ); }); }); + + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBase', () => { + const fakePath = '/rendered/path/projectKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + answer_record: 'answerRecordValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( + 'projectValue', + 'locationValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectLocationAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( + 'projectValue', + 'locationValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( + 'projectValue', + 'locationValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( + 'projectValue', + 'locationValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectLocationConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBase', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBase'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBasePath', () => { + const result = client.projectLocationKnowledgeBasePath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectLocationKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new sessionsModule.v2.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationKnowledgeBaseDocumentPath', () => { + const result = client.projectLocationKnowledgeBaseDocumentPath( + 'projectValue', + 'locationValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchLocationFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectLocationKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectLocationKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectLocationKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); }); }); diff --git a/packages/google-cloud-dialogflow/test/gapic_sessions_v2beta1.ts b/packages/google-cloud-dialogflow/test/gapic_sessions_v2beta1.ts index 69fdd1c653f..00ce087cb33 100644 --- a/packages/google-cloud-dialogflow/test/gapic_sessions_v2beta1.ts +++ b/packages/google-cloud-dialogflow/test/gapic_sessions_v2beta1.ts @@ -1077,58 +1077,734 @@ describe('v2beta1.SessionsClient', () => { }); }); + describe('projectAnswerRecord', () => { + const fakePath = '/rendered/path/projectAnswerRecord'; + const expectedParameters = { + project: 'projectValue', + answer_record: 'answerRecordValue', + }; + const client = new sessionsModule.v2beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectAnswerRecordPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectAnswerRecordPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectAnswerRecordPath', () => { + const result = client.projectAnswerRecordPath( + 'projectValue', + 'answerRecordValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectAnswerRecordName', () => { + const result = client.matchProjectFromProjectAnswerRecordName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchAnswerRecordFromProjectAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectAnswerRecordName( + fakePath + ); + assert.strictEqual(result, 'answerRecordValue'); + assert( + (client.pathTemplates.projectAnswerRecordPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversation', () => { + const fakePath = '/rendered/path/projectConversation'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + }; + const client = new sessionsModule.v2beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationPath', () => { + const result = client.projectConversationPath( + 'projectValue', + 'conversationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationName', () => { + const result = client.matchProjectFromProjectConversationName(fakePath); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationName', () => { + const result = client.matchConversationFromProjectConversationName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectConversationCallMatcher'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', + }; + const client = new sessionsModule.v2beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationCallMatcherPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationCallMatcherPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationCallMatcherPath', () => { + const result = client.projectConversationCallMatcherPath( + 'projectValue', + 'conversationValue', + 'callMatcherValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates.projectConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationMessage', () => { + const fakePath = '/rendered/path/projectConversationMessage'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + message: 'messageValue', + }; + const client = new sessionsModule.v2beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationMessagePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationMessagePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationMessagePath', () => { + const result = client.projectConversationMessagePath( + 'projectValue', + 'conversationValue', + 'messageValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationMessageName', () => { + const result = client.matchProjectFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationMessageName', () => { + const result = client.matchConversationFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectConversationMessageName', () => { + const result = client.matchMessageFromProjectConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationParticipant', () => { + const fakePath = '/rendered/path/projectConversationParticipant'; + const expectedParameters = { + project: 'projectValue', + conversation: 'conversationValue', + participant: 'participantValue', + }; + const client = new sessionsModule.v2beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationParticipantPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationParticipantPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationParticipantPath', () => { + const result = client.projectConversationParticipantPath( + 'projectValue', + 'conversationValue', + 'participantValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationParticipantName', () => { + const result = client.matchProjectFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationFromProjectConversationParticipantName', () => { + const result = client.matchConversationFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'conversationValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchParticipantFromProjectConversationParticipantName', () => { + const result = client.matchParticipantFromProjectConversationParticipantName( + fakePath + ); + assert.strictEqual(result, 'participantValue'); + assert( + (client.pathTemplates.projectConversationParticipantPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectConversationProfile', () => { + const fakePath = '/rendered/path/projectConversationProfile'; + const expectedParameters = { + project: 'projectValue', + conversation_profile: 'conversationProfileValue', + }; + const client = new sessionsModule.v2beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectConversationProfilePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectConversationProfilePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectConversationProfilePath', () => { + const result = client.projectConversationProfilePath( + 'projectValue', + 'conversationProfileValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectConversationProfileName', () => { + const result = client.matchProjectFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchConversationProfileFromProjectConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectConversationProfileName( + fakePath + ); + assert.strictEqual(result, 'conversationProfileValue'); + assert( + (client.pathTemplates.projectConversationProfilePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + describe('projectKnowledgeBase', () => { const fakePath = '/rendered/path/projectKnowledgeBase'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', + knowledge_base: 'knowledgeBaseValue', + }; + const client = new sessionsModule.v2beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBasePath', () => { + const result = client.projectKnowledgeBasePath( + 'projectValue', + 'knowledgeBaseValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBasePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectKnowledgeBaseDocument', () => { + const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + const expectedParameters = { + project: 'projectValue', + knowledge_base: 'knowledgeBaseValue', + document: 'documentValue', + }; + const client = new sessionsModule.v2beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectKnowledgeBaseDocumentPath', () => { + const result = client.projectKnowledgeBaseDocumentPath( + 'projectValue', + 'knowledgeBaseValue', + 'documentValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'knowledgeBaseValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { + const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + fakePath + ); + assert.strictEqual(result, 'documentValue'); + assert( + (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgent', () => { + const fakePath = '/rendered/path/projectLocationAgent'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + }; + const client = new sessionsModule.v2beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentPath', () => { + const result = client.projectLocationAgentPath( + 'projectValue', + 'locationValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentName', () => { + const result = client.matchProjectFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentName', () => { + const result = client.matchLocationFromProjectLocationAgentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentEntityType'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + entity_type: 'entityTypeValue', + }; + const client = new sessionsModule.v2beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentEntityTypePath', () => { + const result = client.projectLocationAgentEntityTypePath( + 'projectValue', + 'locationValue', + 'entityTypeValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentEnvironment', () => { + const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + environment: 'environmentValue', }; const client = new sessionsModule.v2beta1.SessionsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBasePathTemplate.render = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBasePathTemplate.match = sinon + client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBasePath', () => { - const result = client.projectKnowledgeBasePath( + it('projectLocationAgentEnvironmentPath', () => { + const result = client.projectLocationAgentEnvironmentPath( 'projectValue', - 'knowledgeBaseValue' + 'locationValue', + 'environmentValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectKnowledgeBaseName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseName( + it('matchProjectFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchProjectFromProjectLocationAgentEnvironmentName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseName( + it('matchLocationFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchLocationFromProjectLocationAgentEnvironmentName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectKnowledgeBasePathTemplate + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { + const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + fakePath + ); + assert.strictEqual(result, 'environmentValue'); + assert( + (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1136,73 +1812,236 @@ describe('v2beta1.SessionsClient', () => { }); }); - describe('projectKnowledgeBaseDocument', () => { - const fakePath = '/rendered/path/projectKnowledgeBaseDocument'; + describe('projectLocationAgentIntent', () => { + const fakePath = '/rendered/path/projectLocationAgentIntent'; const expectedParameters = { project: 'projectValue', - knowledge_base: 'knowledgeBaseValue', - document: 'documentValue', + location: 'locationValue', + intent: 'intentValue', }; const client = new sessionsModule.v2beta1.SessionsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.render = sinon + client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate.match = sinon + client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectKnowledgeBaseDocumentPath', () => { - const result = client.projectKnowledgeBaseDocumentPath( + it('projectLocationAgentIntentPath', () => { + const result = client.projectLocationAgentIntentPath( 'projectValue', - 'knowledgeBaseValue', - 'documentValue' + 'locationValue', + 'intentValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentIntentName', () => { + const result = client.matchProjectFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentIntentName', () => { + const result = client.matchLocationFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchIntentFromProjectLocationAgentIntentName', () => { + const result = client.matchIntentFromProjectLocationAgentIntentName( + fakePath + ); + assert.strictEqual(result, 'intentValue'); + assert( + (client.pathTemplates.projectLocationAgentIntentPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSession', () => { + const fakePath = '/rendered/path/projectLocationAgentSession'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + }; + const client = new sessionsModule.v2beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionPath', () => { + const result = client.projectLocationAgentSessionPath( + 'projectValue', + 'locationValue', + 'sessionValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionPathTemplate + .render as SinonStub) + .getCall(-1) + .calledWith(expectedParameters) + ); + }); + + it('matchProjectFromProjectLocationAgentSessionName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionName( + fakePath + ); + assert.strictEqual(result, 'locationValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentSessionName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + }); + + describe('projectLocationAgentSessionContext', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + const expectedParameters = { + project: 'projectValue', + location: 'locationValue', + session: 'sessionValue', + context: 'contextValue', + }; + const client = new sessionsModule.v2beta1.SessionsClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize(); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + .stub() + .returns(fakePath); + client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + .stub() + .returns(expectedParameters); + + it('projectLocationAgentSessionContextPath', () => { + const result = client.projectLocationAgentSessionContextPath( + 'projectValue', + 'locationValue', + 'sessionValue', + 'contextValue' + ); + assert.strictEqual(result, fakePath); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchProjectFromProjectKnowledgeBaseDocumentName( + it('matchProjectFromProjectLocationAgentSessionContextName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionContextName( + fakePath + ); + assert.strictEqual(result, 'projectValue'); + assert( + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchLocationFromProjectLocationAgentSessionContextName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'projectValue'); + assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchKnowledgeBaseFromProjectKnowledgeBaseDocumentName( + it('matchSessionFromProjectLocationAgentSessionContextName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'knowledgeBaseValue'); + assert.strictEqual(result, 'sessionValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchDocumentFromProjectKnowledgeBaseDocumentName', () => { - const result = client.matchDocumentFromProjectKnowledgeBaseDocumentName( + it('matchContextFromProjectLocationAgentSessionContextName', () => { + const result = client.matchContextFromProjectLocationAgentSessionContextName( fakePath ); - assert.strictEqual(result, 'documentValue'); + assert.strictEqual(result, 'contextValue'); assert( - (client.pathTemplates.projectKnowledgeBaseDocumentPathTemplate + (client.pathTemplates.projectLocationAgentSessionContextPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1210,58 +2049,93 @@ describe('v2beta1.SessionsClient', () => { }); }); - describe('projectLocationAgent', () => { - const fakePath = '/rendered/path/projectLocationAgent'; + describe('projectLocationAgentSessionEntityType', () => { + const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; const expectedParameters = { project: 'projectValue', location: 'locationValue', + session: 'sessionValue', + entity_type: 'entityTypeValue', }; const client = new sessionsModule.v2beta1.SessionsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentPathTemplate.render = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentPathTemplate.match = sinon + client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentPath', () => { - const result = client.projectLocationAgentPath( + it('projectLocationAgentSessionEntityTypePath', () => { + const result = client.projectLocationAgentSessionEntityTypePath( 'projectValue', - 'locationValue' + 'locationValue', + 'sessionValue', + 'entityTypeValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentName', () => { - const result = client.matchProjectFromProjectLocationAgentName( + it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentName', () => { - const result = client.matchLocationFromProjectLocationAgentName( + it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentPathTemplate + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'sessionValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { + const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + fakePath + ); + assert.strictEqual(result, 'entityTypeValue'); + assert( + (client.pathTemplates + .projectLocationAgentSessionEntityTypePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1269,73 +2143,73 @@ describe('v2beta1.SessionsClient', () => { }); }); - describe('projectLocationAgentEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentEntityType'; + describe('projectLocationAnswerRecord', () => { + const fakePath = '/rendered/path/projectLocationAnswerRecord'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - entity_type: 'entityTypeValue', + answer_record: 'answerRecordValue', }; const client = new sessionsModule.v2beta1.SessionsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationAnswerRecordPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEntityTypePath', () => { - const result = client.projectLocationAgentEntityTypePath( + it('projectLocationAnswerRecordPath', () => { + const result = client.projectLocationAnswerRecordPath( 'projectValue', 'locationValue', - 'entityTypeValue' + 'answerRecordValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentEntityTypeName( + it('matchProjectFromProjectLocationAnswerRecordName', () => { + const result = client.matchProjectFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentEntityTypeName( + it('matchLocationFromProjectLocationAnswerRecordName', () => { + const result = client.matchLocationFromProjectLocationAnswerRecordName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentEntityTypeName( + it('matchAnswerRecordFromProjectLocationAnswerRecordName', () => { + const result = client.matchAnswerRecordFromProjectLocationAnswerRecordName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'answerRecordValue'); assert( - (client.pathTemplates.projectLocationAgentEntityTypePathTemplate + (client.pathTemplates.projectLocationAnswerRecordPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1343,73 +2217,73 @@ describe('v2beta1.SessionsClient', () => { }); }); - describe('projectLocationAgentEnvironment', () => { - const fakePath = '/rendered/path/projectLocationAgentEnvironment'; + describe('projectLocationConversation', () => { + const fakePath = '/rendered/path/projectLocationConversation'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - environment: 'environmentValue', + conversation: 'conversationValue', }; const client = new sessionsModule.v2beta1.SessionsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentEnvironmentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentEnvironmentPath', () => { - const result = client.projectLocationAgentEnvironmentPath( + it('projectLocationConversationPath', () => { + const result = client.projectLocationConversationPath( 'projectValue', 'locationValue', - 'environmentValue' + 'conversationValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchProjectFromProjectLocationAgentEnvironmentName( + it('matchProjectFromProjectLocationConversationName', () => { + const result = client.matchProjectFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchLocationFromProjectLocationAgentEnvironmentName( + it('matchLocationFromProjectLocationConversationName', () => { + const result = client.matchLocationFromProjectLocationConversationName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEnvironmentFromProjectLocationAgentEnvironmentName', () => { - const result = client.matchEnvironmentFromProjectLocationAgentEnvironmentName( + it('matchConversationFromProjectLocationConversationName', () => { + const result = client.matchConversationFromProjectLocationConversationName( fakePath ); - assert.strictEqual(result, 'environmentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentEnvironmentPathTemplate + (client.pathTemplates.projectLocationConversationPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1417,73 +2291,93 @@ describe('v2beta1.SessionsClient', () => { }); }); - describe('projectLocationAgentIntent', () => { - const fakePath = '/rendered/path/projectLocationAgentIntent'; + describe('projectLocationConversationCallMatcher', () => { + const fakePath = '/rendered/path/projectLocationConversationCallMatcher'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - intent: 'intentValue', + conversation: 'conversationValue', + call_matcher: 'callMatcherValue', }; const client = new sessionsModule.v2beta1.SessionsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentIntentPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentIntentPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationCallMatcherPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentIntentPath', () => { - const result = client.projectLocationAgentIntentPath( + it('projectLocationConversationCallMatcherPath', () => { + const result = client.projectLocationConversationCallMatcherPath( 'projectValue', 'locationValue', - 'intentValue' + 'conversationValue', + 'callMatcherValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentIntentName', () => { - const result = client.matchProjectFromProjectLocationAgentIntentName( + it('matchProjectFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchProjectFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentIntentName', () => { - const result = client.matchLocationFromProjectLocationAgentIntentName( + it('matchLocationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchLocationFromProjectLocationConversationCallMatcherName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchIntentFromProjectLocationAgentIntentName', () => { - const result = client.matchIntentFromProjectLocationAgentIntentName( + it('matchConversationFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchConversationFromProjectLocationConversationCallMatcherName( fakePath ); - assert.strictEqual(result, 'intentValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentIntentPathTemplate + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchCallMatcherFromProjectLocationConversationCallMatcherName', () => { + const result = client.matchCallMatcherFromProjectLocationConversationCallMatcherName( + fakePath + ); + assert.strictEqual(result, 'callMatcherValue'); + assert( + (client.pathTemplates + .projectLocationConversationCallMatcherPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1491,73 +2385,88 @@ describe('v2beta1.SessionsClient', () => { }); }); - describe('projectLocationAgentSession', () => { - const fakePath = '/rendered/path/projectLocationAgentSession'; + describe('projectLocationConversationMessage', () => { + const fakePath = '/rendered/path/projectLocationConversationMessage'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', + conversation: 'conversationValue', + message: 'messageValue', }; const client = new sessionsModule.v2beta1.SessionsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationMessagePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionPath', () => { - const result = client.projectLocationAgentSessionPath( + it('projectLocationConversationMessagePath', () => { + const result = client.projectLocationConversationMessagePath( 'projectValue', 'locationValue', - 'sessionValue' + 'conversationValue', + 'messageValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentSessionPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionName( + it('matchProjectFromProjectLocationConversationMessageName', () => { + const result = client.matchProjectFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentSessionPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionName( + it('matchLocationFromProjectLocationConversationMessageName', () => { + const result = client.matchLocationFromProjectLocationConversationMessageName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSessionFromProjectLocationAgentSessionName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionName( + it('matchConversationFromProjectLocationConversationMessageName', () => { + const result = client.matchConversationFromProjectLocationConversationMessageName( fakePath ); - assert.strictEqual(result, 'sessionValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionPathTemplate + (client.pathTemplates.projectLocationConversationMessagePathTemplate + .match as SinonStub) + .getCall(-1) + .calledWith(fakePath) + ); + }); + + it('matchMessageFromProjectLocationConversationMessageName', () => { + const result = client.matchMessageFromProjectLocationConversationMessageName( + fakePath + ); + assert.strictEqual(result, 'messageValue'); + assert( + (client.pathTemplates.projectLocationConversationMessagePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1565,88 +2474,93 @@ describe('v2beta1.SessionsClient', () => { }); }); - describe('projectLocationAgentSessionContext', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionContext'; + describe('projectLocationConversationParticipant', () => { + const fakePath = '/rendered/path/projectLocationConversationParticipant'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - context: 'contextValue', + conversation: 'conversationValue', + participant: 'participantValue', }; const client = new sessionsModule.v2beta1.SessionsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.render = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionContextPathTemplate.match = sinon + client.pathTemplates.projectLocationConversationParticipantPathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionContextPath', () => { - const result = client.projectLocationAgentSessionContextPath( + it('projectLocationConversationParticipantPath', () => { + const result = client.projectLocationConversationParticipantPath( 'projectValue', 'locationValue', - 'sessionValue', - 'contextValue' + 'conversationValue', + 'participantValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionContextName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionContextName( + it('matchProjectFromProjectLocationConversationParticipantName', () => { + const result = client.matchProjectFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionContextName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionContextName( + it('matchLocationFromProjectLocationConversationParticipantName', () => { + const result = client.matchLocationFromProjectLocationConversationParticipantName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchSessionFromProjectLocationAgentSessionContextName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionContextName( + it('matchConversationFromProjectLocationConversationParticipantName', () => { + const result = client.matchConversationFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'sessionValue'); + assert.strictEqual(result, 'conversationValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchContextFromProjectLocationAgentSessionContextName', () => { - const result = client.matchContextFromProjectLocationAgentSessionContextName( + it('matchParticipantFromProjectLocationConversationParticipantName', () => { + const result = client.matchParticipantFromProjectLocationConversationParticipantName( fakePath ); - assert.strictEqual(result, 'contextValue'); + assert.strictEqual(result, 'participantValue'); assert( - (client.pathTemplates.projectLocationAgentSessionContextPathTemplate + (client.pathTemplates + .projectLocationConversationParticipantPathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) @@ -1654,93 +2568,73 @@ describe('v2beta1.SessionsClient', () => { }); }); - describe('projectLocationAgentSessionEntityType', () => { - const fakePath = '/rendered/path/projectLocationAgentSessionEntityType'; + describe('projectLocationConversationProfile', () => { + const fakePath = '/rendered/path/projectLocationConversationProfile'; const expectedParameters = { project: 'projectValue', location: 'locationValue', - session: 'sessionValue', - entity_type: 'entityTypeValue', + conversation_profile: 'conversationProfileValue', }; const client = new sessionsModule.v2beta1.SessionsClient({ credentials: {client_email: 'bogus', private_key: 'bogus'}, projectId: 'bogus', }); client.initialize(); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.render = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.render = sinon .stub() .returns(fakePath); - client.pathTemplates.projectLocationAgentSessionEntityTypePathTemplate.match = sinon + client.pathTemplates.projectLocationConversationProfilePathTemplate.match = sinon .stub() .returns(expectedParameters); - it('projectLocationAgentSessionEntityTypePath', () => { - const result = client.projectLocationAgentSessionEntityTypePath( + it('projectLocationConversationProfilePath', () => { + const result = client.projectLocationConversationProfilePath( 'projectValue', 'locationValue', - 'sessionValue', - 'entityTypeValue' + 'conversationProfileValue' ); assert.strictEqual(result, fakePath); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .render as SinonStub) .getCall(-1) .calledWith(expectedParameters) ); }); - it('matchProjectFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchProjectFromProjectLocationAgentSessionEntityTypeName( + it('matchProjectFromProjectLocationConversationProfileName', () => { + const result = client.matchProjectFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'projectValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchLocationFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchLocationFromProjectLocationAgentSessionEntityTypeName( + it('matchLocationFromProjectLocationConversationProfileName', () => { + const result = client.matchLocationFromProjectLocationConversationProfileName( fakePath ); assert.strictEqual(result, 'locationValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate - .match as SinonStub) - .getCall(-1) - .calledWith(fakePath) - ); - }); - - it('matchSessionFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchSessionFromProjectLocationAgentSessionEntityTypeName( - fakePath - ); - assert.strictEqual(result, 'sessionValue'); - assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) ); }); - it('matchEntityTypeFromProjectLocationAgentSessionEntityTypeName', () => { - const result = client.matchEntityTypeFromProjectLocationAgentSessionEntityTypeName( + it('matchConversationProfileFromProjectLocationConversationProfileName', () => { + const result = client.matchConversationProfileFromProjectLocationConversationProfileName( fakePath ); - assert.strictEqual(result, 'entityTypeValue'); + assert.strictEqual(result, 'conversationProfileValue'); assert( - (client.pathTemplates - .projectLocationAgentSessionEntityTypePathTemplate + (client.pathTemplates.projectLocationConversationProfilePathTemplate .match as SinonStub) .getCall(-1) .calledWith(fakePath) diff --git a/packages/google-cloud-dialogflow/webpack.config.js b/packages/google-cloud-dialogflow/webpack.config.js index 44fde19cc41..754be3d486b 100644 --- a/packages/google-cloud-dialogflow/webpack.config.js +++ b/packages/google-cloud-dialogflow/webpack.config.js @@ -1,4 +1,4 @@ -// Copyright 2020 Google LLC +// Copyright 2021 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License.